@rongcloud/imlib-v2-adapter 5.5.8-beem → 5.6.0-beem-alpha.2
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.d.ts +17 -14
- package/index.esm.js +1 -1
- package/index.js +1 -1
- package/package.json +2 -2
package/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { IPushConfig, IUserProfile, ConversationType, MessageDirection, ReceivedStatus, IReadReceiptInfo, IConversationTag, LogLevel, ConnectionStatus, ITypingMessage, IBlockedMessageInfo, IChatroomListenerData, IMessageDeliver, IGroupMessageDeliverStatus, ErrorCode, APIContext, IMessageReaderResponse, NotificationStatus, IGroupMessageDeliverInfo, IRemoveChatroomEntry, RTCMode, IPluginGenerator, INaviInfo, IChatroomEntry, IChatroomEntries, FileType, IUploadAuth, UploadMethod, ITagParam, ITagInfo, IExtraMethod, IRTCUsers, IRTCRoomInfo, IJoinRTCRoomData, RTCApiType, KVString, IRtcTokenData,
|
|
2
|
-
export { ChatroomEntryType, ChatroomUserChangeType, ConnectionStatus, ConversationType, ErrorCode, FileType, IAndroidPushConfig, IAsyncRes, IBaseConversationInfo, IBlockedMessageInfo, IChatroomEntries, IChatroomEntry, IChatroomEntryListenerData, IChatroomInfo, IChatroomListenerData, IChatroomRejoinedFailed, IChatroomRejoinedInfo, IChatroomRejoinedSuccessed, IChatroomUser, IChatroomUserChangeInfo, IConversationTag, IDeletedExpansion, IEventListener, IExpansionListenerData, IGooglePushConfig, IJoinRTCRoomData, ILogExtensions, ILogInfo, ILogInit, IMessageReader, IMessageReaderResponse, IPushConfig, IRTCRoomInfo, IRTCUsers, IReadReceiptInfo, IReceivedConversation, IReceivedConversationByTag, IReceivedMessage, IRemoveChatroomEntry, IRtcTokenData, ITagInfo, ITagParam, ITypingMessage, ITypingUser, IUpdatedExpansion, IUploadAuth, IUserProfile, IiOSPushConfig, KVString, LogLevel, LogSource, LogTagId,
|
|
1
|
+
import { IPushConfig, IUserProfile, ConversationType, MessageDirection, ReceivedStatus, IReadReceiptInfo, IConversationTag, LogLevel, EnableLogL, ConnectionStatus, ITypingMessage, IBlockedMessageInfo, IChatroomListenerData, IMessageDeliver, IGroupMessageDeliverStatus, ErrorCode, ILogger, APIContext, IMessageReaderResponse, NotificationStatus, IGroupMessageDeliverInfo, IRemoveChatroomEntry, RTCMode, IPluginGenerator, INaviInfo, IChatroomEntry, IChatroomEntries, FileType, IUploadAuth, UploadMethod, ITagParam, ITagInfo, IExtraMethod, IRTCUsers, IRTCRoomInfo, IJoinRTCRoomData, RTCApiType, KVString, IRtcTokenData, MentionedType as MentionedType$1 } from '@rongcloud/engine';
|
|
2
|
+
export { ChatroomEntryType, ChatroomUserChangeType, ConnectionStatus, ConversationType, EnableLogL, ErrorCode, FileType, IAndroidPushConfig, IAsyncRes, IBaseConversationInfo, IBlockedMessageInfo, IChatroomEntries, IChatroomEntry, IChatroomEntryListenerData, IChatroomInfo, IChatroomListenerData, IChatroomRejoinedFailed, IChatroomRejoinedInfo, IChatroomRejoinedSuccessed, IChatroomUser, IChatroomUserChangeInfo, IConversationTag, IDeletedExpansion, IEventListener, IExpansionListenerData, IGooglePushConfig, IJoinRTCRoomData, ILogExtensions, ILogInfo, ILogInit, IMessageReader, IMessageReaderResponse, IPushConfig, IRTCRoomInfo, IRTCUsers, IReadReceiptInfo, IReceivedConversation, IReceivedConversationByTag, IReceivedMessage, IRemoveChatroomEntry, IRtcTokenData, ITagInfo, ITagParam, ITypingMessage, ITypingUser, IUpdatedExpansion, IUploadAuth, IUserProfile, IiOSPushConfig, KVString, LogL, LogLevel, LogSource, LogTagId, MessageBlockType, MessageDirection, NotificationStatus, RTCApiType, RTCMode, ReceivedStatus, UploadMethod, logger } from '@rongcloud/engine';
|
|
3
3
|
|
|
4
4
|
declare enum SentStatus {
|
|
5
5
|
/**
|
|
@@ -233,11 +233,17 @@ interface IInitOption {
|
|
|
233
233
|
*/
|
|
234
234
|
connectionType?: 'websocket' | 'comet';
|
|
235
235
|
/**
|
|
236
|
-
*
|
|
236
|
+
* 该配置已废弃,请使用 `logOutputLevel` 替代。
|
|
237
|
+
* @deprecated
|
|
238
|
+
* 修改 SDK 内部日志打印等级,默认为 `LogLevel.WARN`。
|
|
237
239
|
*/
|
|
238
240
|
logLevel?: LogLevel;
|
|
239
241
|
/**
|
|
240
|
-
*
|
|
242
|
+
* 修改内部日志打印等级,默认输出 `LogL.WARN` 及以上级别
|
|
243
|
+
*/
|
|
244
|
+
logOutputLevel?: EnableLogL;
|
|
245
|
+
/**
|
|
246
|
+
* @deprecated - 配置已废弃
|
|
241
247
|
*/
|
|
242
248
|
logStdout?: (logLevel: LogLevel, content: string) => void;
|
|
243
249
|
/**
|
|
@@ -285,8 +291,9 @@ interface IInitOption {
|
|
|
285
291
|
*/
|
|
286
292
|
typingExpireTime?: number;
|
|
287
293
|
/**
|
|
288
|
-
|
|
289
|
-
|
|
294
|
+
* @deprecate
|
|
295
|
+
* 是否打开 IndexDB 存储, 默认为 true
|
|
296
|
+
*/
|
|
290
297
|
indexDBSwitch?: boolean;
|
|
291
298
|
/**
|
|
292
299
|
* 是否校验证书,默认为 true
|
|
@@ -575,6 +582,7 @@ interface IIMClientOptions {
|
|
|
575
582
|
}
|
|
576
583
|
|
|
577
584
|
declare class ChannelClient {
|
|
585
|
+
private readonly logger;
|
|
578
586
|
private readonly _context;
|
|
579
587
|
readonly channelId: string;
|
|
580
588
|
private readonly _isCPPMode;
|
|
@@ -584,7 +592,7 @@ declare class ChannelClient {
|
|
|
584
592
|
* 草稿数据
|
|
585
593
|
*/
|
|
586
594
|
private readonly _draftMap;
|
|
587
|
-
constructor(_context: APIContext, channelId: string, _isCPPMode: boolean, _readReceiptTimeout: number);
|
|
595
|
+
constructor(logger: ILogger, _context: APIContext, channelId: string, _isCPPMode: boolean, _readReceiptTimeout: number);
|
|
588
596
|
/**
|
|
589
597
|
* 获取会话列表
|
|
590
598
|
* @param callback 结果回调
|
|
@@ -888,10 +896,11 @@ declare type RTCRoomOption = {
|
|
|
888
896
|
declare class IMClient {
|
|
889
897
|
private readonly _context;
|
|
890
898
|
private readonly _options;
|
|
899
|
+
private readonly logger;
|
|
891
900
|
private readonly _channelClient;
|
|
892
901
|
private readonly _defaultChannelClient;
|
|
893
902
|
private readonly _isCPPMode;
|
|
894
|
-
constructor(_context: APIContext, _options: IIMClientOptions);
|
|
903
|
+
constructor(_context: APIContext, _options: IIMClientOptions, logger: ILogger);
|
|
895
904
|
/**
|
|
896
905
|
* 协议栈方法校验
|
|
897
906
|
*/
|
|
@@ -1745,12 +1754,6 @@ declare const _default$i: {
|
|
|
1745
1754
|
* @param searchProps 消息属性名称列表
|
|
1746
1755
|
*/
|
|
1747
1756
|
registerMessageType(messageType: string, objectName: string, mesasgeTag: MessageTag, searchProps: string[]): void;
|
|
1748
|
-
/**
|
|
1749
|
-
* 创建 Logger 实例
|
|
1750
|
-
* @param tag 标签,以 'RC' 开头的为 SDK 内部使用
|
|
1751
|
-
* @returns Logger
|
|
1752
|
-
*/
|
|
1753
|
-
createLogger(tag: string, type: LogSource): Logger | null;
|
|
1754
1757
|
/**
|
|
1755
1758
|
* RTC Lib 内部使用消息监听器
|
|
1756
1759
|
*/
|
package/index.esm.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{NetworkType as e,HttpMethod as t,HTTP_TIMEOUT as n,appendUrl as o,ErrorCode as a,logger as s,LogTagId as c,Logger as r,SEND_MESSAGE_TYPE_OPTION as i,AppStorage as d,ReceivedStatus as u,MessageDirection as g,usingCppEngine as l,assert as C,AssertRules as f,todo as h,RTCApiType as p,VersionManage as m,APIContext as S,ConnectResultCode as I}from"@rongcloud/engine";export{ChatroomEntryType,ChatroomUserChangeType,ConnectionStatus,ConversationType,ErrorCode,FileType,LogLevel,LogSource,LogTagId,Logger,MessageBlockType,MessageDirection,NotificationStatus,RTCApiType,RTCMode,ReceivedStatus,UploadMethod,logger}from"@rongcloud/engine";var R;!function(e){e[e.SENDING=10]="SENDING",e[e.FAILED=20]="FAILED",e[e.SENT=30]="SENT",e[e.RECEIVED=40]="RECEIVED",e[e.READ=50]="READ",e[e.DESTROYED=60]="DESTROYED"}(R||(R={}));var M,v=R;!function(e){e[e.NONE=0]="NONE",e[e.SQQUENCE=1]="SQQUENCE",e[e.REVERSE=2]="REVERSE"}(M||(M={}));var y=M,T=function(){return T=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var a in t=arguments[n])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},T.apply(this,arguments)};function E(e,t,n,o){return new(n||(n=Promise))((function(a,s){function c(e){try{i(o.next(e))}catch(e){s(e)}}function r(e){try{i(o.throw(e))}catch(e){s(e)}}function i(e){var t;e.done?a(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(c,r)}i((o=o.apply(e,t||[])).next())}))}function U(e,t){var n,o,a,s,c={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return s={next:r(0),throw:r(1),return:r(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function r(s){return function(r){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;c;)try{if(n=1,o&&(a=2&s[0]?o.return:s[0]?o.throw||((a=o.return)&&a.call(o),0):o.next)&&!(a=a.call(o,s[1])).done)return a;switch(o=0,a&&(s=[2&s[0],a.value]),s[0]){case 0:case 1:a=s;break;case 4:return c.label++,{value:s[1],done:!1};case 5:c.label++,o=s[1],s=[0];continue;case 7:s=c.ops.pop(),c.trys.pop();continue;default:if(!(a=c.trys,(a=a.length>0&&a[a.length-1])||6!==s[0]&&2!==s[0])){c=0;continue}if(3===s[0]&&(!a||s[1]>a[0]&&s[1]<a[3])){c.label=s[1];break}if(6===s[0]&&c.label<a[1]){c.label=a[1],a=s;break}if(a&&c.label<a[2]){c.label=a[2],c.ops.push(s);break}a[2]&&c.ops.pop(),c.trys.pop();continue}s=t.call(e,c)}catch(e){s=[6,e],o=0}finally{n=a=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,r])}}}function N(e,t,n){if(n||2===arguments.length)for(var o,a=0,s=t.length;a<s;a++)!o&&a in t||(o||(o=Array.prototype.slice.call(t,0,a)),o[a]=t[a]);return e.concat(o||Array.prototype.slice.call(t))}var _=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))},A=_();var L={tag:"browser",httpReq:function(e){var a=e.method||t.GET,s=e.timeout||n,c=e.headers,r=e.query,i=e.body,d=o(e.url,r);return new Promise((function(e){var t,n=(t="undefined"!=typeof XMLHttpRequest&&"withCredentials"in new XMLHttpRequest,"undefined"!=typeof XMLHttpRequest&&t?new XMLHttpRequest:"undefined"!=typeof XDomainRequest?new XDomainRequest:new ActiveXObject("Microsoft.XMLHTTP")),o="[object XDomainRequest]"===Object.prototype.toString.call(n);if(n.open(a,d),c&&n.setRequestHeader)for(var r in c)n.setRequestHeader(r,c[r]);if(o){n.timeout=s,n.onload=function(){e({data:n.responseText,status:n.status||200})},n.onerror=function(){e({status:n.status||0})},n.ontimeout=function(){e({status:n.status||0})};var u="object"==typeof i?JSON.stringify(i):i;n.send(u)}else n.onreadystatechange=function(){4===n.readyState&&e({data:n.responseText,status:n.status})},n.onerror=function(){e({status:n.status||0})},setTimeout((function(){n.abort(),e({status:n.status||0})}),s),n.send(i)}))},localStorage:null===window||void 0===window?void 0:window.localStorage,sessionStorage:null===window||void 0===window?void 0:window.sessionStorage,useNavi:!0,connectPlatform:"",isFromUniapp:A,createWebSocket:function(e,t){var n=new WebSocket(e,t);return n.binaryType="arraybuffer",{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 t=navigator.connection||navigator.mozConnection||navigator.webkitConnection,n=t.type,o=t.effectiveType,a=n||o||e.UNKONWN;return new Promise((function(e){e(a)}))}},B=_(),w=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var o=s.ID();try{return s.info(c.A_CALLBACK_O,{func_name:e,source:"wechat"},{traceId:o}),wx[e].apply(wx,t)}catch(t){s.error(c.A_CALLBACK_E,{func_name:e,source:"wechat"},{traceId:o})}}},x={setItem:w("setStorageSync"),getItem:w("getStorageSync"),removeItem:w("removeStorageSync"),clear:w("clearStorageSync")},k={tag:"wechat",httpReq:function(e){var s=e.method||t.GET,c=e.timeout||n,r=e.headers,i=e.query,d=e.body,u=o(e.url,i);return new Promise((function(e){wx.request({url:u,method:s,header:r,timeout:c,data:d,success:function(t){e({data:t.data,status:t.statusCode})},fail:function(){e({status:a.RC_HTTP_REQ_FAIL})}})}))},localStorage:x,sessionStorage:x,useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:B,createWebSocket:function(e,t){var n=wx.connectSocket({url:e,protocols:t});return{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(t){wx.getNetworkType({success:function(e){var n=e.networkType;t(n)},fail:function(){t(e.UNKONWN)}})}))}},P=_(),b=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var o=s.ID();try{if(s.info(c.A_CALLBACK_O,{func_name:e,source:"alipay"},{traceId:o}),"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 a=my[e]({key:t[0]}).data;return a?JSON.stringify(a):a}catch(t){s.error(c.A_CALLBACK_E,{func_name:e,source:"alipay"},{traceId:o})}}},O={setItem:b("setStorageSync"),getItem:b("getStorageSync"),removeItem:b("removeStorageSync"),clear:b("clearStorageSync")},D={tag:"alipay",httpReq:function(e){var s=e.method||t.GET,c=e.timeout||n,r=e.headers,i=e.query,d=e.body,u=o(e.url,i),g=e.dataType||"json";return new Promise((function(e){my.request({url:u,method:s,headers:r,timeout:c,data:d,dataType:g,success:function(t){e({data:t.data,status:t.status})},fail:function(){e({status:a.RC_HTTP_REQ_FAIL})}})}))},localStorage:O,sessionStorage:O,useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:P,createWebSocket:function(e){return my.connectSocket({url:e}),{onClose:function(e){my.onSocketClose(e)},onError:function(e){my.onSocketError((function(t){e(t.errMsg)}))},onMessage:function(e){my.onSocketMessage((function(t){t.isBuffer?e(my.base64ToArrayBuffer(t.data)):e(t.data)}))},onOpen:function(e){my.onSocketOpen(e)},send:function(e){my.sendSocketMessage({data:my.arrayBufferToBase64(e),isBuffer:!0})},close:function(){my.closeSocket()}}},getNetworkType:function(){return new Promise((function(t){my.getNetworkType({success:function(e){var n=e.networkType;t(n)},fail:function(){t(e.UNKONWN)}})}))}},G=_(),K=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var o=s.ID();try{return s.info(c.A_CALLBACK_O,{func_name:e,source:"toutiao"},{traceId:o}),tt[e].apply(tt,t)}catch(t){s.error(c.A_CALLBACK_E,{func_name:e,source:"toutiao"},{traceId:o})}}},F={setItem:K("setStorageSync"),getItem:K("getStorageSync"),removeItem:K("removeStorageSync"),clear:K("clearStorageSync")},W={tag:"toutiao",useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:G,localStorage:F,sessionStorage:F,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:a.RC_HTTP_REQ_FAIL})}})}))},createWebSocket:function(e,t){var n=tt.connectSocket({url:e,protocols:t});return{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(t){tt.getNetworkType({success:function(e){var n=e.networkType;t(n)},fail:function(){t(e.UNKONWN)}})}))}},H=_(),V=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var o=s.ID();try{return s.info(c.A_CALLBACK_O,{func_name:e,source:"baidu"},{traceId:o}),swan[e].apply(swan,t)}catch(t){s.error(c.A_CALLBACK_E,{func_name:e,source:"baidu"},{traceId:o})}}},q={setItem:V("setStorageSync"),getItem:V("getStorageSync"),removeItem:V("removeStorageSync"),clear:V("clearStorageSync")},j={tag:"baidu",useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:H,localStorage:q,sessionStorage:q,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:a.RC_HTTP_REQ_FAIL})}})}))},createWebSocket:function(e,t){var n=swan.connectSocket({url:e,protocols:t});return{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 E(this,void 0,void 0,(function(){return U(this,(function(t){return[2,new Promise((function(t){swan.getNetworkType({success:function(e){var n=e.networkType;t(n)},fail:function(){t(e.UNKONWN)}})}))]}))}))}},J=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var o=s.ID();try{return s.info(c.A_CALLBACK_O,{func_name:e,source:"uniapp"},{traceId:o}),uni[e].apply(uni,t)}catch(t){s.error(c.A_CALLBACK_E,{func_name:e,source:"uniapp"},{traceId:o})}}},Y={setItem:J("setStorageSync"),getItem:J("getStorageSync"),removeItem:J("removeStorageSync"),clear:J("clearStorageSync")},Q={tag:"uniapp",httpReq:function(e){var s=e.method||t.GET,c=e.timeout||n,r=e.headers,i=e.query,d=e.body,u=o(e.url,i);return new Promise((function(e){uni.request({url:u,method:s,header:r,timeout:c,data:d,success:function(t){e({data:t.data,status:t.statusCode})},fail:function(){e({status:a.RC_HTTP_REQ_FAIL})}})}))},localStorage:Y,sessionStorage:Y,useNavi:!0,connectPlatform:"",isFromUniapp:!0,createWebSocket:function(e,t){var n={complete:function(){},url:e,protocols:t},o=uni.connectSocket(n);return{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(t){uni.getNetworkType({success:function(e){var n=e.networkType;t(n)},fail:function(){t(e.UNKONWN)}})}))}},X=function(e){return e&&e.request&&e.getSystemInfo},z="undefined"!=typeof uni&&X(uni)?function(){switch(process.env.VUE_APP_PLATFORM){case"app-plus":return Q;case"mp-baidu":return j;case"mp-toutiao":return W;case"mp-alipay":return D;case"mp-weixin":return k;default:return L}}():"undefined"!=typeof my&&X(my)?D:"undefined"!=typeof tt&&X(tt)?W:"undefined"!=typeof swan&&X(swan)?j:"undefined"!=typeof wx&&X(wx)?k:L,$=new r("RCIM");function Z(e,t,n){return"".concat(e,"_").concat(t,"_").concat(n)}var ee=function(){function e(){}return e.set=function(t){if(i[t.messageType]&&i[t.messageType].isPersited){var n=e.get(t.conversationType,t.targetId,t.channelId||"");if(!n||n.sentTime<t.sentTime){var o=Z(t.conversationType,t.targetId,t.channelId||"");e.map[o]=t}}},e.get=function(t,n,o){var a=Z(t,n,o);return e.map[a]||null},e.remove=function(t,n,o){var a=Z(t,n,o);delete e.map[a]},e.clear=function(){e.map={}},e.map={},e}(),te={"RC:TxtMsg":"TextMessage","RC:ImgMsg":"ImageMessage","RC:VcMsg":"VoiceMessage","RC:ImgTextMsg":"RichContentMessage","RC:ReferenceMsg":"ReferenceMessage","RC:FileMsg":"FileMessage","RC:HQVCMsg":"HQVoiceMessage","RC:GIFMsg":"GIFMessage","RC:SightMsg":"SightMessage","RC:LBSMsg":"LocationMessage","RC:InfoNtf":"InformationNotificationMessage","RC:ContactNtf":"ContactNotificationMessage","RC:ProfileNtf":"ProfileNotificationMessage","RC:CmdNtf":"CommandNotificationMessage","RC:DizNtf":"DiscussionNotificationMessage","RC:CmdMsg":"CommandMessage","RC:TypSts":"TypingStatusMessage","RC:CsChaR":"ChangeModeResponseMessage","RC:CsHsR":"HandShakeResponseMessage","RC:CsEnd":"TerminateMessage","RC:CsSp":"SuspendMessage","RC:CsUpdate":"CustomerStatusUpdateMessage","RC:ReadNtf":"ReadReceiptMessage","RC:VCAccept":"AcceptMessage","RC:VCRinging":"RingingMessage","RC:VCSummary":"SummaryMessage","RC:VCHangup":"HungupMessage","RC:VCInvite":"InviteMessage","RC:VCModifyMedia":"MediaModifyMessage","RC:VCModifyMem":"MemberModifyMessage","RC:CsContact":"CustomerContact","RC:PSImgTxtMsg":"PublicServiceRichContentMessage","RC:PSMultiImgTxtMsg":"PublicServiceMultiRichContentMessage","RC:GrpNtf":"GroupNotificationMessage","RC:PSCmd":"PublicServiceCommandMessage","RC:RcCmd":"RecallCommandMessage","RC:SRSMsg":"SyncReadStatusMessage","RC:RRReqMsg":"ReadReceiptRequestMessage","RC:RRRspMsg":"ReadReceiptResponseMessage","RCJrmf:RpMsg":"JrmfRedPacketMessage","RCJrmf:RpOpendMsg":"JrmfRedPacketOpenedMessage","RC:CombineMsg":"RCCombineMessage","RC:chrmKVNotiMsg":"ChrmKVNotificationMessage","RC:LogCmdMsg":"LogCommandMessage","RC:MsgExMsg":"ExpansionCommandMessage","RC:RRMsg":"GroupReadReceiptResponseMessage"},ne={},oe=new d(z,"API-V2");function ae(e){var t=e.channelId,n=e.conversationType,o=e.targetId,a=e.unreadMessageCount,s=e.latestMessage,c=e.isTop,r=e.notificationStatus,i=e.matchCount;if(!l()){var d=ee.get(n,o,t||"");s?d&&s.sentTime<d.sentTime&&(s=d):s=d}var u=s?se(s):null;return{channelId:t||"",conversationType:n,targetId:o,unreadMessageCount:a,latestMessage:u,latestMessageId:null==u?void 0:u.messageId,objectName:null==u?void 0:u.messageType,sentTime:null==u?void 0:u.sentTime,isTop:c,notificationStatus:r,receivedStatus:null==u?void 0:u.receivedStatus,matchCount:i}}function se(e){var t=e.conversationType,n=e.targetId,o=e.senderUserId,a=e.content,s=e.messageType,c=e.messageUId,r=e.messageDirection,i=e.isOffLineMessage,d=e.sentTime,g=e.receivedStatus,l=e.receivedTime,C=e.canIncludeExpansion,f=e.disableNotification,h=e.expansion,p=e.messageId,m=e.sentStatus,S=e.channelId,I=e.readReceiptInfo,R=e.pushConfig,M="";return s in te?M=te[s]:s in ne?M=ne[s]:(a={message:{content:a,objectName:s},messageName:"UnknownMessage"},M="UnknownMessage"),g||(g=u.UNREAD),void 0===p&&(p=~~(16777215*Math.random())),{channelId:S||"",conversationType:t,targetId:n,senderUserId:o,content:a,messageType:M,messageUId:c,messageDirection:r,offLineMessage:i,sentTime:d,receivedStatus:g,receivedTime:l,objectName:s,messageId:p,sentStatus:m||v.SENT,disableNotification:f,canIncludeExpansion:C,expansion:h,readReceiptInfo:I,pushConfig:R}}function ce(e,t,n,o){var a=new Date(n-1e3*o*60*60*24).getTime()-e.sentTime<0,s=e.messageType,c=e.messageDirection;if("ReadReceiptRequestMessage"===s&&a&&c===g.SEND){var r="".concat(t).concat(e.content.messageUId,"SENT");oe.set(r,{count:0,dealtime:e.sentTime,userIds:{}})}else if("ReadReceiptRequestMessage"===s&&a){var i="".concat(t).concat(e.conversationType).concat(e.targetId,"RECEIVED"),d=oe.get(i);if(d)if(e.senderUserId in d)d[e.senderUserId].uIds&&-1===d[e.senderUserId].uIds.indexOf(e.content.messageUId)&&(d[e.senderUserId].uIds.push(e.content.messageUId),d[e.senderUserId].dealtime=e.sentTime,d[e.senderUserId].isResponse=!1,oe.set(i,d));else{var u={uIds:[e.content.messageUId],dealtime:e.sentTime,isResponse:!1};d[e.senderUserId]=u,oe.set(i,d)}else{var l={};l[e.senderUserId]={uIds:[e.content.messageUId],dealtime:e.sentTime,isResponse:!1},oe.set(i,l)}}}function re(e,t,n){try{e(t,n)}catch(e){$.error(e)}}function ie(e,t,n){try{e(t,n)}catch(e){$.error(e)}}var de=function(e,t,n,o,a){void 0===o&&(o=!0),void 0===a&&(a=!0),this.messageType=e,this.objectName=t,this.content=n,this.isPersited=o,this.isCounted=a};function ue(e,t,n,o){void 0===n&&(n=!0),void 0===o&&(o=!0);var a=function(a){return new de(e,t,a,n,o)};return a.MessageType=e,a.ObjectName=t,a}var ge,le,Ce=ue("ReadReceiptResponseMessage","RC:RRRspMsg"),fe=function(){function e(e,t,n,o){this._context=e,this.channelId=t,this._isCPPMode=n,this._readReceiptTimeout=o,this._storage=oe,this._draftMap={}}return e.prototype.getConversationList=function(e,t,n){C("callback",e,f.CALLBACK),C("conversationTypes",t,f.ARRAY),C("count",n,f.NUMBER),this._context.getConversationList(n,void 0,0,0,this.channelId).then((function(n){var o=n.code,s=n.data,c=[];s=s||[],o===a.SUCCESS?(t?s.forEach((function(e){t.indexOf(e.conversationType)>-1&&c.push(ae(e))})):s.forEach((function(e){c.push(ae(e))})),re(e.onSuccess,c)):($.warn("getConversationList -> code:".concat(o)),ie(e.onError,o))}))},e.prototype.getConversation=function(e,t,n){var o=this;C("callback",n,f.CALLBACK),C("conversationType",e,f.NUMBER,!0),C("targetId",t,f.STRING,!0),$.info("getConversation ->targetId:".concat(t,",conversationType:").concat(e)),E(o,void 0,void 0,(function(){var o,s,c;return U(this,(function(r){switch(r.label){case 0:return[4,this._context.getConversation(e,t,this.channelId)];case 1:return o=r.sent(),s=o.code,c=o.data,s!==a.SUCCESS?($.warn("getConversation ->code:".concat(s,",targetId:").concat(t)),n.onError(s),[2]):(n.onSuccess(c?ae(c):null),[2])}}))}))},e.prototype.removeConversation=function(e,t,n){var o=this;C("conversationType",e,f.NUMBER,!0),C("targetId",t,f.STRING,!0),C("callback",n,f.CALLBACK),$.info("removeConversation ->targetId:".concat(t,",conversationType:").concat(e)),this._context.removeConversation(e,t,this.channelId).then((function(s){s===a.SUCCESS?(o._isCPPMode||ee.remove(e,t,o.channelId),re(n.onSuccess)):($.warn("removeConversation ->code:".concat(s,",targetId:").concat(t)),ie(n.onError,s))}))},e.prototype.saveTextMessageDraft=function(e,t,n){C("conversationType",e,f.NUMBER,!0),C("targetId",t,f.STRING,!0),C("draftText",n,f.STRING,!0),$.info("saveTextMessageDraft ->targetId:".concat(t,",conversationType:").concat(e));var o=this._context.getCurrentUserId();return!!o&&((this._draftMap[o]=this._draftMap[o]||{})["".concat(e,"_").concat(t,"_").concat(this.channelId)]=n,!0)},e.prototype.getTextMessageDraft=function(e,t){C("conversationType",e,f.NUMBER,!0),C("targetId",t,f.STRING,!0),$.info("getTextMessageDraft ->targetId:".concat(t,",conversationType:").concat(e));var n=this._context.getCurrentUserId();if(n)return(this._draftMap[n]||{})["".concat(e,"_").concat(t,"_").concat(this.channelId)]},e.prototype.clearTextMessageDraft=function(e,t){C("conversationType",e,f.NUMBER,!0),C("targetId",t,f.STRING,!0),$.info("clearTextMessageDraft ->targetId:".concat(t,",conversationType:").concat(e));var n=this._context.getCurrentUserId();return!!n&&delete(this._draftMap[n]||{})["".concat(e,"_").concat(t,"_").concat(this.channelId)]},e.prototype.getTotalUnreadCount=function(e,t,n){C("callback",e,f.CALLBACK),$.info("getTotalUnreadCount ->conversationTypes:".concat(t)),this._context.getTotalUnreadCount(this.channelId,t,n).then((function(t){var n=t.code,o=t.data;n===a.SUCCESS?re(e.onSuccess,o):($.warn("getTotalUnreadCount ->code:".concat(n)),ie(e.onError,n))}))},e.prototype.getUnreadCount=function(e,t,n){C("conversationType",e,f.NUMBER,!0),C("targetId",t,f.STRING,!0),C("callback",n,f.CALLBACK),$.info("getUnreadCount ->targetId:".concat(t,",conversationType:").concat(e)),this._context.getUnreadCount(e,t,this.channelId).then((function(e){var o=e.code,s=e.data;o===a.SUCCESS?re(n.onSuccess,s):($.warn("getUnreadCount ->code:".concat(o,",targetId:").concat(t)),ie(n.onError,o))}))},e.prototype.clearConversations=function(e,t){$.info("clearConversations -> conversationTypes:".concat(t)),this._isCPPMode?this._context.clearConversations(t,this.channelId).then((function(t){t===a.SUCCESS?re(e.onSuccess,!0):($.warn("clearConversations ->code:".concat(t)),ie(e.onError,t))})):$.error("Method is only available in cppProtocol mode")},e.prototype.clearUnreadCount=function(e,t,n){C("conversationType",e,f.NUMBER,!0),C("targetId",t,f.STRING,!0),C("callback",n,f.CALLBACK),$.info("clearUnreadCount ->targetId:".concat(t,",conversationType:").concat(e)),this._context.clearUnreadCount(e,t,this.channelId).then((function(e){e===a.SUCCESS?re(n.onSuccess,!0):($.warn("clearUnreadCount ->code:".concat(e,",targetId:").concat(t)),ie(n.onError,e))}))},e.prototype.clearAllUnreadCount=function(e){C("callback",e,f.CALLBACK),$.info("clearUnreadCount ->"),this._context.clearAllUnreadCount().then((function(t){t===a.SUCCESS?re(e.onSuccess,!0):($.warn("clearUnreadCount ->code:".concat(t)),ie(e.onError,t))}))},e.prototype.getFirstUnreadMessage=function(e,t,n){C("conversationType",e,f.NUMBER,!0),C("targetId",t,f.STRING,!0),C("callback",n,f.CALLBACK),$.info("getFirstUnreadMessage ->targetId:".concat(t,",conversationType:").concat(e)),this._context.getFirstUnreadMessage(e,t,this.channelId).then((function(e){e.code===a.SUCCESS?re(n.onSuccess,e.data?se(e.data):null):($.warn("getFirstUnreadMessage ->code:".concat(e.code,",targetId:").concat(t)),ie(n.onError,e.code))}))},e.prototype.setConversationStatus=function(e,t,n,o){C("conversationType",e,f.NUMBER,!0),C("targetId",t,f.STRING,!0),C("callback",o,f.CALLBACK),C("status",n,f.OBJECT,!0),$.info("setConversationStatus ->targetId:".concat(t,",status:").concat(n));var s=n.isTop,c=n.notificationStatus;this._context.setConversationStatus(e,t,s,c,this.channelId).then((function(e){e===a.SUCCESS?re(o.onSuccess):($.warn("setConversationStatus ->code:".concat(e,",targetId:").concat(t)),ie(o.onError,e))}))},e.prototype.sendMessage=function(e,t,n,o,r,i,d,l){var h=this;C("conversationType",e,f.NUMBER,!0),C("targetId",t,f.STRING,!0),C("msg",n,f.OBJECT,!0),C("callback",o,f.CALLBACK),C("isMentioned",r,f.BOOLEAN),C("pushContent",i,f.ONLY_STRING),C("pushData",d,f.ONLY_STRING),C("options.userIds",null==l?void 0:l.userIds,f.ARRAY),C("options.isVoipPush",null==l?void 0:l.isVoipPush,f.BOOLEAN),C("options.disableNotification",null==l?void 0:l.disableNotification,f.BOOLEAN),C("options.canIncludeExpansion",null==l?void 0:l.canIncludeExpansion,f.BOOLEAN),C("options.expansion",null==l?void 0:l.expansion,f.OBJECT),C("options.pushConfig",null==l?void 0:l.pushConfig,f.OBJECT),C("options.resendMessageId",null==l?void 0:l.resendMessageId,f.NUMBER),$.info("sendMessage ->targetId:".concat(t,",conversationType:").concat(e));var p=!(!(null==l?void 0:l.isStatusMessage)&&!(null==l?void 0:l.isStatus)),m=function(e,t,n){var o,a=e||{},s=a.userIds,c=a.isVoipPush,r=a.disableNotification,i=a.isFilerWhiteBlacklist,d=a.expansion,u=a.canIncludeExpansion,g=a.pushConfig,l=a.resendMessageId,C=[];if(t){var f=(n||{}).content.mentionedInfo;C=f.userIdList,o=f.type}return{mentionedType:o,mentionedUserIdList:C,directionalUserIdList:s,isVoipPush:c,disableNotification:r,isFilerWhiteBlacklist:i,expansion:d,canIncludeExpansion:u,pushConfig:g,messageId:l}}(l,r,n),S=Object.assign(n,T(T({isMentioned:r,pushContent:i,pushData:d},m),{messageType:n.objectName,channelId:this.channelId,isStatusMessage:p})),I=this._context.getCurrentUserId(),R=s.ID();s.info(c.A_SEND_MSG_T,{messageType:S.messageType,conversationType:e,targetId:t,channelId:this.channelId},{traceId:R}),this._context.sendMessage(e,t,S,o.onBefore,R).then((function(r){var i=r.code,d=r.data;if((i===a.SUCCESS?s.info:s.warn)(c.A_SEND_MSG_R,{code:i,messageUId:d?d.messageUId:"",messageId:d?d.messageId:""},{traceId:R}),i===a.SUCCESS){h._isCPPMode||ee.set(d);var C=se(d);ce(C,I,h._context.getConnectedTime(),h._readReceiptTimeout),re(o.onSuccess,C)}else $.warn("sendMessage ->code:".concat(i,",targetId:").concat(t)),ie(o.onError,i,se({isMentioned:!!S.isMentioned,content:n.content,messageType:n.messageType,isPersited:n.isPersited,isCounted:n.isCounted,disableNotification:!!(null==l?void 0:l.disableNotification),canIncludeExpansion:!!(null==l?void 0:l.canIncludeExpansion),expansion:(null==l?void 0:l.expansion)||null,conversationType:e,targetId:t,senderUserId:I,messageUId:"",messageDirection:g.SEND,isOffLineMessage:!1,sentTime:(null==d?void 0:d.sentTime)||0,receivedTime:0,isStatusMessage:p,receivedStatus:u.UNREAD,messageId:null==d?void 0:d.messageId,sentStatus:v.FAILED}))}))},e.prototype.sendRecallMessage=function(e,t,n){var o=this;C("message.conversationType",e.conversationType,f.NUMBER,!0),C("message.targetId",e.targetId,f.STRING,!0),C("message.messageUId",e.messageUId,f.STRING,!0),C("message.sentTime",e.sentTime,f.NUMBER,!0),C("callback",t,f.CALLBACK),C("options.disableNotification",null==n?void 0:n.disableNotification,f.BOOLEAN),C("options.pushConfig",null==n?void 0:n.pushConfig,f.OBJECT),C("options.extra",null==n?void 0:n.extra,f.STRING);var s=e.conversationType,c=e.targetId,r=e.messageUId,i=e.sentTime;$.info("sendRecallMessage ->targetId:".concat(c,",conversationType:").concat(s,",messageUId:").concat(r));var d=T({channelId:this.channelId},n);this._context.recallMessage(s,c,r,i,d).then((function(e){var n=e.code,s=e.data;n===a.SUCCESS?(o._isCPPMode||ee.set(s),re(t.onSuccess,se(s))):($.warn("sendRecallMessage ->code:".concat(n,",targetId:").concat(c,",messageUId:").concat(r)),ie(t.onError,n))}))},e.prototype.sendTypingStatusMessage=function(e,t,n,o){C("conversationType",e,f.NUMBER,!0),C("targetId",t,f.STRING,!0),C("typingContentType",n,f.STRING,!0),C("callback",o,f.CALLBACK),$.info("sendTypingStatusMessage ->targetId:".concat(t,",conversationType:").concat(e));var r={messageType:"RC:TypSts",content:{typingContentType:n},isStatusMessage:!0,channelId:this.channelId},i=s.ID();s.info(c.A_SEND_MSG_T,{messageType:r.messageType,conversationType:e,targetId:t,channelId:r.channelId},{traceId:i}),this._context.sendMessage(e,t,r,void 0,i).then((function(e){var n=e.code,r=e.data;(n===a.SUCCESS?s.info:s.warn)(c.A_SEND_MSG_R,{code:n,messageUId:r?r.messageUId:"",messageId:r?r.messageId:""},{traceId:i}),n===a.SUCCESS?re(o.onSuccess,se(r)):($.warn("sendTypingStatusMessage ->code:".concat(n,",targetId:").concat(t)),ie(o.onError,n))}))},e.prototype.sendReceiptResponse=function(e,t,n){var o=this;$.info("sendReceiptResponse ->targetId:".concat(t,",conversationType:").concat(e));var a=this._context.getCurrentUserId(),s="".concat(a).concat(e).concat(t,"RECEIVED"),c=this._storage.get(s);if(c){var r=[];for(var i in c){var d={};d[i]=c[i].uIds,c[i].isResponse||r.push(d)}if(0===r.length)return void n.onSuccess(null);var u=setInterval((function(){1===r.length&&clearInterval(u);var a=r.splice(0,1)[0],i=new Ce({receiptMessageDic:a});o.sendMessage(e,t,i,{onSuccess:function(e){var t=Object.keys(a)[0];c[t].isResponse=!0,o._storage.set(s,c),re(n.onSuccess,e)},onError:function(e){$.warn("sendReceiptResponse ->code:".concat(e,",targetId:").concat(t)),ie(n.onError,e)}})}),200)}else n.onSuccess(null)},e.prototype.sendReadReceiptMessage=function(e,t,n){C("messageUIds",e,f.ARRAY,!0),C("targetId",t,f.STRING,!0),$.info("sendReadReceiptMessage ->targetId:".concat(t,",messageUIds:").concat(e));for(var o=0,s=e;o<s.length;o++){var c=s[o];C("messageUId",c,f.STRING)}this._context.sendReadReceiptMessage(t,e,this.channelId).then((function(o){var s=o.code;s===a.SUCCESS?n.onSuccess():($.warn("sendReadReceiptMessage ->code:".concat(s,",targetId:").concat(t,",messageUIds:").concat(e)),n.onError(s))})).catch((function(o){$.warn("sendReadReceiptMessage ->code:".concat(o,",targetId:").concat(t,",messageUIds:").concat(e)),n.onError(o)}))},e.prototype.getMessageReader=function(e,t,n){C("messageUId",e,f.STRING,!0),C("targetId",t,f.STRING,!0),$.info("getMessageReader ->targetId:".concat(t,",messageUId:").concat(e)),this._context.getMessageReader(t,e,this.channelId).then((function(o){var s=o.code,c=o.data;s===a.SUCCESS?n.onSuccess(c):($.warn("getMessageReader ->code:".concat(s,",targetId:").concat(t,",messageUId:").concat(e)),n.onError(s))})).catch((function(o){$.warn("getMessageReader ->code:".concat(o,",targetId:").concat(t,",messageUId:").concat(e)),n.onError(o)}))},e.prototype.updateMessageExpansion=function(e,t,n){C("expansion",e,f.OBJECT,!0),C("message",t,f.OBJECT,!0);var o=t.conversationType,s=t.targetId,c=t.messageUId,r=t.canIncludeExpansion,i=t.expansion;$.info("updateMessageExpansion ->targetId:".concat(s,",messageUId:").concat(c,",conversationType:").concat(o)),this._context.sendExpansionMessage({conversationType:o,targetId:s,messageUId:c,canIncludeExpansion:r,originExpansion:i,expansion:e,channelId:this.channelId}).then((function(e){var t=e.code;t===a.SUCCESS?re(n.onSuccess):($.warn("updateMessageExpansion ->code:".concat(t,",targetId:").concat(s,",messageUId:").concat(c)),ie(n.onError,t))}))},e.prototype.removeMessageExpansionForKey=function(e,t,n){C("keys",e,f.ARRAY,!0),C("message",t,f.OBJECT,!0);var o=t.conversationType,s=t.targetId,c=t.messageUId,r=t.canIncludeExpansion;$.info("removeMessageExpansionForKey ->targetId:".concat(s,",messageUId:").concat(c,",conversationType:").concat(o)),this._context.sendExpansionMessage({conversationType:o,targetId:s,messageUId:c,canIncludeExpansion:r,keys:e,channelId:this.channelId}).then((function(e){var t=e.code;t===a.SUCCESS?re(n.onSuccess):($.warn("removeMessageExpansionForKey ->code:".concat(t,",targetId:").concat(s,",messageUId:").concat(c)),ie(n.onError,t))}))},e.prototype.getHistoryMessages=function(e,t,n,o,r,i,d){C("conversationType",e,f.NUMBER,!0),C("targetId",t,f.STRING,!0),C("timestamp",n,f.NUMBER,!0),C("count",o,f.NUMBER,!0),C("callback",r,f.CALLBACK,!0),C("order",d,f.NUMBER),$.info("getHistoryMessages ->targetId:".concat(t,",conversationType:").concat(e,",timestamp:").concat(n));var u=s.ID();s.info(c.A_GET_HISTORY_MSG_T,{targetId:t,conversationType:e,channelId:"",timestamp:n,count:o},{traceId:u}),this._context.getHistoryMessage(e,t,n,o,d,this.channelId,i,u).then((function(e){var n=e.code,o=e.data;if(n===a.SUCCESS)if(o){var i=o.list,d=o.hasMore,g=[],l=i.map((function(e){return g.push(e.messageUId),se(e)}));s.info(c.A_GET_HISTORY_MSG_R,{code:n,messageUIds:g.join(",")},{traceId:u}),re(r.onSuccess,l,d)}else s.info(c.A_GET_HISTORY_MSG_R,{code:n,messageUIds:""},{traceId:u}),re(r.onSuccess,[],!1);else s.warn(c.A_GET_HISTORY_MSG_R,{code:n,messageUIds:""},{traceId:u}),$.warn("getHistoryMessages ->code:".concat(n,",targetId:").concat(t)),ie(r.onError,n)}))},e.prototype.deleteRemoteMessages=function(e,t,n,o){var s=this;C("conversationType",e,f.NUMBER,!0),C("targetId",t,f.STRING,!0),C("messages",n,f.ARRAY,!0),C("callback",o,f.CALLBACK),$.info("deleteRemoteMessages ->targetId:".concat(t,",conversationType:").concat(e)),this._context.deleteRemoteMessage(e,t,n,this.channelId).then((function(c){if(c===a.SUCCESS){if(!s._isCPPMode){var r=ee.get(e,t,s.channelId);r&&n.forEach((function(n){r.messageUId===n.messageUId&&ee.remove(e,t,s.channelId)}))}re(o.onSuccess)}else $.warn("deleteRemoteMessages ->code:".concat(c,",targetId:").concat(t)),ie(o.onError,c)}))},e.prototype.clearRemoteHistoryMessages=function(e,t){C("param.conversationType",e.conversationType,f.NUMBER,!0),C("param.targetId",e.targetId,f.STRING,!0),C("param.timestamp",e.timestamp,f.NUMBER,!0),C("callback",t,f.CALLBACK);var n=e.conversationType,o=e.targetId,s=e.timestamp;$.info("clearRemoteHistoryMessages ->targetId:".concat(o,",conversationType:").concat(n)),this._context.deleteRemoteMessageByTimestamp(n,o,s,this.channelId).then((function(e){e===a.SUCCESS?re(t.onSuccess):($.warn("clearRemoteHistoryMessages ->code:".concat(e)),ie(t.onError,e))}))},e.prototype.getConversationListWithAllChannel=function(e){C("callback",e,f.CALLBACK),this._context.getConversationListWithAllChannel().then((function(t){var n=t.code,o=t.data;n===a.SUCCESS?re(e.onSuccess,o.map(ae)):ie(e.onError,n)}))},e.prototype.getConversationListWithAllChannelByPage=function(e,t,n){C("callback",e,f.CALLBACK),C("index",t,f.NUMBER),C("limit",n,f.NUMBER),this._context.getConversationListWithAllChannelByPage(t,n).then((function(t){var n=t.code,o=t.data;n===a.SUCCESS?re(e.onSuccess,o.map(ae)):ie(e.onError,n)}))},e.prototype.insertMessage=function(e,t,n,o,s){void 0===s&&(s={});var c=n.senderUserId,r=n.objectName,i=n.content,d=n.messageDirection,u=n.messageUId,g=n.canIncludeExpansion,l=n.expansion,C=n.disableNotification,f=n.sentTime,h=n.sentStatus;$.info("insertMessage ->targetId:".concat(t,",conversationType:").concat(e));var p=s.isUnread,m={senderUserId:c,messageType:r,content:i,messageDirection:d,sentTime:f,sentStatus:h,searchContent:s.searchContent,isUnread:p,messageUId:u,disableNotification:C,canIncludeExpansion:g,expansionMsg:JSON.stringify(l),channelId:this.channelId};this._context.insertMessage(e,t,m).then((function(e){var n=e.code,s=e.data;n===a.SUCCESS?re(o.onSuccess,se(s)):($.warn("insertMessage ->code:".concat(n,",targetId:").concat(t)),ie(o.onError,n))}))},e.prototype.deleteLocalMessagesByTimestamp=function(e,t,n,o,s){$.info("deleteLocalMessagesByTimestamp ->targetId:".concat(t,",conversationType:").concat(e,",timestamp:").concat(n)),this._context.deleteMessagesByTimestamp(e,t,n,o,this.channelId).then((function(e){e===a.SUCCESS?re(s.onSuccess,!0):($.warn("deleteLocalMessagesByTimestamp ->code:".concat(e,",targetId:").concat(t)),ie(s.onError,e))}))},e.prototype.getRemoteHistoryMessages=function(e,t,n,o,s,c){$.info("getRemoteHistoryMessages ->targetId:".concat(t,",conversationType:").concat(e));var r=c.order||0;this._context.getRemoteHistoryMessages(e,t,n,o,r,this.channelId).then((function(e){var n=e.code,o=e.data;if(n===a.SUCCESS)if(o){var c=o.list,r=o.hasMore,i=c.map((function(e){return se(e)}));re(s.onSuccess,i,r)}else re(s.onSuccess,[],!1);else $.warn("getRemoteHistoryMessages ->code:".concat(n,",targetId:").concat(t)),ie(s.onError,n)}))},e.prototype.clearMessages=function(e,t,n){var o=this;$.info("clearMessages ->targetId:".concat(t,",conversationType:").concat(e)),this._context.clearMessages(e,t,this.channelId).then((function(s){s===a.SUCCESS?(o._isCPPMode||ee.remove(e,t,o.channelId),re(n.onSuccess,!0)):($.warn("clearMessages ->code:".concat(s,",targetId:").concat(t)),ie(n.onError,s))}))},e.prototype.searchConversationByContent=function(e,t,n,o){$.info("searchConversationByContent ->keyword:".concat(e)),this._context.searchConversationByContent(e,o,this.channelId,n).then((function(n){var o=n.code,s=n.data,c=[];s=s||[],o===a.SUCCESS?(s.forEach((function(e){c.push(ae(e))})),re(t.onSuccess,c)):($.warn("searchConversationByContent ->code:".concat(o,",keyword:").concat(e)),ie(t.onError,o))}))},e.prototype.searchConversationByContentWithAllChannel=function(e,t,n,o){void 0===n&&(n=[]),s.info("searchConversationByContentWithAllChannel ->keyword:".concat(e)),this._context.searchConversationByContentWithAllChannel(e,n,o).then((function(n){var o=n.code,c=n.data,r=[];c=c||[],o===a.SUCCESS?(c.forEach((function(e){r.push(ae(e))})),re(t.onSuccess,r)):(s.warn("searchConversationByContentWithAllChannel ->code:".concat(o,",keyword:").concat(e)),ie(t.onError,o))}))},e.prototype.searchMessageByContent=function(e,t,n,o,s,c,r){$.info("searchMessageByContent ->targetId:".concat(t,",conversationType:").concat(e,",keyword:").concat(n)),this._context.searchMessageByContent(e,t,n,o,s,c,this.channelId).then((function(e){var n=e.code,o=e.data,s=[];if(n===a.SUCCESS){var c=o=o||{},i=c.messages,d=c.count;i.forEach((function(e){s.push(se(e))})),re(r.onSuccess,s,d)}else $.warn("searchMessageByContent ->code:".concat(n,",targetId:").concat(t)),ie(r.onError,n)}))},e.prototype.searchMessageByContentWithAllChannel=function(e,t,n,o,c,r){s.info("searchMessageByContentWithAllChannel ->targetId: ".concat(t," ,conversationType: ").concat(e," ,keyword: ").concat(n,", timestamp: ").concat(o,", count: ").concat(c)),this._context.searchMessageByContentWithAllChannel(e,t,n,o,c).then((function(e){var n=e.code,o=e.data,c=[];if(n===a.SUCCESS){var i=o=o||{},d=i.messages,u=i.count;d.forEach((function(e){c.push(se(e))})),re(r.onSuccess,c,u)}else s.warn("searchMessageByContentWithAllChannel ->code:".concat(n,",targetId:").concat(t)),ie(r.onError,n)}))},e.prototype.searchMessageByContentInTimeRangeWithAllChannel=function(e,t,n,o,c,r,i,d){s.info("searchMessageByContentInTimeRangeWithAllChannel ->targetId: ".concat(t," ,conversationType: ").concat(e," ,keyword: ").concat(n,", startTime: ").concat(o,", endTime: ").concat(c,", offset: ").concat(r,", limit: ").concat(i)),this._context.searchMessageByContentInTimeRangeWithAllChannel(e,t,n,o,c,r,i).then((function(e){var n=e.code,o=e.data,c=[];n===a.SUCCESS?((o=o||{}).messages.forEach((function(e){c.push(se(e))})),re(d.onSuccess,c)):(s.warn("searchMessageByContentInTimeRangeWithAllChannel ->code:".concat(n,",targetId:").concat(t)),ie(d.onError,n))}))},e.prototype.getUnreadMentionedMessages=function(e,t){return $.info("getUnreadMentionedMessages ->targetId:".concat(t,",conversationType:").concat(e)),this._context.getUnreadMentionedMessages(e,t,this.channelId).map((function(e){return se(e)}))},e.prototype.clearUnreadCountByTimestamp=function(e,t,n,o){$.info("clearUnreadCountByTimestamp ->targetId:".concat(t,",conversationType:").concat(e)),this._context.clearUnreadCountByTimestamp(e,t,n,this.channelId).then((function(e){e===a.SUCCESS?re(o.onSuccess,!0):($.warn("clearUnreadCountByTimestamp ->code:".concat(e,",targetId:").concat(t)),ie(o.onError,e))}))},e.prototype.getConversationNotificationStatus=function(e,t,n){$.info("getConversationNotificationStatus ->targetId:".concat(t,",conversationType:").concat(e)),this._context.getConversationNotificationStatus(e,t,this.channelId).then((function(e){var o=e.code,s=e.data;o===a.SUCCESS?re(n.onSuccess,s):($.warn("getConversationNotificationStatus ->code:".concat(o,",targetId:").concat(t)),ie(n.onError,o))}))},e.prototype.getGroupMessageDeliverList=function(e,t,n){s.info("getGroupMessageDeliverList ->targetId:".concat(e,"',messageUId:").concat(t)),this._context.getGroupMessageDeliverList(e,t,this.channelId).then((function(e){var o=e.code,c=e.data;o===a.SUCCESS?re(n.onSuccess,c):(s.warn("getGroupMessageDeliverList ->code:".concat(o,",messageUId:").concat(t)),ie(n.onError,o))}))},e.prototype.getPrivateMessageDeliverTime=function(e,t){s.info("getPrivateMessageDeliverTime -> messageUId:".concat(e)),this._context.getPrivateMessageDeliverTime(e,this.channelId).then((function(n){var o=n.code,c=n.data;o===a.SUCCESS?re(t.onSuccess,c):(s.warn("getPrivateMessageDeliverTime ->code:".concat(o,",messageUId:").concat(e)),ie(t.onError,o))}))},e}(),he=function(e){return{targetId:e.targetId,channelId:e.channelId,conversationType:e.type}},pe=function(){function e(e,t){this._context=e,this._options=t,this._channelClient={},this._isCPPMode=l(),this._defaultChannelClient=new fe(e,"",this._isCPPMode,t.readReceiptTimeout)}return e.prototype.assertCPPMode=function(e,t,n){if(!this._isCPPMode)return null==n||n.onError(a.NOT_SUPPORT),void $.error("'".concat(t,"' is unusable!"));e()},e.prototype.install=function(e,t){return this._context.install(e,t)},e.prototype.getChannel=function(e){if($.info("getChannel ->channelId:".concat(e)),!this._isCPPMode)return $.error("getChannel method is only available in protocol stack mode"),null;if(C("channelId",e,f.STRING,!0),e.length>20)return $.error("The channelId cannot exceed 20 characters"),null;if(e in this._channelClient)return this._channelClient[e];if(Object.keys(this._channelClient).length>1e3)return $.error("Only 1000 channels can be obtained"),null;var t=new fe(this._context,e,this._isCPPMode,this._options.readReceiptTimeout);return this._channelClient[e]=t,t},e.prototype.deleteChannels=function(e){var t=this;C("channelIds",e,f.ARRAY,!0),$.info("deleteChannels ->channelIds:".concat(e)),this.assertCPPMode((function(){e.forEach((function(e){delete t._channelClient[e]}))}),"deleteChannels")},e.prototype.getNavi=function(){return this._context.getInfoFromCache()||{}},e.prototype.getSDKInfo=function(){return{version:this._context.apiVersion}},e.prototype.getAppInfo=function(){return{appKey:this._context.appkey}},e.prototype.getCurrentUserId=function(){return this._context.getCurrentUserId()},e.prototype.disconnect=function(){return E(this,void 0,void 0,(function(){return U(this,(function(e){switch(e.label){case 0:return s.info(c.A_DISCONNECT_O,{}),[4,this._context.disconnect()];case 1:return e.sent(),[2]}}))}))},e.prototype.logout=function(){return this.disconnect()},e.prototype.clearCache=function(){},e.prototype.getDeviceId=function(){return this._context.getDeviceId()},e.prototype.getConversationList=function(e,t,n){this._defaultChannelClient.getConversationList(e,t,n)},e.prototype.getConversationListWithAllChannel=function(e){this._defaultChannelClient.getConversationListWithAllChannel(e)},e.prototype.getConversationListWithAllChannelByPage=function(e,t,n){void 0===n&&(n=30),this._defaultChannelClient.getConversationListWithAllChannelByPage(e,t,n)},e.prototype.getConversation=function(e,t,n){return this._defaultChannelClient.getConversation(e,t,n)},e.prototype.removeConversation=function(e,t,n){return this._defaultChannelClient.removeConversation(e,t,n)},e.prototype.saveTextMessageDraft=function(e,t,n){return this._defaultChannelClient.saveTextMessageDraft(e,t,n)},e.prototype.getTextMessageDraft=function(e,t){return this._defaultChannelClient.getTextMessageDraft(e,t)},e.prototype.clearTextMessageDraft=function(e,t){return this._defaultChannelClient.clearTextMessageDraft(e,t)},e.prototype.getTotalUnreadCount=function(e,t,n){return this._defaultChannelClient.getTotalUnreadCount(e,t,n)},e.prototype.getUnreadCount=function(e,t,n){return this._defaultChannelClient.getUnreadCount(e,t,n)},e.prototype.getConversationUnreadCount=function(e,t){$.error("Method is deprecated")},e.prototype.clearConversations=function(e,t){return this._defaultChannelClient.clearConversations(e,t)},e.prototype.clearUnreadCount=function(e,t,n){this._defaultChannelClient.clearUnreadCount(e,t,n)},e.prototype.clearAllUnreadCount=function(e){this._defaultChannelClient.clearAllUnreadCount(e)},e.prototype.setConversationStatus=function(e,t,n,o){return this._defaultChannelClient.setConversationStatus(e,t,n,o)},e.prototype.sendMessage=function(e,t,n,o,a,s,c,r,i){return this._defaultChannelClient.sendMessage(e,t,n,o,a,s,c,i)},e.prototype.sendRecallMessage=function(e,t,n){return this._defaultChannelClient.sendRecallMessage(e,t,n)},e.prototype.sendTypingStatusMessage=function(e,t,n,o){return this._defaultChannelClient.sendTypingStatusMessage(e,t,n,o)},e.prototype.sendReceiptResponse=function(e,t,n){return this._defaultChannelClient.sendReceiptResponse(e,t,n)},e.prototype.sendReadReceiptMessage=function(e,t,n){return this._defaultChannelClient.sendReadReceiptMessage(e,t,n)},e.prototype.getMessageReader=function(e,t,n){this._defaultChannelClient.getMessageReader(e,t,n)},e.prototype.updateMessageExpansion=function(e,t,n){this._defaultChannelClient.updateMessageExpansion(e,t,n)},e.prototype.removeMessageExpansionForKey=function(e,t,n){this._defaultChannelClient.removeMessageExpansionForKey(e,t,n)},e.prototype.getHistoryMessages=function(e,t,n,o,a,s,c){return this._defaultChannelClient.getHistoryMessages(e,t,n,o,a,s,c)},e.prototype.joinChatRoom=function(e,t,n){C("chatRoomId",e,f.STRING,!0),C("count",t,f.NUMBER,!0),C("callback",n,f.CALLBACK),$.info("joinChatRoom ->chatRoomId:".concat(e));var o=s.ID();s.info(c.A_JOIN_CHATROOM_T,{chatroomId:e,count:t,joinExist:!1},{traceId:o}),this._context.joinChatroom(e,t,o).then((function(t){(t===a.SUCCESS?s.info:s.warn)(c.A_JOIN_CHATROOM_R,{code:t,timestamp:(new Date).getTime()},{traceId:o}),t===a.SUCCESS?re(n.onSuccess):($.warn("joinChatRoom ->code:".concat(t,",chatRoomId:").concat(e)),ie(n.onError,t))}))},e.prototype.quitChatRoom=function(e,t){C("chatRoomId",e,f.STRING,!0),C("callback",t,f.CALLBACK),$.info("quitChatRoom ->chatRoomId:".concat(e));var n=s.ID();s.info(c.A_QUIT_CHATROOM_T,{chatroomId:e},{traceId:n}),this._context.quitChatroom(e).then((function(o){(o===a.SUCCESS?s.info:s.warn)(c.A_QUIT_CHATROOM_R,{code:o},{traceId:n}),o===a.SUCCESS?re(t.onSuccess):($.warn("quitChatRoom ->code:".concat(o,",chatRoomId:").concat(e)),ie(t.onError,o))}))},e.prototype.getChatRoomInfo=function(e,t,n,o){C("chatRoomId",e,f.STRING,!0),C("count",t,f.NUMBER,!0),C("order",n,f.NUMBER,!0),C("callback",o,f.CALLBACK),$.info("getChatRoomInfo ->chatRoomId:".concat(e)),this._context.getChatroomInfo(e,t,n).then((function(t){var n=t.code,s=t.data;n===a.SUCCESS?re(o.onSuccess,{userInfos:(null==s?void 0:s.userInfos)||[],userTotalNums:(null==s?void 0:s.userCount)||0}):($.warn("getChatRoomInfo ->code:".concat(n,",chatRoomId:").concat(e)),ie(o.onError,n))}))},e.prototype.setChatroomEntry=function(e,t,n){C("chatRoomId",e,f.STRING,!0),C("chatroomEntry",t,f.OBJECT,!0),C("callback",n,f.CALLBACK),$.info("setChatroomEntry ->chatRoomId:".concat(e)),this._context.setChatroomEntry(e,t).then((function(t){t===a.SUCCESS?re(n.onSuccess):($.warn("setChatroomEntry ->code:".concat(t,",chatRoomId:").concat(e)),ie(n.onError,t))}))},e.prototype.setChatRoomEntries=function(e,t,n){if(C("chatRoomId",e,f.STRING,!0),function(e){e.entries.forEach((function(e){C("entry.key",e.key,f.STRING,!0),C("entry.value",e.value,f.STRING,!0)})),C("options.isAutoDelete",e.isAutoDelete,f.BOOLEAN)}(t),C("callback",n,f.CALLBACK),t.entries.length>10)ie(n.onError,a.CHATROOM_KV_STORE_OUT_LIMIT);else{var o="id:".concat(e);$.info("set chatroom entry->".concat(o)),this._context.setChatroomEntries(e,t).then((function(e){var t=e.code,s=e.data;t===a.SUCCESS?re(n.onSuccess):($.warn("set chatroom entry fail ->code+:".concat(t,",").concat(o)),ie(n.onError,t,s))}))}},e.prototype.forceSetChatroomEntry=function(e,t,n){C("chatRoomId",e,f.STRING,!0),C("chatroomEntry",t,f.OBJECT,!0),C("callback",n,f.CALLBACK),$.info("forceSetChatroomEntry ->chatRoomId:".concat(e)),this._context.forceSetChatroomEntry(e,t).then((function(t){t===a.SUCCESS?re(n.onSuccess):($.warn("forceSetChatroomEntry ->code:".concat(t,",chatRoomId:").concat(e)),ie(n.onError,t))}))},e.prototype.removeChatroomEntry=function(e,t,n){C("chatRoomId",e,f.STRING,!0),C("chatroomEntry",t,f.OBJECT,!0),C("callback",n,f.CALLBACK),$.info("removeChatroomEntry ->chatRoomId:".concat(e)),this._context.removeChatroomEntry(e,t).then((function(t){t===a.SUCCESS?re(n.onSuccess):($.warn("removeChatroomEntry ->code:".concat(t,",chatRoomId:").concat(e)),ie(n.onError,t))}))},e.prototype.removeChatRoomEntries=function(e,t,n){C("chatRoomId",e,f.STRING,!0),function(e){e.entries.forEach((function(e){C("key",e,f.STRING,!0)}))}(t);var o="id:".concat(e);$.debug("remove chatroom entry->".concat(o));var s=T({},t);s.entries=t.entries.map((function(e){return{key:e}})),this._context.removeChatroomEntries(e,s).then((function(e){var t=e.code,s=e.data;t===a.SUCCESS?re(n.onSuccess):($.warn("remove chatroom entry fail ->code+:".concat(t,",").concat(o)),ie(n.onError,t,s))}))},e.prototype.forceRemoveChatroomEntry=function(e,t,n){C("chatRoomId",e,f.STRING,!0),C("chatroomEntry",t,f.OBJECT,!0),C("callback",n,f.CALLBACK),$.info("forceRemoveChatroomEntry ->chatRoomId:".concat(e)),this._context.forceRemoveChatroomEntry(e,t).then((function(t){t===a.SUCCESS?re(n.onSuccess):($.warn("forceRemoveChatroomEntry ->code:".concat(t,",chatRoomId:").concat(e)),ie(n.onError,t))}))},e.prototype.getChatroomEntry=function(e,t,n){C("chatRoomId",e,f.STRING,!0),C("key",t,f.STRING,!0),C("callback",n,f.CALLBACK),$.info("getChatroomEntry ->chatRoomId:".concat(e,",key:").concat(t)),this._context.getChatroomEntry(e,t).then((function(t){var o=t.code,s=t.data;o===a.SUCCESS?re(n.onSuccess,s||""):($.warn("getChatroomEntry ->code:".concat(o,",chatRoomId:").concat(e)),ie(n.onError,o))}))},e.prototype.getAllChatroomEntries=function(e,t){C("chatRoomId",e,f.STRING,!0),C("callback",t,f.CALLBACK),$.info("getAllChatroomEntries ->chatRoomId:".concat(e)),this._context.getAllChatroomEntries(e).then((function(n){var o=n.code,s=n.data;o===a.SUCCESS?re(t.onSuccess,s):($.warn("getAllChatroomEntries ->code:".concat(o,",chatRoomId:").concat(e)),ie(t.onError,o))}))},e.prototype.getChatRoomHistoryMessages=function(e,t,n,o,s){void 0===s&&(s=0),C("chatRoomId",e,f.STRING,!0),C("count",t,f.NUMBER,!0),C("order",n,f.NUMBER,!0),C("callback",o,f.CALLBACK),C("timestamp",s,f.NUMBER),$.info("getChatRoomHistoryMessages ->chatRoomId:".concat(e)),this._context.getChatRoomHistoryMessages(e,t,n,s).then((function(t){var n=t.code,s=t.data;if(n===a.SUCCESS)if(s){var c=s.list,r=s.hasMore,i=c.map((function(e){return se(e)}));re(o.onSuccess,i,r)}else re(o.onSuccess,[],!1);else $.warn("getChatRoomHistoryMessages ->code:".concat(n,",chatRoomId:").concat(e)),ie(o.onError,n)}))},e.prototype.setDeviceInfo=function(e){},e.prototype.getCurrentConnectionStatus=function(){return this._context.getConnectionStatus()},e.prototype.deleteRemoteMessages=function(e,t,n,o){return this._defaultChannelClient.deleteRemoteMessages(e,t,n,o)},e.prototype.clearRemoteHistoryMessages=function(e,t){return this._defaultChannelClient.clearRemoteHistoryMessages(e,t)},e.prototype.getFileToken=function(e,t,n,o,a){C("fileType",e,f.NUMBER,!0),C("fileName",n,f.STRING),C("callback",t,f.CALLBACK),$.info("getFileToken ->fileType:".concat(e,",fileName:").concat(n,",queryString:").concat(a)),this._context.getFileToken(e,n,o,a).then(t.onSuccess).catch(t.onError)},e.prototype.getFileUrl=function(e,t,n,o,a,s){C("fileType",e,f.NUMBER,!0),C("fileName",t,f.STRING,!0),C("saveName",n,f.STRING),C("callback",o,f.CALLBACK),C("serverType",s,f.NUMBER),C("uploadRes",a,f.OBJECT),$.info("getFileUrl ->fileType:".concat(e,",fileName:").concat(t)),this._context.getFileUrl(e,t,n,a,s).then(o.onSuccess).catch(o.onError)},e.prototype.createTag=function(e,t){C("tag.tagId",e.tagId,f.STRING,!0),C("tag.tagId",e.tagId,(function(e){return e.length<=10})),C("tag.tagName",e.tagName,(function(e){return e.length<=15})),C("tag.tagName",e.tagName,f.STRING,!0),C("callback",t,f.CALLBACK),$.info("createTag ->tagId:".concat(e.tagId,",tagName:").concat(e.tagName)),this._context.createTag(e).then((function(n){var o=n.code;o===a.SUCCESS?t.onSuccess():($.warn("createTag ->code:".concat(o,",tagId:").concat(e.tagId)),t.onError(o))})).catch((function(n){$.warn("createTag ->code:".concat(n,",tagId:").concat(e.tagId)),t.onError(n)}))},e.prototype.removeTag=function(e,t){C("tagId",e,f.STRING,!0),C("callback",t,f.CALLBACK),$.info("removeTag ->tagId:".concat(e)),this._context.removeTag(e).then((function(n){var o=n.code;o===a.SUCCESS?t.onSuccess():($.warn("removeTag ->code:".concat(o,",tagId:").concat(e)),t.onError(o))})).catch((function(n){$.warn("removeTag ->code:".concat(n,",tagId:").concat(e)),t.onError(n)}))},e.prototype.updateTag=function(e,t){C("tag.tagId",e.tagId,f.STRING,!0),C("tag.tagName",e.tagName,f.STRING,!0),C("tag.tagName",e.tagName,(function(e){return e.length<=15})),C("callback",t,f.CALLBACK),$.info("updateTag ->tagId:".concat(e.tagId,",tagName:").concat(e.tagName)),this._context.updateTag(e).then((function(n){var o=n.code;o===a.SUCCESS?t.onSuccess():($.warn("updateTag ->code:".concat(o,",tagId:").concat(e.tagId)),t.onError(o))})).catch((function(n){$.warn("updateTag ->reason:".concat(n,",tagId:").concat(e.tagId)),t.onError(n)}))},e.prototype.getTagList=function(e){C("callback",e,f.CALLBACK),this._context.getTagList().then((function(t){var n=t.code,o=t.data;n===a.SUCCESS?e.onSuccess(o||[]):($.warn("getTagList ->code:".concat(n)),e.onError(n))})).catch((function(t){$.warn("getTagList ->reason:".concat(t)),e.onError(t)}))},e.prototype.getTagsForConversation=function(e,t){C("conversationType",e.type,f.NUMBER),C("targetId",e.targetId,f.STRING),C("channelId",e.channelId,f.ONLY_STRING),C("callback",t,f.CALLBACK),$.info("getTagsForConversation ->targetId:".concat(e.targetId,",conversationType:").concat(e.type)),this._context.getTagsForConversation(he(e)).then((function(e){var n=e.code,o=e.data;n===a.SUCCESS?t.onSuccess(o||[]):($.warn("getTagsForConversation ->code:".concat(n)),t.onError(n))})).catch((function(e){$.warn("getTagsForConversation ->reason:".concat(e)),t.onError(e)}))},e.prototype.addTagForConversations=function(e,t,n){C("tagId",e,f.STRING,!0),C("conversations",t,f.ARRAY,!0),C("callback",n,f.CALLBACK),t.forEach((function(e){C("conversation.type",e.type,f.NUMBER,!0),C("conversation.targetId",e.targetId,f.STRING,!0),C("conversation.channelId",e.channelId,f.ONLY_STRING)})),$.info("addTagForConversations ->tagId:".concat(e)),this._context.addTagForConversations(e,t.map((function(e){return he(e)}))).then((function(t){var o=t.code;t.data,o===a.SUCCESS?n.onSuccess():($.warn("addTagForConversations ->code:".concat(o,",tagId:").concat(e)),n.onError(o))})).catch((function(t){$.warn("addTagForConversations ->reason:".concat(t,",tagId:").concat(e)),n.onError(t)}))},e.prototype.removeTagForConversations=function(e,t,n){C("tagId",e,f.STRING,!0),C("conversations",t,f.ARRAY,!0),C("callback",n,f.CALLBACK),t.forEach((function(e){C("conversation.type",e.type,f.NUMBER,!0),C("conversation.targetId",e.targetId,f.STRING,!0),C("conversation.channelId",e.channelId,f.ONLY_STRING)})),$.info("removeTagForConversations ->tagId:".concat(e)),this._context.removeTagForConversations(e,t.map((function(e){return he(e)}))).then((function(t){var o=t.code;t.data,o===a.SUCCESS?n.onSuccess():($.warn("removeTagForConversations ->code:".concat(o,",tagId:").concat(e)),n.onError(o))})).catch((function(t){$.warn("removeTagForConversations ->reason:".concat(t,",tagId:").concat(e)),n.onError(t)}))},e.prototype.removeTagsForConversation=function(e,t,n){C("conversation.type",e.type,f.NUMBER,!0),C("conversation.targetId",e.targetId,f.STRING,!0),C("conversation.channelId",e.channelId,f.ONLY_STRING),C("tagIds",t,f.ARRAY,!0),C("callback",n,f.CALLBACK),t.forEach((function(e){C("tagId",e,f.STRING,!0)})),$.info("removeTagsForConversation ->tagIds:".concat(t,",targetId:").concat(e.targetId,",type:").concat(e.type)),this._context.removeTagsForConversation(he(e),t).then((function(e){var o=e.code;e.data,o===a.SUCCESS?n.onSuccess():($.warn("removeTagsForConversation ->code:".concat(o,",tagIds:").concat(t)),n.onError(o))})).catch((function(e){$.warn("removeTagsForConversation ->reason:".concat(e,",tagIds:").concat(t)),n.onError(e)}))},e.prototype.getConversationListByTag=function(e,t,n,o){C("tagId",e,f.STRING,!0),C("count",t,f.NUMBER,!0),C("startTime",n,f.NUMBER,!0),C("callback",o,f.CALLBACK,!0),$.info("getConversationListByTag ->tagId:".concat(e)),this._context.getConversationListByTag(e,n,t).then((function(t){var n=t.code,s=t.data,c=[];n===a.SUCCESS?((s=s||[]).forEach((function(e){c.push(function(e){var t=e.channelId,n=e.conversationType,o=e.targetId,a=e.unreadMessageCount,s=e.latestMessage,c=e.isTop,r=e.notificationStatus,i=e.isTopInTag,d=s?se(s):null,u=d||{};return u.messageType,u.sentTime,u.receivedStatus,u.messageId,{channelId:t||"",conversationType:n,targetId:o,unreadMessageCount:a,latestMessage:d,isTopInTag:i,latestMessageId:null==d?void 0:d.messageId,objectName:null==d?void 0:d.messageType,sentTime:null==d?void 0:d.sentTime,isTop:c,notificationStatus:r,receivedStatus:null==d?void 0:d.receivedStatus}}(e))})),o.onSuccess(c)):($.warn("getConversationListByTag ->code:".concat(n,",tagId:").concat(e)),o.onError(n))})).catch((function(t){$.warn("getConversationListByTag ->reason:".concat(t,",tagId:").concat(e)),o.onError(t)}))},e.prototype.getUnreadCountByTag=function(e,t,n){C("tagId",e,f.STRING,!0),C("containMuted",t,f.BOOLEAN,!0),C("callback",n,f.CALLBACK),$.info("getUnreadCountByTag ->tagId:".concat(e)),this._context.getUnreadCountByTag(e,t).then((function(t){var o=t.code,s=t.data;$.info(o,s),o===a.SUCCESS?n.onSuccess(s||0):($.warn("getUnreadCountByTag ->code:".concat(o,",tagId:").concat(e)),n.onError(o))})).catch((function(t){$.warn("getUnreadCountByTag ->reason:".concat(t,",tagId:").concat(e)),n.onError(t)}))},e.prototype.setConversationStatusInTag=function(e,t,n,o){C("tagId",e,f.STRING,!0),C("conversation.targetId",t.targetId,f.STRING,!0),C("conversation.type",t.type,f.NUMBER,!0),C("conversation.channelId",t.channelId,f.ONLY_STRING),C("status.isTop",null==n?void 0:n.isTop,f.BOOLEAN,!0),C("callback",o,f.CALLBACK),$.info("setConversationStatusInTag ->tagId:".concat(e,",targetId:").concat(t.targetId,",type").concat(t.type)),this._context.setConversationStatusInTag(e,he(t),n).then((function(t){var n=t.code;t.data,n===a.SUCCESS?o.onSuccess():($.warn("setConversationStatusInTag ->code:".concat(n,",tagId:").concat(e)),o.onError(n))})).catch((function(t){$.warn("setConversationStatusInTag ->reason:".concat(t,",tagId:").concat(e)),o.onError(t)}))},e.prototype.callExtra=function(e,t){for(var n,o=[],s=2;s<arguments.length;s++)o[s-2]=arguments[s];$.info("callExtra ->method:".concat(e)),(n=this._context).callExtra.apply(n,N([e],o,!1)).then((function(n){var o=n.code,s=n.data;if(o!==a.SUCCESS)$.warn("callExtra ->code:".concat(o)),t.onError&&ie(t.onError,o);else{if("getConversationsByPage"===e&&s.forEach((function(e){e.latestMessage=e.latestMessage?se(e.latestMessage):null})),"getHistoryMessagesByObjectNames"===e){var c=s,r=c.list,i=c.hasMore,d=r.map((function(e){return se(e)}));return void re(t.onSuccess,d,i)}t.onSuccess&&re(t.onSuccess,s)}}))},e.prototype.hasRemoteUnreadMessages=function(e,t){C("callback",t,f.CALLBACK),$.info("hasRemoteUnreadMessages ->token:".concat(e)),this.assertCPPMode((function(){re(t.onSuccess,!1)}),"hasRemoteUnreadMessages",t)},e.prototype.setUserStatusListener=function(e,t){var n=this;$.info("setUserStatusListener ->userIds:".concat(e.userIds)),this.assertCPPMode((function(){n._context.setUserStatusListener(e,t)}),"setUserStatusListener")},e.prototype.setUserStatus=function(e,t){var n=this;C("status",e,f.NUMBER),C("callback",t,f.CALLBACK),$.info("setUserStatus ->status:".concat(e)),this.assertCPPMode((function(){n._context.setUserStatus(e).then((function(e){e===a.SUCCESS?re(t.onSuccess,!0):($.warn("setUserStatus ->code:".concat(e)),ie(t.onError,e))}))}),"setUserStatus",t)},e.prototype.getUserStatus=function(e,t){var n=this;C("userId",e,f.STRING),C("callback",t,f.CALLBACK),$.info("getUserStatus ->userId:".concat(e)),this.assertCPPMode((function(){n._context.getUserStatus(e).then((function(n){var o=n.code,s=n.data;o===a.SUCCESS?re(t.onSuccess,s):($.warn("getUserStatus ->code:".concat(o,",useerId:").concat(e)),ie(t.onError,o))}))}),"getUserStatus",t)},e.prototype.addToBlacklist=function(e,t){var n=this;C("userId",e,f.STRING),C("callback",t,f.CALLBACK),$.info("addToBlacklist ->userId:".concat(e)),this.assertCPPMode((function(){n._context.addToBlacklist(e).then((function(n){n===a.SUCCESS?re(t.onSuccess):($.warn("addToBlacklist ->code:".concat(n,",useerId:").concat(e)),ie(t.onError,n))}))}),"addToBlacklist",t)},e.prototype.removeFromBlacklist=function(e,t){var n=this;C("userId",e,f.STRING),C("callback",t,f.CALLBACK),$.info("removeFromBlacklist ->userId:".concat(e)),this.assertCPPMode((function(){n._context.removeFromBlacklist(e).then((function(n){n===a.SUCCESS?re(t.onSuccess):($.warn("removeFromBlacklist ->code:".concat(n,",useerId:").concat(e)),ie(t.onError,n))}))}),"removeFromBlacklist",t)},e.prototype.getBlacklist=function(e){var t=this;C("callback",e,f.CALLBACK),this.assertCPPMode((function(){t._context.getBlacklist().then((function(t){var n=t.code,o=t.data;n===a.SUCCESS?re(e.onSuccess,o):($.warn("getBlacklist ->code:".concat(n)),ie(e.onError,n))}))}),"getBlacklist",e)},e.prototype.getBlacklistStatus=function(e,t){var n=this;C("userId",e,f.STRING),C("callback",t,f.CALLBACK),$.info("getBlacklistStatus ->userId:".concat(e)),this.assertCPPMode((function(){n._context.getBlacklistStatus(e).then((function(n){var o=n.code,s=n.data;o===a.SUCCESS?re(t.onSuccess,s):($.warn("getBlacklistStatus ->code:".concat(o,",userId:").concat(e)),ie(t.onError,o))}))}),"getBlacklistStatus",t)},e.prototype.insertMessage=function(e,t,n,o,a){var s=this;void 0===a&&(a={}),C("conversationType",e,f.NUMBER,!0),C("targetId",t,f.STRING,!0),C("content.senderUserId",n.senderUserId,f.STRING,!0),C("callback",o,f.CALLBACK),$.info("insertMessage ->targetId:".concat(t,",conversationType:").concat(e,",senderUserId:").concat(n.senderUserId)),this.assertCPPMode((function(){s._defaultChannelClient.insertMessage(e,t,n,o,a)}),"insertMessage",o)},e.prototype.getRemoteHistoryMessages=function(e,t,n,o,a,s){var c=this;void 0===s&&(s={}),C("conversationType",e,f.NUMBER,!0),C("targetId",t,f.STRING,!0),C("timestamp",n,f.NUMBER,!0),C("count",o,f.NUMBER,!0),C("callback",a,f.CALLBACK),C("options.order",s.order,f.NUMBER),this.assertCPPMode((function(){c._defaultChannelClient.getRemoteHistoryMessages(e,t,n,o,a,s)}),"getRemoteHistoryMessages",a)},e.prototype.deleteLocalMessages=function(e,t,n,o){var s=this;C("messageIds",n,f.ARRAY,!0),C("callback",o,f.CALLBACK),$.info("deleteLocalMessages ->messageIds:".concat(n)),this.assertCPPMode((function(){s._context.deleteMessages(n).then((function(e){e===a.SUCCESS?re(o.onSuccess,!0):($.warn("deleteLocalMessages ->code:".concat(e,",messageIds:").concat(n)),ie(o.onError,e))}))}),"deleteLocalMessages",o)},e.prototype.deleteLocalMessagesByTimestamp=function(e,t,n,o,a){var s=this;C("conversationType",e,f.NUMBER,!0),C("targetId",t,f.STRING,!0),C("timestamp",n,f.NUMBER,!0),C("cleanSpace",o,f.BOOLEAN),C("callback",a,f.CALLBACK),this.assertCPPMode((function(){s._defaultChannelClient.deleteLocalMessagesByTimestamp(e,t,n,o,a)}),"deleteLocalMessagesByTimestamp",a)},e.prototype.clearMessages=function(e,t,n){var o=this;C("conversationType",e,f.NUMBER,!0),C("targetId",t,f.STRING,!0),C("callback",n,f.CALLBACK),this.assertCPPMode((function(){o._defaultChannelClient.clearMessages(e,t,n)}),"clearMessages",n)},e.prototype.getMessage=function(e,t){var n=this;C("callback",t,f.CALLBACK),this.assertCPPMode((function(){n._context.getMessage(e).then((function(n){var o=n.code,s=n.data;o===a.SUCCESS?re(t.onSuccess,se(s)):($.warn("getMessage ->code:".concat(o,",messageId:").concat(e)),ie(t.onError,o))}))}),"getMessage",t)},e.prototype.setMessageSentStatus=function(e,t,n){var o=this;C("messageId",e,f.NUMBER,!0),C("sentStatus",t,f.NUMBER,!0),$.info("setMessageSentStatus ->messageId:".concat(e,",sentStatus:").concat(t)),this.assertCPPMode((function(){o._context.setMessageSentStatus(e,t).then((function(t){t===a.SUCCESS?re(n.onSuccess,!0):($.warn("setMessageSentStatus ->code:".concat(t,",messageId:").concat(e)),ie(n.onError,t))}))}),"setMessageSentStatus",n)},e.prototype.setMessageReceivedStatus=function(e,t,n){var o=this;C("messageId",e,f.NUMBER,!0),C("receivedStatus",t,f.NUMBER,!0),$.info("setMessageReceivedStatus ->messageId:".concat(e,",receivedStatus:").concat(t)),this.assertCPPMode((function(){o._context.setMessageReceivedStatus(e,t).then((function(t){t===a.SUCCESS?re(n.onSuccess,!0):($.warn("setMessageReceivedStatus ->code:".concat(t,",messageId:").concat(e)),ie(n.onError,t))}))}),"setMessageReceivedStatus",n)},e.prototype.setMessageContent=function(e,t,n,o){var c=this;C("messageId",e,f.NUMBER,!0),C("objectName",n,f.ONLY_STRING,!0),$.info("setMessageContent ->messageId:".concat(e,",objectName:").concat(n)),this.assertCPPMode((function(){c._context.setMessageContent(e,t,n).then((function(t){t===a.SUCCESS?re(o.onSuccess,!0):(s.warn("setMessageContent ->code:".concat(t,",messageId:").concat(e)),ie(o.onError,t))}))}),"setMessageContent",o)},e.prototype.setMessageSearchField=function(e,t,n){var o=this;C("messageId",e,f.NUMBER,!0),C("searchFiles",n,f.STRING,!0),$.info("setMessageSearchField ->messageId:".concat(e,",searchFiles:").concat(n)),this.assertCPPMode((function(){o._context.setMessageSearchField(e,t,n)}),"setMessageSearchField")},e.prototype.searchConversationByContent=function(e,t,n,o){var a=this;C("keyword",e,f.STRING,!0),C("callback",t,f.CALLBACK),C("conversationTypes",n,f.ARRAY),C("customMessageType",o,f.ARRAY),this.assertCPPMode((function(){a._defaultChannelClient.searchConversationByContent(e,t,n,o)}),"searchConversationByContent",t)},e.prototype.searchConversationByContentWithAllChannel=function(e,t,n,o){var a=this;void 0===n&&(n=[]),C("keyword",e,f.STRING,!0),C("callback",t,f.CALLBACK),C("conversationTypes",o,f.ARRAY),C("customMessageType",n,f.ARRAY),this.assertCPPMode((function(){a._defaultChannelClient.searchConversationByContentWithAllChannel(e,t,n,o)}),"searchConversationByContentWithAllChannel",t)},e.prototype.searchMessageByContent=function(e,t,n,o,a,s,c){var r=this;C("conversationType",e,f.NUMBER,!0),C("targetId",t,f.STRING,!0),C("keyword",n,f.STRING,!0),C("timestamp",o,f.NUMBER),C("count",a,f.NUMBER),C("total",s,f.NUMBER),C("callback",c,f.CALLBACK),this.assertCPPMode((function(){r._defaultChannelClient.searchMessageByContent(e,t,n,o,a,s,c)}),"searchMessageByContent",c)},e.prototype.searchMessageByContentWithAllChannel=function(e,t,n,o,a,s){var c=this;C("conversationType",e,f.NUMBER,!0),C("targetId",t,f.STRING,!0),C("keyword",n,f.STRING,!0),C("timestamp",o,f.NUMBER),C("count",a,f.NUMBER),C("callback",s,f.CALLBACK),this.assertCPPMode((function(){c._defaultChannelClient.searchMessageByContentWithAllChannel(e,t,n,o,a,s)}),"searchMessageByContentWithAllChannel",s)},e.prototype.searchMessageByContentInTimeRangeWithAllChannel=function(e,t,n,o,a,s,c,r){var i=this;C("conversationType",e,f.NUMBER,!0),C("targetId",t,f.STRING,!0),C("keyword",n,f.STRING,!0),C("startTime",o,f.NUMBER),C("endTime",a,f.NUMBER),C("offset",s,f.NUMBER),C("limit",c,f.NUMBER),C("callback",r,f.CALLBACK),this.assertCPPMode((function(){i._defaultChannelClient.searchMessageByContentInTimeRangeWithAllChannel(e,t,n,o,a,s,c,r)}),"searchMessageByContentInTimeRangeWithAllChannel",r)},e.prototype.getUnreadMentionedMessages=function(e,t){return this._isCPPMode?(C("conversationType",e,f.NUMBER,!0),C("targetId",t,f.STRING,!0),this._defaultChannelClient.getUnreadMentionedMessages(e,t)):($.error("getUnreadMentionedMessages method is not supported in a browser!"),null)},e.prototype.clearUnreadCountByTimestamp=function(e,t,n,o){var a=this;C("conversationType",e,f.NUMBER,!0),C("targetId",t,f.STRING,!0),C("timestamp",n,f.NUMBER,!0),this.assertCPPMode((function(){a._defaultChannelClient.clearUnreadCountByTimestamp(e,t,n,o)}),"clearUnreadCountByTimestamp",o)},e.prototype.getFirstUnreadMessage=function(e,t,n){return this._defaultChannelClient.getFirstUnreadMessage(e,t,n)},e.prototype.getConversationNotificationStatus=function(e,t,n){var o=this;C("conversationType",e,f.NUMBER,!0),C("targetId",t,f.STRING,!0),this.assertCPPMode((function(){o._defaultChannelClient.getConversationNotificationStatus(e,t,n)}),"getConversationNotificationStatus",n)},e.prototype.getServerTime=function(){return this._context.getServerTime()},e.prototype.getGroupMessageDeliverList=function(e,t,n){this._defaultChannelClient.getGroupMessageDeliverList(e,t,n)},e.prototype.getPrivateMessageDeliverTime=function(e,t){this._defaultChannelClient.getPrivateMessageDeliverTime(e,t)},e.prototype.getRTCUserInfoList=function(e,t){$.info("getRTCUserInfoList ->roomId:".concat(e.id)),this._context.getRTCUserInfoList(e.id).then((function(n){var o=n.code,s=n.data;if(o!==a.SUCCESS)$.warn("getRTCUserInfoList ->code:".concat(o,",roomId:").concat(e.id)),t.onError(o);else{var c=null==s?void 0:s.users;t.onSuccess(c)}})).catch((function(n){$.warn("getRTCUserInfoList ->error:".concat(n,",roomId:").concat(e.id)),t.onError(n)}))},e.prototype.getRTCUserList=function(e,t){$.info("getRTCUserList ->roomId:".concat(e.id)),this._context.getRTCUserList(e.id).then((function(n){var o=n.code,s=n.data;o!==a.SUCCESS?($.warn("getRTCUserList ->code:".concat(o,",roomId:").concat(e.id)),t.onError(o)):t.onSuccess(s)})).catch((function(n){$.warn("getRTCUserList ->error:".concat(n,",roomId:").concat(e.id)),t.onError(n)}))},e.prototype.setRTCUserInfo=function(e,t,n){$.info("setRTCUserInfo ->roomId:".concat(e.id,",info:").concat(JSON.stringify(t||{}))),this._context.setRTCUserInfo(e.id,t.key,t.value).then((function(o){o!==a.SUCCESS?($.warn("setRTCUserInfo ->code:".concat(o,",roomId:").concat(e.id,",key:").concat(t.key,",value:").concat(t.value)),n.onError(o)):n.onSuccess(!0)})).catch((function(o){$.warn("setRTCUserInfo ->code:".concat(o,",roomId:").concat(e.id,",key:").concat(t.key,",value:").concat(t.value)),n.onError(o)}))},e.prototype.removeRTCUserInfo=function(e,t,n){$.info("removeRTCUserInfo ->roomId:".concat(e.id,"keys:").concat(t.keys)),this._context.removeRTCUserInfo(e.id,t.keys).then((function(t){t!==a.SUCCESS?($.warn("removeRTCUserInfo ->code:".concat(t,",roomId:").concat(e.id)),n.onError(t)):n.onSuccess(!0)})).catch((function(t){$.warn("removeRTCUserInfo ->error:".concat(t,",roomId:").concat(e.id)),n.onError(t)}))},e.prototype.getRTCRoomInfo=function(e,t){$.info("getRTCRoomInfo ->roomId:".concat(e.id)),this._context.getRTCRoomInfo(e.id).then((function(n){var o=n.code,s=n.data;o!==a.SUCCESS?($.warn("getRTCRoomInfo ->code:".concat(o,",roomId:").concat(e.id)),t.onError(o)):t.onSuccess(s)})).catch((function(n){$.warn("getRTCRoomInfo ->error:".concat(n,",roomId:").concat(e.id)),t.onError(n)}))},e.prototype.setRTCRoomInfo=function(e,t,n){throw h("setRTCRoomInfo")},e.prototype.removeRTCRoomInfo=function(e,t,n){throw h("removeRTCRoomInfo")},e.prototype.joinRTCRoom=function(e,t){$.info("joinRTCRoom ->roomId:".concat(e.id));var n=e.mode||0;this._context.joinRTCRoom(e.id,n).then((function(n){var o=n.code,s=n.data;o!==a.SUCCESS?($.warn("joinRTCRoom ->code:".concat(o,",roomId:").concat(e.id)),t.onError(o)):t.onSuccess(s)})).catch((function(n){$.warn("joinRTCRoom ->error:".concat(n,",roomId:").concat(e.id)),t.onError(n)}))},e.prototype.quitRTCRoom=function(e,t){$.info("quitRTCRoom ->roomId:".concat(e.id)),this._context.quitRTCRoom(e.id).then((function(n){n!==a.SUCCESS?($.warn("quitRTCRoom ->code:".concat(n,",roomId:").concat(e.id)),t.onError(n)):t.onSuccess(!0)})).catch((function(n){$.warn("quitRTCRoom ->error:".concat(n,",roomId:").concat(e.id)),t.onError(n)}))},e.prototype.RTCPing=function(e,t){$.info("RTCPing ->roomId:".concat(e.id));var n=e.mode||0;this._context.rtcPing(e.id,n).then((function(n){n!==a.SUCCESS?($.warn("RTCPing ->code:".concat(n,",roomId:").concat(e.id)),t.onError(n)):t.onSuccess(!0)})).catch((function(n){$.warn("RTCPing ->error:".concat(n,",roomId:").concat(e.id)),t.onError(n)}))},e.prototype.setRTCData=function(e,t,n,o,s,c,r){$.info("setRTCData ->roomId:".concat(e,",key:").concat(t)),this._context.setRTCData(e,t,n,o,s,r).then((function(t){t!==a.SUCCESS?($.warn("setRTCData ->code:".concat(t,",roomId:").concat(e)),c.onError(t)):c.onSuccess(!0)})).catch((function(t){$.warn("setRTCData ->error:".concat(t,",roomId:").concat(e)),c.onError(t)}))},e.prototype.getRTCData=function(e,t,n,o,s){$.info("getRTCData ->roomId:".concat(e,",keys:").concat(t)),this._context.getRTCData(e,t,n,o).then((function(t){var n=t.code,o=t.data;n!==a.SUCCESS?($.warn("getRTCData ->code:".concat(n,",roomId:").concat(e)),s.onError(n)):s.onSuccess(o)})).catch((function(t){$.warn("setRTCUserInfo ->error:".concat(t,",roomId:").concat(e)),s.onError(t)}))},e.prototype.removeRTCData=function(e,t,n,o,s,c){$.info("removeRTCData ->roomId:".concat(e,",keys:").concat(t)),this._context.removeRTCData(e,t,n,o,c).then((function(t){t!==a.SUCCESS?($.warn("removeRTCData ->code:".concat(t,",roomId:").concat(e)),s.onError(t)):s.onSuccess(!0)})).catch((function(t){$.warn("removeRTCData ->error:".concat(t,",roomId:").concat(e)),s.onError(t)}))},e.prototype.setRTCUserData=function(e,t,n,o,a,s){this.setRTCData(e,t,n,o,p.PERSON,a,s)},e.prototype.setRTCUserTotalRes=function(e,t,n,o,s){$.info("setRTCUserTotalRes ->roomId:".concat(e)),this._context.setRTCTotalRes(e,t,n,o).then((function(t){t!==a.SUCCESS?($.warn("setRTCUserTotalRes ->code:".concat(t,",roomId:").concat(e)),s.onError(t)):s.onSuccess(!0)})).catch((function(t){$.warn("setRTCUserTotalRes ->error:".concat(t,",roomId:").concat(e)),s.onError(t)}))},e.prototype.getRTCUserData=function(e,t,n,o){this.getRTCData(e,t,n,p.PERSON,o)},e.prototype.removeRTCUserData=function(e,t,n,o,a){this.removeRTCData(e,t,n,p.PERSON,o,a)},e.prototype.setRTCRoomData=function(e,t,n,o,a,s){this.setRTCData(e,t,n,o,p.ROOM,a,s)},e.prototype.getRTCRoomData=function(e,t,n,o){this.getRTCData(e,t,n,p.ROOM,o)},e.prototype.removeRTCRoomData=function(e,t,n,o,a){this.removeRTCData(e,t,n,p.ROOM,o,a)},e.prototype.setRTCOutData=function(e,t,n,o,a){throw h("setRTCOutData")},e.prototype.getRTCOutData=function(e,t,n){throw h("getRTCOutData")},e.prototype.getRTCToken=function(e,t){$.info("getRTCToken ->roomId:".concat(e.id)),this._context.getRTCToken(e.id,e.mode,e.broadcastType).then((function(n){var o=n.code,s=n.data;o!==a.SUCCESS?($.warn("getRTCToken ->code:".concat(o,",roomId:").concat(e.id)),t.onError(o)):t.onSuccess(s)})).catch((function(n){$.warn("getRTCToken ->error:".concat(n,",roomId:").concat(e.id)),t.onError(n)}))},e.prototype.setRTCState=function(e,t,n){$.info("setRTCState ->roomId:".concat(e.id)),this._context.setRTCState(e.id,t.report).then((function(t){t!==a.SUCCESS?($.warn("setRTCState ->code:".concat(t,",roomId:").concat(e.id)),n.onError(t)):n.onSuccess(!0)})).catch((function(t){$.warn("setRTCState ->error:".concat(t,",roomId:").concat(e.id)),n.onError(t)}))},e}(),me=[],Se=[],Ie={message:function(e){me.forEach((function(t){return t(se(e))}))},status:function(e){Se.forEach((function(t){return t(e)}))}},Re=1;m.add("imlib-v2-adapter","5.5.8-beem");var Me,ve={init:function(e,t,n){void 0===n&&(n={}),C("appkey",e,f.STRING,!0),$.setLogLevel(n.logLevel),$.setLogStdout(n.logStdout),$.info("RongIMLib Version: ".concat("5.5.8-beem",", Commit: ").concat("a043d301e30dcebea9ba30b36f38969b34fc8c9d",",appkey:").concat(e)),s.info(c.A_INIT_O,{appkey:e,navigators:n.navi?[n.navi]:[],logLevel:n.logLevel,typingExpireTime:n.typingExpireTime}),le=S.init(z,{appkey:e,apiVersion:"5.5.8-beem",navigators:n.navi?[n.navi]:[],miniCMPProxy:[],logLevel:n.logLevel,logStdout:n.logStdout,typingExpireTime:n.typingExpireTime,indexDBSwitch:n.indexDBSwitch,checkCA:n.checkCA,httpInMainProcess:!!n.httpInMainProcess}),Re=Math.min(15,Math.max(n.readReceiptTimeout||1,1)),ge=new pe(le,{readReceiptTimeout:Re})},getInstance:function(){return ge},setConnectionStatusListener:function(e){var t=s.ID();le.assignWatcher({connectionState:function(n){s.info(c.A_CONNECT_S,{status:n},{traceId:t}),ee.clear(),e.onChanged(n)}})},setOnReceiveMessageListener:function(e){le.assignWatcher({message:function(t,n,o){try{var a=se(t),r=le.getCurrentUserId(),i=le.getConnectedTime();ce(a,r,i,Re),a=function(e,t,n,o){var a=new Date(n-1e3*o*60*60*24).getTime()-e.sentTime<0;if("ReadReceiptResponseMessage"!==e.messageType||!a)return e;var s=e.content,c=((s=s||{}).receiptMessageDic||{})[t],r="",i={};if(e.receiptResponse=e.receiptResponse||{},c){for(var d=[],u=0;u<c.length;u++)r="".concat(t).concat(c[u],"SENT"),(i=oe.get(r))&&!(e.senderUserId in i.userIds)&&(d.push(c[u]),i.count+=1,i.userIds[e.senderUserId]=e.sentTime,e.receiptResponse[c[u]]=i.count,oe.set(r,i));s.receiptMessageDic[t]=d,e.content=s}return e}(a,r,i,Re),l()||ee.set(t),s.info(c.A_PULL_MSG_O,{message:t.messageUId}),e.onReceived(a,void 0,o)}catch(e){$.error("setOnReceiveMessageListener ->error:".concat(e))}}})},setConversationStatusListener:function(e){le.assignWatcher({conversationState:function(t){try{var n=[];t.forEach((function(e){var t=e.updatedItems,o=e.conversationType,a=e.targetId,s=e.channelId,c=(t=t||{}).notificationStatus,r=t.isTop;c&&r&&n.push({notificationStatus:c.val,isTop:r.val,conversationType:o,targetId:a,channelId:s||"",updatedTime:c.time})})),n.length>0&&e.onChanged(n)}catch(e){$.error("setConversationStatusListener ->error:".concat(e))}}})},setMessageExpansionListener:function(e){le.assignWatcher({expansion:function(t){try{t.updatedExpansion&&e.onUpdated(t.updatedExpansion),t.deletedExpansion&&e.onDeleted(t.deletedExpansion)}catch(e){$.error("setMessageExpansionListener ->error:".concat(e))}}})},setTagListener:function(e){le.assignWatcher({tag:function(){try{e.onChanged()}catch(e){s.error("setTagListener ->error:".concat(e))}}})},setConversationTagListener:function(e){le.assignWatcher({conversationTagChanged:function(){try{e.onChanged()}catch(e){s.error("setConversationTagListener ->error:".concat(e))}}})},setPullOffLineFinished:function(e){le.assignWatcher({pullFinished:function(){try{e.onFinished()}catch(e){s.error("setPullOffLineFinished ->error:".concat(e))}}})},setTypingStatusListener:function(e){le.assignWatcher({typingState:function(t){try{e.onChanged(t)}catch(e){s.error("setTypingStatusListener ->error:".concat(e))}}})},setMessageBlockedListener:function(e){le.assignWatcher({messageBlocked:function(t){e.onReceived(t)}})},setChatRoomStatusListener:function(e){le.assignWatcher({chatroomState:function(t){e.onChanged(t)}})},setMessageDeliveredListener:function(e){le.assignWatcher({messageDelivered:function(t){try{e.onDelivered(t)}catch(e){s.error("setMessageDeliveredListener ->error:".concat(e))}}})},setGroupMessageDeliveredStatusListener:function(e){le.assignWatcher({groupMessageDeliveredStatus:function(t){try{e.onDelivered(t)}catch(e){s.error("setGroupMessageDeliveredStatusListener ->error:".concat(e))}}})},connect:function(e,t,n){return E(this,void 0,void 0,(function(){var o,r,i;return U(this,(function(d){switch(d.label){case 0:return o=s.ID(),s.info(c.A_CONNECT_T,{token:e,reconnectKickEnable:!1},{traceId:o}),$.info("connect ->token:".concat(e)),[4,le.connect(e,!1,n,o)];case 1:return r=d.sent(),(r.code===a.SUCCESS?s.info:s.warn)(c.A_CONNECT_R,{code:r.code,userId:r.userId},{traceId:o}),r.code===a.SUCCESS?(t.onSuccess(r.userId),i=new Date(le.getConnectedTime()-1e3*Re*60*60*24).getTime(),oe.getKeys().forEach((function(e){if(/SENT$/.test(e)){var t=oe.get(e).dealtime;t&&i-t>0&&oe.remove(e)}else if(/RECEIVED$/.test(e)){var n=oe.get(e),o=Object.keys(n).length;Object.keys(n).forEach((function(e){var t=n[e].dealtime;t&&i-t>0&&delete n[e]})),Object.keys(n).length!==o&&(0===n.length?oe.remove(e):oe.set(e,n))}}))):r.code===a.RC_CONN_USER_OR_PASSWD_ERROR?($.warn("connect ->code:".concat(r.code,",token:").concat(e)),t.onTokenIncorrect()):($.warn("connect ->code:".concat(r.code,",token:").concat(e)),t.onError(r.code)),[2]}}))}))},reconnect:function(e,t,n){var o=s.ID();s.info(c.A_RECONNECT_T,{},{traceId:o}),le.reconnect(n).then((function(t){(t.code===a.SUCCESS?s.info:s.warn)(c.A_RECONNECT_R,{code:t.code,userId:t.userId},{traceId:o}),t.code===a.SUCCESS?e.onSuccess(t.userId):($.warn("reconnect ->code:".concat(t.code)),e.onError(t.code))})).catch((function(t){e.onError(t)}))},RegisterMessage:{},RegisterMessageTypeMapping:ne,getMessageObjectName:function(e){var t=T(T({},te),ne);return Object.keys(t).find((function(n){return t[n]===e}))||e},registerMessageType:function(e,t,n,o){this.RegisterMessage[e]=ue(e,t,n.isPersited,n.isCounted),this.RegisterMessageTypeMapping[t]=e,le.registerMessageType(t,n.isPersited,n.isCounted,o)},createLogger:function(e,t){return/^(RC)/.test(e)?($.error("Tag error. Tags that start with RC are used internally by the SDK !"),null):["IM","RTC"].includes(t)?new r(e,t,"A"):($.error("The parameter type must be one of IM, or RTC !"),null)},messageWatch:function(e){var t=this;me.push((function(n){var o,a;$.info("messageWatch ->message:".concat(JSON.stringify(n||{})));try{e(n),null===(a=(o=t._voipProvider).onReceived)||void 0===a||a.call(o,n)}catch(e){$.error("messageWatch ->error:".concat(e))}})),le.assignWatcher({rtcInnerWatcher:Ie})},statusWatch:function(e){Se.push((function(t){$.info("statusWatch ->status:".concat(t));try{e(t)}catch(e){$.error("statusWatch ->error:".concat(e))}}))},MessageType:{TextMessage:"TextMessage",ImageMessage:"ImageMessage",ReferenceMessage:"ReferenceMessage",DiscussionNotificationMessage:"DiscussionNotificationMessage",VoiceMessage:"VoiceMessage",RichContentMessage:"RichContentMessage",HandshakeMessage:"HandshakeMessage",UnknownMessage:"UnknownMessage",LocationMessage:"LocationMessage",InformationNotificationMessage:"InformationNotificationMessage",ContactNotificationMessage:"ContactNotificationMessage",ProfileNotificationMessage:"ProfileNotificationMessage",CommandNotificationMessage:"CommandNotificationMessage",CommandMessage:"CommandMessage",TypingStatusMessage:"TypingStatusMessage",ChangeModeResponseMessage:"ChangeModeResponseMessage",ChangeModeMessage:"ChangeModeMessage",EvaluateMessage:"EvaluateMessage",HandShakeMessage:"HandShakeMessage",HandShakeResponseMessage:"HandShakeResponseMessage",SuspendMessage:"SuspendMessage",TerminateMessage:"TerminateMessage",CustomerContact:"CustomerContact",CustomerStatusUpdateMessage:"CustomerStatusUpdateMessage",SyncReadStatusMessage:"SyncReadStatusMessage",ReadReceiptRequestMessage:"ReadReceiptRequestMessage",ReadReceiptResponseMessage:"ReadReceiptResponseMessage",FileMessage:"FileMessage",HQVoiceMessage:"HQVoiceMessage",GIFMessage:"GIFMessage",SightMessage:"SightMessage",AcceptMessage:"AcceptMessage",RingingMessage:"RingingMessage",SummaryMessage:"SummaryMessage",HungupMessage:"HungupMessage",InviteMessage:"InviteMessage",MediaModifyMessage:"MediaModifyMessage",MemberModifyMessage:"MemberModifyMessage",JrmfRedPacketMessage:"JrmfRedPacketMessage",JrmfRedPacketOpenedMessage:"JrmfRedPacketOpenedMessage",GroupNotificationMessage:"GroupNotificationMessage",PublicServiceRichContentMessage:"PublicServiceRichContentMessage",PublicServiceMultiRichContentMessage:"PublicServiceMultiRichContentMessage",PublicServiceCommandMessage:"PublicServiceCommandMessage",RecallCommandMessage:"RecallCommandMessage",ReadReceiptMessage:"ReadReceiptMessage",RCCombineMessage:"RCCombineMessage",ChrmKVNotificationMessage:"ChrmKVNotificationMessage",LogCommandMessage:"LogCommandMessage"},_voipProvider:{}},ye=function(e,t,n){this.type=e,this.userIdList=t,this.mentionedContent=n},Te=function(e,t){this.isCounted=e,this.isPersited=t},Ee=ue("TextMessage","RC:TxtMsg"),Ue=ue("LocationMessage","RC:LBSMsg"),Ne=ue("TypingStatusMessage","RC:TypSts"),_e=ue("ImageMessage","RC:ImgMsg"),Ae=ue("RichContentMessage","RC:ImgTextMsg"),Le=ue("VoiceMessage","RC:VcMsg"),Be=ue("HQVoiceMessage","RC:HQVCMsg"),we=ue("FileMessage","RC:FileMsg"),xe=ue("SightMessage","RC:SightMsg"),ke=ue("GIFMessage","RC:GIFMsg"),Pe=ue("ReadReceiptMessage","RC:ReadNtf"),be=ue("ReadReceiptRequestMessage","RC:RRReqMsg"),Oe=ue("RCCombineMessage","RC:CombineMsg"),De=function(e,t,n,o,a,s,c,r,i,d,u,g,l,C,f,h,p,m){this.conversationType=e,this.targetId=t,this.senderUserId=n,this.content=o,this.objectName=a,this.messageType=s,this.messageId=c,this.messageUId=r,this.messageDirection=i,this.offLineMessage=d,this.sentStatus=u,this.sentTime=g,this.receivedStatus=l,this.receivedTime=C,this.canIncludeExpansion=f,this.expansion=h,this.receiptResponse=p,this.disableNotification=m};!function(e){e[e.MEDIA_AUDIO=1]="MEDIA_AUDIO",e[e.MEDIA_VEDIO=2]="MEDIA_VEDIO",e[e.MEDIA_VIDEO=2]="MEDIA_VIDEO"}(Me||(Me={}));var Ge,Ke=ue("AcceptMessage","RC:VCAccept"),Fe=ue("RingingMessage","RC:VCRinging"),We=ue("SummaryMessage","RC:VCSummary"),He=ue("HungupMessage","RC:VCHangup"),Ve=ue("InviteMessage","RC:VCInvite"),qe=ue("MediaModifyMessage","RC:VCModifyMedia"),je=ue("MemberModifyMessage","RC:VCModifyMem"),Je=ue("lastMessageSendTime","RC:SRSMsg"),Ye=ue("ReferenceMessage","RC:ReferenceMsg"),Qe=ue("PublicServiceRichContentMessage","RC:PSImgTxtMsg"),Xe=ue("PublicServiceMultiRichContentMessage","RC:PSMultiImgTxtMsg");!function(e){e[e.ALL=1]="ALL",e[e.PART=2]="PART"}(Ge||(Ge={}));var ze=Ge,$e=I;window&&(window.RongIMClient=ve);export{Ke as AcceptMessage,de as BaseMessage,fe as ChannelClient,$e as ConnectionState,we as FileMessage,ke as GIFMessage,y as GetChatRoomType,Be as HQVoiceMessage,He as HungupMessage,pe as IMClient,_e as ImageMessage,Ve as InviteMessage,Ue as LocationMessage,qe as MediaModifyMessage,je as MemberModifyMessage,ye as MentionedInfo,ze as MentionedType,De as Message,Te as MessageTag,Xe as PublicServiceMultiRichContentMessage,Qe as PublicServiceRichContentMessage,Oe as RCCombineMessage,Pe as ReadReceiptMessage,be as ReadReceiptRequestMessage,Ce as ReadReceiptResponseMessage,Ye as ReferenceMessage,Ae as RichContentMessage,Fe as RingingMessage,ve as RongIMClient,v as SentStatus,xe as SightMessage,We as SummaryMessage,Je as SyncReadStatusMessage,Ee as TextMessage,Ne as TypingStatusMessage,Me as VoIPMediaType,Le as VoiceMessage};
|
|
1
|
+
import{NetworkType as e,HttpMethod as t,HTTP_TIMEOUT as n,appendUrl as o,ErrorCode as a,SEND_MESSAGE_TYPE_OPTION as s,AppStorage as r,ReceivedStatus as c,MessageDirection as i,usingCppEngine as g,assert as d,AssertRules as u,LogTagId as l,todo as h,RTCApiType as f,VersionManage as C,APIContext as p,ConnectResultCode as S}from"@rongcloud/engine";export{ChatroomEntryType,ChatroomUserChangeType,ConnectionStatus,ConversationType,ErrorCode,FileType,LogL,LogLevel,LogSource,LogTagId,MessageBlockType,MessageDirection,NotificationStatus,RTCApiType,RTCMode,ReceivedStatus,UploadMethod,logger}from"@rongcloud/engine";var m;!function(e){e[e.SENDING=10]="SENDING",e[e.FAILED=20]="FAILED",e[e.SENT=30]="SENT",e[e.RECEIVED=40]="RECEIVED",e[e.READ=50]="READ",e[e.DESTROYED=60]="DESTROYED"}(m||(m={}));var v,I=m;!function(e){e[e.NONE=0]="NONE",e[e.SQQUENCE=1]="SQQUENCE",e[e.REVERSE=2]="REVERSE"}(v||(v={}));var R=v,y=function(){return y=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var a in t=arguments[n])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},y.apply(this,arguments)};function M(e,t,n,o){return new(n||(n=Promise))((function(a,s){function r(e){try{i(o.next(e))}catch(e){s(e)}}function c(e){try{i(o.throw(e))}catch(e){s(e)}}function i(e){var t;e.done?a(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(r,c)}i((o=o.apply(e,t||[])).next())}))}function T(e,t){var n,o,a,s,r={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return s={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function c(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,o&&(a=2&s[0]?o.return:s[0]?o.throw||((a=o.return)&&a.call(o),0):o.next)&&!(a=a.call(o,s[1])).done)return a;switch(o=0,a&&(s=[2&s[0],a.value]),s[0]){case 0:case 1:a=s;break;case 4:return r.label++,{value:s[1],done:!1};case 5:r.label++,o=s[1],s=[0];continue;case 7:s=r.ops.pop(),r.trys.pop();continue;default:if(!(a=r.trys,(a=a.length>0&&a[a.length-1])||6!==s[0]&&2!==s[0])){r=0;continue}if(3===s[0]&&(!a||s[1]>a[0]&&s[1]<a[3])){r.label=s[1];break}if(6===s[0]&&r.label<a[1]){r.label=a[1],a=s;break}if(a&&r.label<a[2]){r.label=a[2],r.ops.push(s);break}a[2]&&r.ops.pop(),r.trys.pop();continue}s=t.call(e,r)}catch(e){s=[6,e],o=0}finally{n=a=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}}function E(e,t,n){if(n||2===arguments.length)for(var o,a=0,s=t.length;a<s;a++)!o&&a in t||(o||(o=Array.prototype.slice.call(t,0,a)),o[a]=t[a]);return e.concat(o||Array.prototype.slice.call(t))}var O=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))},U=O();var N={tag:"browser",httpReq:function(e){var a=e.method||t.GET,s=e.timeout||n,r=e.headers,c=e.query,i=e.body,g=o(e.url,c);return new Promise((function(e){var t,n=(t="undefined"!=typeof XMLHttpRequest&&"withCredentials"in new XMLHttpRequest,"undefined"!=typeof XMLHttpRequest&&t?new XMLHttpRequest:"undefined"!=typeof XDomainRequest?new XDomainRequest:new ActiveXObject("Microsoft.XMLHTTP")),o="[object XDomainRequest]"===Object.prototype.toString.call(n);if(n.open(a,g),r&&n.setRequestHeader)for(var c in r)n.setRequestHeader(c,r[c]);if(o){n.timeout=s,n.onload=function(){e({data:n.responseText,status:n.status||200})},n.onerror=function(){e({status:n.status||0})},n.ontimeout=function(){e({status:n.status||0})};var d="object"==typeof i?JSON.stringify(i):i;n.send(d)}else n.onreadystatechange=function(){4===n.readyState&&e({data:n.responseText,status:n.status})},n.onerror=function(){e({status:n.status||0})},setTimeout((function(){n.abort(),e({status:n.status||0})}),s),n.send(i)}))},localStorage:null===window||void 0===window?void 0:window.localStorage,sessionStorage:null===window||void 0===window?void 0:window.sessionStorage,useNavi:!0,connectPlatform:"",isFromUniapp:U,createWebSocket:function(e,t){var n=new WebSocket(e,t);return n.binaryType="arraybuffer",{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 t=navigator.connection||navigator.mozConnection||navigator.webkitConnection,n=t.type,o=t.effectiveType,a=n||o||e.UNKONWN;return new Promise((function(e){e(a)}))}},_=O(),A=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)}}},L={setItem:A("setStorageSync"),getItem:A("getStorageSync"),removeItem:A("removeStorageSync"),clear:A("clearStorageSync")},B={tag:"wechat",httpReq:function(e){var s=e.method||t.GET,r=e.timeout||n,c=e.headers,i=e.query,g=e.body,d=o(e.url,i);return new Promise((function(e){wx.request({url:d,method:s,header:c,timeout:r,data:g,success:function(t){e({data:t.data,status:t.statusCode})},fail:function(){e({status:a.RC_HTTP_REQ_FAIL})}})}))},localStorage:L,sessionStorage:L,useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:_,createWebSocket:function(e,t){var n=wx.connectSocket({url:e,protocols:t});return{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(t){wx.getNetworkType({success:function(e){var n=e.networkType;t(n)},fail:function(){t(e.UNKONWN)}})}))}},w=O(),x=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){}}},k={setItem:x("setStorageSync"),getItem:x("getStorageSync"),removeItem:x("removeStorageSync"),clear:x("clearStorageSync")},P={tag:"alipay",httpReq:function(e){var s=e.method||t.GET,r=e.timeout||n,c=e.headers,i=e.query,g=e.body,d=o(e.url,i),u=e.dataType||"json";return new Promise((function(e){my.request({url:d,method:s,headers:c,timeout:r,data:g,dataType:u,success:function(t){e({data:t.data,status:t.status})},fail:function(){e({status:a.RC_HTTP_REQ_FAIL})}})}))},localStorage:k,sessionStorage:k,useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:w,createWebSocket:function(e){return my.connectSocket({url:e}),{onClose:function(e){my.onSocketClose(e)},onError:function(e){my.onSocketError((function(t){e(t.errMsg)}))},onMessage:function(e){my.onSocketMessage((function(t){t.isBuffer?e(my.base64ToArrayBuffer(t.data)):e(t.data)}))},onOpen:function(e){my.onSocketOpen(e)},send:function(e){my.sendSocketMessage({data:my.arrayBufferToBase64(e),isBuffer:!0})},close:function(){my.closeSocket()}}},getNetworkType:function(){return new Promise((function(t){my.getNetworkType({success:function(e){var n=e.networkType;t(n)},fail:function(){t(e.UNKONWN)}})}))}},b=O(),D=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){}}},G={setItem:D("setStorageSync"),getItem:D("getStorageSync"),removeItem:D("removeStorageSync"),clear:D("clearStorageSync")},F={tag:"toutiao",useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:b,localStorage:G,sessionStorage:G,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:a.RC_HTTP_REQ_FAIL})}})}))},createWebSocket:function(e,t){var n=tt.connectSocket({url:e,protocols:t});return{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(t){tt.getNetworkType({success:function(e){var n=e.networkType;t(n)},fail:function(){t(e.UNKONWN)}})}))}},K=O(),W=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){}}},H={setItem:W("setStorageSync"),getItem:W("getStorageSync"),removeItem:W("removeStorageSync"),clear:W("clearStorageSync")},J={tag:"baidu",useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:K,localStorage:H,sessionStorage:H,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:a.RC_HTTP_REQ_FAIL})}})}))},createWebSocket:function(e,t){var n=swan.connectSocket({url:e,protocols:t});return{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 M(this,void 0,void 0,(function(){return T(this,(function(t){return[2,new Promise((function(t){swan.getNetworkType({success:function(e){var n=e.networkType;t(n)},fail:function(){t(e.UNKONWN)}})}))]}))}))}},V=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)}}},q={setItem:V("setStorageSync"),getItem:V("getStorageSync"),removeItem:V("removeStorageSync"),clear:V("clearStorageSync")},j={tag:"uniapp",httpReq:function(e){var s=e.method||t.GET,r=e.timeout||n,c=e.headers,i=e.query,g=e.body,d=o(e.url,i);return new Promise((function(e){uni.request({url:d,method:s,header:c,timeout:r,data:g,success:function(t){e({data:t.data,status:t.statusCode})},fail:function(){e({status:a.RC_HTTP_REQ_FAIL})}})}))},localStorage:q,sessionStorage:q,useNavi:!0,connectPlatform:"",isFromUniapp:!0,createWebSocket:function(e,t){var n={complete:function(){},url:e,protocols:t},o=uni.connectSocket(n);return{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(t){uni.getNetworkType({success:function(e){var n=e.networkType;t(n)},fail:function(){t(e.UNKONWN)}})}))}},Y=function(e){return e&&e.request&&e.getSystemInfo},Q="undefined"!=typeof uni&&Y(uni)?function(){switch(process.env.VUE_APP_PLATFORM){case"app-plus":return j;case"mp-baidu":return J;case"mp-toutiao":return F;case"mp-alipay":return P;case"mp-weixin":return B;default:return N}}():"undefined"!=typeof my&&Y(my)?P:"undefined"!=typeof tt&&Y(tt)?F:"undefined"!=typeof swan&&Y(swan)?J:"undefined"!=typeof wx&&Y(wx)?B:N;function X(e,t,n){return"".concat(e,"_").concat(t,"_").concat(n)}var z=function(){function e(){}return e.set=function(t){if(s[t.messageType]&&s[t.messageType].isPersited){var n=e.get(t.conversationType,t.targetId,t.channelId||"");if(!n||n.sentTime<t.sentTime){var o=X(t.conversationType,t.targetId,t.channelId||"");e.map[o]=t}}},e.get=function(t,n,o){var a=X(t,n,o);return e.map[a]||null},e.remove=function(t,n,o){var a=X(t,n,o);delete e.map[a]},e.clear=function(){e.map={}},e.map={},e}(),$={"RC:TxtMsg":"TextMessage","RC:ImgMsg":"ImageMessage","RC:VcMsg":"VoiceMessage","RC:ImgTextMsg":"RichContentMessage","RC:ReferenceMsg":"ReferenceMessage","RC:FileMsg":"FileMessage","RC:HQVCMsg":"HQVoiceMessage","RC:GIFMsg":"GIFMessage","RC:SightMsg":"SightMessage","RC:LBSMsg":"LocationMessage","RC:InfoNtf":"InformationNotificationMessage","RC:ContactNtf":"ContactNotificationMessage","RC:ProfileNtf":"ProfileNotificationMessage","RC:CmdNtf":"CommandNotificationMessage","RC:DizNtf":"DiscussionNotificationMessage","RC:CmdMsg":"CommandMessage","RC:TypSts":"TypingStatusMessage","RC:CsChaR":"ChangeModeResponseMessage","RC:CsHsR":"HandShakeResponseMessage","RC:CsEnd":"TerminateMessage","RC:CsSp":"SuspendMessage","RC:CsUpdate":"CustomerStatusUpdateMessage","RC:ReadNtf":"ReadReceiptMessage","RC:VCAccept":"AcceptMessage","RC:VCRinging":"RingingMessage","RC:VCSummary":"SummaryMessage","RC:VCHangup":"HungupMessage","RC:VCInvite":"InviteMessage","RC:VCModifyMedia":"MediaModifyMessage","RC:VCModifyMem":"MemberModifyMessage","RC:CsContact":"CustomerContact","RC:PSImgTxtMsg":"PublicServiceRichContentMessage","RC:PSMultiImgTxtMsg":"PublicServiceMultiRichContentMessage","RC:GrpNtf":"GroupNotificationMessage","RC:PSCmd":"PublicServiceCommandMessage","RC:RcCmd":"RecallCommandMessage","RC:SRSMsg":"SyncReadStatusMessage","RC:RRReqMsg":"ReadReceiptRequestMessage","RC:RRRspMsg":"ReadReceiptResponseMessage","RCJrmf:RpMsg":"JrmfRedPacketMessage","RCJrmf:RpOpendMsg":"JrmfRedPacketOpenedMessage","RC:CombineMsg":"RCCombineMessage","RC:chrmKVNotiMsg":"ChrmKVNotificationMessage","RC:LogCmdMsg":"LogCommandMessage","RC:MsgExMsg":"ExpansionCommandMessage","RC:RRMsg":"GroupReadReceiptResponseMessage"},Z={},ee=new r(Q,"API-V2");function te(e){var t=e.channelId,n=e.conversationType,o=e.targetId,a=e.unreadMessageCount,s=e.latestMessage,r=e.isTop,c=e.notificationStatus,i=e.matchCount;if(!g()){var d=z.get(n,o,t||"");s?d&&s.sentTime<d.sentTime&&(s=d):s=d}var u=s?ne(s):null;return{channelId:t||"",conversationType:n,targetId:o,unreadMessageCount:a,latestMessage:u,latestMessageId:null==u?void 0:u.messageId,objectName:null==u?void 0:u.messageType,sentTime:null==u?void 0:u.sentTime,isTop:r,notificationStatus:c,receivedStatus:null==u?void 0:u.receivedStatus,matchCount:i}}function ne(e){var t=e.conversationType,n=e.targetId,o=e.senderUserId,a=e.content,s=e.messageType,r=e.messageUId,i=e.messageDirection,g=e.isOffLineMessage,d=e.sentTime,u=e.receivedStatus,l=e.receivedTime,h=e.canIncludeExpansion,f=e.disableNotification,C=e.expansion,p=e.messageId,S=e.sentStatus,m=e.channelId,v=e.readReceiptInfo,R=e.pushConfig,y="";return s in $?y=$[s]:s in Z?y=Z[s]:(a={message:{content:a,objectName:s},messageName:"UnknownMessage"},y="UnknownMessage"),u||(u=c.UNREAD),void 0===p&&(p=~~(16777215*Math.random())),{channelId:m||"",conversationType:t,targetId:n,senderUserId:o,content:a,messageType:y,messageUId:r,messageDirection:i,offLineMessage:g,sentTime:d,receivedStatus:u,receivedTime:l,objectName:s,messageId:p,sentStatus:S||I.SENT,disableNotification:f,canIncludeExpansion:h,expansion:C,readReceiptInfo:v,pushConfig:R}}function oe(e,t,n,o){var a=new Date(n-1e3*o*60*60*24).getTime()-e.sentTime<0,s=e.messageType,r=e.messageDirection;if("ReadReceiptRequestMessage"===s&&a&&r===i.SEND){var c="".concat(t).concat(e.content.messageUId,"SENT");ee.set(c,{count:0,dealtime:e.sentTime,userIds:{}})}else if("ReadReceiptRequestMessage"===s&&a){var g="".concat(t).concat(e.conversationType).concat(e.targetId,"RECEIVED"),d=ee.get(g);if(d)if(e.senderUserId in d)d[e.senderUserId].uIds&&-1===d[e.senderUserId].uIds.indexOf(e.content.messageUId)&&(d[e.senderUserId].uIds.push(e.content.messageUId),d[e.senderUserId].dealtime=e.sentTime,d[e.senderUserId].isResponse=!1,ee.set(g,d));else{var u={uIds:[e.content.messageUId],dealtime:e.sentTime,isResponse:!1};d[e.senderUserId]=u,ee.set(g,d)}else{var l={};l[e.senderUserId]={uIds:[e.content.messageUId],dealtime:e.sentTime,isResponse:!1},ee.set(g,l)}}}function ae(e,t,n){try{e(t,n)}catch(e){null===console||void 0===console||console.error(e)}}function se(e,t,n){try{e(t,n)}catch(e){null===console||void 0===console||console.error(e)}}var re=function(e,t,n,o,a){void 0===o&&(o=!0),void 0===a&&(a=!0),this.messageType=e,this.objectName=t,this.content=n,this.isPersited=o,this.isCounted=a};function ce(e,t,n,o){void 0===n&&(n=!0),void 0===o&&(o=!0);var a=function(a){return new re(e,t,a,n,o)};return a.MessageType=e,a.ObjectName=t,a}var ie,ge,de=ce("ReadReceiptResponseMessage","RC:RRRspMsg"),ue=function(){function e(e,t,n,o,a){this.logger=e,this._context=t,this.channelId=n,this._isCPPMode=o,this._readReceiptTimeout=a,this._storage=ee,this._draftMap={}}return e.prototype.getConversationList=function(e,t,n){var o=this;d("callback",e,u.CALLBACK),d("conversationTypes",t,u.ARRAY),d("count",n,u.NUMBER),this._context.getConversationList(n,void 0,0,0,this.channelId).then((function(n){var s=n.code,r=n.data,c=[];r=r||[],s===a.SUCCESS?(t?r.forEach((function(e){t.indexOf(e.conversationType)>-1&&c.push(te(e))})):r.forEach((function(e){c.push(te(e))})),ae(e.onSuccess,c)):(o.logger.warn(l.O,"getConversationList -> code:".concat(s)),se(e.onError,s))}))},e.prototype.getConversation=function(e,t,n){var o=this;d("callback",n,u.CALLBACK),d("conversationType",e,u.NUMBER,!0),d("targetId",t,u.STRING,!0),this.logger.info(l.O,"getConversation ->targetId:".concat(t,",conversationType:").concat(e)),M(o,void 0,void 0,(function(){var o,s,r;return T(this,(function(c){switch(c.label){case 0:return[4,this._context.getConversation(e,t,this.channelId)];case 1:return o=c.sent(),s=o.code,r=o.data,s!==a.SUCCESS?(this.logger.warn(l.O,"getConversation ->code:".concat(s,",targetId:").concat(t)),n.onError(s),[2]):(n.onSuccess(r?te(r):null),[2])}}))}))},e.prototype.removeConversation=function(e,t,n){var o=this;d("conversationType",e,u.NUMBER,!0),d("targetId",t,u.STRING,!0),d("callback",n,u.CALLBACK),this.logger.info(l.O,"removeConversation ->targetId:".concat(t,",conversationType:").concat(e)),this._context.removeConversation(e,t,this.channelId).then((function(s){s===a.SUCCESS?(o._isCPPMode||z.remove(e,t,o.channelId),ae(n.onSuccess)):(o.logger.warn(l.O,"removeConversation ->code:".concat(s,",targetId:").concat(t)),se(n.onError,s))}))},e.prototype.saveTextMessageDraft=function(e,t,n){d("conversationType",e,u.NUMBER,!0),d("targetId",t,u.STRING,!0),d("draftText",n,u.STRING,!0),this.logger.info(l.O,"saveTextMessageDraft ->targetId:".concat(t,",conversationType:").concat(e));var o=this._context.getCurrentUserId();return!!o&&((this._draftMap[o]=this._draftMap[o]||{})["".concat(e,"_").concat(t,"_").concat(this.channelId)]=n,!0)},e.prototype.getTextMessageDraft=function(e,t){d("conversationType",e,u.NUMBER,!0),d("targetId",t,u.STRING,!0),this.logger.info(l.O,"getTextMessageDraft ->targetId:".concat(t,",conversationType:").concat(e));var n=this._context.getCurrentUserId();if(n)return(this._draftMap[n]||{})["".concat(e,"_").concat(t,"_").concat(this.channelId)]},e.prototype.clearTextMessageDraft=function(e,t){d("conversationType",e,u.NUMBER,!0),d("targetId",t,u.STRING,!0),this.logger.info(l.O,"clearTextMessageDraft ->targetId:".concat(t,",conversationType:").concat(e));var n=this._context.getCurrentUserId();return!!n&&delete(this._draftMap[n]||{})["".concat(e,"_").concat(t,"_").concat(this.channelId)]},e.prototype.getTotalUnreadCount=function(e,t,n){var o=this;d("callback",e,u.CALLBACK),this.logger.info(l.O,"getTotalUnreadCount ->conversationTypes:".concat(t)),this._context.getTotalUnreadCount(this.channelId,t,n).then((function(t){var n=t.code,s=t.data;n===a.SUCCESS?ae(e.onSuccess,s):(o.logger.warn(l.O,"getTotalUnreadCount ->code:".concat(n)),se(e.onError,n))}))},e.prototype.getUnreadCount=function(e,t,n){var o=this;d("conversationType",e,u.NUMBER,!0),d("targetId",t,u.STRING,!0),d("callback",n,u.CALLBACK),this.logger.info(l.O,"getUnreadCount ->targetId:".concat(t,",conversationType:").concat(e)),this._context.getUnreadCount(e,t,this.channelId).then((function(e){var s=e.code,r=e.data;s===a.SUCCESS?ae(n.onSuccess,r):(o.logger.warn(l.O,"getUnreadCount ->code:".concat(s,",targetId:").concat(t)),se(n.onError,s))}))},e.prototype.clearConversations=function(e,t){var n=this;this.logger.info(l.O,"clearConversations -> conversationTypes:".concat(t)),this._isCPPMode?this._context.clearConversations(t,this.channelId).then((function(t){t===a.SUCCESS?ae(e.onSuccess,!0):(n.logger.warn(l.O,"clearConversations ->code:".concat(t)),se(e.onError,t))})):this.logger.error(l.O,"Method is only available in cppProtocol mode")},e.prototype.clearUnreadCount=function(e,t,n){var o=this;d("conversationType",e,u.NUMBER,!0),d("targetId",t,u.STRING,!0),d("callback",n,u.CALLBACK),this.logger.info(l.O,"clearUnreadCount ->targetId:".concat(t,",conversationType:").concat(e)),this._context.clearUnreadCount(e,t,this.channelId).then((function(e){e===a.SUCCESS?ae(n.onSuccess,!0):(o.logger.warn(l.O,"clearUnreadCount ->code:".concat(e,",targetId:").concat(t)),se(n.onError,e))}))},e.prototype.clearAllUnreadCount=function(e){var t=this;d("callback",e,u.CALLBACK),this.logger.info(l.O,"clearUnreadCount ->"),this._context.clearAllUnreadCount().then((function(n){n===a.SUCCESS?ae(e.onSuccess,!0):(t.logger.warn(l.O,"clearUnreadCount ->code:".concat(n)),se(e.onError,n))}))},e.prototype.getFirstUnreadMessage=function(e,t,n){var o=this;d("conversationType",e,u.NUMBER,!0),d("targetId",t,u.STRING,!0),d("callback",n,u.CALLBACK),this.logger.info(l.O,"getFirstUnreadMessage ->targetId:".concat(t,",conversationType:").concat(e)),this._context.getFirstUnreadMessage(e,t,this.channelId).then((function(e){e.code===a.SUCCESS?ae(n.onSuccess,e.data?ne(e.data):null):(o.logger.warn(l.O,"getFirstUnreadMessage ->code:".concat(e.code,",targetId:").concat(t)),se(n.onError,e.code))}))},e.prototype.setConversationStatus=function(e,t,n,o){var s=this;d("conversationType",e,u.NUMBER,!0),d("targetId",t,u.STRING,!0),d("callback",o,u.CALLBACK),d("status",n,u.OBJECT,!0),this.logger.info(l.O,"setConversationStatus ->targetId:".concat(t,",status:").concat(n));var r=n.isTop,c=n.notificationStatus;this._context.setConversationStatus(e,t,r,c,this.channelId).then((function(e){e===a.SUCCESS?ae(o.onSuccess):(s.logger.warn(l.O,"setConversationStatus ->code:".concat(e,",targetId:").concat(t)),se(o.onError,e))}))},e.prototype.sendMessage=function(e,t,n,o,s,r,g,h){var f=this;d("conversationType",e,u.NUMBER,!0),d("targetId",t,u.STRING,!0),d("msg",n,u.OBJECT,!0),d("callback",o,u.CALLBACK),d("isMentioned",s,u.BOOLEAN),d("pushContent",r,u.ONLY_STRING),d("pushData",g,u.ONLY_STRING),d("options.userIds",null==h?void 0:h.userIds,u.ARRAY),d("options.isVoipPush",null==h?void 0:h.isVoipPush,u.BOOLEAN),d("options.disableNotification",null==h?void 0:h.disableNotification,u.BOOLEAN),d("options.canIncludeExpansion",null==h?void 0:h.canIncludeExpansion,u.BOOLEAN),d("options.expansion",null==h?void 0:h.expansion,u.OBJECT),d("options.pushConfig",null==h?void 0:h.pushConfig,u.OBJECT),d("options.resendMessageId",null==h?void 0:h.resendMessageId,u.NUMBER),this.logger.info(l.O,"sendMessage ->targetId:".concat(t,",conversationType:").concat(e));var C=!(!(null==h?void 0:h.isStatusMessage)&&!(null==h?void 0:h.isStatus)),p=function(e,t,n){var o,a=e||{},s=a.userIds,r=a.isVoipPush,c=a.disableNotification,i=a.isFilerWhiteBlacklist,g=a.expansion,d=a.canIncludeExpansion,u=a.pushConfig,l=a.resendMessageId,h=[];if(t){var f=(n||{}).content.mentionedInfo;h=f.userIdList,o=f.type}return{mentionedType:o,mentionedUserIdList:h,directionalUserIdList:s,isVoipPush:r,disableNotification:c,isFilerWhiteBlacklist:i,expansion:g,canIncludeExpansion:d,pushConfig:u,messageId:l}}(h,s,n),S=Object.assign(n,y(y({isMentioned:s,pushContent:r,pushData:g},p),{messageType:n.objectName,channelId:this.channelId,isStatusMessage:C})),m=this._context.getCurrentUserId(),v=this.logger.createTraceId();this.logger.info(l.A_SEND_MSG_T,JSON.stringify({messageType:S.messageType,conversationType:e,targetId:t,channelId:this.channelId}),v),this._context.sendMessage(e,t,S,o.onBefore,v).then((function(s){var r=s.code,g=s.data,d=r===a.SUCCESS?"info":"warn";if(f.logger[d](l.A_SEND_MSG_R,JSON.stringify({code:r,messageUId:g?g.messageUId:"",messageId:g?g.messageId:""}),v),r===a.SUCCESS){f._isCPPMode||z.set(g);var u=ne(g);oe(u,m,f._context.getConnectedTime(),f._readReceiptTimeout),ae(o.onSuccess,u)}else f.logger.warn(l.O,"sendMessage ->code:".concat(r,",targetId:").concat(t)),se(o.onError,r,ne({isMentioned:!!S.isMentioned,content:n.content,messageType:n.messageType,isPersited:n.isPersited,isCounted:n.isCounted,disableNotification:!!(null==h?void 0:h.disableNotification),canIncludeExpansion:!!(null==h?void 0:h.canIncludeExpansion),expansion:(null==h?void 0:h.expansion)||null,conversationType:e,targetId:t,senderUserId:m,messageUId:"",messageDirection:i.SEND,isOffLineMessage:!1,sentTime:(null==g?void 0:g.sentTime)||0,receivedTime:0,isStatusMessage:C,receivedStatus:c.UNREAD,messageId:null==g?void 0:g.messageId,sentStatus:I.FAILED}))}))},e.prototype.sendRecallMessage=function(e,t,n){var o=this;d("message.conversationType",e.conversationType,u.NUMBER,!0),d("message.targetId",e.targetId,u.STRING,!0),d("message.messageUId",e.messageUId,u.STRING,!0),d("message.sentTime",e.sentTime,u.NUMBER,!0),d("callback",t,u.CALLBACK),d("options.disableNotification",null==n?void 0:n.disableNotification,u.BOOLEAN),d("options.pushConfig",null==n?void 0:n.pushConfig,u.OBJECT),d("options.extra",null==n?void 0:n.extra,u.STRING);var s=e.conversationType,r=e.targetId,c=e.messageUId,i=e.sentTime;this.logger.info(l.O,"sendRecallMessage ->targetId:".concat(r,",conversationType:").concat(s,",messageUId:").concat(c));var g=y({channelId:this.channelId},n);this._context.recallMessage(s,r,c,i,g).then((function(e){var n=e.code,s=e.data;n===a.SUCCESS?(o._isCPPMode||z.set(s),ae(t.onSuccess,ne(s))):(o.logger.warn(l.O,"sendRecallMessage ->code:".concat(n,",targetId:").concat(r,",messageUId:").concat(c)),se(t.onError,n))}))},e.prototype.sendTypingStatusMessage=function(e,t,n,o){var s=this;d("conversationType",e,u.NUMBER,!0),d("targetId",t,u.STRING,!0),d("typingContentType",n,u.STRING,!0),d("callback",o,u.CALLBACK),this.logger.info(l.O,"sendTypingStatusMessage ->targetId:".concat(t,",conversationType:").concat(e));var r={messageType:"RC:TypSts",content:{typingContentType:n},isStatusMessage:!0,channelId:this.channelId},c=this.logger.createTraceId();this.logger.info(l.A_SEND_MSG_T,JSON.stringify({messageType:r.messageType,conversationType:e,targetId:t,channelId:r.channelId}),c),this._context.sendMessage(e,t,r,void 0,c).then((function(e){var n=e.code,r=e.data,i=n===a.SUCCESS?"info":"warn";s.logger[i](l.A_SEND_MSG_R,JSON.stringify({code:n,messageUId:r?r.messageUId:"",messageId:r?r.messageId:""}),c),n===a.SUCCESS?ae(o.onSuccess,ne(r)):(s.logger.warn(l.O,"sendTypingStatusMessage ->code:".concat(n,",targetId:").concat(t)),se(o.onError,n))}))},e.prototype.sendReceiptResponse=function(e,t,n){var o=this;this.logger.info(l.O,"sendReceiptResponse ->targetId:".concat(t,",conversationType:").concat(e));var a=this._context.getCurrentUserId(),s="".concat(a).concat(e).concat(t,"RECEIVED"),r=this._storage.get(s);if(r){var c=[];for(var i in r){var g={};g[i]=r[i].uIds,r[i].isResponse||c.push(g)}if(0===c.length)return void n.onSuccess(null);var d=setInterval((function(){1===c.length&&clearInterval(d);var a=c.splice(0,1)[0],i=new de({receiptMessageDic:a});o.sendMessage(e,t,i,{onSuccess:function(e){var t=Object.keys(a)[0];r[t].isResponse=!0,o._storage.set(s,r),ae(n.onSuccess,e)},onError:function(e){o.logger.warn(l.O,"sendReceiptResponse ->code:".concat(e,",targetId:").concat(t)),se(n.onError,e)}})}),200)}else n.onSuccess(null)},e.prototype.sendReadReceiptMessage=function(e,t,n){var o=this;d("messageUIds",e,u.ARRAY,!0),d("targetId",t,u.STRING,!0),this.logger.info(l.O,"sendReadReceiptMessage ->targetId:".concat(t,",messageUIds:").concat(e));for(var s=0,r=e;s<r.length;s++){var c=r[s];d("messageUId",c,u.STRING)}this._context.sendReadReceiptMessage(t,e,this.channelId).then((function(s){var r=s.code;r===a.SUCCESS?n.onSuccess():(o.logger.warn(l.O,"sendReadReceiptMessage ->code:".concat(r,",targetId:").concat(t,",messageUIds:").concat(e)),n.onError(r))})).catch((function(a){o.logger.warn(l.O,"sendReadReceiptMessage ->code:".concat(a,",targetId:").concat(t,",messageUIds:").concat(e)),n.onError(a)}))},e.prototype.getMessageReader=function(e,t,n){var o=this;d("messageUId",e,u.STRING,!0),d("targetId",t,u.STRING,!0),this.logger.info(l.O,"getMessageReader ->targetId:".concat(t,",messageUId:").concat(e)),this._context.getMessageReader(t,e,this.channelId).then((function(s){var r=s.code,c=s.data;r===a.SUCCESS?n.onSuccess(c):(o.logger.warn(l.O,"getMessageReader ->code:".concat(r,",targetId:").concat(t,",messageUId:").concat(e)),n.onError(r))})).catch((function(a){o.logger.warn(l.O,"getMessageReader ->code:".concat(a,",targetId:").concat(t,",messageUId:").concat(e)),n.onError(a)}))},e.prototype.updateMessageExpansion=function(e,t,n){var o=this;d("expansion",e,u.OBJECT,!0),d("message",t,u.OBJECT,!0);var s=t.conversationType,r=t.targetId,c=t.messageUId,i=t.canIncludeExpansion,g=t.expansion;this.logger.info(l.O,"updateMessageExpansion ->targetId:".concat(r,",messageUId:").concat(c,",conversationType:").concat(s)),this._context.sendExpansionMessage({conversationType:s,targetId:r,messageUId:c,canIncludeExpansion:i,originExpansion:g,expansion:e,channelId:this.channelId}).then((function(e){var t=e.code;t===a.SUCCESS?ae(n.onSuccess):(o.logger.warn(l.O,"updateMessageExpansion ->code:".concat(t,",targetId:").concat(r,",messageUId:").concat(c)),se(n.onError,t))}))},e.prototype.removeMessageExpansionForKey=function(e,t,n){var o=this;d("keys",e,u.ARRAY,!0),d("message",t,u.OBJECT,!0);var s=t.conversationType,r=t.targetId,c=t.messageUId,i=t.canIncludeExpansion;this.logger.info(l.O,"removeMessageExpansionForKey ->targetId:".concat(r,",messageUId:").concat(c,",conversationType:").concat(s)),this._context.sendExpansionMessage({conversationType:s,targetId:r,messageUId:c,canIncludeExpansion:i,keys:e,channelId:this.channelId}).then((function(e){var t=e.code;t===a.SUCCESS?ae(n.onSuccess):(o.logger.warn(l.O,"removeMessageExpansionForKey ->code:".concat(t,",targetId:").concat(r,",messageUId:").concat(c)),se(n.onError,t))}))},e.prototype.getHistoryMessages=function(e,t,n,o,s,r,c){var i=this;d("conversationType",e,u.NUMBER,!0),d("targetId",t,u.STRING,!0),d("timestamp",n,u.NUMBER,!0),d("count",o,u.NUMBER,!0),d("callback",s,u.CALLBACK,!0),d("order",c,u.NUMBER),this.logger.info(l.O,"getHistoryMessages ->targetId:".concat(t,",conversationType:").concat(e,",timestamp:").concat(n));var g=this.logger.createTraceId();this.logger.info(l.A_GET_HISTORY_MSG_T,JSON.stringify({targetId:t,conversationType:e,channelId:"",timestamp:n,count:o}),g),this._context.getHistoryMessage(e,t,n,o,c,this.channelId,r,g).then((function(e){var t=e.code,n=e.data;if(t===a.SUCCESS)if(n){var o=n.list,r=n.hasMore,c=[],d=o.map((function(e){return c.push(e.messageUId),ne(e)}));i.logger.info(l.A_GET_HISTORY_MSG_R,JSON.stringify({code:t,messageUIds:c.join(",")}),g),ae(s.onSuccess,d,r)}else i.logger.info(l.A_GET_HISTORY_MSG_R,JSON.stringify({code:t,messageUIds:""}),g),ae(s.onSuccess,[],!1);else i.logger.warn(l.A_GET_HISTORY_MSG_R,JSON.stringify({code:t,messageUIds:""}),g),se(s.onError,t)}))},e.prototype.deleteRemoteMessages=function(e,t,n,o){var s=this;d("conversationType",e,u.NUMBER,!0),d("targetId",t,u.STRING,!0),d("messages",n,u.ARRAY,!0),d("callback",o,u.CALLBACK),this.logger.info(l.O,"deleteRemoteMessages ->targetId:".concat(t,",conversationType:").concat(e)),this._context.deleteRemoteMessage(e,t,n,this.channelId).then((function(r){if(r===a.SUCCESS){if(!s._isCPPMode){var c=z.get(e,t,s.channelId);c&&n.forEach((function(n){c.messageUId===n.messageUId&&z.remove(e,t,s.channelId)}))}ae(o.onSuccess)}else s.logger.warn(l.O,"deleteRemoteMessages ->code:".concat(r,",targetId:").concat(t)),se(o.onError,r)}))},e.prototype.clearRemoteHistoryMessages=function(e,t){var n=this;d("param.conversationType",e.conversationType,u.NUMBER,!0),d("param.targetId",e.targetId,u.STRING,!0),d("param.timestamp",e.timestamp,u.NUMBER,!0),d("callback",t,u.CALLBACK);var o=e.conversationType,s=e.targetId,r=e.timestamp;this.logger.info(l.O,"clearRemoteHistoryMessages ->targetId:".concat(s,",conversationType:").concat(o)),this._context.deleteRemoteMessageByTimestamp(o,s,r,this.channelId).then((function(e){e===a.SUCCESS?ae(t.onSuccess):(n.logger.warn(l.O,"clearRemoteHistoryMessages ->code:".concat(e)),se(t.onError,e))}))},e.prototype.getConversationListWithAllChannel=function(e){d("callback",e,u.CALLBACK),this._context.getConversationListWithAllChannel().then((function(t){var n=t.code,o=t.data;n===a.SUCCESS?ae(e.onSuccess,o.map(te)):se(e.onError,n)}))},e.prototype.getConversationListWithAllChannelByPage=function(e,t,n){d("callback",e,u.CALLBACK),d("index",t,u.NUMBER),d("limit",n,u.NUMBER),this._context.getConversationListWithAllChannelByPage(t,n).then((function(t){var n=t.code,o=t.data;n===a.SUCCESS?ae(e.onSuccess,o.map(te)):se(e.onError,n)}))},e.prototype.insertMessage=function(e,t,n,o,s){var r=this;void 0===s&&(s={});var c=n.senderUserId,i=n.objectName,g=n.content,d=n.messageDirection,u=n.messageUId,h=n.canIncludeExpansion,f=n.expansion,C=n.disableNotification,p=n.sentTime,S=n.sentStatus;this.logger.info(l.O,"insertMessage ->targetId:".concat(t,",conversationType:").concat(e));var m=s.isUnread,v={senderUserId:c,messageType:i,content:g,messageDirection:d,sentTime:p,sentStatus:S,searchContent:s.searchContent,isUnread:m,messageUId:u,disableNotification:C,canIncludeExpansion:h,expansionMsg:JSON.stringify(f),channelId:this.channelId};this._context.insertMessage(e,t,v).then((function(e){var n=e.code,s=e.data;n===a.SUCCESS?ae(o.onSuccess,ne(s)):(r.logger.warn(l.O,"insertMessage ->code:".concat(n,",targetId:").concat(t)),se(o.onError,n))}))},e.prototype.deleteLocalMessagesByTimestamp=function(e,t,n,o,s){var r=this;this.logger.info(l.O,"deleteLocalMessagesByTimestamp ->targetId:".concat(t,",conversationType:").concat(e,",timestamp:").concat(n)),this._context.deleteMessagesByTimestamp(e,t,n,o,this.channelId).then((function(e){e===a.SUCCESS?ae(s.onSuccess,!0):(r.logger.warn(l.O,"deleteLocalMessagesByTimestamp ->code:".concat(e,",targetId:").concat(t)),se(s.onError,e))}))},e.prototype.getRemoteHistoryMessages=function(e,t,n,o,s,r){var c=this;this.logger.info(l.O,"getRemoteHistoryMessages ->targetId:".concat(t,",conversationType:").concat(e));var i=r.order||0;this._context.getRemoteHistoryMessages(e,t,n,o,i,this.channelId).then((function(e){var n=e.code,o=e.data;if(n===a.SUCCESS)if(o){var r=o.list,i=o.hasMore,g=r.map((function(e){return ne(e)}));ae(s.onSuccess,g,i)}else ae(s.onSuccess,[],!1);else c.logger.warn(l.O,"getRemoteHistoryMessages ->code:".concat(n,",targetId:").concat(t)),se(s.onError,n)}))},e.prototype.clearMessages=function(e,t,n){var o=this;this.logger.info(l.O,"clearMessages ->targetId:".concat(t,",conversationType:").concat(e)),this._context.clearMessages(e,t,this.channelId).then((function(s){s===a.SUCCESS?(o._isCPPMode||z.remove(e,t,o.channelId),ae(n.onSuccess,!0)):(o.logger.warn(l.O,"clearMessages ->code:".concat(s,",targetId:").concat(t)),se(n.onError,s))}))},e.prototype.searchConversationByContent=function(e,t,n,o){var s=this;this.logger.info(l.O,"searchConversationByContent ->keyword:".concat(e)),this._context.searchConversationByContent(e,o,this.channelId,n).then((function(n){var o=n.code,r=n.data,c=[];r=r||[],o===a.SUCCESS?(r.forEach((function(e){c.push(te(e))})),ae(t.onSuccess,c)):(s.logger.warn(l.O,"searchConversationByContent ->code:".concat(o,",keyword:").concat(e)),se(t.onError,o))}))},e.prototype.searchConversationByContentWithAllChannel=function(e,t,n,o){var s=this;void 0===n&&(n=[]),this.logger.info("searchConversationByContentWithAllChannel ->keyword:".concat(e)),this._context.searchConversationByContentWithAllChannel(e,n,o).then((function(n){var o=n.code,r=n.data,c=[];r=r||[],o===a.SUCCESS?(r.forEach((function(e){c.push(te(e))})),ae(t.onSuccess,c)):(s.logger.warn(l.O,"searchConversationByContentWithAllChannel ->code:".concat(o,",keyword:").concat(e)),se(t.onError,o))}))},e.prototype.searchMessageByContent=function(e,t,n,o,s,r,c){var i=this;this.logger.info(l.O,"searchMessageByContent ->targetId:".concat(t,",conversationType:").concat(e,",keyword:").concat(n)),this._context.searchMessageByContent(e,t,n,o,s,r,this.channelId).then((function(e){var n=e.code,o=e.data,s=[];if(n===a.SUCCESS){var r=o=o||{},g=r.messages,d=r.count;g.forEach((function(e){s.push(ne(e))})),ae(c.onSuccess,s,d)}else i.logger.warn(l.O,"searchMessageByContent ->code:".concat(n,",targetId:").concat(t)),se(c.onError,n)}))},e.prototype.searchMessageByContentWithAllChannel=function(e,t,n,o,s,r){var c=this;this.logger.info("searchMessageByContentWithAllChannel ->targetId: ".concat(t," ,conversationType: ").concat(e," ,keyword: ").concat(n,", timestamp: ").concat(o,", count: ").concat(s)),this._context.searchMessageByContentWithAllChannel(e,t,n,o,s).then((function(e){var n=e.code,o=e.data,s=[];if(n===a.SUCCESS){var i=o=o||{},g=i.messages,d=i.count;g.forEach((function(e){s.push(ne(e))})),ae(r.onSuccess,s,d)}else c.logger.warn(l.O,"searchMessageByContentWithAllChannel ->code:".concat(n,",targetId:").concat(t)),se(r.onError,n)}))},e.prototype.searchMessageByContentInTimeRangeWithAllChannel=function(e,t,n,o,s,r,c,i){var g=this;this.logger.info("searchMessageByContentInTimeRangeWithAllChannel ->targetId: ".concat(t," ,conversationType: ").concat(e," ,keyword: ").concat(n,", startTime: ").concat(o,", endTime: ").concat(s,", offset: ").concat(r,", limit: ").concat(c)),this._context.searchMessageByContentInTimeRangeWithAllChannel(e,t,n,o,s,r,c).then((function(e){var n=e.code,o=e.data,s=[];n===a.SUCCESS?((o=o||{}).messages.forEach((function(e){s.push(ne(e))})),ae(i.onSuccess,s)):(g.logger.warn(l.O,"searchMessageByContentInTimeRangeWithAllChannel ->code:".concat(n,",targetId:").concat(t)),se(i.onError,n))}))},e.prototype.getUnreadMentionedMessages=function(e,t){return this.logger.info(l.O,"getUnreadMentionedMessages ->targetId:".concat(t,",conversationType:").concat(e)),this._context.getUnreadMentionedMessages(e,t,this.channelId).map((function(e){return ne(e)}))},e.prototype.clearUnreadCountByTimestamp=function(e,t,n,o){var s=this;this.logger.info(l.O,"clearUnreadCountByTimestamp ->targetId:".concat(t,",conversationType:").concat(e)),this._context.clearUnreadCountByTimestamp(e,t,n,this.channelId).then((function(e){e===a.SUCCESS?ae(o.onSuccess,!0):(s.logger.warn(l.O,"clearUnreadCountByTimestamp ->code:".concat(e,",targetId:").concat(t)),se(o.onError,e))}))},e.prototype.getConversationNotificationStatus=function(e,t,n){var o=this;this.logger.info(l.O,"getConversationNotificationStatus ->targetId:".concat(t,",conversationType:").concat(e)),this._context.getConversationNotificationStatus(e,t,this.channelId).then((function(e){var s=e.code,r=e.data;s===a.SUCCESS?ae(n.onSuccess,r):(o.logger.warn(l.O,"getConversationNotificationStatus ->code:".concat(s,",targetId:").concat(t)),se(n.onError,s))}))},e.prototype.getGroupMessageDeliverList=function(e,t,n){var o=this;this.logger.info("getGroupMessageDeliverList ->targetId:".concat(e,"',messageUId:").concat(t)),this._context.getGroupMessageDeliverList(e,t,this.channelId).then((function(e){var s=e.code,r=e.data;s===a.SUCCESS?ae(n.onSuccess,r):(o.logger.warn(l.O,"getGroupMessageDeliverList ->code:".concat(s,",messageUId:").concat(t)),se(n.onError,s))}))},e.prototype.getPrivateMessageDeliverTime=function(e,t){var n=this;this.logger.info("getPrivateMessageDeliverTime -> messageUId:".concat(e)),this._context.getPrivateMessageDeliverTime(e,this.channelId).then((function(o){var s=o.code,r=o.data;s===a.SUCCESS?ae(t.onSuccess,r):(n.logger.warn(l.O,"getPrivateMessageDeliverTime ->code:".concat(s,",messageUId:").concat(e)),se(t.onError,s))}))},e}(),le=function(e){return{targetId:e.targetId,channelId:e.channelId,conversationType:e.type}},he=function(){function e(e,t,n){this._context=e,this._options=t,this.logger=n,this._channelClient={},this._isCPPMode=g(),this._defaultChannelClient=new ue(this.logger,e,"",this._isCPPMode,t.readReceiptTimeout)}return e.prototype.assertCPPMode=function(e,t,n){if(!this._isCPPMode)return null==n||n.onError(a.NOT_SUPPORT),void this.logger.error(l.O,"'".concat(t,"' is unusable!"));e()},e.prototype.install=function(e,t){return this._context.install(e,t)},e.prototype.getChannel=function(e){if(this.logger.info(l.O,"getChannel ->channelId:".concat(e)),!this._isCPPMode)return this.logger.error(l.O,"getChannel method is only available in protocol stack mode"),null;if(d("channelId",e,u.STRING,!0),e.length>20)return this.logger.error(l.O,"The channelId cannot exceed 20 characters"),null;if(e in this._channelClient)return this._channelClient[e];if(Object.keys(this._channelClient).length>1e3)return this.logger.error(l.O,"Only 1000 channels can be obtained"),null;var t=new ue(this.logger,this._context,e,this._isCPPMode,this._options.readReceiptTimeout);return this._channelClient[e]=t,t},e.prototype.deleteChannels=function(e){var t=this;d("channelIds",e,u.ARRAY,!0),this.logger.info(l.O,"deleteChannels ->channelIds:".concat(e)),this.assertCPPMode((function(){e.forEach((function(e){delete t._channelClient[e]}))}),"deleteChannels")},e.prototype.getNavi=function(){return this._context.getInfoFromCache()||{}},e.prototype.getSDKInfo=function(){return{version:this._context.apiVersion}},e.prototype.getAppInfo=function(){return{appKey:this._context.appkey}},e.prototype.getCurrentUserId=function(){return this._context.getCurrentUserId()},e.prototype.disconnect=function(){return M(this,void 0,void 0,(function(){return T(this,(function(e){switch(e.label){case 0:return this.logger.info(l.A_DISCONNECT_O),[4,this._context.disconnect()];case 1:return e.sent(),[2]}}))}))},e.prototype.logout=function(){return this.disconnect()},e.prototype.clearCache=function(){},e.prototype.getDeviceId=function(){return this._context.getDeviceId()},e.prototype.getConversationList=function(e,t,n){this._defaultChannelClient.getConversationList(e,t,n)},e.prototype.getConversationListWithAllChannel=function(e){this._defaultChannelClient.getConversationListWithAllChannel(e)},e.prototype.getConversationListWithAllChannelByPage=function(e,t,n){void 0===n&&(n=30),this._defaultChannelClient.getConversationListWithAllChannelByPage(e,t,n)},e.prototype.getConversation=function(e,t,n){return this._defaultChannelClient.getConversation(e,t,n)},e.prototype.removeConversation=function(e,t,n){return this._defaultChannelClient.removeConversation(e,t,n)},e.prototype.saveTextMessageDraft=function(e,t,n){return this._defaultChannelClient.saveTextMessageDraft(e,t,n)},e.prototype.getTextMessageDraft=function(e,t){return this._defaultChannelClient.getTextMessageDraft(e,t)},e.prototype.clearTextMessageDraft=function(e,t){return this._defaultChannelClient.clearTextMessageDraft(e,t)},e.prototype.getTotalUnreadCount=function(e,t,n){return this._defaultChannelClient.getTotalUnreadCount(e,t,n)},e.prototype.getUnreadCount=function(e,t,n){return this._defaultChannelClient.getUnreadCount(e,t,n)},e.prototype.getConversationUnreadCount=function(e,t){this.logger.error(l.O,"Method is deprecated")},e.prototype.clearConversations=function(e,t){return this._defaultChannelClient.clearConversations(e,t)},e.prototype.clearUnreadCount=function(e,t,n){this._defaultChannelClient.clearUnreadCount(e,t,n)},e.prototype.clearAllUnreadCount=function(e){this._defaultChannelClient.clearAllUnreadCount(e)},e.prototype.setConversationStatus=function(e,t,n,o){return this._defaultChannelClient.setConversationStatus(e,t,n,o)},e.prototype.sendMessage=function(e,t,n,o,a,s,r,c,i){return this._defaultChannelClient.sendMessage(e,t,n,o,a,s,r,i)},e.prototype.sendRecallMessage=function(e,t,n){return this._defaultChannelClient.sendRecallMessage(e,t,n)},e.prototype.sendTypingStatusMessage=function(e,t,n,o){return this._defaultChannelClient.sendTypingStatusMessage(e,t,n,o)},e.prototype.sendReceiptResponse=function(e,t,n){return this._defaultChannelClient.sendReceiptResponse(e,t,n)},e.prototype.sendReadReceiptMessage=function(e,t,n){return this._defaultChannelClient.sendReadReceiptMessage(e,t,n)},e.prototype.getMessageReader=function(e,t,n){this._defaultChannelClient.getMessageReader(e,t,n)},e.prototype.updateMessageExpansion=function(e,t,n){this._defaultChannelClient.updateMessageExpansion(e,t,n)},e.prototype.removeMessageExpansionForKey=function(e,t,n){this._defaultChannelClient.removeMessageExpansionForKey(e,t,n)},e.prototype.getHistoryMessages=function(e,t,n,o,a,s,r){return this._defaultChannelClient.getHistoryMessages(e,t,n,o,a,s,r)},e.prototype.joinChatRoom=function(e,t,n){var o=this;d("chatRoomId",e,u.STRING,!0),d("count",t,u.NUMBER,!0),d("callback",n,u.CALLBACK),this.logger.info(l.O,"joinChatRoom ->chatRoomId:".concat(e));var s=this.logger.createTraceId();this.logger.info(l.A_JOIN_CHATROOM_T,JSON.stringify({chatroomId:e,count:t,joinExist:!1}),s),this._context.joinChatroom(e,t,s).then((function(t){var r=t===a.SUCCESS?"info":"warn";o.logger[r](l.A_JOIN_CHATROOM_R,JSON.stringify({code:t,timestamp:(new Date).getTime()}),s),t===a.SUCCESS?ae(n.onSuccess):(o.logger.warn(l.O,"joinChatRoom ->code:".concat(t,",chatRoomId:").concat(e)),se(n.onError,t))}))},e.prototype.quitChatRoom=function(e,t){var n=this;d("chatRoomId",e,u.STRING,!0),d("callback",t,u.CALLBACK),this.logger.info(l.O,"quitChatRoom ->chatRoomId:".concat(e));var o=this.logger.createTraceId();this.logger.info(l.A_QUIT_CHATROOM_T,JSON.stringify({chatroomId:e}),o),this._context.quitChatroom(e).then((function(s){var r=s===a.SUCCESS?"info":"warn";n.logger[r](l.A_QUIT_CHATROOM_R,JSON.stringify({code:s}),o),s===a.SUCCESS?ae(t.onSuccess):(n.logger.warn(l.O,"quitChatRoom ->code:".concat(s,",chatRoomId:").concat(e)),se(t.onError,s))}))},e.prototype.getChatRoomInfo=function(e,t,n,o){var s=this;d("chatRoomId",e,u.STRING,!0),d("count",t,u.NUMBER,!0),d("order",n,u.NUMBER,!0),d("callback",o,u.CALLBACK),this.logger.info(l.O,"getChatRoomInfo ->chatRoomId:".concat(e)),this._context.getChatroomInfo(e,t,n).then((function(t){var n=t.code,r=t.data;n===a.SUCCESS?ae(o.onSuccess,{userInfos:(null==r?void 0:r.userInfos)||[],userTotalNums:(null==r?void 0:r.userCount)||0}):(s.logger.warn(l.O,"getChatRoomInfo ->code:".concat(n,",chatRoomId:").concat(e)),se(o.onError,n))}))},e.prototype.setChatroomEntry=function(e,t,n){var o=this;d("chatRoomId",e,u.STRING,!0),d("chatroomEntry",t,u.OBJECT,!0),d("callback",n,u.CALLBACK),this.logger.info(l.O,"setChatroomEntry ->chatRoomId:".concat(e)),this._context.setChatroomEntry(e,t).then((function(t){t===a.SUCCESS?ae(n.onSuccess):(o.logger.warn(l.O,"setChatroomEntry ->code:".concat(t,",chatRoomId:").concat(e)),se(n.onError,t))}))},e.prototype.setChatRoomEntries=function(e,t,n){var o=this;if(d("chatRoomId",e,u.STRING,!0),function(e){e.entries.forEach((function(e){d("entry.key",e.key,u.STRING,!0),d("entry.value",e.value,u.STRING,!0)})),d("options.isAutoDelete",e.isAutoDelete,u.BOOLEAN)}(t),d("callback",n,u.CALLBACK),t.entries.length>10)se(n.onError,a.CHATROOM_KV_STORE_OUT_LIMIT);else{var s="id:".concat(e);this.logger.info(l.O,"set chatroom entry->".concat(s)),this._context.setChatroomEntries(e,t).then((function(e){var t=e.code,r=e.data;t===a.SUCCESS?ae(n.onSuccess):(o.logger.warn(l.O,"set chatroom entry fail ->code+:".concat(t,",").concat(s)),se(n.onError,t,r))}))}},e.prototype.forceSetChatroomEntry=function(e,t,n){var o=this;d("chatRoomId",e,u.STRING,!0),d("chatroomEntry",t,u.OBJECT,!0),d("callback",n,u.CALLBACK),this.logger.info(l.O,"forceSetChatroomEntry ->chatRoomId:".concat(e)),this._context.forceSetChatroomEntry(e,t).then((function(t){t===a.SUCCESS?ae(n.onSuccess):(o.logger.warn(l.O,"forceSetChatroomEntry ->code:".concat(t,",chatRoomId:").concat(e)),se(n.onError,t))}))},e.prototype.removeChatroomEntry=function(e,t,n){var o=this;d("chatRoomId",e,u.STRING,!0),d("chatroomEntry",t,u.OBJECT,!0),d("callback",n,u.CALLBACK),this.logger.info(l.O,"removeChatroomEntry ->chatRoomId:".concat(e)),this._context.removeChatroomEntry(e,t).then((function(t){t===a.SUCCESS?ae(n.onSuccess):(o.logger.warn(l.O,"removeChatroomEntry ->code:".concat(t,",chatRoomId:").concat(e)),se(n.onError,t))}))},e.prototype.removeChatRoomEntries=function(e,t,n){var o=this;d("chatRoomId",e,u.STRING,!0),function(e){e.entries.forEach((function(e){d("key",e,u.STRING,!0)}))}(t);var s="id:".concat(e);this.logger.debug(l.O,"remove chatroom entry->".concat(s));var r=y({},t);r.entries=t.entries.map((function(e){return{key:e}})),this._context.removeChatroomEntries(e,r).then((function(e){var t=e.code,r=e.data;t===a.SUCCESS?ae(n.onSuccess):(o.logger.warn(l.O,"remove chatroom entry fail ->code+:".concat(t,",").concat(s)),se(n.onError,t,r))}))},e.prototype.forceRemoveChatroomEntry=function(e,t,n){var o=this;d("chatRoomId",e,u.STRING,!0),d("chatroomEntry",t,u.OBJECT,!0),d("callback",n,u.CALLBACK),this.logger.info(l.O,"forceRemoveChatroomEntry ->chatRoomId:".concat(e)),this._context.forceRemoveChatroomEntry(e,t).then((function(t){t===a.SUCCESS?ae(n.onSuccess):(o.logger.warn(l.O,"forceRemoveChatroomEntry ->code:".concat(t,",chatRoomId:").concat(e)),se(n.onError,t))}))},e.prototype.getChatroomEntry=function(e,t,n){var o=this;d("chatRoomId",e,u.STRING,!0),d("key",t,u.STRING,!0),d("callback",n,u.CALLBACK),this.logger.info(l.O,"getChatroomEntry ->chatRoomId:".concat(e,",key:").concat(t)),this._context.getChatroomEntry(e,t).then((function(t){var s=t.code,r=t.data;s===a.SUCCESS?ae(n.onSuccess,r||""):(o.logger.warn(l.O,"getChatroomEntry ->code:".concat(s,",chatRoomId:").concat(e)),se(n.onError,s))}))},e.prototype.getAllChatroomEntries=function(e,t){var n=this;d("chatRoomId",e,u.STRING,!0),d("callback",t,u.CALLBACK),this.logger.info(l.O,"getAllChatroomEntries ->chatRoomId:".concat(e)),this._context.getAllChatroomEntries(e).then((function(o){var s=o.code,r=o.data;s===a.SUCCESS?ae(t.onSuccess,r):(n.logger.warn(l.O,"getAllChatroomEntries ->code:".concat(s,",chatRoomId:").concat(e)),se(t.onError,s))}))},e.prototype.getChatRoomHistoryMessages=function(e,t,n,o,s){var r=this;void 0===s&&(s=0),d("chatRoomId",e,u.STRING,!0),d("count",t,u.NUMBER,!0),d("order",n,u.NUMBER,!0),d("callback",o,u.CALLBACK),d("timestamp",s,u.NUMBER),this.logger.info(l.O,"getChatRoomHistoryMessages ->chatRoomId:".concat(e)),this._context.getChatRoomHistoryMessages(e,t,n,s).then((function(t){var n=t.code,s=t.data;if(n===a.SUCCESS)if(s){var c=s.list,i=s.hasMore,g=c.map((function(e){return ne(e)}));ae(o.onSuccess,g,i)}else ae(o.onSuccess,[],!1);else r.logger.warn(l.O,"getChatRoomHistoryMessages ->code:".concat(n,",chatRoomId:").concat(e)),se(o.onError,n)}))},e.prototype.setDeviceInfo=function(e){},e.prototype.getCurrentConnectionStatus=function(){return this._context.getConnectionStatus()},e.prototype.deleteRemoteMessages=function(e,t,n,o){return this._defaultChannelClient.deleteRemoteMessages(e,t,n,o)},e.prototype.clearRemoteHistoryMessages=function(e,t){return this._defaultChannelClient.clearRemoteHistoryMessages(e,t)},e.prototype.getFileToken=function(e,t,n,o,a){d("fileType",e,u.NUMBER,!0),d("fileName",n,u.STRING),d("callback",t,u.CALLBACK),this.logger.info(l.O,"getFileToken ->fileType:".concat(e,",fileName:").concat(n,",queryString:").concat(a)),this._context.getFileToken(e,n,o,a).then(t.onSuccess).catch(t.onError)},e.prototype.getFileUrl=function(e,t,n,o,a,s){d("fileType",e,u.NUMBER,!0),d("fileName",t,u.STRING,!0),d("saveName",n,u.STRING),d("callback",o,u.CALLBACK),d("serverType",s,u.NUMBER),d("uploadRes",a,u.OBJECT),this.logger.info(l.O,"getFileUrl ->fileType:".concat(e,",fileName:").concat(t)),this._context.getFileUrl(e,t,n,a,s).then(o.onSuccess).catch(o.onError)},e.prototype.createTag=function(e,t){var n=this;d("tag.tagId",e.tagId,u.STRING,!0),d("tag.tagId",e.tagId,(function(e){return e.length<=10})),d("tag.tagName",e.tagName,(function(e){return e.length<=15})),d("tag.tagName",e.tagName,u.STRING,!0),d("callback",t,u.CALLBACK),this.logger.info(l.O,"createTag ->tagId:".concat(e.tagId,",tagName:").concat(e.tagName)),this._context.createTag(e).then((function(o){var s=o.code;s===a.SUCCESS?t.onSuccess():(n.logger.warn(l.O,"createTag ->code:".concat(s,",tagId:").concat(e.tagId)),t.onError(s))})).catch((function(o){n.logger.warn(l.O,"createTag ->code:".concat(o,",tagId:").concat(e.tagId)),t.onError(o)}))},e.prototype.removeTag=function(e,t){var n=this;d("tagId",e,u.STRING,!0),d("callback",t,u.CALLBACK),this.logger.info(l.O,"removeTag ->tagId:".concat(e)),this._context.removeTag(e).then((function(o){var s=o.code;s===a.SUCCESS?t.onSuccess():(n.logger.warn(l.O,"removeTag ->code:".concat(s,",tagId:").concat(e)),t.onError(s))})).catch((function(o){n.logger.warn(l.O,"removeTag ->code:".concat(o,",tagId:").concat(e)),t.onError(o)}))},e.prototype.updateTag=function(e,t){var n=this;d("tag.tagId",e.tagId,u.STRING,!0),d("tag.tagName",e.tagName,u.STRING,!0),d("tag.tagName",e.tagName,(function(e){return e.length<=15})),d("callback",t,u.CALLBACK),this.logger.info(l.O,"updateTag ->tagId:".concat(e.tagId,",tagName:").concat(e.tagName)),this._context.updateTag(e).then((function(o){var s=o.code;s===a.SUCCESS?t.onSuccess():(n.logger.warn(l.O,"updateTag ->code:".concat(s,",tagId:").concat(e.tagId)),t.onError(s))})).catch((function(o){n.logger.warn(l.O,"updateTag ->reason:".concat(o,",tagId:").concat(e.tagId)),t.onError(o)}))},e.prototype.getTagList=function(e){var t=this;d("callback",e,u.CALLBACK),this._context.getTagList().then((function(n){var o=n.code,s=n.data;o===a.SUCCESS?e.onSuccess(s||[]):(t.logger.warn(l.O,"getTagList ->code:".concat(o)),e.onError(o))})).catch((function(n){t.logger.warn(l.O,"getTagList ->reason:".concat(n)),e.onError(n)}))},e.prototype.getTagsForConversation=function(e,t){var n=this;d("conversationType",e.type,u.NUMBER),d("targetId",e.targetId,u.STRING),d("channelId",e.channelId,u.ONLY_STRING),d("callback",t,u.CALLBACK),this.logger.info(l.O,"getTagsForConversation ->targetId:".concat(e.targetId,",conversationType:").concat(e.type)),this._context.getTagsForConversation(le(e)).then((function(e){var o=e.code,s=e.data;o===a.SUCCESS?t.onSuccess(s||[]):(n.logger.warn(l.O,"getTagsForConversation ->code:".concat(o)),t.onError(o))})).catch((function(e){n.logger.warn(l.O,"getTagsForConversation ->reason:".concat(e)),t.onError(e)}))},e.prototype.addTagForConversations=function(e,t,n){var o=this;d("tagId",e,u.STRING,!0),d("conversations",t,u.ARRAY,!0),d("callback",n,u.CALLBACK),t.forEach((function(e){d("conversation.type",e.type,u.NUMBER,!0),d("conversation.targetId",e.targetId,u.STRING,!0),d("conversation.channelId",e.channelId,u.ONLY_STRING)})),this.logger.info(l.O,"addTagForConversations ->tagId:".concat(e)),this._context.addTagForConversations(e,t.map((function(e){return le(e)}))).then((function(t){var s=t.code;t.data,s===a.SUCCESS?n.onSuccess():(o.logger.warn(l.O,"addTagForConversations ->code:".concat(s,",tagId:").concat(e)),n.onError(s))})).catch((function(t){o.logger.warn(l.O,"addTagForConversations ->reason:".concat(t,",tagId:").concat(e)),n.onError(t)}))},e.prototype.removeTagForConversations=function(e,t,n){var o=this;d("tagId",e,u.STRING,!0),d("conversations",t,u.ARRAY,!0),d("callback",n,u.CALLBACK),t.forEach((function(e){d("conversation.type",e.type,u.NUMBER,!0),d("conversation.targetId",e.targetId,u.STRING,!0),d("conversation.channelId",e.channelId,u.ONLY_STRING)})),this.logger.info(l.O,"removeTagForConversations ->tagId:".concat(e)),this._context.removeTagForConversations(e,t.map((function(e){return le(e)}))).then((function(t){var s=t.code;t.data,s===a.SUCCESS?n.onSuccess():(o.logger.warn(l.O,"removeTagForConversations ->code:".concat(s,",tagId:").concat(e)),n.onError(s))})).catch((function(t){o.logger.warn(l.O,"removeTagForConversations ->reason:".concat(t,",tagId:").concat(e)),n.onError(t)}))},e.prototype.removeTagsForConversation=function(e,t,n){var o=this;d("conversation.type",e.type,u.NUMBER,!0),d("conversation.targetId",e.targetId,u.STRING,!0),d("conversation.channelId",e.channelId,u.ONLY_STRING),d("tagIds",t,u.ARRAY,!0),d("callback",n,u.CALLBACK),t.forEach((function(e){d("tagId",e,u.STRING,!0)})),this.logger.info(l.O,"removeTagsForConversation ->tagIds:".concat(t,",targetId:").concat(e.targetId,",type:").concat(e.type)),this._context.removeTagsForConversation(le(e),t).then((function(e){var s=e.code;e.data,s===a.SUCCESS?n.onSuccess():(o.logger.warn(l.O,"removeTagsForConversation ->code:".concat(s,",tagIds:").concat(t)),n.onError(s))})).catch((function(e){o.logger.warn(l.O,"removeTagsForConversation ->reason:".concat(e,",tagIds:").concat(t)),n.onError(e)}))},e.prototype.getConversationListByTag=function(e,t,n,o){var s=this;d("tagId",e,u.STRING,!0),d("count",t,u.NUMBER,!0),d("startTime",n,u.NUMBER,!0),d("callback",o,u.CALLBACK,!0),this.logger.info(l.O,"getConversationListByTag ->tagId:".concat(e)),this._context.getConversationListByTag(e,n,t).then((function(t){var n=t.code,r=t.data,c=[];n===a.SUCCESS?((r=r||[]).forEach((function(e){c.push(function(e){var t=e.channelId,n=e.conversationType,o=e.targetId,a=e.unreadMessageCount,s=e.latestMessage,r=e.isTop,c=e.notificationStatus,i=e.isTopInTag,g=s?ne(s):null,d=g||{};return d.messageType,d.sentTime,d.receivedStatus,d.messageId,{channelId:t||"",conversationType:n,targetId:o,unreadMessageCount:a,latestMessage:g,isTopInTag:i,latestMessageId:null==g?void 0:g.messageId,objectName:null==g?void 0:g.messageType,sentTime:null==g?void 0:g.sentTime,isTop:r,notificationStatus:c,receivedStatus:null==g?void 0:g.receivedStatus}}(e))})),o.onSuccess(c)):(s.logger.warn(l.O,"getConversationListByTag ->code:".concat(n,",tagId:").concat(e)),o.onError(n))})).catch((function(t){s.logger.warn(l.O,"getConversationListByTag ->reason:".concat(t,",tagId:").concat(e)),o.onError(t)}))},e.prototype.getUnreadCountByTag=function(e,t,n){var o=this;d("tagId",e,u.STRING,!0),d("containMuted",t,u.BOOLEAN,!0),d("callback",n,u.CALLBACK),this.logger.info(l.O,"getUnreadCountByTag ->tagId:".concat(e)),this._context.getUnreadCountByTag(e,t).then((function(t){var s=t.code,r=t.data;o.logger.info(l.O,JSON.stringify({code:s,data:r})),s===a.SUCCESS?n.onSuccess(r||0):(o.logger.warn(l.O,"getUnreadCountByTag ->code:".concat(s,",tagId:").concat(e)),n.onError(s))})).catch((function(t){o.logger.warn(l.O,"getUnreadCountByTag ->reason:".concat(t,",tagId:").concat(e)),n.onError(t)}))},e.prototype.setConversationStatusInTag=function(e,t,n,o){var s=this;d("tagId",e,u.STRING,!0),d("conversation.targetId",t.targetId,u.STRING,!0),d("conversation.type",t.type,u.NUMBER,!0),d("conversation.channelId",t.channelId,u.ONLY_STRING),d("status.isTop",null==n?void 0:n.isTop,u.BOOLEAN,!0),d("callback",o,u.CALLBACK),this.logger.info(l.O,"setConversationStatusInTag ->tagId:".concat(e,",targetId:").concat(t.targetId,",type").concat(t.type)),this._context.setConversationStatusInTag(e,le(t),n).then((function(t){var n=t.code;t.data,n===a.SUCCESS?o.onSuccess():(s.logger.warn(l.O,"setConversationStatusInTag ->code:".concat(n,",tagId:").concat(e)),o.onError(n))})).catch((function(t){s.logger.warn(l.O,"setConversationStatusInTag ->reason:".concat(t,",tagId:").concat(e)),o.onError(t)}))},e.prototype.callExtra=function(e,t){for(var n,o=this,s=[],r=2;r<arguments.length;r++)s[r-2]=arguments[r];this.logger.info(l.O,"callExtra ->method:".concat(e)),(n=this._context).callExtra.apply(n,E([e],s,!1)).then((function(n){var s=n.code,r=n.data;if(s!==a.SUCCESS)o.logger.warn(l.O,"callExtra ->code:".concat(s)),t.onError&&se(t.onError,s);else{if("getConversationsByPage"===e&&r.forEach((function(e){e.latestMessage=e.latestMessage?ne(e.latestMessage):null})),"getHistoryMessagesByObjectNames"===e){var c=r,i=c.list,g=c.hasMore,d=i.map((function(e){return ne(e)}));return void ae(t.onSuccess,d,g)}t.onSuccess&&ae(t.onSuccess,r)}}))},e.prototype.hasRemoteUnreadMessages=function(e,t){d("callback",t,u.CALLBACK),this.logger.info(l.O,"hasRemoteUnreadMessages ->token:".concat(e)),this.assertCPPMode((function(){ae(t.onSuccess,!1)}),"hasRemoteUnreadMessages",t)},e.prototype.setUserStatusListener=function(e,t){var n=this;this.logger.info(l.O,"setUserStatusListener ->userIds:".concat(e.userIds)),this.assertCPPMode((function(){n._context.setUserStatusListener(e,t)}),"setUserStatusListener")},e.prototype.setUserStatus=function(e,t){var n=this;d("status",e,u.NUMBER),d("callback",t,u.CALLBACK),this.logger.info(l.O,"setUserStatus ->status:".concat(e)),this.assertCPPMode((function(){n._context.setUserStatus(e).then((function(e){e===a.SUCCESS?ae(t.onSuccess,!0):(n.logger.warn(l.O,"setUserStatus ->code:".concat(e)),se(t.onError,e))}))}),"setUserStatus",t)},e.prototype.getUserStatus=function(e,t){var n=this;d("userId",e,u.STRING),d("callback",t,u.CALLBACK),this.logger.info(l.O,"getUserStatus ->userId:".concat(e)),this.assertCPPMode((function(){n._context.getUserStatus(e).then((function(o){var s=o.code,r=o.data;s===a.SUCCESS?ae(t.onSuccess,r):(n.logger.warn(l.O,"getUserStatus ->code:".concat(s,",useerId:").concat(e)),se(t.onError,s))}))}),"getUserStatus",t)},e.prototype.addToBlacklist=function(e,t){var n=this;d("userId",e,u.STRING),d("callback",t,u.CALLBACK),this.logger.info(l.O,"addToBlacklist ->userId:".concat(e)),this.assertCPPMode((function(){n._context.addToBlacklist(e).then((function(o){o===a.SUCCESS?ae(t.onSuccess):(n.logger.warn(l.O,"addToBlacklist ->code:".concat(o,",useerId:").concat(e)),se(t.onError,o))}))}),"addToBlacklist",t)},e.prototype.removeFromBlacklist=function(e,t){var n=this;d("userId",e,u.STRING),d("callback",t,u.CALLBACK),this.logger.info(l.O,"removeFromBlacklist ->userId:".concat(e)),this.assertCPPMode((function(){n._context.removeFromBlacklist(e).then((function(o){o===a.SUCCESS?ae(t.onSuccess):(n.logger.warn(l.O,"removeFromBlacklist ->code:".concat(o,",useerId:").concat(e)),se(t.onError,o))}))}),"removeFromBlacklist",t)},e.prototype.getBlacklist=function(e){var t=this;d("callback",e,u.CALLBACK),this.assertCPPMode((function(){t._context.getBlacklist().then((function(n){var o=n.code,s=n.data;o===a.SUCCESS?ae(e.onSuccess,s):(t.logger.warn(l.O,"getBlacklist ->code:".concat(o)),se(e.onError,o))}))}),"getBlacklist",e)},e.prototype.getBlacklistStatus=function(e,t){var n=this;d("userId",e,u.STRING),d("callback",t,u.CALLBACK),this.logger.info(l.O,"getBlacklistStatus ->userId:".concat(e)),this.assertCPPMode((function(){n._context.getBlacklistStatus(e).then((function(o){var s=o.code,r=o.data;s===a.SUCCESS?ae(t.onSuccess,r):(n.logger.warn(l.O,"getBlacklistStatus ->code:".concat(s,",userId:").concat(e)),se(t.onError,s))}))}),"getBlacklistStatus",t)},e.prototype.insertMessage=function(e,t,n,o,a){var s=this;void 0===a&&(a={}),d("conversationType",e,u.NUMBER,!0),d("targetId",t,u.STRING,!0),d("content.senderUserId",n.senderUserId,u.STRING,!0),d("callback",o,u.CALLBACK),this.logger.info(l.O,"insertMessage ->targetId:".concat(t,",conversationType:").concat(e,",senderUserId:").concat(n.senderUserId)),this.assertCPPMode((function(){s._defaultChannelClient.insertMessage(e,t,n,o,a)}),"insertMessage",o)},e.prototype.getRemoteHistoryMessages=function(e,t,n,o,a,s){var r=this;void 0===s&&(s={}),d("conversationType",e,u.NUMBER,!0),d("targetId",t,u.STRING,!0),d("timestamp",n,u.NUMBER,!0),d("count",o,u.NUMBER,!0),d("callback",a,u.CALLBACK),d("options.order",s.order,u.NUMBER),this.assertCPPMode((function(){r._defaultChannelClient.getRemoteHistoryMessages(e,t,n,o,a,s)}),"getRemoteHistoryMessages",a)},e.prototype.deleteLocalMessages=function(e,t,n,o){var s=this;d("messageIds",n,u.ARRAY,!0),d("callback",o,u.CALLBACK),this.logger.info(l.O,"deleteLocalMessages ->messageIds:".concat(n)),this.assertCPPMode((function(){s._context.deleteMessages(n).then((function(e){e===a.SUCCESS?ae(o.onSuccess,!0):(s.logger.warn(l.O,"deleteLocalMessages ->code:".concat(e,",messageIds:").concat(n)),se(o.onError,e))}))}),"deleteLocalMessages",o)},e.prototype.deleteLocalMessagesByTimestamp=function(e,t,n,o,a){var s=this;d("conversationType",e,u.NUMBER,!0),d("targetId",t,u.STRING,!0),d("timestamp",n,u.NUMBER,!0),d("cleanSpace",o,u.BOOLEAN),d("callback",a,u.CALLBACK),this.assertCPPMode((function(){s._defaultChannelClient.deleteLocalMessagesByTimestamp(e,t,n,o,a)}),"deleteLocalMessagesByTimestamp",a)},e.prototype.clearMessages=function(e,t,n){var o=this;d("conversationType",e,u.NUMBER,!0),d("targetId",t,u.STRING,!0),d("callback",n,u.CALLBACK),this.assertCPPMode((function(){o._defaultChannelClient.clearMessages(e,t,n)}),"clearMessages",n)},e.prototype.getMessage=function(e,t){var n=this;d("callback",t,u.CALLBACK),this.assertCPPMode((function(){n._context.getMessage(e).then((function(o){var s=o.code,r=o.data;s===a.SUCCESS?ae(t.onSuccess,ne(r)):(n.logger.warn(l.O,"getMessage ->code:".concat(s,",messageId:").concat(e)),se(t.onError,s))}))}),"getMessage",t)},e.prototype.setMessageSentStatus=function(e,t,n){var o=this;d("messageId",e,u.NUMBER,!0),d("sentStatus",t,u.NUMBER,!0),this.logger.info(l.O,"setMessageSentStatus ->messageId:".concat(e,",sentStatus:").concat(t)),this.assertCPPMode((function(){o._context.setMessageSentStatus(e,t).then((function(t){t===a.SUCCESS?ae(n.onSuccess,!0):(o.logger.warn(l.O,"setMessageSentStatus ->code:".concat(t,",messageId:").concat(e)),se(n.onError,t))}))}),"setMessageSentStatus",n)},e.prototype.setMessageReceivedStatus=function(e,t,n){var o=this;d("messageId",e,u.NUMBER,!0),d("receivedStatus",t,u.NUMBER,!0),this.logger.info(l.O,"setMessageReceivedStatus ->messageId:".concat(e,",receivedStatus:").concat(t)),this.assertCPPMode((function(){o._context.setMessageReceivedStatus(e,t).then((function(t){t===a.SUCCESS?ae(n.onSuccess,!0):(o.logger.warn(l.O,"setMessageReceivedStatus ->code:".concat(t,",messageId:").concat(e)),se(n.onError,t))}))}),"setMessageReceivedStatus",n)},e.prototype.setMessageContent=function(e,t,n,o){var s=this;d("messageId",e,u.NUMBER,!0),d("objectName",n,u.ONLY_STRING,!0),this.logger.info(l.O,"setMessageContent ->messageId:".concat(e,",objectName:").concat(n)),this.assertCPPMode((function(){s._context.setMessageContent(e,t,n).then((function(t){t===a.SUCCESS?ae(o.onSuccess,!0):(s.logger.warn(l.O,"setMessageContent ->code:".concat(t,",messageId:").concat(e)),se(o.onError,t))}))}),"setMessageContent",o)},e.prototype.setMessageSearchField=function(e,t,n){var o=this;d("messageId",e,u.NUMBER,!0),d("searchFiles",n,u.STRING,!0),this.logger.info(l.O,"setMessageSearchField ->messageId:".concat(e,",searchFiles:").concat(n)),this.assertCPPMode((function(){o._context.setMessageSearchField(e,t,n)}),"setMessageSearchField")},e.prototype.searchConversationByContent=function(e,t,n,o){var a=this;d("keyword",e,u.STRING,!0),d("callback",t,u.CALLBACK),d("conversationTypes",n,u.ARRAY),d("customMessageType",o,u.ARRAY),this.assertCPPMode((function(){a._defaultChannelClient.searchConversationByContent(e,t,n,o)}),"searchConversationByContent",t)},e.prototype.searchConversationByContentWithAllChannel=function(e,t,n,o){var a=this;void 0===n&&(n=[]),d("keyword",e,u.STRING,!0),d("callback",t,u.CALLBACK),d("conversationTypes",o,u.ARRAY),d("customMessageType",n,u.ARRAY),this.assertCPPMode((function(){a._defaultChannelClient.searchConversationByContentWithAllChannel(e,t,n,o)}),"searchConversationByContentWithAllChannel",t)},e.prototype.searchMessageByContent=function(e,t,n,o,a,s,r){var c=this;d("conversationType",e,u.NUMBER,!0),d("targetId",t,u.STRING,!0),d("keyword",n,u.STRING,!0),d("timestamp",o,u.NUMBER),d("count",a,u.NUMBER),d("total",s,u.NUMBER),d("callback",r,u.CALLBACK),this.assertCPPMode((function(){c._defaultChannelClient.searchMessageByContent(e,t,n,o,a,s,r)}),"searchMessageByContent",r)},e.prototype.searchMessageByContentWithAllChannel=function(e,t,n,o,a,s){var r=this;d("conversationType",e,u.NUMBER,!0),d("targetId",t,u.STRING,!0),d("keyword",n,u.STRING,!0),d("timestamp",o,u.NUMBER),d("count",a,u.NUMBER),d("callback",s,u.CALLBACK),this.assertCPPMode((function(){r._defaultChannelClient.searchMessageByContentWithAllChannel(e,t,n,o,a,s)}),"searchMessageByContentWithAllChannel",s)},e.prototype.searchMessageByContentInTimeRangeWithAllChannel=function(e,t,n,o,a,s,r,c){var i=this;d("conversationType",e,u.NUMBER,!0),d("targetId",t,u.STRING,!0),d("keyword",n,u.STRING,!0),d("startTime",o,u.NUMBER),d("endTime",a,u.NUMBER),d("offset",s,u.NUMBER),d("limit",r,u.NUMBER),d("callback",c,u.CALLBACK),this.assertCPPMode((function(){i._defaultChannelClient.searchMessageByContentInTimeRangeWithAllChannel(e,t,n,o,a,s,r,c)}),"searchMessageByContentInTimeRangeWithAllChannel",c)},e.prototype.getUnreadMentionedMessages=function(e,t){return this._isCPPMode?(d("conversationType",e,u.NUMBER,!0),d("targetId",t,u.STRING,!0),this._defaultChannelClient.getUnreadMentionedMessages(e,t)):(this.logger.error(l.O,"getUnreadMentionedMessages method is not supported in a browser!"),null)},e.prototype.clearUnreadCountByTimestamp=function(e,t,n,o){var a=this;d("conversationType",e,u.NUMBER,!0),d("targetId",t,u.STRING,!0),d("timestamp",n,u.NUMBER,!0),this.assertCPPMode((function(){a._defaultChannelClient.clearUnreadCountByTimestamp(e,t,n,o)}),"clearUnreadCountByTimestamp",o)},e.prototype.getFirstUnreadMessage=function(e,t,n){return this._defaultChannelClient.getFirstUnreadMessage(e,t,n)},e.prototype.getConversationNotificationStatus=function(e,t,n){var o=this;d("conversationType",e,u.NUMBER,!0),d("targetId",t,u.STRING,!0),this.assertCPPMode((function(){o._defaultChannelClient.getConversationNotificationStatus(e,t,n)}),"getConversationNotificationStatus",n)},e.prototype.getServerTime=function(){return this._context.getServerTime()},e.prototype.getGroupMessageDeliverList=function(e,t,n){this._defaultChannelClient.getGroupMessageDeliverList(e,t,n)},e.prototype.getPrivateMessageDeliverTime=function(e,t){this._defaultChannelClient.getPrivateMessageDeliverTime(e,t)},e.prototype.getRTCUserInfoList=function(e,t){var n=this;this.logger.info(l.O,"getRTCUserInfoList ->roomId:".concat(e.id)),this._context.getRTCUserInfoList(e.id).then((function(o){var s=o.code,r=o.data;if(s!==a.SUCCESS)n.logger.warn(l.O,"getRTCUserInfoList ->code:".concat(s,",roomId:").concat(e.id)),t.onError(s);else{var c=null==r?void 0:r.users;t.onSuccess(c)}})).catch((function(o){n.logger.warn(l.O,"getRTCUserInfoList ->error:".concat(o,",roomId:").concat(e.id)),t.onError(o)}))},e.prototype.getRTCUserList=function(e,t){var n=this;this.logger.info(l.O,"getRTCUserList ->roomId:".concat(e.id)),this._context.getRTCUserList(e.id).then((function(o){var s=o.code,r=o.data;s!==a.SUCCESS?(n.logger.warn(l.O,"getRTCUserList ->code:".concat(s,",roomId:").concat(e.id)),t.onError(s)):t.onSuccess(r)})).catch((function(o){n.logger.warn(l.O,"getRTCUserList ->error:".concat(o,",roomId:").concat(e.id)),t.onError(o)}))},e.prototype.setRTCUserInfo=function(e,t,n){var o=this;this.logger.info(l.O,"setRTCUserInfo ->roomId:".concat(e.id,",info:").concat(JSON.stringify(t||{}))),this._context.setRTCUserInfo(e.id,t.key,t.value).then((function(s){s!==a.SUCCESS?(o.logger.warn(l.O,"setRTCUserInfo ->code:".concat(s,",roomId:").concat(e.id,",key:").concat(t.key,",value:").concat(t.value)),n.onError(s)):n.onSuccess(!0)})).catch((function(a){o.logger.warn(l.O,"setRTCUserInfo ->code:".concat(a,",roomId:").concat(e.id,",key:").concat(t.key,",value:").concat(t.value)),n.onError(a)}))},e.prototype.removeRTCUserInfo=function(e,t,n){var o=this;this.logger.info(l.O,"removeRTCUserInfo ->roomId:".concat(e.id,"keys:").concat(t.keys)),this._context.removeRTCUserInfo(e.id,t.keys).then((function(t){t!==a.SUCCESS?(o.logger.warn(l.O,"removeRTCUserInfo ->code:".concat(t,",roomId:").concat(e.id)),n.onError(t)):n.onSuccess(!0)})).catch((function(t){o.logger.warn(l.O,"removeRTCUserInfo ->error:".concat(t,",roomId:").concat(e.id)),n.onError(t)}))},e.prototype.getRTCRoomInfo=function(e,t){var n=this;this.logger.info(l.O,"getRTCRoomInfo ->roomId:".concat(e.id)),this._context.getRTCRoomInfo(e.id).then((function(o){var s=o.code,r=o.data;s!==a.SUCCESS?(n.logger.warn(l.O,"getRTCRoomInfo ->code:".concat(s,",roomId:").concat(e.id)),t.onError(s)):t.onSuccess(r)})).catch((function(o){n.logger.warn(l.O,"getRTCRoomInfo ->error:".concat(o,",roomId:").concat(e.id)),t.onError(o)}))},e.prototype.setRTCRoomInfo=function(e,t,n){throw h("setRTCRoomInfo")},e.prototype.removeRTCRoomInfo=function(e,t,n){throw h("removeRTCRoomInfo")},e.prototype.joinRTCRoom=function(e,t){var n=this;this.logger.info(l.O,"joinRTCRoom ->roomId:".concat(e.id));var o=e.mode||0;this._context.joinRTCRoom(e.id,o).then((function(o){var s=o.code,r=o.data;s!==a.SUCCESS?(n.logger.warn(l.O,"joinRTCRoom ->code:".concat(s,",roomId:").concat(e.id)),t.onError(s)):t.onSuccess(r)})).catch((function(o){n.logger.warn(l.O,"joinRTCRoom ->error:".concat(o,",roomId:").concat(e.id)),t.onError(o)}))},e.prototype.quitRTCRoom=function(e,t){var n=this;this.logger.info(l.O,"quitRTCRoom ->roomId:".concat(e.id)),this._context.quitRTCRoom(e.id).then((function(o){o!==a.SUCCESS?(n.logger.warn(l.O,"quitRTCRoom ->code:".concat(o,",roomId:").concat(e.id)),t.onError(o)):t.onSuccess(!0)})).catch((function(o){n.logger.warn(l.O,"quitRTCRoom ->error:".concat(o,",roomId:").concat(e.id)),t.onError(o)}))},e.prototype.RTCPing=function(e,t){var n=this;this.logger.info(l.O,"RTCPing ->roomId:".concat(e.id));var o=e.mode||0;this._context.rtcPing(e.id,o).then((function(o){o!==a.SUCCESS?(n.logger.warn(l.O,"RTCPing ->code:".concat(o,",roomId:").concat(e.id)),t.onError(o)):t.onSuccess(!0)})).catch((function(o){n.logger.warn(l.O,"RTCPing ->error:".concat(o,",roomId:").concat(e.id)),t.onError(o)}))},e.prototype.setRTCData=function(e,t,n,o,s,r,c){var i=this;this.logger.info(l.O,"setRTCData ->roomId:".concat(e,",key:").concat(t)),this._context.setRTCData(e,t,n,o,s,c).then((function(t){t!==a.SUCCESS?(i.logger.warn(l.O,"setRTCData ->code:".concat(t,",roomId:").concat(e)),r.onError(t)):r.onSuccess(!0)})).catch((function(t){i.logger.warn(l.O,"setRTCData ->error:".concat(t,",roomId:").concat(e)),r.onError(t)}))},e.prototype.getRTCData=function(e,t,n,o,s){var r=this;this.logger.info(l.O,"getRTCData ->roomId:".concat(e,",keys:").concat(t)),this._context.getRTCData(e,t,n,o).then((function(t){var n=t.code,o=t.data;n!==a.SUCCESS?(r.logger.warn(l.O,"getRTCData ->code:".concat(n,",roomId:").concat(e)),s.onError(n)):s.onSuccess(o)})).catch((function(t){r.logger.warn(l.O,"setRTCUserInfo ->error:".concat(t,",roomId:").concat(e)),s.onError(t)}))},e.prototype.removeRTCData=function(e,t,n,o,s,r){var c=this;this.logger.info(l.O,"removeRTCData ->roomId:".concat(e,",keys:").concat(t)),this._context.removeRTCData(e,t,n,o,r).then((function(t){t!==a.SUCCESS?(c.logger.warn(l.O,"removeRTCData ->code:".concat(t,",roomId:").concat(e)),s.onError(t)):s.onSuccess(!0)})).catch((function(t){c.logger.warn(l.O,"removeRTCData ->error:".concat(t,",roomId:").concat(e)),s.onError(t)}))},e.prototype.setRTCUserData=function(e,t,n,o,a,s){this.setRTCData(e,t,n,o,f.PERSON,a,s)},e.prototype.setRTCUserTotalRes=function(e,t,n,o,s){var r=this;this.logger.info(l.O,"setRTCUserTotalRes ->roomId:".concat(e)),this._context.setRTCTotalRes(e,t,n,o).then((function(t){t!==a.SUCCESS?(r.logger.warn(l.O,"setRTCUserTotalRes ->code:".concat(t,",roomId:").concat(e)),s.onError(t)):s.onSuccess(!0)})).catch((function(t){r.logger.warn(l.O,"setRTCUserTotalRes ->error:".concat(t,",roomId:").concat(e)),s.onError(t)}))},e.prototype.getRTCUserData=function(e,t,n,o){this.getRTCData(e,t,n,f.PERSON,o)},e.prototype.removeRTCUserData=function(e,t,n,o,a){this.removeRTCData(e,t,n,f.PERSON,o,a)},e.prototype.setRTCRoomData=function(e,t,n,o,a,s){this.setRTCData(e,t,n,o,f.ROOM,a,s)},e.prototype.getRTCRoomData=function(e,t,n,o){this.getRTCData(e,t,n,f.ROOM,o)},e.prototype.removeRTCRoomData=function(e,t,n,o,a){this.removeRTCData(e,t,n,f.ROOM,o,a)},e.prototype.setRTCOutData=function(e,t,n,o,a){throw h("setRTCOutData")},e.prototype.getRTCOutData=function(e,t,n){throw h("getRTCOutData")},e.prototype.getRTCToken=function(e,t){var n=this;this.logger.info(l.O,"getRTCToken ->roomId:".concat(e.id)),this._context.getRTCToken(e.id,e.mode,e.broadcastType).then((function(o){var s=o.code,r=o.data;s!==a.SUCCESS?(n.logger.warn(l.O,"getRTCToken ->code:".concat(s,",roomId:").concat(e.id)),t.onError(s)):t.onSuccess(r)})).catch((function(o){n.logger.warn(l.O,"getRTCToken ->error:".concat(o,",roomId:").concat(e.id)),t.onError(o)}))},e.prototype.setRTCState=function(e,t,n){var o=this;this.logger.info(l.O,"setRTCState ->roomId:".concat(e.id)),this._context.setRTCState(e.id,t.report).then((function(t){t!==a.SUCCESS?(o.logger.warn(l.O,"setRTCState ->code:".concat(t,",roomId:").concat(e.id)),n.onError(t)):n.onSuccess(!0)})).catch((function(t){o.logger.warn(l.O,"setRTCState ->error:".concat(t,",roomId:").concat(e.id)),n.onError(t)}))},e}(),fe=[],Ce=[],pe={message:function(e){fe.forEach((function(t){return t(ne(e))}))},status:function(e){Ce.forEach((function(t){return t(e)}))}},Se=1;C.add("imlib-v2-adapter","5.6.0-beem-alpha.2");var me,ve=null,Ie={init:function(e,t,n){void 0===n&&(n={}),d("appkey",e,u.STRING,!0),ge=p.init(Q,{appkey:e,apiVersion:"5.6.0-beem-alpha.2",navigators:n.navi?[n.navi]:[],miniCMPProxy:[],logOutputLevel:n.logOutputLevel,typingExpireTime:n.typingExpireTime,checkCA:n.checkCA,httpInMainProcess:!!n.httpInMainProcess}),(ve=ge.createLogger("RC-IM","IM")).info(l.A_INIT_O,JSON.stringify({appkey:e,navigators:n.navi?[n.navi]:[],typingExpireTime:n.typingExpireTime})),Se=Math.min(15,Math.max(n.readReceiptTimeout||1,1)),ie=new he(ge,{readReceiptTimeout:Se},ve)},getInstance:function(){return ie},setConnectionStatusListener:function(e){var t=null==ve?void 0:ve.createTraceId();ge.assignWatcher({connectionState:function(n){null==ve||ve.info(l.A_CONNECT_S,JSON.stringify({status:n}),t),z.clear(),e.onChanged(n)}})},setOnReceiveMessageListener:function(e){ge.assignWatcher({message:function(t,n,o){try{var a=ne(t),s=ge.getCurrentUserId(),r=ge.getConnectedTime();oe(a,s,r,Se),a=function(e,t,n,o){var a=new Date(n-1e3*o*60*60*24).getTime()-e.sentTime<0;if("ReadReceiptResponseMessage"!==e.messageType||!a)return e;var s=e.content,r=((s=s||{}).receiptMessageDic||{})[t],c="",i={};if(e.receiptResponse=e.receiptResponse||{},r){for(var g=[],d=0;d<r.length;d++)c="".concat(t).concat(r[d],"SENT"),(i=ee.get(c))&&!(e.senderUserId in i.userIds)&&(g.push(r[d]),i.count+=1,i.userIds[e.senderUserId]=e.sentTime,e.receiptResponse[r[d]]=i.count,ee.set(c,i));s.receiptMessageDic[t]=g,e.content=s}return e}(a,s,r,Se),g()||z.set(t),null==ve||ve.info(l.A_PULL_MSG_O,JSON.stringify({message:t.messageUId})),e.onReceived(a,void 0,o)}catch(e){null==ve||ve.error(l.O,"setOnReceiveMessageListener ->error:".concat(e))}}})},setConversationStatusListener:function(e){ge.assignWatcher({conversationState:function(t){try{var n=[];t.forEach((function(e){var t=e.updatedItems,o=e.conversationType,a=e.targetId,s=e.channelId,r=(t=t||{}).notificationStatus,c=t.isTop;r&&c&&n.push({notificationStatus:r.val,isTop:c.val,conversationType:o,targetId:a,channelId:s||"",updatedTime:r.time})})),n.length>0&&e.onChanged(n)}catch(e){null==ve||ve.error(l.O,"setConversationStatusListener ->error:".concat(e))}}})},setMessageExpansionListener:function(e){ge.assignWatcher({expansion:function(t){try{t.updatedExpansion&&e.onUpdated(t.updatedExpansion),t.deletedExpansion&&e.onDeleted(t.deletedExpansion)}catch(e){null==ve||ve.error(l.O,"setMessageExpansionListener ->error:".concat(e))}}})},setTagListener:function(e){ge.assignWatcher({tag:function(){try{e.onChanged()}catch(e){null==ve||ve.error(l.O,"setTagListener ->error:".concat(e))}}})},setConversationTagListener:function(e){ge.assignWatcher({conversationTagChanged:function(){try{e.onChanged()}catch(e){null==ve||ve.error(l.O,"setConversationTagListener ->error:".concat(e))}}})},setPullOffLineFinished:function(e){ge.assignWatcher({pullFinished:function(){try{e.onFinished()}catch(e){null==ve||ve.error(l.O,"setPullOffLineFinished ->error:".concat(e))}}})},setTypingStatusListener:function(e){ge.assignWatcher({typingState:function(t){try{e.onChanged(t)}catch(e){null==ve||ve.error(l.O,"setTypingStatusListener ->error:".concat(e))}}})},setMessageBlockedListener:function(e){ge.assignWatcher({messageBlocked:function(t){e.onReceived(t)}})},setChatRoomStatusListener:function(e){ge.assignWatcher({chatroomState:function(t){e.onChanged(t)}})},setMessageDeliveredListener:function(e){ge.assignWatcher({messageDelivered:function(t){try{e.onDelivered(t)}catch(e){null==ve||ve.error(l.O,"setMessageDeliveredListener ->error:".concat(e))}}})},setGroupMessageDeliveredStatusListener:function(e){ge.assignWatcher({groupMessageDeliveredStatus:function(t){try{e.onDelivered(t)}catch(e){null==ve||ve.error(l.O,"setGroupMessageDeliveredStatusListener ->error:".concat(e))}}})},connect:function(e,t,n){return M(this,void 0,void 0,(function(){var o,s,r,c;return T(this,(function(i){switch(i.label){case 0:return o=null==ve?void 0:ve.createTraceId(),null==ve||ve.info(l.A_CONNECT_T,JSON.stringify({token:e,reconnectKickEnable:!1}),o),[4,ge.connect(e,!1,n,o)];case 1:return s=i.sent(),r=s.code===a.SUCCESS?"info":"warn",null==ve||ve[r](l.A_CONNECT_R,JSON.stringify({code:s.code,userId:s.userId}),o),s.code===a.SUCCESS?(t.onSuccess(s.userId),c=new Date(ge.getConnectedTime()-1e3*Se*60*60*24).getTime(),ee.getKeys().forEach((function(e){if(/SENT$/.test(e)){var t=ee.get(e).dealtime;t&&c-t>0&&ee.remove(e)}else if(/RECEIVED$/.test(e)){var n=ee.get(e),o=Object.keys(n).length;Object.keys(n).forEach((function(e){var t=n[e].dealtime;t&&c-t>0&&delete n[e]})),Object.keys(n).length!==o&&(0===n.length?ee.remove(e):ee.set(e,n))}}))):s.code===a.RC_CONN_USER_OR_PASSWD_ERROR?(null==ve||ve.warn(l.O,"connect ->code:".concat(s.code,",token:").concat(e)),t.onTokenIncorrect()):(null==ve||ve.warn(l.O,"connect ->code:".concat(s.code,",token:").concat(e)),t.onError(s.code)),[2]}}))}))},reconnect:function(e,t,n){var o=null==ve?void 0:ve.createTraceId();null==ve||ve.info(l.A_RECONNECT_T,null,o),ge.reconnect(n).then((function(t){var n=t.code===a.SUCCESS?"info":"warn";null==ve||ve[n](l.A_RECONNECT_R,JSON.stringify({code:t.code,userId:t.userId}),o),t.code===a.SUCCESS?e.onSuccess(t.userId):(null==ve||ve.warn(l.O,"reconnect ->code:".concat(t.code)),e.onError(t.code))})).catch((function(t){e.onError(t)}))},RegisterMessage:{},RegisterMessageTypeMapping:Z,getMessageObjectName:function(e){var t=y(y({},$),Z);return Object.keys(t).find((function(n){return t[n]===e}))||e},registerMessageType:function(e,t,n,o){this.RegisterMessage[e]=ce(e,t,n.isPersited,n.isCounted),this.RegisterMessageTypeMapping[t]=e,ge.registerMessageType(t,n.isPersited,n.isCounted,o)},messageWatch:function(e){var t=this;fe.push((function(n){var o,a;null==ve||ve.info(l.O,"messageWatch ->message:".concat(JSON.stringify(n||{})));try{e(n),null===(a=(o=t._voipProvider).onReceived)||void 0===a||a.call(o,n)}catch(e){null==ve||ve.error(l.O,"messageWatch ->error:".concat(e))}})),ge.assignWatcher({rtcInnerWatcher:pe})},statusWatch:function(e){Ce.push((function(t){null==ve||ve.info(l.O,"statusWatch ->status:".concat(t));try{e(t)}catch(e){null==ve||ve.error(l.O,"statusWatch ->error:".concat(e))}}))},MessageType:{TextMessage:"TextMessage",ImageMessage:"ImageMessage",ReferenceMessage:"ReferenceMessage",DiscussionNotificationMessage:"DiscussionNotificationMessage",VoiceMessage:"VoiceMessage",RichContentMessage:"RichContentMessage",HandshakeMessage:"HandshakeMessage",UnknownMessage:"UnknownMessage",LocationMessage:"LocationMessage",InformationNotificationMessage:"InformationNotificationMessage",ContactNotificationMessage:"ContactNotificationMessage",ProfileNotificationMessage:"ProfileNotificationMessage",CommandNotificationMessage:"CommandNotificationMessage",CommandMessage:"CommandMessage",TypingStatusMessage:"TypingStatusMessage",ChangeModeResponseMessage:"ChangeModeResponseMessage",ChangeModeMessage:"ChangeModeMessage",EvaluateMessage:"EvaluateMessage",HandShakeMessage:"HandShakeMessage",HandShakeResponseMessage:"HandShakeResponseMessage",SuspendMessage:"SuspendMessage",TerminateMessage:"TerminateMessage",CustomerContact:"CustomerContact",CustomerStatusUpdateMessage:"CustomerStatusUpdateMessage",SyncReadStatusMessage:"SyncReadStatusMessage",ReadReceiptRequestMessage:"ReadReceiptRequestMessage",ReadReceiptResponseMessage:"ReadReceiptResponseMessage",FileMessage:"FileMessage",HQVoiceMessage:"HQVoiceMessage",GIFMessage:"GIFMessage",SightMessage:"SightMessage",AcceptMessage:"AcceptMessage",RingingMessage:"RingingMessage",SummaryMessage:"SummaryMessage",HungupMessage:"HungupMessage",InviteMessage:"InviteMessage",MediaModifyMessage:"MediaModifyMessage",MemberModifyMessage:"MemberModifyMessage",JrmfRedPacketMessage:"JrmfRedPacketMessage",JrmfRedPacketOpenedMessage:"JrmfRedPacketOpenedMessage",GroupNotificationMessage:"GroupNotificationMessage",PublicServiceRichContentMessage:"PublicServiceRichContentMessage",PublicServiceMultiRichContentMessage:"PublicServiceMultiRichContentMessage",PublicServiceCommandMessage:"PublicServiceCommandMessage",RecallCommandMessage:"RecallCommandMessage",ReadReceiptMessage:"ReadReceiptMessage",RCCombineMessage:"RCCombineMessage",ChrmKVNotificationMessage:"ChrmKVNotificationMessage",LogCommandMessage:"LogCommandMessage"},_voipProvider:{}},Re=function(e,t,n){this.type=e,this.userIdList=t,this.mentionedContent=n},ye=function(e,t){this.isCounted=e,this.isPersited=t},Me=ce("TextMessage","RC:TxtMsg"),Te=ce("LocationMessage","RC:LBSMsg"),Ee=ce("TypingStatusMessage","RC:TypSts"),Oe=ce("ImageMessage","RC:ImgMsg"),Ue=ce("RichContentMessage","RC:ImgTextMsg"),Ne=ce("VoiceMessage","RC:VcMsg"),_e=ce("HQVoiceMessage","RC:HQVCMsg"),Ae=ce("FileMessage","RC:FileMsg"),Le=ce("SightMessage","RC:SightMsg"),Be=ce("GIFMessage","RC:GIFMsg"),we=ce("ReadReceiptMessage","RC:ReadNtf"),xe=ce("ReadReceiptRequestMessage","RC:RRReqMsg"),ke=ce("RCCombineMessage","RC:CombineMsg"),Pe=function(e,t,n,o,a,s,r,c,i,g,d,u,l,h,f,C,p,S){this.conversationType=e,this.targetId=t,this.senderUserId=n,this.content=o,this.objectName=a,this.messageType=s,this.messageId=r,this.messageUId=c,this.messageDirection=i,this.offLineMessage=g,this.sentStatus=d,this.sentTime=u,this.receivedStatus=l,this.receivedTime=h,this.canIncludeExpansion=f,this.expansion=C,this.receiptResponse=p,this.disableNotification=S};!function(e){e[e.MEDIA_AUDIO=1]="MEDIA_AUDIO",e[e.MEDIA_VEDIO=2]="MEDIA_VEDIO",e[e.MEDIA_VIDEO=2]="MEDIA_VIDEO"}(me||(me={}));var be,De=ce("AcceptMessage","RC:VCAccept"),Ge=ce("RingingMessage","RC:VCRinging"),Fe=ce("SummaryMessage","RC:VCSummary"),Ke=ce("HungupMessage","RC:VCHangup"),We=ce("InviteMessage","RC:VCInvite"),He=ce("MediaModifyMessage","RC:VCModifyMedia"),Je=ce("MemberModifyMessage","RC:VCModifyMem"),Ve=ce("lastMessageSendTime","RC:SRSMsg"),qe=ce("ReferenceMessage","RC:ReferenceMsg"),je=ce("PublicServiceRichContentMessage","RC:PSImgTxtMsg"),Ye=ce("PublicServiceMultiRichContentMessage","RC:PSMultiImgTxtMsg");!function(e){e[e.ALL=1]="ALL",e[e.PART=2]="PART"}(be||(be={}));var Qe=be,Xe=S;window&&(window.RongIMClient=Ie);export{De as AcceptMessage,re as BaseMessage,ue as ChannelClient,Xe as ConnectionState,Ae as FileMessage,Be as GIFMessage,R as GetChatRoomType,_e as HQVoiceMessage,Ke as HungupMessage,he as IMClient,Oe as ImageMessage,We as InviteMessage,Te as LocationMessage,He as MediaModifyMessage,Je as MemberModifyMessage,Re as MentionedInfo,Qe as MentionedType,Pe as Message,ye as MessageTag,Ye as PublicServiceMultiRichContentMessage,je as PublicServiceRichContentMessage,ke as RCCombineMessage,we as ReadReceiptMessage,xe as ReadReceiptRequestMessage,de as ReadReceiptResponseMessage,qe as ReferenceMessage,Ue as RichContentMessage,Ge as RingingMessage,Ie as RongIMClient,I as SentStatus,Le as SightMessage,Fe as SummaryMessage,Ve as SyncReadStatusMessage,Me as TextMessage,Ee as TypingStatusMessage,me as VoIPMediaType,Ne as VoiceMessage};
|
package/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,t=require("@rongcloud/engine");!function(e){e[e.SENDING=10]="SENDING",e[e.FAILED=20]="FAILED",e[e.SENT=30]="SENT",e[e.RECEIVED=40]="RECEIVED",e[e.READ=50]="READ",e[e.DESTROYED=60]="DESTROYED"}(e||(e={}));var s,n=e;!function(e){e[e.NONE=0]="NONE",e[e.SQQUENCE=1]="SQQUENCE",e[e.REVERSE=2]="REVERSE"}(s||(s={}));var o=s,a=function(){return a=Object.assign||function(e){for(var t,s=1,n=arguments.length;s<n;s++)for(var o in t=arguments[s])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},a.apply(this,arguments)};function r(e,t,s,n){return new(s||(s=Promise))((function(o,a){function r(e){try{i(n.next(e))}catch(e){a(e)}}function c(e){try{i(n.throw(e))}catch(e){a(e)}}function i(e){var t;e.done?o(e.value):(t=e.value,t instanceof s?t:new s((function(e){e(t)}))).then(r,c)}i((n=n.apply(e,t||[])).next())}))}function c(e,t){var s,n,o,a,r={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function c(a){return function(c){return function(a){if(s)throw new TypeError("Generator is already executing.");for(;r;)try{if(s=1,n&&(o=2&a[0]?n.return:a[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,a[1])).done)return o;switch(n=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return r.label++,{value:a[1],done:!1};case 5:r.label++,n=a[1],a=[0];continue;case 7:a=r.ops.pop(),r.trys.pop();continue;default:if(!(o=r.trys,(o=o.length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){r=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){r.label=a[1];break}if(6===a[0]&&r.label<o[1]){r.label=o[1],o=a;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(a);break}o[2]&&r.ops.pop(),r.trys.pop();continue}a=t.call(e,r)}catch(e){a=[6,e],n=0}finally{s=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}}function i(e,t,s){if(s||2===arguments.length)for(var n,o=0,a=t.length;o<a;o++)!n&&o in t||(n||(n=Array.prototype.slice.call(t,0,o)),n[o]=t[o]);return e.concat(n||Array.prototype.slice.call(t))}var u=function(){return!("undefined"==typeof uni||!function(e){for(var t=["request","getSystemInfo"],s=0,n=t.length;s<n;s++)if(!e[t[s]])return!1;return!0}(uni))},d=u();var g={tag:"browser",httpReq:function(e){var s=e.method||t.HttpMethod.GET,n=e.timeout||t.HTTP_TIMEOUT,o=e.headers,a=e.query,r=e.body,c=t.appendUrl(e.url,a);return new Promise((function(e){var t,a=(t="undefined"!=typeof XMLHttpRequest&&"withCredentials"in new XMLHttpRequest,"undefined"!=typeof XMLHttpRequest&&t?new XMLHttpRequest:"undefined"!=typeof XDomainRequest?new XDomainRequest:new ActiveXObject("Microsoft.XMLHTTP")),i="[object XDomainRequest]"===Object.prototype.toString.call(a);if(a.open(s,c),o&&a.setRequestHeader)for(var u in o)a.setRequestHeader(u,o[u]);if(i){a.timeout=n,a.onload=function(){e({data:a.responseText,status:a.status||200})},a.onerror=function(){e({status:a.status||0})},a.ontimeout=function(){e({status:a.status||0})};var d="object"==typeof r?JSON.stringify(r):r;a.send(d)}else a.onreadystatechange=function(){4===a.readyState&&e({data:a.responseText,status:a.status})},a.onerror=function(){e({status:a.status||0})},setTimeout((function(){a.abort(),e({status:a.status||0})}),n),a.send(r)}))},localStorage:null===window||void 0===window?void 0:window.localStorage,sessionStorage:null===window||void 0===window?void 0:window.sessionStorage,useNavi:!0,connectPlatform:"",isFromUniapp:d,createWebSocket:function(e,t){var s=new WebSocket(e,t);return s.binaryType="arraybuffer",{onClose:function(e){s.onclose=function(t){var s=t.code,n=t.reason;e(s,n)}},onError:function(e){s.onerror=e},onMessage:function(e){s.onmessage=function(t){e(t.data)}},onOpen:function(e){s.onopen=e},send:function(e){s.send(e)},close:function(e,t){s.close()}}},getNetworkType:function(){var e=navigator.connection||navigator.mozConnection||navigator.webkitConnection,s=e.type,n=e.effectiveType,o=s||n||t.NetworkType.UNKONWN;return new Promise((function(e){e(o)}))}},l=u(),C=function(e){return function(){for(var s=[],n=0;n<arguments.length;n++)s[n]=arguments[n];var o=t.logger.ID();try{return t.logger.info(t.LogTagId.A_CALLBACK_O,{func_name:e,source:"wechat"},{traceId:o}),wx[e].apply(wx,s)}catch(s){t.logger.error(t.LogTagId.A_CALLBACK_E,{func_name:e,source:"wechat"},{traceId:o})}}},f={setItem:C("setStorageSync"),getItem:C("getStorageSync"),removeItem:C("removeStorageSync"),clear:C("clearStorageSync")},p={tag:"wechat",httpReq:function(e){var s=e.method||t.HttpMethod.GET,n=e.timeout||t.HTTP_TIMEOUT,o=e.headers,a=e.query,r=e.body,c=t.appendUrl(e.url,a);return new Promise((function(e){wx.request({url:c,method:s,header:o,timeout:n,data:r,success:function(t){e({data:t.data,status:t.statusCode})},fail:function(){e({status:t.ErrorCode.RC_HTTP_REQ_FAIL})}})}))},localStorage:f,sessionStorage:f,useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:l,createWebSocket:function(e,t){var s=wx.connectSocket({url:e,protocols:t});return{onClose:function(e){s.onClose((function(t){e(t.code,t.reason)}))},onError:function(e){s.onError((function(t){e(t.errMsg)}))},onMessage:function(e){s.onMessage((function(t){e(t.data)}))},onOpen:function(e){s.onOpen(e)},send:function(e){s.send({data:e})},close:function(e,t){s.close({code:e,reason:t})}}},getNetworkType:function(){return new Promise((function(e){wx.getNetworkType({success:function(t){var s=t.networkType;e(s)},fail:function(){e(t.NetworkType.UNKONWN)}})}))}},R=u(),h=function(e){return function(){for(var s=[],n=0;n<arguments.length;n++)s[n]=arguments[n];var o=t.logger.ID();try{if(t.logger.info(t.LogTagId.A_CALLBACK_O,{func_name:e,source:"alipay"},{traceId:o}),"setStorageSync"===e)return my[e]({key:s[0],data:JSON.parse(s[1])});if("clearStorageSync"===e)return my[e]();if("removeStorageSync"===e)return my[e]({key:s[0]});var a=my[e]({key:s[0]}).data;return a?JSON.stringify(a):a}catch(s){t.logger.error(t.LogTagId.A_CALLBACK_E,{func_name:e,source:"alipay"},{traceId:o})}}},m={setItem:h("setStorageSync"),getItem:h("getStorageSync"),removeItem:h("removeStorageSync"),clear:h("clearStorageSync")},I={tag:"alipay",httpReq:function(e){var s=e.method||t.HttpMethod.GET,n=e.timeout||t.HTTP_TIMEOUT,o=e.headers,a=e.query,r=e.body,c=t.appendUrl(e.url,a),i=e.dataType||"json";return new Promise((function(e){my.request({url:c,method:s,headers:o,timeout:n,data:r,dataType:i,success:function(t){e({data:t.data,status:t.status})},fail:function(){e({status:t.ErrorCode.RC_HTTP_REQ_FAIL})}})}))},localStorage:m,sessionStorage:m,useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:R,createWebSocket:function(e){return my.connectSocket({url:e}),{onClose:function(e){my.onSocketClose(e)},onError:function(e){my.onSocketError((function(t){e(t.errMsg)}))},onMessage:function(e){my.onSocketMessage((function(t){t.isBuffer?e(my.base64ToArrayBuffer(t.data)):e(t.data)}))},onOpen:function(e){my.onSocketOpen(e)},send:function(e){my.sendSocketMessage({data:my.arrayBufferToBase64(e),isBuffer:!0})},close:function(){my.closeSocket()}}},getNetworkType:function(){return new Promise((function(e){my.getNetworkType({success:function(t){var s=t.networkType;e(s)},fail:function(){e(t.NetworkType.UNKONWN)}})}))}},S=u(),M=function(e){return function(){for(var s=[],n=0;n<arguments.length;n++)s[n]=arguments[n];var o=t.logger.ID();try{return t.logger.info(t.LogTagId.A_CALLBACK_O,{func_name:e,source:"toutiao"},{traceId:o}),tt[e].apply(tt,s)}catch(s){t.logger.error(t.LogTagId.A_CALLBACK_E,{func_name:e,source:"toutiao"},{traceId:o})}}},T={setItem:M("setStorageSync"),getItem:M("getStorageSync"),removeItem:M("removeStorageSync"),clear:M("clearStorageSync")},y={tag:"toutiao",useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:S,localStorage:T,sessionStorage:T,httpReq:function(e){return new Promise((function(s){tt.request({url:e.url,data:e.body,header:e.headers,method:e.method,success:function(e){var t=(null==e?void 0:e.data)||{},n={data:JSON.stringify(t),status:e.statusCode};s(n)},fail:function(e){s({status:t.ErrorCode.RC_HTTP_REQ_FAIL})}})}))},createWebSocket:function(e,t){var s=tt.connectSocket({url:e,protocols:t});return{onOpen:function(e){s.onOpen(e)},onClose:function(e){s.onClose((function(t){return e(t.code,t.reason)}))},onError:function(e){s.onError((function(t){return e(t.errMsg)}))},onMessage:function(e){s.onMessage((function(t){return e(t.data)}))},send:function(e){s.send({data:e})},close:function(e,t){s.close({code:e,reason:t})}}},getNetworkType:function(){return new Promise((function(e){tt.getNetworkType({success:function(t){var s=t.networkType;e(s)},fail:function(){e(t.NetworkType.UNKONWN)}})}))}},v=u(),E=function(e){return function(){for(var s=[],n=0;n<arguments.length;n++)s[n]=arguments[n];var o=t.logger.ID();try{return t.logger.info(t.LogTagId.A_CALLBACK_O,{func_name:e,source:"baidu"},{traceId:o}),swan[e].apply(swan,s)}catch(s){t.logger.error(t.LogTagId.A_CALLBACK_E,{func_name:e,source:"baidu"},{traceId:o})}}},A={setItem:E("setStorageSync"),getItem:E("getStorageSync"),removeItem:E("removeStorageSync"),clear:E("clearStorageSync")},U={tag:"baidu",useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:v,localStorage:A,sessionStorage:A,httpReq:function(e){return new Promise((function(s,n){swan.request({url:e.url,data:e.body,header:e.headers,method:e.method,success:function(e){var t=(null==e?void 0:e.data)||{},n={data:JSON.stringify(t),status:e.statusCode};s(n)},fail:function(e){s({status:t.ErrorCode.RC_HTTP_REQ_FAIL})}})}))},createWebSocket:function(e,t){var s=swan.connectSocket({url:e,protocols:t});return{onOpen:function(e){s.onOpen(e)},onClose:function(e){s.onClose((function(t){return e(t.code,t.reason)}))},onError:function(e){s.onError((function(t){return e(t.errMsg)}))},onMessage:function(e){s.onMessage((function(t){return e(t.data)}))},send:function(e){s.send({data:e})},close:function(e,t){s.close({code:e,reason:t})}}},getNetworkType:function(){return r(this,void 0,void 0,(function(){return c(this,(function(e){return[2,new Promise((function(e){swan.getNetworkType({success:function(t){var s=t.networkType;e(s)},fail:function(){e(t.NetworkType.UNKONWN)}})}))]}))}))}},N=function(e){return function(){for(var s=[],n=0;n<arguments.length;n++)s[n]=arguments[n];var o=t.logger.ID();try{return t.logger.info(t.LogTagId.A_CALLBACK_O,{func_name:e,source:"uniapp"},{traceId:o}),uni[e].apply(uni,s)}catch(s){t.logger.error(t.LogTagId.A_CALLBACK_E,{func_name:e,source:"uniapp"},{traceId:o})}}},_={setItem:N("setStorageSync"),getItem:N("getStorageSync"),removeItem:N("removeStorageSync"),clear:N("clearStorageSync")},L={tag:"uniapp",httpReq:function(e){var s=e.method||t.HttpMethod.GET,n=e.timeout||t.HTTP_TIMEOUT,o=e.headers,a=e.query,r=e.body,c=t.appendUrl(e.url,a);return new Promise((function(e){uni.request({url:c,method:s,header:o,timeout:n,data:r,success:function(t){e({data:t.data,status:t.statusCode})},fail:function(){e({status:t.ErrorCode.RC_HTTP_REQ_FAIL})}})}))},localStorage:_,sessionStorage:_,useNavi:!0,connectPlatform:"",isFromUniapp:!0,createWebSocket:function(e,t){var s={complete:function(){},url:e,protocols:t},n=uni.connectSocket(s);return{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){uni.getNetworkType({success:function(t){var s=t.networkType;e(s)},fail:function(){e(t.NetworkType.UNKONWN)}})}))}},x=function(e){return e&&e.request&&e.getSystemInfo},B="undefined"!=typeof uni&&x(uni)?function(){switch(process.env.VUE_APP_PLATFORM){case"app-plus":return L;case"mp-baidu":return U;case"mp-toutiao":return y;case"mp-alipay":return I;case"mp-weixin":return p;default:return g}}():"undefined"!=typeof my&&x(my)?I:"undefined"!=typeof tt&&x(tt)?y:"undefined"!=typeof swan&&x(swan)?U:"undefined"!=typeof wx&&x(wx)?p:g,w=new t.Logger("RCIM");function b(e,t,s){return"".concat(e,"_").concat(t,"_").concat(s)}var P=function(){function e(){}return e.set=function(s){if(t.SEND_MESSAGE_TYPE_OPTION[s.messageType]&&t.SEND_MESSAGE_TYPE_OPTION[s.messageType].isPersited){var n=e.get(s.conversationType,s.targetId,s.channelId||"");if(!n||n.sentTime<s.sentTime){var o=b(s.conversationType,s.targetId,s.channelId||"");e.map[o]=s}}},e.get=function(t,s,n){var o=b(t,s,n);return e.map[o]||null},e.remove=function(t,s,n){var o=b(t,s,n);delete e.map[o]},e.clear=function(){e.map={}},e.map={},e}(),k={"RC:TxtMsg":"TextMessage","RC:ImgMsg":"ImageMessage","RC:VcMsg":"VoiceMessage","RC:ImgTextMsg":"RichContentMessage","RC:ReferenceMsg":"ReferenceMessage","RC:FileMsg":"FileMessage","RC:HQVCMsg":"HQVoiceMessage","RC:GIFMsg":"GIFMessage","RC:SightMsg":"SightMessage","RC:LBSMsg":"LocationMessage","RC:InfoNtf":"InformationNotificationMessage","RC:ContactNtf":"ContactNotificationMessage","RC:ProfileNtf":"ProfileNotificationMessage","RC:CmdNtf":"CommandNotificationMessage","RC:DizNtf":"DiscussionNotificationMessage","RC:CmdMsg":"CommandMessage","RC:TypSts":"TypingStatusMessage","RC:CsChaR":"ChangeModeResponseMessage","RC:CsHsR":"HandShakeResponseMessage","RC:CsEnd":"TerminateMessage","RC:CsSp":"SuspendMessage","RC:CsUpdate":"CustomerStatusUpdateMessage","RC:ReadNtf":"ReadReceiptMessage","RC:VCAccept":"AcceptMessage","RC:VCRinging":"RingingMessage","RC:VCSummary":"SummaryMessage","RC:VCHangup":"HungupMessage","RC:VCInvite":"InviteMessage","RC:VCModifyMedia":"MediaModifyMessage","RC:VCModifyMem":"MemberModifyMessage","RC:CsContact":"CustomerContact","RC:PSImgTxtMsg":"PublicServiceRichContentMessage","RC:PSMultiImgTxtMsg":"PublicServiceMultiRichContentMessage","RC:GrpNtf":"GroupNotificationMessage","RC:PSCmd":"PublicServiceCommandMessage","RC:RcCmd":"RecallCommandMessage","RC:SRSMsg":"SyncReadStatusMessage","RC:RRReqMsg":"ReadReceiptRequestMessage","RC:RRRspMsg":"ReadReceiptResponseMessage","RCJrmf:RpMsg":"JrmfRedPacketMessage","RCJrmf:RpOpendMsg":"JrmfRedPacketOpenedMessage","RC:CombineMsg":"RCCombineMessage","RC:chrmKVNotiMsg":"ChrmKVNotificationMessage","RC:LogCmdMsg":"LogCommandMessage","RC:MsgExMsg":"ExpansionCommandMessage","RC:RRMsg":"GroupReadReceiptResponseMessage"},O={},D=new t.AppStorage(B,"API-V2");function G(e){var s=e.channelId,n=e.conversationType,o=e.targetId,a=e.unreadMessageCount,r=e.latestMessage,c=e.isTop,i=e.notificationStatus,u=e.matchCount;if(!t.usingCppEngine()){var d=P.get(n,o,s||"");r?d&&r.sentTime<d.sentTime&&(r=d):r=d}var g=r?K(r):null;return{channelId:s||"",conversationType:n,targetId:o,unreadMessageCount:a,latestMessage:g,latestMessageId:null==g?void 0:g.messageId,objectName:null==g?void 0:g.messageType,sentTime:null==g?void 0:g.sentTime,isTop:c,notificationStatus:i,receivedStatus:null==g?void 0:g.receivedStatus,matchCount:u}}function K(e){var s=e.conversationType,o=e.targetId,a=e.senderUserId,r=e.content,c=e.messageType,i=e.messageUId,u=e.messageDirection,d=e.isOffLineMessage,g=e.sentTime,l=e.receivedStatus,C=e.receivedTime,f=e.canIncludeExpansion,p=e.disableNotification,R=e.expansion,h=e.messageId,m=e.sentStatus,I=e.channelId,S=e.readReceiptInfo,M=e.pushConfig,T="";return c in k?T=k[c]:c in O?T=O[c]:(r={message:{content:r,objectName:c},messageName:"UnknownMessage"},T="UnknownMessage"),l||(l=t.ReceivedStatus.UNREAD),void 0===h&&(h=~~(16777215*Math.random())),{channelId:I||"",conversationType:s,targetId:o,senderUserId:a,content:r,messageType:T,messageUId:i,messageDirection:u,offLineMessage:d,sentTime:g,receivedStatus:l,receivedTime:C,objectName:c,messageId:h,sentStatus:m||n.SENT,disableNotification:p,canIncludeExpansion:f,expansion:R,readReceiptInfo:S,pushConfig:M}}function F(e,s,n,o){var a=new Date(n-1e3*o*60*60*24).getTime()-e.sentTime<0,r=e.messageType,c=e.messageDirection;if("ReadReceiptRequestMessage"===r&&a&&c===t.MessageDirection.SEND){var i="".concat(s).concat(e.content.messageUId,"SENT");D.set(i,{count:0,dealtime:e.sentTime,userIds:{}})}else if("ReadReceiptRequestMessage"===r&&a){var u="".concat(s).concat(e.conversationType).concat(e.targetId,"RECEIVED"),d=D.get(u);if(d)if(e.senderUserId in d)d[e.senderUserId].uIds&&-1===d[e.senderUserId].uIds.indexOf(e.content.messageUId)&&(d[e.senderUserId].uIds.push(e.content.messageUId),d[e.senderUserId].dealtime=e.sentTime,d[e.senderUserId].isResponse=!1,D.set(u,d));else{var g={uIds:[e.content.messageUId],dealtime:e.sentTime,isResponse:!1};d[e.senderUserId]=g,D.set(u,d)}else{var l={};l[e.senderUserId]={uIds:[e.content.messageUId],dealtime:e.sentTime,isResponse:!1},D.set(u,l)}}}function H(e,t,s){try{e(t,s)}catch(e){w.error(e)}}function W(e,t,s){try{e(t,s)}catch(e){w.error(e)}}var j=function(e,t,s,n,o){void 0===n&&(n=!0),void 0===o&&(o=!0),this.messageType=e,this.objectName=t,this.content=s,this.isPersited=n,this.isCounted=o};function V(e,t,s,n){void 0===s&&(s=!0),void 0===n&&(n=!0);var o=function(o){return new j(e,t,o,s,n)};return o.MessageType=e,o.ObjectName=t,o}var q,J,Y=V("ReadReceiptResponseMessage","RC:RRRspMsg"),Q=function(){function e(e,t,s,n){this._context=e,this.channelId=t,this._isCPPMode=s,this._readReceiptTimeout=n,this._storage=D,this._draftMap={}}return e.prototype.getConversationList=function(e,s,n){t.assert("callback",e,t.AssertRules.CALLBACK),t.assert("conversationTypes",s,t.AssertRules.ARRAY),t.assert("count",n,t.AssertRules.NUMBER),this._context.getConversationList(n,void 0,0,0,this.channelId).then((function(n){var o=n.code,a=n.data,r=[];a=a||[],o===t.ErrorCode.SUCCESS?(s?a.forEach((function(e){s.indexOf(e.conversationType)>-1&&r.push(G(e))})):a.forEach((function(e){r.push(G(e))})),H(e.onSuccess,r)):(w.warn("getConversationList -> code:".concat(o)),W(e.onError,o))}))},e.prototype.getConversation=function(e,s,n){var o=this;t.assert("callback",n,t.AssertRules.CALLBACK),t.assert("conversationType",e,t.AssertRules.NUMBER,!0),t.assert("targetId",s,t.AssertRules.STRING,!0),w.info("getConversation ->targetId:".concat(s,",conversationType:").concat(e)),r(o,void 0,void 0,(function(){var o,a,r;return c(this,(function(c){switch(c.label){case 0:return[4,this._context.getConversation(e,s,this.channelId)];case 1:return o=c.sent(),a=o.code,r=o.data,a!==t.ErrorCode.SUCCESS?(w.warn("getConversation ->code:".concat(a,",targetId:").concat(s)),n.onError(a),[2]):(n.onSuccess(r?G(r):null),[2])}}))}))},e.prototype.removeConversation=function(e,s,n){var o=this;t.assert("conversationType",e,t.AssertRules.NUMBER,!0),t.assert("targetId",s,t.AssertRules.STRING,!0),t.assert("callback",n,t.AssertRules.CALLBACK),w.info("removeConversation ->targetId:".concat(s,",conversationType:").concat(e)),this._context.removeConversation(e,s,this.channelId).then((function(a){a===t.ErrorCode.SUCCESS?(o._isCPPMode||P.remove(e,s,o.channelId),H(n.onSuccess)):(w.warn("removeConversation ->code:".concat(a,",targetId:").concat(s)),W(n.onError,a))}))},e.prototype.saveTextMessageDraft=function(e,s,n){t.assert("conversationType",e,t.AssertRules.NUMBER,!0),t.assert("targetId",s,t.AssertRules.STRING,!0),t.assert("draftText",n,t.AssertRules.STRING,!0),w.info("saveTextMessageDraft ->targetId:".concat(s,",conversationType:").concat(e));var o=this._context.getCurrentUserId();return!!o&&((this._draftMap[o]=this._draftMap[o]||{})["".concat(e,"_").concat(s,"_").concat(this.channelId)]=n,!0)},e.prototype.getTextMessageDraft=function(e,s){t.assert("conversationType",e,t.AssertRules.NUMBER,!0),t.assert("targetId",s,t.AssertRules.STRING,!0),w.info("getTextMessageDraft ->targetId:".concat(s,",conversationType:").concat(e));var n=this._context.getCurrentUserId();if(n)return(this._draftMap[n]||{})["".concat(e,"_").concat(s,"_").concat(this.channelId)]},e.prototype.clearTextMessageDraft=function(e,s){t.assert("conversationType",e,t.AssertRules.NUMBER,!0),t.assert("targetId",s,t.AssertRules.STRING,!0),w.info("clearTextMessageDraft ->targetId:".concat(s,",conversationType:").concat(e));var n=this._context.getCurrentUserId();return!!n&&delete(this._draftMap[n]||{})["".concat(e,"_").concat(s,"_").concat(this.channelId)]},e.prototype.getTotalUnreadCount=function(e,s,n){t.assert("callback",e,t.AssertRules.CALLBACK),w.info("getTotalUnreadCount ->conversationTypes:".concat(s)),this._context.getTotalUnreadCount(this.channelId,s,n).then((function(s){var n=s.code,o=s.data;n===t.ErrorCode.SUCCESS?H(e.onSuccess,o):(w.warn("getTotalUnreadCount ->code:".concat(n)),W(e.onError,n))}))},e.prototype.getUnreadCount=function(e,s,n){t.assert("conversationType",e,t.AssertRules.NUMBER,!0),t.assert("targetId",s,t.AssertRules.STRING,!0),t.assert("callback",n,t.AssertRules.CALLBACK),w.info("getUnreadCount ->targetId:".concat(s,",conversationType:").concat(e)),this._context.getUnreadCount(e,s,this.channelId).then((function(e){var o=e.code,a=e.data;o===t.ErrorCode.SUCCESS?H(n.onSuccess,a):(w.warn("getUnreadCount ->code:".concat(o,",targetId:").concat(s)),W(n.onError,o))}))},e.prototype.clearConversations=function(e,s){w.info("clearConversations -> conversationTypes:".concat(s)),this._isCPPMode?this._context.clearConversations(s,this.channelId).then((function(s){s===t.ErrorCode.SUCCESS?H(e.onSuccess,!0):(w.warn("clearConversations ->code:".concat(s)),W(e.onError,s))})):w.error("Method is only available in cppProtocol mode")},e.prototype.clearUnreadCount=function(e,s,n){t.assert("conversationType",e,t.AssertRules.NUMBER,!0),t.assert("targetId",s,t.AssertRules.STRING,!0),t.assert("callback",n,t.AssertRules.CALLBACK),w.info("clearUnreadCount ->targetId:".concat(s,",conversationType:").concat(e)),this._context.clearUnreadCount(e,s,this.channelId).then((function(e){e===t.ErrorCode.SUCCESS?H(n.onSuccess,!0):(w.warn("clearUnreadCount ->code:".concat(e,",targetId:").concat(s)),W(n.onError,e))}))},e.prototype.clearAllUnreadCount=function(e){t.assert("callback",e,t.AssertRules.CALLBACK),w.info("clearUnreadCount ->"),this._context.clearAllUnreadCount().then((function(s){s===t.ErrorCode.SUCCESS?H(e.onSuccess,!0):(w.warn("clearUnreadCount ->code:".concat(s)),W(e.onError,s))}))},e.prototype.getFirstUnreadMessage=function(e,s,n){t.assert("conversationType",e,t.AssertRules.NUMBER,!0),t.assert("targetId",s,t.AssertRules.STRING,!0),t.assert("callback",n,t.AssertRules.CALLBACK),w.info("getFirstUnreadMessage ->targetId:".concat(s,",conversationType:").concat(e)),this._context.getFirstUnreadMessage(e,s,this.channelId).then((function(e){e.code===t.ErrorCode.SUCCESS?H(n.onSuccess,e.data?K(e.data):null):(w.warn("getFirstUnreadMessage ->code:".concat(e.code,",targetId:").concat(s)),W(n.onError,e.code))}))},e.prototype.setConversationStatus=function(e,s,n,o){t.assert("conversationType",e,t.AssertRules.NUMBER,!0),t.assert("targetId",s,t.AssertRules.STRING,!0),t.assert("callback",o,t.AssertRules.CALLBACK),t.assert("status",n,t.AssertRules.OBJECT,!0),w.info("setConversationStatus ->targetId:".concat(s,",status:").concat(n));var a=n.isTop,r=n.notificationStatus;this._context.setConversationStatus(e,s,a,r,this.channelId).then((function(e){e===t.ErrorCode.SUCCESS?H(o.onSuccess):(w.warn("setConversationStatus ->code:".concat(e,",targetId:").concat(s)),W(o.onError,e))}))},e.prototype.sendMessage=function(e,s,o,r,c,i,u,d){var g=this;t.assert("conversationType",e,t.AssertRules.NUMBER,!0),t.assert("targetId",s,t.AssertRules.STRING,!0),t.assert("msg",o,t.AssertRules.OBJECT,!0),t.assert("callback",r,t.AssertRules.CALLBACK),t.assert("isMentioned",c,t.AssertRules.BOOLEAN),t.assert("pushContent",i,t.AssertRules.ONLY_STRING),t.assert("pushData",u,t.AssertRules.ONLY_STRING),t.assert("options.userIds",null==d?void 0:d.userIds,t.AssertRules.ARRAY),t.assert("options.isVoipPush",null==d?void 0:d.isVoipPush,t.AssertRules.BOOLEAN),t.assert("options.disableNotification",null==d?void 0:d.disableNotification,t.AssertRules.BOOLEAN),t.assert("options.canIncludeExpansion",null==d?void 0:d.canIncludeExpansion,t.AssertRules.BOOLEAN),t.assert("options.expansion",null==d?void 0:d.expansion,t.AssertRules.OBJECT),t.assert("options.pushConfig",null==d?void 0:d.pushConfig,t.AssertRules.OBJECT),t.assert("options.resendMessageId",null==d?void 0:d.resendMessageId,t.AssertRules.NUMBER),w.info("sendMessage ->targetId:".concat(s,",conversationType:").concat(e));var l=!(!(null==d?void 0:d.isStatusMessage)&&!(null==d?void 0:d.isStatus)),C=function(e,t,s){var n,o=e||{},a=o.userIds,r=o.isVoipPush,c=o.disableNotification,i=o.isFilerWhiteBlacklist,u=o.expansion,d=o.canIncludeExpansion,g=o.pushConfig,l=o.resendMessageId,C=[];if(t){var f=(s||{}).content.mentionedInfo;C=f.userIdList,n=f.type}return{mentionedType:n,mentionedUserIdList:C,directionalUserIdList:a,isVoipPush:r,disableNotification:c,isFilerWhiteBlacklist:i,expansion:u,canIncludeExpansion:d,pushConfig:g,messageId:l}}(d,c,o),f=Object.assign(o,a(a({isMentioned:c,pushContent:i,pushData:u},C),{messageType:o.objectName,channelId:this.channelId,isStatusMessage:l})),p=this._context.getCurrentUserId(),R=t.logger.ID();t.logger.info(t.LogTagId.A_SEND_MSG_T,{messageType:f.messageType,conversationType:e,targetId:s,channelId:this.channelId},{traceId:R}),this._context.sendMessage(e,s,f,r.onBefore,R).then((function(a){var c=a.code,i=a.data;if((c===t.ErrorCode.SUCCESS?t.logger.info:t.logger.warn)(t.LogTagId.A_SEND_MSG_R,{code:c,messageUId:i?i.messageUId:"",messageId:i?i.messageId:""},{traceId:R}),c===t.ErrorCode.SUCCESS){g._isCPPMode||P.set(i);var u=K(i);F(u,p,g._context.getConnectedTime(),g._readReceiptTimeout),H(r.onSuccess,u)}else w.warn("sendMessage ->code:".concat(c,",targetId:").concat(s)),W(r.onError,c,K({isMentioned:!!f.isMentioned,content:o.content,messageType:o.messageType,isPersited:o.isPersited,isCounted:o.isCounted,disableNotification:!!(null==d?void 0:d.disableNotification),canIncludeExpansion:!!(null==d?void 0:d.canIncludeExpansion),expansion:(null==d?void 0:d.expansion)||null,conversationType:e,targetId:s,senderUserId:p,messageUId:"",messageDirection:t.MessageDirection.SEND,isOffLineMessage:!1,sentTime:(null==i?void 0:i.sentTime)||0,receivedTime:0,isStatusMessage:l,receivedStatus:t.ReceivedStatus.UNREAD,messageId:null==i?void 0:i.messageId,sentStatus:n.FAILED}))}))},e.prototype.sendRecallMessage=function(e,s,n){var o=this;t.assert("message.conversationType",e.conversationType,t.AssertRules.NUMBER,!0),t.assert("message.targetId",e.targetId,t.AssertRules.STRING,!0),t.assert("message.messageUId",e.messageUId,t.AssertRules.STRING,!0),t.assert("message.sentTime",e.sentTime,t.AssertRules.NUMBER,!0),t.assert("callback",s,t.AssertRules.CALLBACK),t.assert("options.disableNotification",null==n?void 0:n.disableNotification,t.AssertRules.BOOLEAN),t.assert("options.pushConfig",null==n?void 0:n.pushConfig,t.AssertRules.OBJECT),t.assert("options.extra",null==n?void 0:n.extra,t.AssertRules.STRING);var r=e.conversationType,c=e.targetId,i=e.messageUId,u=e.sentTime;w.info("sendRecallMessage ->targetId:".concat(c,",conversationType:").concat(r,",messageUId:").concat(i));var d=a({channelId:this.channelId},n);this._context.recallMessage(r,c,i,u,d).then((function(e){var n=e.code,a=e.data;n===t.ErrorCode.SUCCESS?(o._isCPPMode||P.set(a),H(s.onSuccess,K(a))):(w.warn("sendRecallMessage ->code:".concat(n,",targetId:").concat(c,",messageUId:").concat(i)),W(s.onError,n))}))},e.prototype.sendTypingStatusMessage=function(e,s,n,o){t.assert("conversationType",e,t.AssertRules.NUMBER,!0),t.assert("targetId",s,t.AssertRules.STRING,!0),t.assert("typingContentType",n,t.AssertRules.STRING,!0),t.assert("callback",o,t.AssertRules.CALLBACK),w.info("sendTypingStatusMessage ->targetId:".concat(s,",conversationType:").concat(e));var a={messageType:"RC:TypSts",content:{typingContentType:n},isStatusMessage:!0,channelId:this.channelId},r=t.logger.ID();t.logger.info(t.LogTagId.A_SEND_MSG_T,{messageType:a.messageType,conversationType:e,targetId:s,channelId:a.channelId},{traceId:r}),this._context.sendMessage(e,s,a,void 0,r).then((function(e){var n=e.code,a=e.data;(n===t.ErrorCode.SUCCESS?t.logger.info:t.logger.warn)(t.LogTagId.A_SEND_MSG_R,{code:n,messageUId:a?a.messageUId:"",messageId:a?a.messageId:""},{traceId:r}),n===t.ErrorCode.SUCCESS?H(o.onSuccess,K(a)):(w.warn("sendTypingStatusMessage ->code:".concat(n,",targetId:").concat(s)),W(o.onError,n))}))},e.prototype.sendReceiptResponse=function(e,t,s){var n=this;w.info("sendReceiptResponse ->targetId:".concat(t,",conversationType:").concat(e));var o=this._context.getCurrentUserId(),a="".concat(o).concat(e).concat(t,"RECEIVED"),r=this._storage.get(a);if(r){var c=[];for(var i in r){var u={};u[i]=r[i].uIds,r[i].isResponse||c.push(u)}if(0===c.length)return void s.onSuccess(null);var d=setInterval((function(){1===c.length&&clearInterval(d);var o=c.splice(0,1)[0],i=new Y({receiptMessageDic:o});n.sendMessage(e,t,i,{onSuccess:function(e){var t=Object.keys(o)[0];r[t].isResponse=!0,n._storage.set(a,r),H(s.onSuccess,e)},onError:function(e){w.warn("sendReceiptResponse ->code:".concat(e,",targetId:").concat(t)),W(s.onError,e)}})}),200)}else s.onSuccess(null)},e.prototype.sendReadReceiptMessage=function(e,s,n){t.assert("messageUIds",e,t.AssertRules.ARRAY,!0),t.assert("targetId",s,t.AssertRules.STRING,!0),w.info("sendReadReceiptMessage ->targetId:".concat(s,",messageUIds:").concat(e));for(var o=0,a=e;o<a.length;o++){var r=a[o];t.assert("messageUId",r,t.AssertRules.STRING)}this._context.sendReadReceiptMessage(s,e,this.channelId).then((function(o){var a=o.code;a===t.ErrorCode.SUCCESS?n.onSuccess():(w.warn("sendReadReceiptMessage ->code:".concat(a,",targetId:").concat(s,",messageUIds:").concat(e)),n.onError(a))})).catch((function(t){w.warn("sendReadReceiptMessage ->code:".concat(t,",targetId:").concat(s,",messageUIds:").concat(e)),n.onError(t)}))},e.prototype.getMessageReader=function(e,s,n){t.assert("messageUId",e,t.AssertRules.STRING,!0),t.assert("targetId",s,t.AssertRules.STRING,!0),w.info("getMessageReader ->targetId:".concat(s,",messageUId:").concat(e)),this._context.getMessageReader(s,e,this.channelId).then((function(o){var a=o.code,r=o.data;a===t.ErrorCode.SUCCESS?n.onSuccess(r):(w.warn("getMessageReader ->code:".concat(a,",targetId:").concat(s,",messageUId:").concat(e)),n.onError(a))})).catch((function(t){w.warn("getMessageReader ->code:".concat(t,",targetId:").concat(s,",messageUId:").concat(e)),n.onError(t)}))},e.prototype.updateMessageExpansion=function(e,s,n){t.assert("expansion",e,t.AssertRules.OBJECT,!0),t.assert("message",s,t.AssertRules.OBJECT,!0);var o=s.conversationType,a=s.targetId,r=s.messageUId,c=s.canIncludeExpansion,i=s.expansion;w.info("updateMessageExpansion ->targetId:".concat(a,",messageUId:").concat(r,",conversationType:").concat(o)),this._context.sendExpansionMessage({conversationType:o,targetId:a,messageUId:r,canIncludeExpansion:c,originExpansion:i,expansion:e,channelId:this.channelId}).then((function(e){var s=e.code;s===t.ErrorCode.SUCCESS?H(n.onSuccess):(w.warn("updateMessageExpansion ->code:".concat(s,",targetId:").concat(a,",messageUId:").concat(r)),W(n.onError,s))}))},e.prototype.removeMessageExpansionForKey=function(e,s,n){t.assert("keys",e,t.AssertRules.ARRAY,!0),t.assert("message",s,t.AssertRules.OBJECT,!0);var o=s.conversationType,a=s.targetId,r=s.messageUId,c=s.canIncludeExpansion;w.info("removeMessageExpansionForKey ->targetId:".concat(a,",messageUId:").concat(r,",conversationType:").concat(o)),this._context.sendExpansionMessage({conversationType:o,targetId:a,messageUId:r,canIncludeExpansion:c,keys:e,channelId:this.channelId}).then((function(e){var s=e.code;s===t.ErrorCode.SUCCESS?H(n.onSuccess):(w.warn("removeMessageExpansionForKey ->code:".concat(s,",targetId:").concat(a,",messageUId:").concat(r)),W(n.onError,s))}))},e.prototype.getHistoryMessages=function(e,s,n,o,a,r,c){t.assert("conversationType",e,t.AssertRules.NUMBER,!0),t.assert("targetId",s,t.AssertRules.STRING,!0),t.assert("timestamp",n,t.AssertRules.NUMBER,!0),t.assert("count",o,t.AssertRules.NUMBER,!0),t.assert("callback",a,t.AssertRules.CALLBACK,!0),t.assert("order",c,t.AssertRules.NUMBER),w.info("getHistoryMessages ->targetId:".concat(s,",conversationType:").concat(e,",timestamp:").concat(n));var i=t.logger.ID();t.logger.info(t.LogTagId.A_GET_HISTORY_MSG_T,{targetId:s,conversationType:e,channelId:"",timestamp:n,count:o},{traceId:i}),this._context.getHistoryMessage(e,s,n,o,c,this.channelId,r,i).then((function(e){var n=e.code,o=e.data;if(n===t.ErrorCode.SUCCESS)if(o){var r=o.list,c=o.hasMore,u=[],d=r.map((function(e){return u.push(e.messageUId),K(e)}));t.logger.info(t.LogTagId.A_GET_HISTORY_MSG_R,{code:n,messageUIds:u.join(",")},{traceId:i}),H(a.onSuccess,d,c)}else t.logger.info(t.LogTagId.A_GET_HISTORY_MSG_R,{code:n,messageUIds:""},{traceId:i}),H(a.onSuccess,[],!1);else t.logger.warn(t.LogTagId.A_GET_HISTORY_MSG_R,{code:n,messageUIds:""},{traceId:i}),w.warn("getHistoryMessages ->code:".concat(n,",targetId:").concat(s)),W(a.onError,n)}))},e.prototype.deleteRemoteMessages=function(e,s,n,o){var a=this;t.assert("conversationType",e,t.AssertRules.NUMBER,!0),t.assert("targetId",s,t.AssertRules.STRING,!0),t.assert("messages",n,t.AssertRules.ARRAY,!0),t.assert("callback",o,t.AssertRules.CALLBACK),w.info("deleteRemoteMessages ->targetId:".concat(s,",conversationType:").concat(e)),this._context.deleteRemoteMessage(e,s,n,this.channelId).then((function(r){if(r===t.ErrorCode.SUCCESS){if(!a._isCPPMode){var c=P.get(e,s,a.channelId);c&&n.forEach((function(t){c.messageUId===t.messageUId&&P.remove(e,s,a.channelId)}))}H(o.onSuccess)}else w.warn("deleteRemoteMessages ->code:".concat(r,",targetId:").concat(s)),W(o.onError,r)}))},e.prototype.clearRemoteHistoryMessages=function(e,s){t.assert("param.conversationType",e.conversationType,t.AssertRules.NUMBER,!0),t.assert("param.targetId",e.targetId,t.AssertRules.STRING,!0),t.assert("param.timestamp",e.timestamp,t.AssertRules.NUMBER,!0),t.assert("callback",s,t.AssertRules.CALLBACK);var n=e.conversationType,o=e.targetId,a=e.timestamp;w.info("clearRemoteHistoryMessages ->targetId:".concat(o,",conversationType:").concat(n)),this._context.deleteRemoteMessageByTimestamp(n,o,a,this.channelId).then((function(e){e===t.ErrorCode.SUCCESS?H(s.onSuccess):(w.warn("clearRemoteHistoryMessages ->code:".concat(e)),W(s.onError,e))}))},e.prototype.getConversationListWithAllChannel=function(e){t.assert("callback",e,t.AssertRules.CALLBACK),this._context.getConversationListWithAllChannel().then((function(s){var n=s.code,o=s.data;n===t.ErrorCode.SUCCESS?H(e.onSuccess,o.map(G)):W(e.onError,n)}))},e.prototype.getConversationListWithAllChannelByPage=function(e,s,n){t.assert("callback",e,t.AssertRules.CALLBACK),t.assert("index",s,t.AssertRules.NUMBER),t.assert("limit",n,t.AssertRules.NUMBER),this._context.getConversationListWithAllChannelByPage(s,n).then((function(s){var n=s.code,o=s.data;n===t.ErrorCode.SUCCESS?H(e.onSuccess,o.map(G)):W(e.onError,n)}))},e.prototype.insertMessage=function(e,s,n,o,a){void 0===a&&(a={});var r=n.senderUserId,c=n.objectName,i=n.content,u=n.messageDirection,d=n.messageUId,g=n.canIncludeExpansion,l=n.expansion,C=n.disableNotification,f=n.sentTime,p=n.sentStatus;w.info("insertMessage ->targetId:".concat(s,",conversationType:").concat(e));var R=a.isUnread,h={senderUserId:r,messageType:c,content:i,messageDirection:u,sentTime:f,sentStatus:p,searchContent:a.searchContent,isUnread:R,messageUId:d,disableNotification:C,canIncludeExpansion:g,expansionMsg:JSON.stringify(l),channelId:this.channelId};this._context.insertMessage(e,s,h).then((function(e){var n=e.code,a=e.data;n===t.ErrorCode.SUCCESS?H(o.onSuccess,K(a)):(w.warn("insertMessage ->code:".concat(n,",targetId:").concat(s)),W(o.onError,n))}))},e.prototype.deleteLocalMessagesByTimestamp=function(e,s,n,o,a){w.info("deleteLocalMessagesByTimestamp ->targetId:".concat(s,",conversationType:").concat(e,",timestamp:").concat(n)),this._context.deleteMessagesByTimestamp(e,s,n,o,this.channelId).then((function(e){e===t.ErrorCode.SUCCESS?H(a.onSuccess,!0):(w.warn("deleteLocalMessagesByTimestamp ->code:".concat(e,",targetId:").concat(s)),W(a.onError,e))}))},e.prototype.getRemoteHistoryMessages=function(e,s,n,o,a,r){w.info("getRemoteHistoryMessages ->targetId:".concat(s,",conversationType:").concat(e));var c=r.order||0;this._context.getRemoteHistoryMessages(e,s,n,o,c,this.channelId).then((function(e){var n=e.code,o=e.data;if(n===t.ErrorCode.SUCCESS)if(o){var r=o.list,c=o.hasMore,i=r.map((function(e){return K(e)}));H(a.onSuccess,i,c)}else H(a.onSuccess,[],!1);else w.warn("getRemoteHistoryMessages ->code:".concat(n,",targetId:").concat(s)),W(a.onError,n)}))},e.prototype.clearMessages=function(e,s,n){var o=this;w.info("clearMessages ->targetId:".concat(s,",conversationType:").concat(e)),this._context.clearMessages(e,s,this.channelId).then((function(a){a===t.ErrorCode.SUCCESS?(o._isCPPMode||P.remove(e,s,o.channelId),H(n.onSuccess,!0)):(w.warn("clearMessages ->code:".concat(a,",targetId:").concat(s)),W(n.onError,a))}))},e.prototype.searchConversationByContent=function(e,s,n,o){w.info("searchConversationByContent ->keyword:".concat(e)),this._context.searchConversationByContent(e,o,this.channelId,n).then((function(n){var o=n.code,a=n.data,r=[];a=a||[],o===t.ErrorCode.SUCCESS?(a.forEach((function(e){r.push(G(e))})),H(s.onSuccess,r)):(w.warn("searchConversationByContent ->code:".concat(o,",keyword:").concat(e)),W(s.onError,o))}))},e.prototype.searchConversationByContentWithAllChannel=function(e,s,n,o){void 0===n&&(n=[]),t.logger.info("searchConversationByContentWithAllChannel ->keyword:".concat(e)),this._context.searchConversationByContentWithAllChannel(e,n,o).then((function(n){var o=n.code,a=n.data,r=[];a=a||[],o===t.ErrorCode.SUCCESS?(a.forEach((function(e){r.push(G(e))})),H(s.onSuccess,r)):(t.logger.warn("searchConversationByContentWithAllChannel ->code:".concat(o,",keyword:").concat(e)),W(s.onError,o))}))},e.prototype.searchMessageByContent=function(e,s,n,o,a,r,c){w.info("searchMessageByContent ->targetId:".concat(s,",conversationType:").concat(e,",keyword:").concat(n)),this._context.searchMessageByContent(e,s,n,o,a,r,this.channelId).then((function(e){var n=e.code,o=e.data,a=[];if(n===t.ErrorCode.SUCCESS){var r=o=o||{},i=r.messages,u=r.count;i.forEach((function(e){a.push(K(e))})),H(c.onSuccess,a,u)}else w.warn("searchMessageByContent ->code:".concat(n,",targetId:").concat(s)),W(c.onError,n)}))},e.prototype.searchMessageByContentWithAllChannel=function(e,s,n,o,a,r){t.logger.info("searchMessageByContentWithAllChannel ->targetId: ".concat(s," ,conversationType: ").concat(e," ,keyword: ").concat(n,", timestamp: ").concat(o,", count: ").concat(a)),this._context.searchMessageByContentWithAllChannel(e,s,n,o,a).then((function(e){var n=e.code,o=e.data,a=[];if(n===t.ErrorCode.SUCCESS){var c=o=o||{},i=c.messages,u=c.count;i.forEach((function(e){a.push(K(e))})),H(r.onSuccess,a,u)}else t.logger.warn("searchMessageByContentWithAllChannel ->code:".concat(n,",targetId:").concat(s)),W(r.onError,n)}))},e.prototype.searchMessageByContentInTimeRangeWithAllChannel=function(e,s,n,o,a,r,c,i){t.logger.info("searchMessageByContentInTimeRangeWithAllChannel ->targetId: ".concat(s," ,conversationType: ").concat(e," ,keyword: ").concat(n,", startTime: ").concat(o,", endTime: ").concat(a,", offset: ").concat(r,", limit: ").concat(c)),this._context.searchMessageByContentInTimeRangeWithAllChannel(e,s,n,o,a,r,c).then((function(e){var n=e.code,o=e.data,a=[];n===t.ErrorCode.SUCCESS?((o=o||{}).messages.forEach((function(e){a.push(K(e))})),H(i.onSuccess,a)):(t.logger.warn("searchMessageByContentInTimeRangeWithAllChannel ->code:".concat(n,",targetId:").concat(s)),W(i.onError,n))}))},e.prototype.getUnreadMentionedMessages=function(e,t){return w.info("getUnreadMentionedMessages ->targetId:".concat(t,",conversationType:").concat(e)),this._context.getUnreadMentionedMessages(e,t,this.channelId).map((function(e){return K(e)}))},e.prototype.clearUnreadCountByTimestamp=function(e,s,n,o){w.info("clearUnreadCountByTimestamp ->targetId:".concat(s,",conversationType:").concat(e)),this._context.clearUnreadCountByTimestamp(e,s,n,this.channelId).then((function(e){e===t.ErrorCode.SUCCESS?H(o.onSuccess,!0):(w.warn("clearUnreadCountByTimestamp ->code:".concat(e,",targetId:").concat(s)),W(o.onError,e))}))},e.prototype.getConversationNotificationStatus=function(e,s,n){w.info("getConversationNotificationStatus ->targetId:".concat(s,",conversationType:").concat(e)),this._context.getConversationNotificationStatus(e,s,this.channelId).then((function(e){var o=e.code,a=e.data;o===t.ErrorCode.SUCCESS?H(n.onSuccess,a):(w.warn("getConversationNotificationStatus ->code:".concat(o,",targetId:").concat(s)),W(n.onError,o))}))},e.prototype.getGroupMessageDeliverList=function(e,s,n){t.logger.info("getGroupMessageDeliverList ->targetId:".concat(e,"',messageUId:").concat(s)),this._context.getGroupMessageDeliverList(e,s,this.channelId).then((function(e){var o=e.code,a=e.data;o===t.ErrorCode.SUCCESS?H(n.onSuccess,a):(t.logger.warn("getGroupMessageDeliverList ->code:".concat(o,",messageUId:").concat(s)),W(n.onError,o))}))},e.prototype.getPrivateMessageDeliverTime=function(e,s){t.logger.info("getPrivateMessageDeliverTime -> messageUId:".concat(e)),this._context.getPrivateMessageDeliverTime(e,this.channelId).then((function(n){var o=n.code,a=n.data;o===t.ErrorCode.SUCCESS?H(s.onSuccess,a):(t.logger.warn("getPrivateMessageDeliverTime ->code:".concat(o,",messageUId:").concat(e)),W(s.onError,o))}))},e}(),X=function(e){return{targetId:e.targetId,channelId:e.channelId,conversationType:e.type}},z=function(){function e(e,s){this._context=e,this._options=s,this._channelClient={},this._isCPPMode=t.usingCppEngine(),this._defaultChannelClient=new Q(e,"",this._isCPPMode,s.readReceiptTimeout)}return e.prototype.assertCPPMode=function(e,s,n){if(!this._isCPPMode)return null==n||n.onError(t.ErrorCode.NOT_SUPPORT),void w.error("'".concat(s,"' is unusable!"));e()},e.prototype.install=function(e,t){return this._context.install(e,t)},e.prototype.getChannel=function(e){if(w.info("getChannel ->channelId:".concat(e)),!this._isCPPMode)return w.error("getChannel method is only available in protocol stack mode"),null;if(t.assert("channelId",e,t.AssertRules.STRING,!0),e.length>20)return w.error("The channelId cannot exceed 20 characters"),null;if(e in this._channelClient)return this._channelClient[e];if(Object.keys(this._channelClient).length>1e3)return w.error("Only 1000 channels can be obtained"),null;var s=new Q(this._context,e,this._isCPPMode,this._options.readReceiptTimeout);return this._channelClient[e]=s,s},e.prototype.deleteChannels=function(e){var s=this;t.assert("channelIds",e,t.AssertRules.ARRAY,!0),w.info("deleteChannels ->channelIds:".concat(e)),this.assertCPPMode((function(){e.forEach((function(e){delete s._channelClient[e]}))}),"deleteChannels")},e.prototype.getNavi=function(){return this._context.getInfoFromCache()||{}},e.prototype.getSDKInfo=function(){return{version:this._context.apiVersion}},e.prototype.getAppInfo=function(){return{appKey:this._context.appkey}},e.prototype.getCurrentUserId=function(){return this._context.getCurrentUserId()},e.prototype.disconnect=function(){return r(this,void 0,void 0,(function(){return c(this,(function(e){switch(e.label){case 0:return t.logger.info(t.LogTagId.A_DISCONNECT_O,{}),[4,this._context.disconnect()];case 1:return e.sent(),[2]}}))}))},e.prototype.logout=function(){return this.disconnect()},e.prototype.clearCache=function(){},e.prototype.getDeviceId=function(){return this._context.getDeviceId()},e.prototype.getConversationList=function(e,t,s){this._defaultChannelClient.getConversationList(e,t,s)},e.prototype.getConversationListWithAllChannel=function(e){this._defaultChannelClient.getConversationListWithAllChannel(e)},e.prototype.getConversationListWithAllChannelByPage=function(e,t,s){void 0===s&&(s=30),this._defaultChannelClient.getConversationListWithAllChannelByPage(e,t,s)},e.prototype.getConversation=function(e,t,s){return this._defaultChannelClient.getConversation(e,t,s)},e.prototype.removeConversation=function(e,t,s){return this._defaultChannelClient.removeConversation(e,t,s)},e.prototype.saveTextMessageDraft=function(e,t,s){return this._defaultChannelClient.saveTextMessageDraft(e,t,s)},e.prototype.getTextMessageDraft=function(e,t){return this._defaultChannelClient.getTextMessageDraft(e,t)},e.prototype.clearTextMessageDraft=function(e,t){return this._defaultChannelClient.clearTextMessageDraft(e,t)},e.prototype.getTotalUnreadCount=function(e,t,s){return this._defaultChannelClient.getTotalUnreadCount(e,t,s)},e.prototype.getUnreadCount=function(e,t,s){return this._defaultChannelClient.getUnreadCount(e,t,s)},e.prototype.getConversationUnreadCount=function(e,t){w.error("Method is deprecated")},e.prototype.clearConversations=function(e,t){return this._defaultChannelClient.clearConversations(e,t)},e.prototype.clearUnreadCount=function(e,t,s){this._defaultChannelClient.clearUnreadCount(e,t,s)},e.prototype.clearAllUnreadCount=function(e){this._defaultChannelClient.clearAllUnreadCount(e)},e.prototype.setConversationStatus=function(e,t,s,n){return this._defaultChannelClient.setConversationStatus(e,t,s,n)},e.prototype.sendMessage=function(e,t,s,n,o,a,r,c,i){return this._defaultChannelClient.sendMessage(e,t,s,n,o,a,r,i)},e.prototype.sendRecallMessage=function(e,t,s){return this._defaultChannelClient.sendRecallMessage(e,t,s)},e.prototype.sendTypingStatusMessage=function(e,t,s,n){return this._defaultChannelClient.sendTypingStatusMessage(e,t,s,n)},e.prototype.sendReceiptResponse=function(e,t,s){return this._defaultChannelClient.sendReceiptResponse(e,t,s)},e.prototype.sendReadReceiptMessage=function(e,t,s){return this._defaultChannelClient.sendReadReceiptMessage(e,t,s)},e.prototype.getMessageReader=function(e,t,s){this._defaultChannelClient.getMessageReader(e,t,s)},e.prototype.updateMessageExpansion=function(e,t,s){this._defaultChannelClient.updateMessageExpansion(e,t,s)},e.prototype.removeMessageExpansionForKey=function(e,t,s){this._defaultChannelClient.removeMessageExpansionForKey(e,t,s)},e.prototype.getHistoryMessages=function(e,t,s,n,o,a,r){return this._defaultChannelClient.getHistoryMessages(e,t,s,n,o,a,r)},e.prototype.joinChatRoom=function(e,s,n){t.assert("chatRoomId",e,t.AssertRules.STRING,!0),t.assert("count",s,t.AssertRules.NUMBER,!0),t.assert("callback",n,t.AssertRules.CALLBACK),w.info("joinChatRoom ->chatRoomId:".concat(e));var o=t.logger.ID();t.logger.info(t.LogTagId.A_JOIN_CHATROOM_T,{chatroomId:e,count:s,joinExist:!1},{traceId:o}),this._context.joinChatroom(e,s,o).then((function(s){(s===t.ErrorCode.SUCCESS?t.logger.info:t.logger.warn)(t.LogTagId.A_JOIN_CHATROOM_R,{code:s,timestamp:(new Date).getTime()},{traceId:o}),s===t.ErrorCode.SUCCESS?H(n.onSuccess):(w.warn("joinChatRoom ->code:".concat(s,",chatRoomId:").concat(e)),W(n.onError,s))}))},e.prototype.quitChatRoom=function(e,s){t.assert("chatRoomId",e,t.AssertRules.STRING,!0),t.assert("callback",s,t.AssertRules.CALLBACK),w.info("quitChatRoom ->chatRoomId:".concat(e));var n=t.logger.ID();t.logger.info(t.LogTagId.A_QUIT_CHATROOM_T,{chatroomId:e},{traceId:n}),this._context.quitChatroom(e).then((function(o){(o===t.ErrorCode.SUCCESS?t.logger.info:t.logger.warn)(t.LogTagId.A_QUIT_CHATROOM_R,{code:o},{traceId:n}),o===t.ErrorCode.SUCCESS?H(s.onSuccess):(w.warn("quitChatRoom ->code:".concat(o,",chatRoomId:").concat(e)),W(s.onError,o))}))},e.prototype.getChatRoomInfo=function(e,s,n,o){t.assert("chatRoomId",e,t.AssertRules.STRING,!0),t.assert("count",s,t.AssertRules.NUMBER,!0),t.assert("order",n,t.AssertRules.NUMBER,!0),t.assert("callback",o,t.AssertRules.CALLBACK),w.info("getChatRoomInfo ->chatRoomId:".concat(e)),this._context.getChatroomInfo(e,s,n).then((function(s){var n=s.code,a=s.data;n===t.ErrorCode.SUCCESS?H(o.onSuccess,{userInfos:(null==a?void 0:a.userInfos)||[],userTotalNums:(null==a?void 0:a.userCount)||0}):(w.warn("getChatRoomInfo ->code:".concat(n,",chatRoomId:").concat(e)),W(o.onError,n))}))},e.prototype.setChatroomEntry=function(e,s,n){t.assert("chatRoomId",e,t.AssertRules.STRING,!0),t.assert("chatroomEntry",s,t.AssertRules.OBJECT,!0),t.assert("callback",n,t.AssertRules.CALLBACK),w.info("setChatroomEntry ->chatRoomId:".concat(e)),this._context.setChatroomEntry(e,s).then((function(s){s===t.ErrorCode.SUCCESS?H(n.onSuccess):(w.warn("setChatroomEntry ->code:".concat(s,",chatRoomId:").concat(e)),W(n.onError,s))}))},e.prototype.setChatRoomEntries=function(e,s,n){if(t.assert("chatRoomId",e,t.AssertRules.STRING,!0),function(e){e.entries.forEach((function(e){t.assert("entry.key",e.key,t.AssertRules.STRING,!0),t.assert("entry.value",e.value,t.AssertRules.STRING,!0)})),t.assert("options.isAutoDelete",e.isAutoDelete,t.AssertRules.BOOLEAN)}(s),t.assert("callback",n,t.AssertRules.CALLBACK),s.entries.length>10)W(n.onError,t.ErrorCode.CHATROOM_KV_STORE_OUT_LIMIT);else{var o="id:".concat(e);w.info("set chatroom entry->".concat(o)),this._context.setChatroomEntries(e,s).then((function(e){var s=e.code,a=e.data;s===t.ErrorCode.SUCCESS?H(n.onSuccess):(w.warn("set chatroom entry fail ->code+:".concat(s,",").concat(o)),W(n.onError,s,a))}))}},e.prototype.forceSetChatroomEntry=function(e,s,n){t.assert("chatRoomId",e,t.AssertRules.STRING,!0),t.assert("chatroomEntry",s,t.AssertRules.OBJECT,!0),t.assert("callback",n,t.AssertRules.CALLBACK),w.info("forceSetChatroomEntry ->chatRoomId:".concat(e)),this._context.forceSetChatroomEntry(e,s).then((function(s){s===t.ErrorCode.SUCCESS?H(n.onSuccess):(w.warn("forceSetChatroomEntry ->code:".concat(s,",chatRoomId:").concat(e)),W(n.onError,s))}))},e.prototype.removeChatroomEntry=function(e,s,n){t.assert("chatRoomId",e,t.AssertRules.STRING,!0),t.assert("chatroomEntry",s,t.AssertRules.OBJECT,!0),t.assert("callback",n,t.AssertRules.CALLBACK),w.info("removeChatroomEntry ->chatRoomId:".concat(e)),this._context.removeChatroomEntry(e,s).then((function(s){s===t.ErrorCode.SUCCESS?H(n.onSuccess):(w.warn("removeChatroomEntry ->code:".concat(s,",chatRoomId:").concat(e)),W(n.onError,s))}))},e.prototype.removeChatRoomEntries=function(e,s,n){t.assert("chatRoomId",e,t.AssertRules.STRING,!0),function(e){e.entries.forEach((function(e){t.assert("key",e,t.AssertRules.STRING,!0)}))}(s);var o="id:".concat(e);w.debug("remove chatroom entry->".concat(o));var r=a({},s);r.entries=s.entries.map((function(e){return{key:e}})),this._context.removeChatroomEntries(e,r).then((function(e){var s=e.code,a=e.data;s===t.ErrorCode.SUCCESS?H(n.onSuccess):(w.warn("remove chatroom entry fail ->code+:".concat(s,",").concat(o)),W(n.onError,s,a))}))},e.prototype.forceRemoveChatroomEntry=function(e,s,n){t.assert("chatRoomId",e,t.AssertRules.STRING,!0),t.assert("chatroomEntry",s,t.AssertRules.OBJECT,!0),t.assert("callback",n,t.AssertRules.CALLBACK),w.info("forceRemoveChatroomEntry ->chatRoomId:".concat(e)),this._context.forceRemoveChatroomEntry(e,s).then((function(s){s===t.ErrorCode.SUCCESS?H(n.onSuccess):(w.warn("forceRemoveChatroomEntry ->code:".concat(s,",chatRoomId:").concat(e)),W(n.onError,s))}))},e.prototype.getChatroomEntry=function(e,s,n){t.assert("chatRoomId",e,t.AssertRules.STRING,!0),t.assert("key",s,t.AssertRules.STRING,!0),t.assert("callback",n,t.AssertRules.CALLBACK),w.info("getChatroomEntry ->chatRoomId:".concat(e,",key:").concat(s)),this._context.getChatroomEntry(e,s).then((function(s){var o=s.code,a=s.data;o===t.ErrorCode.SUCCESS?H(n.onSuccess,a||""):(w.warn("getChatroomEntry ->code:".concat(o,",chatRoomId:").concat(e)),W(n.onError,o))}))},e.prototype.getAllChatroomEntries=function(e,s){t.assert("chatRoomId",e,t.AssertRules.STRING,!0),t.assert("callback",s,t.AssertRules.CALLBACK),w.info("getAllChatroomEntries ->chatRoomId:".concat(e)),this._context.getAllChatroomEntries(e).then((function(n){var o=n.code,a=n.data;o===t.ErrorCode.SUCCESS?H(s.onSuccess,a):(w.warn("getAllChatroomEntries ->code:".concat(o,",chatRoomId:").concat(e)),W(s.onError,o))}))},e.prototype.getChatRoomHistoryMessages=function(e,s,n,o,a){void 0===a&&(a=0),t.assert("chatRoomId",e,t.AssertRules.STRING,!0),t.assert("count",s,t.AssertRules.NUMBER,!0),t.assert("order",n,t.AssertRules.NUMBER,!0),t.assert("callback",o,t.AssertRules.CALLBACK),t.assert("timestamp",a,t.AssertRules.NUMBER),w.info("getChatRoomHistoryMessages ->chatRoomId:".concat(e)),this._context.getChatRoomHistoryMessages(e,s,n,a).then((function(s){var n=s.code,a=s.data;if(n===t.ErrorCode.SUCCESS)if(a){var r=a.list,c=a.hasMore,i=r.map((function(e){return K(e)}));H(o.onSuccess,i,c)}else H(o.onSuccess,[],!1);else w.warn("getChatRoomHistoryMessages ->code:".concat(n,",chatRoomId:").concat(e)),W(o.onError,n)}))},e.prototype.setDeviceInfo=function(e){},e.prototype.getCurrentConnectionStatus=function(){return this._context.getConnectionStatus()},e.prototype.deleteRemoteMessages=function(e,t,s,n){return this._defaultChannelClient.deleteRemoteMessages(e,t,s,n)},e.prototype.clearRemoteHistoryMessages=function(e,t){return this._defaultChannelClient.clearRemoteHistoryMessages(e,t)},e.prototype.getFileToken=function(e,s,n,o,a){t.assert("fileType",e,t.AssertRules.NUMBER,!0),t.assert("fileName",n,t.AssertRules.STRING),t.assert("callback",s,t.AssertRules.CALLBACK),w.info("getFileToken ->fileType:".concat(e,",fileName:").concat(n,",queryString:").concat(a)),this._context.getFileToken(e,n,o,a).then(s.onSuccess).catch(s.onError)},e.prototype.getFileUrl=function(e,s,n,o,a,r){t.assert("fileType",e,t.AssertRules.NUMBER,!0),t.assert("fileName",s,t.AssertRules.STRING,!0),t.assert("saveName",n,t.AssertRules.STRING),t.assert("callback",o,t.AssertRules.CALLBACK),t.assert("serverType",r,t.AssertRules.NUMBER),t.assert("uploadRes",a,t.AssertRules.OBJECT),w.info("getFileUrl ->fileType:".concat(e,",fileName:").concat(s)),this._context.getFileUrl(e,s,n,a,r).then(o.onSuccess).catch(o.onError)},e.prototype.createTag=function(e,s){t.assert("tag.tagId",e.tagId,t.AssertRules.STRING,!0),t.assert("tag.tagId",e.tagId,(function(e){return e.length<=10})),t.assert("tag.tagName",e.tagName,(function(e){return e.length<=15})),t.assert("tag.tagName",e.tagName,t.AssertRules.STRING,!0),t.assert("callback",s,t.AssertRules.CALLBACK),w.info("createTag ->tagId:".concat(e.tagId,",tagName:").concat(e.tagName)),this._context.createTag(e).then((function(n){var o=n.code;o===t.ErrorCode.SUCCESS?s.onSuccess():(w.warn("createTag ->code:".concat(o,",tagId:").concat(e.tagId)),s.onError(o))})).catch((function(t){w.warn("createTag ->code:".concat(t,",tagId:").concat(e.tagId)),s.onError(t)}))},e.prototype.removeTag=function(e,s){t.assert("tagId",e,t.AssertRules.STRING,!0),t.assert("callback",s,t.AssertRules.CALLBACK),w.info("removeTag ->tagId:".concat(e)),this._context.removeTag(e).then((function(n){var o=n.code;o===t.ErrorCode.SUCCESS?s.onSuccess():(w.warn("removeTag ->code:".concat(o,",tagId:").concat(e)),s.onError(o))})).catch((function(t){w.warn("removeTag ->code:".concat(t,",tagId:").concat(e)),s.onError(t)}))},e.prototype.updateTag=function(e,s){t.assert("tag.tagId",e.tagId,t.AssertRules.STRING,!0),t.assert("tag.tagName",e.tagName,t.AssertRules.STRING,!0),t.assert("tag.tagName",e.tagName,(function(e){return e.length<=15})),t.assert("callback",s,t.AssertRules.CALLBACK),w.info("updateTag ->tagId:".concat(e.tagId,",tagName:").concat(e.tagName)),this._context.updateTag(e).then((function(n){var o=n.code;o===t.ErrorCode.SUCCESS?s.onSuccess():(w.warn("updateTag ->code:".concat(o,",tagId:").concat(e.tagId)),s.onError(o))})).catch((function(t){w.warn("updateTag ->reason:".concat(t,",tagId:").concat(e.tagId)),s.onError(t)}))},e.prototype.getTagList=function(e){t.assert("callback",e,t.AssertRules.CALLBACK),this._context.getTagList().then((function(s){var n=s.code,o=s.data;n===t.ErrorCode.SUCCESS?e.onSuccess(o||[]):(w.warn("getTagList ->code:".concat(n)),e.onError(n))})).catch((function(t){w.warn("getTagList ->reason:".concat(t)),e.onError(t)}))},e.prototype.getTagsForConversation=function(e,s){t.assert("conversationType",e.type,t.AssertRules.NUMBER),t.assert("targetId",e.targetId,t.AssertRules.STRING),t.assert("channelId",e.channelId,t.AssertRules.ONLY_STRING),t.assert("callback",s,t.AssertRules.CALLBACK),w.info("getTagsForConversation ->targetId:".concat(e.targetId,",conversationType:").concat(e.type)),this._context.getTagsForConversation(X(e)).then((function(e){var n=e.code,o=e.data;n===t.ErrorCode.SUCCESS?s.onSuccess(o||[]):(w.warn("getTagsForConversation ->code:".concat(n)),s.onError(n))})).catch((function(e){w.warn("getTagsForConversation ->reason:".concat(e)),s.onError(e)}))},e.prototype.addTagForConversations=function(e,s,n){t.assert("tagId",e,t.AssertRules.STRING,!0),t.assert("conversations",s,t.AssertRules.ARRAY,!0),t.assert("callback",n,t.AssertRules.CALLBACK),s.forEach((function(e){t.assert("conversation.type",e.type,t.AssertRules.NUMBER,!0),t.assert("conversation.targetId",e.targetId,t.AssertRules.STRING,!0),t.assert("conversation.channelId",e.channelId,t.AssertRules.ONLY_STRING)})),w.info("addTagForConversations ->tagId:".concat(e)),this._context.addTagForConversations(e,s.map((function(e){return X(e)}))).then((function(s){var o=s.code;s.data,o===t.ErrorCode.SUCCESS?n.onSuccess():(w.warn("addTagForConversations ->code:".concat(o,",tagId:").concat(e)),n.onError(o))})).catch((function(t){w.warn("addTagForConversations ->reason:".concat(t,",tagId:").concat(e)),n.onError(t)}))},e.prototype.removeTagForConversations=function(e,s,n){t.assert("tagId",e,t.AssertRules.STRING,!0),t.assert("conversations",s,t.AssertRules.ARRAY,!0),t.assert("callback",n,t.AssertRules.CALLBACK),s.forEach((function(e){t.assert("conversation.type",e.type,t.AssertRules.NUMBER,!0),t.assert("conversation.targetId",e.targetId,t.AssertRules.STRING,!0),t.assert("conversation.channelId",e.channelId,t.AssertRules.ONLY_STRING)})),w.info("removeTagForConversations ->tagId:".concat(e)),this._context.removeTagForConversations(e,s.map((function(e){return X(e)}))).then((function(s){var o=s.code;s.data,o===t.ErrorCode.SUCCESS?n.onSuccess():(w.warn("removeTagForConversations ->code:".concat(o,",tagId:").concat(e)),n.onError(o))})).catch((function(t){w.warn("removeTagForConversations ->reason:".concat(t,",tagId:").concat(e)),n.onError(t)}))},e.prototype.removeTagsForConversation=function(e,s,n){t.assert("conversation.type",e.type,t.AssertRules.NUMBER,!0),t.assert("conversation.targetId",e.targetId,t.AssertRules.STRING,!0),t.assert("conversation.channelId",e.channelId,t.AssertRules.ONLY_STRING),t.assert("tagIds",s,t.AssertRules.ARRAY,!0),t.assert("callback",n,t.AssertRules.CALLBACK),s.forEach((function(e){t.assert("tagId",e,t.AssertRules.STRING,!0)})),w.info("removeTagsForConversation ->tagIds:".concat(s,",targetId:").concat(e.targetId,",type:").concat(e.type)),this._context.removeTagsForConversation(X(e),s).then((function(e){var o=e.code;e.data,o===t.ErrorCode.SUCCESS?n.onSuccess():(w.warn("removeTagsForConversation ->code:".concat(o,",tagIds:").concat(s)),n.onError(o))})).catch((function(e){w.warn("removeTagsForConversation ->reason:".concat(e,",tagIds:").concat(s)),n.onError(e)}))},e.prototype.getConversationListByTag=function(e,s,n,o){t.assert("tagId",e,t.AssertRules.STRING,!0),t.assert("count",s,t.AssertRules.NUMBER,!0),t.assert("startTime",n,t.AssertRules.NUMBER,!0),t.assert("callback",o,t.AssertRules.CALLBACK,!0),w.info("getConversationListByTag ->tagId:".concat(e)),this._context.getConversationListByTag(e,n,s).then((function(s){var n=s.code,a=s.data,r=[];n===t.ErrorCode.SUCCESS?((a=a||[]).forEach((function(e){r.push(function(e){var t=e.channelId,s=e.conversationType,n=e.targetId,o=e.unreadMessageCount,a=e.latestMessage,r=e.isTop,c=e.notificationStatus,i=e.isTopInTag,u=a?K(a):null,d=u||{};return d.messageType,d.sentTime,d.receivedStatus,d.messageId,{channelId:t||"",conversationType:s,targetId:n,unreadMessageCount:o,latestMessage:u,isTopInTag:i,latestMessageId:null==u?void 0:u.messageId,objectName:null==u?void 0:u.messageType,sentTime:null==u?void 0:u.sentTime,isTop:r,notificationStatus:c,receivedStatus:null==u?void 0:u.receivedStatus}}(e))})),o.onSuccess(r)):(w.warn("getConversationListByTag ->code:".concat(n,",tagId:").concat(e)),o.onError(n))})).catch((function(t){w.warn("getConversationListByTag ->reason:".concat(t,",tagId:").concat(e)),o.onError(t)}))},e.prototype.getUnreadCountByTag=function(e,s,n){t.assert("tagId",e,t.AssertRules.STRING,!0),t.assert("containMuted",s,t.AssertRules.BOOLEAN,!0),t.assert("callback",n,t.AssertRules.CALLBACK),w.info("getUnreadCountByTag ->tagId:".concat(e)),this._context.getUnreadCountByTag(e,s).then((function(s){var o=s.code,a=s.data;w.info(o,a),o===t.ErrorCode.SUCCESS?n.onSuccess(a||0):(w.warn("getUnreadCountByTag ->code:".concat(o,",tagId:").concat(e)),n.onError(o))})).catch((function(t){w.warn("getUnreadCountByTag ->reason:".concat(t,",tagId:").concat(e)),n.onError(t)}))},e.prototype.setConversationStatusInTag=function(e,s,n,o){t.assert("tagId",e,t.AssertRules.STRING,!0),t.assert("conversation.targetId",s.targetId,t.AssertRules.STRING,!0),t.assert("conversation.type",s.type,t.AssertRules.NUMBER,!0),t.assert("conversation.channelId",s.channelId,t.AssertRules.ONLY_STRING),t.assert("status.isTop",null==n?void 0:n.isTop,t.AssertRules.BOOLEAN,!0),t.assert("callback",o,t.AssertRules.CALLBACK),w.info("setConversationStatusInTag ->tagId:".concat(e,",targetId:").concat(s.targetId,",type").concat(s.type)),this._context.setConversationStatusInTag(e,X(s),n).then((function(s){var n=s.code;s.data,n===t.ErrorCode.SUCCESS?o.onSuccess():(w.warn("setConversationStatusInTag ->code:".concat(n,",tagId:").concat(e)),o.onError(n))})).catch((function(t){w.warn("setConversationStatusInTag ->reason:".concat(t,",tagId:").concat(e)),o.onError(t)}))},e.prototype.callExtra=function(e,s){for(var n,o=[],a=2;a<arguments.length;a++)o[a-2]=arguments[a];w.info("callExtra ->method:".concat(e)),(n=this._context).callExtra.apply(n,i([e],o,!1)).then((function(n){var o=n.code,a=n.data;if(o!==t.ErrorCode.SUCCESS)w.warn("callExtra ->code:".concat(o)),s.onError&&W(s.onError,o);else{if("getConversationsByPage"===e&&a.forEach((function(e){e.latestMessage=e.latestMessage?K(e.latestMessage):null})),"getHistoryMessagesByObjectNames"===e){var r=a,c=r.list,i=r.hasMore,u=c.map((function(e){return K(e)}));return void H(s.onSuccess,u,i)}s.onSuccess&&H(s.onSuccess,a)}}))},e.prototype.hasRemoteUnreadMessages=function(e,s){t.assert("callback",s,t.AssertRules.CALLBACK),w.info("hasRemoteUnreadMessages ->token:".concat(e)),this.assertCPPMode((function(){H(s.onSuccess,!1)}),"hasRemoteUnreadMessages",s)},e.prototype.setUserStatusListener=function(e,t){var s=this;w.info("setUserStatusListener ->userIds:".concat(e.userIds)),this.assertCPPMode((function(){s._context.setUserStatusListener(e,t)}),"setUserStatusListener")},e.prototype.setUserStatus=function(e,s){var n=this;t.assert("status",e,t.AssertRules.NUMBER),t.assert("callback",s,t.AssertRules.CALLBACK),w.info("setUserStatus ->status:".concat(e)),this.assertCPPMode((function(){n._context.setUserStatus(e).then((function(e){e===t.ErrorCode.SUCCESS?H(s.onSuccess,!0):(w.warn("setUserStatus ->code:".concat(e)),W(s.onError,e))}))}),"setUserStatus",s)},e.prototype.getUserStatus=function(e,s){var n=this;t.assert("userId",e,t.AssertRules.STRING),t.assert("callback",s,t.AssertRules.CALLBACK),w.info("getUserStatus ->userId:".concat(e)),this.assertCPPMode((function(){n._context.getUserStatus(e).then((function(n){var o=n.code,a=n.data;o===t.ErrorCode.SUCCESS?H(s.onSuccess,a):(w.warn("getUserStatus ->code:".concat(o,",useerId:").concat(e)),W(s.onError,o))}))}),"getUserStatus",s)},e.prototype.addToBlacklist=function(e,s){var n=this;t.assert("userId",e,t.AssertRules.STRING),t.assert("callback",s,t.AssertRules.CALLBACK),w.info("addToBlacklist ->userId:".concat(e)),this.assertCPPMode((function(){n._context.addToBlacklist(e).then((function(n){n===t.ErrorCode.SUCCESS?H(s.onSuccess):(w.warn("addToBlacklist ->code:".concat(n,",useerId:").concat(e)),W(s.onError,n))}))}),"addToBlacklist",s)},e.prototype.removeFromBlacklist=function(e,s){var n=this;t.assert("userId",e,t.AssertRules.STRING),t.assert("callback",s,t.AssertRules.CALLBACK),w.info("removeFromBlacklist ->userId:".concat(e)),this.assertCPPMode((function(){n._context.removeFromBlacklist(e).then((function(n){n===t.ErrorCode.SUCCESS?H(s.onSuccess):(w.warn("removeFromBlacklist ->code:".concat(n,",useerId:").concat(e)),W(s.onError,n))}))}),"removeFromBlacklist",s)},e.prototype.getBlacklist=function(e){var s=this;t.assert("callback",e,t.AssertRules.CALLBACK),this.assertCPPMode((function(){s._context.getBlacklist().then((function(s){var n=s.code,o=s.data;n===t.ErrorCode.SUCCESS?H(e.onSuccess,o):(w.warn("getBlacklist ->code:".concat(n)),W(e.onError,n))}))}),"getBlacklist",e)},e.prototype.getBlacklistStatus=function(e,s){var n=this;t.assert("userId",e,t.AssertRules.STRING),t.assert("callback",s,t.AssertRules.CALLBACK),w.info("getBlacklistStatus ->userId:".concat(e)),this.assertCPPMode((function(){n._context.getBlacklistStatus(e).then((function(n){var o=n.code,a=n.data;o===t.ErrorCode.SUCCESS?H(s.onSuccess,a):(w.warn("getBlacklistStatus ->code:".concat(o,",userId:").concat(e)),W(s.onError,o))}))}),"getBlacklistStatus",s)},e.prototype.insertMessage=function(e,s,n,o,a){var r=this;void 0===a&&(a={}),t.assert("conversationType",e,t.AssertRules.NUMBER,!0),t.assert("targetId",s,t.AssertRules.STRING,!0),t.assert("content.senderUserId",n.senderUserId,t.AssertRules.STRING,!0),t.assert("callback",o,t.AssertRules.CALLBACK),w.info("insertMessage ->targetId:".concat(s,",conversationType:").concat(e,",senderUserId:").concat(n.senderUserId)),this.assertCPPMode((function(){r._defaultChannelClient.insertMessage(e,s,n,o,a)}),"insertMessage",o)},e.prototype.getRemoteHistoryMessages=function(e,s,n,o,a,r){var c=this;void 0===r&&(r={}),t.assert("conversationType",e,t.AssertRules.NUMBER,!0),t.assert("targetId",s,t.AssertRules.STRING,!0),t.assert("timestamp",n,t.AssertRules.NUMBER,!0),t.assert("count",o,t.AssertRules.NUMBER,!0),t.assert("callback",a,t.AssertRules.CALLBACK),t.assert("options.order",r.order,t.AssertRules.NUMBER),this.assertCPPMode((function(){c._defaultChannelClient.getRemoteHistoryMessages(e,s,n,o,a,r)}),"getRemoteHistoryMessages",a)},e.prototype.deleteLocalMessages=function(e,s,n,o){var a=this;t.assert("messageIds",n,t.AssertRules.ARRAY,!0),t.assert("callback",o,t.AssertRules.CALLBACK),w.info("deleteLocalMessages ->messageIds:".concat(n)),this.assertCPPMode((function(){a._context.deleteMessages(n).then((function(e){e===t.ErrorCode.SUCCESS?H(o.onSuccess,!0):(w.warn("deleteLocalMessages ->code:".concat(e,",messageIds:").concat(n)),W(o.onError,e))}))}),"deleteLocalMessages",o)},e.prototype.deleteLocalMessagesByTimestamp=function(e,s,n,o,a){var r=this;t.assert("conversationType",e,t.AssertRules.NUMBER,!0),t.assert("targetId",s,t.AssertRules.STRING,!0),t.assert("timestamp",n,t.AssertRules.NUMBER,!0),t.assert("cleanSpace",o,t.AssertRules.BOOLEAN),t.assert("callback",a,t.AssertRules.CALLBACK),this.assertCPPMode((function(){r._defaultChannelClient.deleteLocalMessagesByTimestamp(e,s,n,o,a)}),"deleteLocalMessagesByTimestamp",a)},e.prototype.clearMessages=function(e,s,n){var o=this;t.assert("conversationType",e,t.AssertRules.NUMBER,!0),t.assert("targetId",s,t.AssertRules.STRING,!0),t.assert("callback",n,t.AssertRules.CALLBACK),this.assertCPPMode((function(){o._defaultChannelClient.clearMessages(e,s,n)}),"clearMessages",n)},e.prototype.getMessage=function(e,s){var n=this;t.assert("callback",s,t.AssertRules.CALLBACK),this.assertCPPMode((function(){n._context.getMessage(e).then((function(n){var o=n.code,a=n.data;o===t.ErrorCode.SUCCESS?H(s.onSuccess,K(a)):(w.warn("getMessage ->code:".concat(o,",messageId:").concat(e)),W(s.onError,o))}))}),"getMessage",s)},e.prototype.setMessageSentStatus=function(e,s,n){var o=this;t.assert("messageId",e,t.AssertRules.NUMBER,!0),t.assert("sentStatus",s,t.AssertRules.NUMBER,!0),w.info("setMessageSentStatus ->messageId:".concat(e,",sentStatus:").concat(s)),this.assertCPPMode((function(){o._context.setMessageSentStatus(e,s).then((function(s){s===t.ErrorCode.SUCCESS?H(n.onSuccess,!0):(w.warn("setMessageSentStatus ->code:".concat(s,",messageId:").concat(e)),W(n.onError,s))}))}),"setMessageSentStatus",n)},e.prototype.setMessageReceivedStatus=function(e,s,n){var o=this;t.assert("messageId",e,t.AssertRules.NUMBER,!0),t.assert("receivedStatus",s,t.AssertRules.NUMBER,!0),w.info("setMessageReceivedStatus ->messageId:".concat(e,",receivedStatus:").concat(s)),this.assertCPPMode((function(){o._context.setMessageReceivedStatus(e,s).then((function(s){s===t.ErrorCode.SUCCESS?H(n.onSuccess,!0):(w.warn("setMessageReceivedStatus ->code:".concat(s,",messageId:").concat(e)),W(n.onError,s))}))}),"setMessageReceivedStatus",n)},e.prototype.setMessageContent=function(e,s,n,o){var a=this;t.assert("messageId",e,t.AssertRules.NUMBER,!0),t.assert("objectName",n,t.AssertRules.ONLY_STRING,!0),w.info("setMessageContent ->messageId:".concat(e,",objectName:").concat(n)),this.assertCPPMode((function(){a._context.setMessageContent(e,s,n).then((function(s){s===t.ErrorCode.SUCCESS?H(o.onSuccess,!0):(t.logger.warn("setMessageContent ->code:".concat(s,",messageId:").concat(e)),W(o.onError,s))}))}),"setMessageContent",o)},e.prototype.setMessageSearchField=function(e,s,n){var o=this;t.assert("messageId",e,t.AssertRules.NUMBER,!0),t.assert("searchFiles",n,t.AssertRules.STRING,!0),w.info("setMessageSearchField ->messageId:".concat(e,",searchFiles:").concat(n)),this.assertCPPMode((function(){o._context.setMessageSearchField(e,s,n)}),"setMessageSearchField")},e.prototype.searchConversationByContent=function(e,s,n,o){var a=this;t.assert("keyword",e,t.AssertRules.STRING,!0),t.assert("callback",s,t.AssertRules.CALLBACK),t.assert("conversationTypes",n,t.AssertRules.ARRAY),t.assert("customMessageType",o,t.AssertRules.ARRAY),this.assertCPPMode((function(){a._defaultChannelClient.searchConversationByContent(e,s,n,o)}),"searchConversationByContent",s)},e.prototype.searchConversationByContentWithAllChannel=function(e,s,n,o){var a=this;void 0===n&&(n=[]),t.assert("keyword",e,t.AssertRules.STRING,!0),t.assert("callback",s,t.AssertRules.CALLBACK),t.assert("conversationTypes",o,t.AssertRules.ARRAY),t.assert("customMessageType",n,t.AssertRules.ARRAY),this.assertCPPMode((function(){a._defaultChannelClient.searchConversationByContentWithAllChannel(e,s,n,o)}),"searchConversationByContentWithAllChannel",s)},e.prototype.searchMessageByContent=function(e,s,n,o,a,r,c){var i=this;t.assert("conversationType",e,t.AssertRules.NUMBER,!0),t.assert("targetId",s,t.AssertRules.STRING,!0),t.assert("keyword",n,t.AssertRules.STRING,!0),t.assert("timestamp",o,t.AssertRules.NUMBER),t.assert("count",a,t.AssertRules.NUMBER),t.assert("total",r,t.AssertRules.NUMBER),t.assert("callback",c,t.AssertRules.CALLBACK),this.assertCPPMode((function(){i._defaultChannelClient.searchMessageByContent(e,s,n,o,a,r,c)}),"searchMessageByContent",c)},e.prototype.searchMessageByContentWithAllChannel=function(e,s,n,o,a,r){var c=this;t.assert("conversationType",e,t.AssertRules.NUMBER,!0),t.assert("targetId",s,t.AssertRules.STRING,!0),t.assert("keyword",n,t.AssertRules.STRING,!0),t.assert("timestamp",o,t.AssertRules.NUMBER),t.assert("count",a,t.AssertRules.NUMBER),t.assert("callback",r,t.AssertRules.CALLBACK),this.assertCPPMode((function(){c._defaultChannelClient.searchMessageByContentWithAllChannel(e,s,n,o,a,r)}),"searchMessageByContentWithAllChannel",r)},e.prototype.searchMessageByContentInTimeRangeWithAllChannel=function(e,s,n,o,a,r,c,i){var u=this;t.assert("conversationType",e,t.AssertRules.NUMBER,!0),t.assert("targetId",s,t.AssertRules.STRING,!0),t.assert("keyword",n,t.AssertRules.STRING,!0),t.assert("startTime",o,t.AssertRules.NUMBER),t.assert("endTime",a,t.AssertRules.NUMBER),t.assert("offset",r,t.AssertRules.NUMBER),t.assert("limit",c,t.AssertRules.NUMBER),t.assert("callback",i,t.AssertRules.CALLBACK),this.assertCPPMode((function(){u._defaultChannelClient.searchMessageByContentInTimeRangeWithAllChannel(e,s,n,o,a,r,c,i)}),"searchMessageByContentInTimeRangeWithAllChannel",i)},e.prototype.getUnreadMentionedMessages=function(e,s){return this._isCPPMode?(t.assert("conversationType",e,t.AssertRules.NUMBER,!0),t.assert("targetId",s,t.AssertRules.STRING,!0),this._defaultChannelClient.getUnreadMentionedMessages(e,s)):(w.error("getUnreadMentionedMessages method is not supported in a browser!"),null)},e.prototype.clearUnreadCountByTimestamp=function(e,s,n,o){var a=this;t.assert("conversationType",e,t.AssertRules.NUMBER,!0),t.assert("targetId",s,t.AssertRules.STRING,!0),t.assert("timestamp",n,t.AssertRules.NUMBER,!0),this.assertCPPMode((function(){a._defaultChannelClient.clearUnreadCountByTimestamp(e,s,n,o)}),"clearUnreadCountByTimestamp",o)},e.prototype.getFirstUnreadMessage=function(e,t,s){return this._defaultChannelClient.getFirstUnreadMessage(e,t,s)},e.prototype.getConversationNotificationStatus=function(e,s,n){var o=this;t.assert("conversationType",e,t.AssertRules.NUMBER,!0),t.assert("targetId",s,t.AssertRules.STRING,!0),this.assertCPPMode((function(){o._defaultChannelClient.getConversationNotificationStatus(e,s,n)}),"getConversationNotificationStatus",n)},e.prototype.getServerTime=function(){return this._context.getServerTime()},e.prototype.getGroupMessageDeliverList=function(e,t,s){this._defaultChannelClient.getGroupMessageDeliverList(e,t,s)},e.prototype.getPrivateMessageDeliverTime=function(e,t){this._defaultChannelClient.getPrivateMessageDeliverTime(e,t)},e.prototype.getRTCUserInfoList=function(e,s){w.info("getRTCUserInfoList ->roomId:".concat(e.id)),this._context.getRTCUserInfoList(e.id).then((function(n){var o=n.code,a=n.data;if(o!==t.ErrorCode.SUCCESS)w.warn("getRTCUserInfoList ->code:".concat(o,",roomId:").concat(e.id)),s.onError(o);else{var r=null==a?void 0:a.users;s.onSuccess(r)}})).catch((function(t){w.warn("getRTCUserInfoList ->error:".concat(t,",roomId:").concat(e.id)),s.onError(t)}))},e.prototype.getRTCUserList=function(e,s){w.info("getRTCUserList ->roomId:".concat(e.id)),this._context.getRTCUserList(e.id).then((function(n){var o=n.code,a=n.data;o!==t.ErrorCode.SUCCESS?(w.warn("getRTCUserList ->code:".concat(o,",roomId:").concat(e.id)),s.onError(o)):s.onSuccess(a)})).catch((function(t){w.warn("getRTCUserList ->error:".concat(t,",roomId:").concat(e.id)),s.onError(t)}))},e.prototype.setRTCUserInfo=function(e,s,n){w.info("setRTCUserInfo ->roomId:".concat(e.id,",info:").concat(JSON.stringify(s||{}))),this._context.setRTCUserInfo(e.id,s.key,s.value).then((function(o){o!==t.ErrorCode.SUCCESS?(w.warn("setRTCUserInfo ->code:".concat(o,",roomId:").concat(e.id,",key:").concat(s.key,",value:").concat(s.value)),n.onError(o)):n.onSuccess(!0)})).catch((function(t){w.warn("setRTCUserInfo ->code:".concat(t,",roomId:").concat(e.id,",key:").concat(s.key,",value:").concat(s.value)),n.onError(t)}))},e.prototype.removeRTCUserInfo=function(e,s,n){w.info("removeRTCUserInfo ->roomId:".concat(e.id,"keys:").concat(s.keys)),this._context.removeRTCUserInfo(e.id,s.keys).then((function(s){s!==t.ErrorCode.SUCCESS?(w.warn("removeRTCUserInfo ->code:".concat(s,",roomId:").concat(e.id)),n.onError(s)):n.onSuccess(!0)})).catch((function(t){w.warn("removeRTCUserInfo ->error:".concat(t,",roomId:").concat(e.id)),n.onError(t)}))},e.prototype.getRTCRoomInfo=function(e,s){w.info("getRTCRoomInfo ->roomId:".concat(e.id)),this._context.getRTCRoomInfo(e.id).then((function(n){var o=n.code,a=n.data;o!==t.ErrorCode.SUCCESS?(w.warn("getRTCRoomInfo ->code:".concat(o,",roomId:").concat(e.id)),s.onError(o)):s.onSuccess(a)})).catch((function(t){w.warn("getRTCRoomInfo ->error:".concat(t,",roomId:").concat(e.id)),s.onError(t)}))},e.prototype.setRTCRoomInfo=function(e,s,n){throw t.todo("setRTCRoomInfo")},e.prototype.removeRTCRoomInfo=function(e,s,n){throw t.todo("removeRTCRoomInfo")},e.prototype.joinRTCRoom=function(e,s){w.info("joinRTCRoom ->roomId:".concat(e.id));var n=e.mode||0;this._context.joinRTCRoom(e.id,n).then((function(n){var o=n.code,a=n.data;o!==t.ErrorCode.SUCCESS?(w.warn("joinRTCRoom ->code:".concat(o,",roomId:").concat(e.id)),s.onError(o)):s.onSuccess(a)})).catch((function(t){w.warn("joinRTCRoom ->error:".concat(t,",roomId:").concat(e.id)),s.onError(t)}))},e.prototype.quitRTCRoom=function(e,s){w.info("quitRTCRoom ->roomId:".concat(e.id)),this._context.quitRTCRoom(e.id).then((function(n){n!==t.ErrorCode.SUCCESS?(w.warn("quitRTCRoom ->code:".concat(n,",roomId:").concat(e.id)),s.onError(n)):s.onSuccess(!0)})).catch((function(t){w.warn("quitRTCRoom ->error:".concat(t,",roomId:").concat(e.id)),s.onError(t)}))},e.prototype.RTCPing=function(e,s){w.info("RTCPing ->roomId:".concat(e.id));var n=e.mode||0;this._context.rtcPing(e.id,n).then((function(n){n!==t.ErrorCode.SUCCESS?(w.warn("RTCPing ->code:".concat(n,",roomId:").concat(e.id)),s.onError(n)):s.onSuccess(!0)})).catch((function(t){w.warn("RTCPing ->error:".concat(t,",roomId:").concat(e.id)),s.onError(t)}))},e.prototype.setRTCData=function(e,s,n,o,a,r,c){w.info("setRTCData ->roomId:".concat(e,",key:").concat(s)),this._context.setRTCData(e,s,n,o,a,c).then((function(s){s!==t.ErrorCode.SUCCESS?(w.warn("setRTCData ->code:".concat(s,",roomId:").concat(e)),r.onError(s)):r.onSuccess(!0)})).catch((function(t){w.warn("setRTCData ->error:".concat(t,",roomId:").concat(e)),r.onError(t)}))},e.prototype.getRTCData=function(e,s,n,o,a){w.info("getRTCData ->roomId:".concat(e,",keys:").concat(s)),this._context.getRTCData(e,s,n,o).then((function(s){var n=s.code,o=s.data;n!==t.ErrorCode.SUCCESS?(w.warn("getRTCData ->code:".concat(n,",roomId:").concat(e)),a.onError(n)):a.onSuccess(o)})).catch((function(t){w.warn("setRTCUserInfo ->error:".concat(t,",roomId:").concat(e)),a.onError(t)}))},e.prototype.removeRTCData=function(e,s,n,o,a,r){w.info("removeRTCData ->roomId:".concat(e,",keys:").concat(s)),this._context.removeRTCData(e,s,n,o,r).then((function(s){s!==t.ErrorCode.SUCCESS?(w.warn("removeRTCData ->code:".concat(s,",roomId:").concat(e)),a.onError(s)):a.onSuccess(!0)})).catch((function(t){w.warn("removeRTCData ->error:".concat(t,",roomId:").concat(e)),a.onError(t)}))},e.prototype.setRTCUserData=function(e,s,n,o,a,r){this.setRTCData(e,s,n,o,t.RTCApiType.PERSON,a,r)},e.prototype.setRTCUserTotalRes=function(e,s,n,o,a){w.info("setRTCUserTotalRes ->roomId:".concat(e)),this._context.setRTCTotalRes(e,s,n,o).then((function(s){s!==t.ErrorCode.SUCCESS?(w.warn("setRTCUserTotalRes ->code:".concat(s,",roomId:").concat(e)),a.onError(s)):a.onSuccess(!0)})).catch((function(t){w.warn("setRTCUserTotalRes ->error:".concat(t,",roomId:").concat(e)),a.onError(t)}))},e.prototype.getRTCUserData=function(e,s,n,o){this.getRTCData(e,s,n,t.RTCApiType.PERSON,o)},e.prototype.removeRTCUserData=function(e,s,n,o,a){this.removeRTCData(e,s,n,t.RTCApiType.PERSON,o,a)},e.prototype.setRTCRoomData=function(e,s,n,o,a,r){this.setRTCData(e,s,n,o,t.RTCApiType.ROOM,a,r)},e.prototype.getRTCRoomData=function(e,s,n,o){this.getRTCData(e,s,n,t.RTCApiType.ROOM,o)},e.prototype.removeRTCRoomData=function(e,s,n,o,a){this.removeRTCData(e,s,n,t.RTCApiType.ROOM,o,a)},e.prototype.setRTCOutData=function(e,s,n,o,a){throw t.todo("setRTCOutData")},e.prototype.getRTCOutData=function(e,s,n){throw t.todo("getRTCOutData")},e.prototype.getRTCToken=function(e,s){w.info("getRTCToken ->roomId:".concat(e.id)),this._context.getRTCToken(e.id,e.mode,e.broadcastType).then((function(n){var o=n.code,a=n.data;o!==t.ErrorCode.SUCCESS?(w.warn("getRTCToken ->code:".concat(o,",roomId:").concat(e.id)),s.onError(o)):s.onSuccess(a)})).catch((function(t){w.warn("getRTCToken ->error:".concat(t,",roomId:").concat(e.id)),s.onError(t)}))},e.prototype.setRTCState=function(e,s,n){w.info("setRTCState ->roomId:".concat(e.id)),this._context.setRTCState(e.id,s.report).then((function(s){s!==t.ErrorCode.SUCCESS?(w.warn("setRTCState ->code:".concat(s,",roomId:").concat(e.id)),n.onError(s)):n.onSuccess(!0)})).catch((function(t){w.warn("setRTCState ->error:".concat(t,",roomId:").concat(e.id)),n.onError(t)}))},e}(),$=[],Z=[],ee={message:function(e){$.forEach((function(t){return t(K(e))}))},status:function(e){Z.forEach((function(t){return t(e)}))}},te=1;t.VersionManage.add("imlib-v2-adapter","5.5.8-beem");var se,ne={init:function(e,s,n){void 0===n&&(n={}),t.assert("appkey",e,t.AssertRules.STRING,!0),w.setLogLevel(n.logLevel),w.setLogStdout(n.logStdout),w.info("RongIMLib Version: ".concat("5.5.8-beem",", Commit: ").concat("a043d301e30dcebea9ba30b36f38969b34fc8c9d",",appkey:").concat(e)),t.logger.info(t.LogTagId.A_INIT_O,{appkey:e,navigators:n.navi?[n.navi]:[],logLevel:n.logLevel,typingExpireTime:n.typingExpireTime}),J=t.APIContext.init(B,{appkey:e,apiVersion:"5.5.8-beem",navigators:n.navi?[n.navi]:[],miniCMPProxy:[],logLevel:n.logLevel,logStdout:n.logStdout,typingExpireTime:n.typingExpireTime,indexDBSwitch:n.indexDBSwitch,checkCA:n.checkCA,httpInMainProcess:!!n.httpInMainProcess}),te=Math.min(15,Math.max(n.readReceiptTimeout||1,1)),q=new z(J,{readReceiptTimeout:te})},getInstance:function(){return q},setConnectionStatusListener:function(e){var s=t.logger.ID();J.assignWatcher({connectionState:function(n){t.logger.info(t.LogTagId.A_CONNECT_S,{status:n},{traceId:s}),P.clear(),e.onChanged(n)}})},setOnReceiveMessageListener:function(e){J.assignWatcher({message:function(s,n,o){try{var a=K(s),r=J.getCurrentUserId(),c=J.getConnectedTime();F(a,r,c,te),a=function(e,t,s,n){var o=new Date(s-1e3*n*60*60*24).getTime()-e.sentTime<0;if("ReadReceiptResponseMessage"!==e.messageType||!o)return e;var a=e.content,r=((a=a||{}).receiptMessageDic||{})[t],c="",i={};if(e.receiptResponse=e.receiptResponse||{},r){for(var u=[],d=0;d<r.length;d++)c="".concat(t).concat(r[d],"SENT"),(i=D.get(c))&&!(e.senderUserId in i.userIds)&&(u.push(r[d]),i.count+=1,i.userIds[e.senderUserId]=e.sentTime,e.receiptResponse[r[d]]=i.count,D.set(c,i));a.receiptMessageDic[t]=u,e.content=a}return e}(a,r,c,te),t.usingCppEngine()||P.set(s),t.logger.info(t.LogTagId.A_PULL_MSG_O,{message:s.messageUId}),e.onReceived(a,void 0,o)}catch(e){w.error("setOnReceiveMessageListener ->error:".concat(e))}}})},setConversationStatusListener:function(e){J.assignWatcher({conversationState:function(t){try{var s=[];t.forEach((function(e){var t=e.updatedItems,n=e.conversationType,o=e.targetId,a=e.channelId,r=(t=t||{}).notificationStatus,c=t.isTop;r&&c&&s.push({notificationStatus:r.val,isTop:c.val,conversationType:n,targetId:o,channelId:a||"",updatedTime:r.time})})),s.length>0&&e.onChanged(s)}catch(e){w.error("setConversationStatusListener ->error:".concat(e))}}})},setMessageExpansionListener:function(e){J.assignWatcher({expansion:function(t){try{t.updatedExpansion&&e.onUpdated(t.updatedExpansion),t.deletedExpansion&&e.onDeleted(t.deletedExpansion)}catch(e){w.error("setMessageExpansionListener ->error:".concat(e))}}})},setTagListener:function(e){J.assignWatcher({tag:function(){try{e.onChanged()}catch(e){t.logger.error("setTagListener ->error:".concat(e))}}})},setConversationTagListener:function(e){J.assignWatcher({conversationTagChanged:function(){try{e.onChanged()}catch(e){t.logger.error("setConversationTagListener ->error:".concat(e))}}})},setPullOffLineFinished:function(e){J.assignWatcher({pullFinished:function(){try{e.onFinished()}catch(e){t.logger.error("setPullOffLineFinished ->error:".concat(e))}}})},setTypingStatusListener:function(e){J.assignWatcher({typingState:function(s){try{e.onChanged(s)}catch(e){t.logger.error("setTypingStatusListener ->error:".concat(e))}}})},setMessageBlockedListener:function(e){J.assignWatcher({messageBlocked:function(t){e.onReceived(t)}})},setChatRoomStatusListener:function(e){J.assignWatcher({chatroomState:function(t){e.onChanged(t)}})},setMessageDeliveredListener:function(e){J.assignWatcher({messageDelivered:function(s){try{e.onDelivered(s)}catch(e){t.logger.error("setMessageDeliveredListener ->error:".concat(e))}}})},setGroupMessageDeliveredStatusListener:function(e){J.assignWatcher({groupMessageDeliveredStatus:function(s){try{e.onDelivered(s)}catch(e){t.logger.error("setGroupMessageDeliveredStatusListener ->error:".concat(e))}}})},connect:function(e,s,n){return r(this,void 0,void 0,(function(){var o,a,r;return c(this,(function(c){switch(c.label){case 0:return o=t.logger.ID(),t.logger.info(t.LogTagId.A_CONNECT_T,{token:e,reconnectKickEnable:!1},{traceId:o}),w.info("connect ->token:".concat(e)),[4,J.connect(e,!1,n,o)];case 1:return a=c.sent(),(a.code===t.ErrorCode.SUCCESS?t.logger.info:t.logger.warn)(t.LogTagId.A_CONNECT_R,{code:a.code,userId:a.userId},{traceId:o}),a.code===t.ErrorCode.SUCCESS?(s.onSuccess(a.userId),r=new Date(J.getConnectedTime()-1e3*te*60*60*24).getTime(),D.getKeys().forEach((function(e){if(/SENT$/.test(e)){var t=D.get(e).dealtime;t&&r-t>0&&D.remove(e)}else if(/RECEIVED$/.test(e)){var s=D.get(e),n=Object.keys(s).length;Object.keys(s).forEach((function(e){var t=s[e].dealtime;t&&r-t>0&&delete s[e]})),Object.keys(s).length!==n&&(0===s.length?D.remove(e):D.set(e,s))}}))):a.code===t.ErrorCode.RC_CONN_USER_OR_PASSWD_ERROR?(w.warn("connect ->code:".concat(a.code,",token:").concat(e)),s.onTokenIncorrect()):(w.warn("connect ->code:".concat(a.code,",token:").concat(e)),s.onError(a.code)),[2]}}))}))},reconnect:function(e,s,n){var o=t.logger.ID();t.logger.info(t.LogTagId.A_RECONNECT_T,{},{traceId:o}),J.reconnect(n).then((function(s){(s.code===t.ErrorCode.SUCCESS?t.logger.info:t.logger.warn)(t.LogTagId.A_RECONNECT_R,{code:s.code,userId:s.userId},{traceId:o}),s.code===t.ErrorCode.SUCCESS?e.onSuccess(s.userId):(w.warn("reconnect ->code:".concat(s.code)),e.onError(s.code))})).catch((function(t){e.onError(t)}))},RegisterMessage:{},RegisterMessageTypeMapping:O,getMessageObjectName:function(e){var t=a(a({},k),O);return Object.keys(t).find((function(s){return t[s]===e}))||e},registerMessageType:function(e,t,s,n){this.RegisterMessage[e]=V(e,t,s.isPersited,s.isCounted),this.RegisterMessageTypeMapping[t]=e,J.registerMessageType(t,s.isPersited,s.isCounted,n)},createLogger:function(e,s){return/^(RC)/.test(e)?(w.error("Tag error. Tags that start with RC are used internally by the SDK !"),null):["IM","RTC"].includes(s)?new t.Logger(e,s,"A"):(w.error("The parameter type must be one of IM, or RTC !"),null)},messageWatch:function(e){var t=this;$.push((function(s){var n,o;w.info("messageWatch ->message:".concat(JSON.stringify(s||{})));try{e(s),null===(o=(n=t._voipProvider).onReceived)||void 0===o||o.call(n,s)}catch(e){w.error("messageWatch ->error:".concat(e))}})),J.assignWatcher({rtcInnerWatcher:ee})},statusWatch:function(e){Z.push((function(t){w.info("statusWatch ->status:".concat(t));try{e(t)}catch(e){w.error("statusWatch ->error:".concat(e))}}))},MessageType:{TextMessage:"TextMessage",ImageMessage:"ImageMessage",ReferenceMessage:"ReferenceMessage",DiscussionNotificationMessage:"DiscussionNotificationMessage",VoiceMessage:"VoiceMessage",RichContentMessage:"RichContentMessage",HandshakeMessage:"HandshakeMessage",UnknownMessage:"UnknownMessage",LocationMessage:"LocationMessage",InformationNotificationMessage:"InformationNotificationMessage",ContactNotificationMessage:"ContactNotificationMessage",ProfileNotificationMessage:"ProfileNotificationMessage",CommandNotificationMessage:"CommandNotificationMessage",CommandMessage:"CommandMessage",TypingStatusMessage:"TypingStatusMessage",ChangeModeResponseMessage:"ChangeModeResponseMessage",ChangeModeMessage:"ChangeModeMessage",EvaluateMessage:"EvaluateMessage",HandShakeMessage:"HandShakeMessage",HandShakeResponseMessage:"HandShakeResponseMessage",SuspendMessage:"SuspendMessage",TerminateMessage:"TerminateMessage",CustomerContact:"CustomerContact",CustomerStatusUpdateMessage:"CustomerStatusUpdateMessage",SyncReadStatusMessage:"SyncReadStatusMessage",ReadReceiptRequestMessage:"ReadReceiptRequestMessage",ReadReceiptResponseMessage:"ReadReceiptResponseMessage",FileMessage:"FileMessage",HQVoiceMessage:"HQVoiceMessage",GIFMessage:"GIFMessage",SightMessage:"SightMessage",AcceptMessage:"AcceptMessage",RingingMessage:"RingingMessage",SummaryMessage:"SummaryMessage",HungupMessage:"HungupMessage",InviteMessage:"InviteMessage",MediaModifyMessage:"MediaModifyMessage",MemberModifyMessage:"MemberModifyMessage",JrmfRedPacketMessage:"JrmfRedPacketMessage",JrmfRedPacketOpenedMessage:"JrmfRedPacketOpenedMessage",GroupNotificationMessage:"GroupNotificationMessage",PublicServiceRichContentMessage:"PublicServiceRichContentMessage",PublicServiceMultiRichContentMessage:"PublicServiceMultiRichContentMessage",PublicServiceCommandMessage:"PublicServiceCommandMessage",RecallCommandMessage:"RecallCommandMessage",ReadReceiptMessage:"ReadReceiptMessage",RCCombineMessage:"RCCombineMessage",ChrmKVNotificationMessage:"ChrmKVNotificationMessage",LogCommandMessage:"LogCommandMessage"},_voipProvider:{}},oe=function(e,t,s){this.type=e,this.userIdList=t,this.mentionedContent=s},ae=function(e,t){this.isCounted=e,this.isPersited=t},re=V("TextMessage","RC:TxtMsg"),ce=V("LocationMessage","RC:LBSMsg"),ie=V("TypingStatusMessage","RC:TypSts"),ue=V("ImageMessage","RC:ImgMsg"),de=V("RichContentMessage","RC:ImgTextMsg"),ge=V("VoiceMessage","RC:VcMsg"),le=V("HQVoiceMessage","RC:HQVCMsg"),Ce=V("FileMessage","RC:FileMsg"),fe=V("SightMessage","RC:SightMsg"),pe=V("GIFMessage","RC:GIFMsg"),Re=V("ReadReceiptMessage","RC:ReadNtf"),he=V("ReadReceiptRequestMessage","RC:RRReqMsg"),me=V("RCCombineMessage","RC:CombineMsg"),Ie=function(e,t,s,n,o,a,r,c,i,u,d,g,l,C,f,p,R,h){this.conversationType=e,this.targetId=t,this.senderUserId=s,this.content=n,this.objectName=o,this.messageType=a,this.messageId=r,this.messageUId=c,this.messageDirection=i,this.offLineMessage=u,this.sentStatus=d,this.sentTime=g,this.receivedStatus=l,this.receivedTime=C,this.canIncludeExpansion=f,this.expansion=p,this.receiptResponse=R,this.disableNotification=h};exports.VoIPMediaType=void 0,(se=exports.VoIPMediaType||(exports.VoIPMediaType={}))[se.MEDIA_AUDIO=1]="MEDIA_AUDIO",se[se.MEDIA_VEDIO=2]="MEDIA_VEDIO",se[se.MEDIA_VIDEO=2]="MEDIA_VIDEO";var Se,Me=V("AcceptMessage","RC:VCAccept"),Te=V("RingingMessage","RC:VCRinging"),ye=V("SummaryMessage","RC:VCSummary"),ve=V("HungupMessage","RC:VCHangup"),Ee=V("InviteMessage","RC:VCInvite"),Ae=V("MediaModifyMessage","RC:VCModifyMedia"),Ue=V("MemberModifyMessage","RC:VCModifyMem"),Ne=V("lastMessageSendTime","RC:SRSMsg"),_e=V("ReferenceMessage","RC:ReferenceMsg"),Le=V("PublicServiceRichContentMessage","RC:PSImgTxtMsg"),xe=V("PublicServiceMultiRichContentMessage","RC:PSMultiImgTxtMsg");!function(e){e[e.ALL=1]="ALL",e[e.PART=2]="PART"}(Se||(Se={}));var Be=Se,we=t.ConnectResultCode;window&&(window.RongIMClient=ne),Object.defineProperty(exports,"ChatroomEntryType",{enumerable:!0,get:function(){return t.ChatroomEntryType}}),Object.defineProperty(exports,"ChatroomUserChangeType",{enumerable:!0,get:function(){return t.ChatroomUserChangeType}}),Object.defineProperty(exports,"ConnectionStatus",{enumerable:!0,get:function(){return t.ConnectionStatus}}),Object.defineProperty(exports,"ConversationType",{enumerable:!0,get:function(){return t.ConversationType}}),Object.defineProperty(exports,"ErrorCode",{enumerable:!0,get:function(){return t.ErrorCode}}),Object.defineProperty(exports,"FileType",{enumerable:!0,get:function(){return t.FileType}}),Object.defineProperty(exports,"LogLevel",{enumerable:!0,get:function(){return t.LogLevel}}),Object.defineProperty(exports,"LogSource",{enumerable:!0,get:function(){return t.LogSource}}),Object.defineProperty(exports,"LogTagId",{enumerable:!0,get:function(){return t.LogTagId}}),Object.defineProperty(exports,"Logger",{enumerable:!0,get:function(){return t.Logger}}),Object.defineProperty(exports,"MessageBlockType",{enumerable:!0,get:function(){return t.MessageBlockType}}),Object.defineProperty(exports,"MessageDirection",{enumerable:!0,get:function(){return t.MessageDirection}}),Object.defineProperty(exports,"NotificationStatus",{enumerable:!0,get:function(){return t.NotificationStatus}}),Object.defineProperty(exports,"RTCApiType",{enumerable:!0,get:function(){return t.RTCApiType}}),Object.defineProperty(exports,"RTCMode",{enumerable:!0,get:function(){return t.RTCMode}}),Object.defineProperty(exports,"ReceivedStatus",{enumerable:!0,get:function(){return t.ReceivedStatus}}),Object.defineProperty(exports,"UploadMethod",{enumerable:!0,get:function(){return t.UploadMethod}}),Object.defineProperty(exports,"logger",{enumerable:!0,get:function(){return t.logger}}),exports.AcceptMessage=Me,exports.BaseMessage=j,exports.ChannelClient=Q,exports.ConnectionState=we,exports.FileMessage=Ce,exports.GIFMessage=pe,exports.GetChatRoomType=o,exports.HQVoiceMessage=le,exports.HungupMessage=ve,exports.IMClient=z,exports.ImageMessage=ue,exports.InviteMessage=Ee,exports.LocationMessage=ce,exports.MediaModifyMessage=Ae,exports.MemberModifyMessage=Ue,exports.MentionedInfo=oe,exports.MentionedType=Be,exports.Message=Ie,exports.MessageTag=ae,exports.PublicServiceMultiRichContentMessage=xe,exports.PublicServiceRichContentMessage=Le,exports.RCCombineMessage=me,exports.ReadReceiptMessage=Re,exports.ReadReceiptRequestMessage=he,exports.ReadReceiptResponseMessage=Y,exports.ReferenceMessage=_e,exports.RichContentMessage=de,exports.RingingMessage=Te,exports.RongIMClient=ne,exports.SentStatus=n,exports.SightMessage=fe,exports.SummaryMessage=ye,exports.SyncReadStatusMessage=Ne,exports.TextMessage=re,exports.TypingStatusMessage=ie,exports.VoiceMessage=ge;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,t=require("@rongcloud/engine");!function(e){e[e.SENDING=10]="SENDING",e[e.FAILED=20]="FAILED",e[e.SENT=30]="SENT",e[e.RECEIVED=40]="RECEIVED",e[e.READ=50]="READ",e[e.DESTROYED=60]="DESTROYED"}(e||(e={}));var o,s=e;!function(e){e[e.NONE=0]="NONE",e[e.SQQUENCE=1]="SQQUENCE",e[e.REVERSE=2]="REVERSE"}(o||(o={}));var n=o,a=function(){return a=Object.assign||function(e){for(var t,o=1,s=arguments.length;o<s;o++)for(var n in t=arguments[o])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},a.apply(this,arguments)};function r(e,t,o,s){return new(o||(o=Promise))((function(n,a){function r(e){try{i(s.next(e))}catch(e){a(e)}}function c(e){try{i(s.throw(e))}catch(e){a(e)}}function i(e){var t;e.done?n(e.value):(t=e.value,t instanceof o?t:new o((function(e){e(t)}))).then(r,c)}i((s=s.apply(e,t||[])).next())}))}function c(e,t){var o,s,n,a,r={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return a={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function c(a){return function(c){return function(a){if(o)throw new TypeError("Generator is already executing.");for(;r;)try{if(o=1,s&&(n=2&a[0]?s.return:a[0]?s.throw||((n=s.return)&&n.call(s),0):s.next)&&!(n=n.call(s,a[1])).done)return n;switch(s=0,n&&(a=[2&a[0],n.value]),a[0]){case 0:case 1:n=a;break;case 4:return r.label++,{value:a[1],done:!1};case 5:r.label++,s=a[1],a=[0];continue;case 7:a=r.ops.pop(),r.trys.pop();continue;default:if(!(n=r.trys,(n=n.length>0&&n[n.length-1])||6!==a[0]&&2!==a[0])){r=0;continue}if(3===a[0]&&(!n||a[1]>n[0]&&a[1]<n[3])){r.label=a[1];break}if(6===a[0]&&r.label<n[1]){r.label=n[1],n=a;break}if(n&&r.label<n[2]){r.label=n[2],r.ops.push(a);break}n[2]&&r.ops.pop(),r.trys.pop();continue}a=t.call(e,r)}catch(e){a=[6,e],s=0}finally{o=n=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}}function i(e,t,o){if(o||2===arguments.length)for(var s,n=0,a=t.length;n<a;n++)!s&&n in t||(s||(s=Array.prototype.slice.call(t,0,n)),s[n]=t[n]);return e.concat(s||Array.prototype.slice.call(t))}var g=function(){return!("undefined"==typeof uni||!function(e){for(var t=["request","getSystemInfo"],o=0,s=t.length;o<s;o++)if(!e[t[o]])return!1;return!0}(uni))},d=g();var u={tag:"browser",httpReq:function(e){var o=e.method||t.HttpMethod.GET,s=e.timeout||t.HTTP_TIMEOUT,n=e.headers,a=e.query,r=e.body,c=t.appendUrl(e.url,a);return new Promise((function(e){var t,a=(t="undefined"!=typeof XMLHttpRequest&&"withCredentials"in new XMLHttpRequest,"undefined"!=typeof XMLHttpRequest&&t?new XMLHttpRequest:"undefined"!=typeof XDomainRequest?new XDomainRequest:new ActiveXObject("Microsoft.XMLHTTP")),i="[object XDomainRequest]"===Object.prototype.toString.call(a);if(a.open(o,c),n&&a.setRequestHeader)for(var g in n)a.setRequestHeader(g,n[g]);if(i){a.timeout=s,a.onload=function(){e({data:a.responseText,status:a.status||200})},a.onerror=function(){e({status:a.status||0})},a.ontimeout=function(){e({status:a.status||0})};var d="object"==typeof r?JSON.stringify(r):r;a.send(d)}else a.onreadystatechange=function(){4===a.readyState&&e({data:a.responseText,status:a.status})},a.onerror=function(){e({status:a.status||0})},setTimeout((function(){a.abort(),e({status:a.status||0})}),s),a.send(r)}))},localStorage:null===window||void 0===window?void 0:window.localStorage,sessionStorage:null===window||void 0===window?void 0:window.sessionStorage,useNavi:!0,connectPlatform:"",isFromUniapp:d,createWebSocket:function(e,t){var o=new WebSocket(e,t);return o.binaryType="arraybuffer",{onClose:function(e){o.onclose=function(t){var o=t.code,s=t.reason;e(o,s)}},onError:function(e){o.onerror=e},onMessage:function(e){o.onmessage=function(t){e(t.data)}},onOpen:function(e){o.onopen=e},send:function(e){o.send(e)},close:function(e,t){o.close()}}},getNetworkType:function(){var e=navigator.connection||navigator.mozConnection||navigator.webkitConnection,o=e.type,s=e.effectiveType,n=o||s||t.NetworkType.UNKONWN;return new Promise((function(e){e(n)}))}},l=g(),C=function(e){return function(){for(var t=[],o=0;o<arguments.length;o++)t[o]=arguments[o];try{return wx[e].apply(wx,t)}catch(e){null===console||void 0===console||console.error(e)}}},h={setItem:C("setStorageSync"),getItem:C("getStorageSync"),removeItem:C("removeStorageSync"),clear:C("clearStorageSync")},f={tag:"wechat",httpReq:function(e){var o=e.method||t.HttpMethod.GET,s=e.timeout||t.HTTP_TIMEOUT,n=e.headers,a=e.query,r=e.body,c=t.appendUrl(e.url,a);return new Promise((function(e){wx.request({url:c,method:o,header:n,timeout:s,data:r,success:function(t){e({data:t.data,status:t.statusCode})},fail:function(){e({status:t.ErrorCode.RC_HTTP_REQ_FAIL})}})}))},localStorage:h,sessionStorage:h,useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:l,createWebSocket:function(e,t){var o=wx.connectSocket({url:e,protocols:t});return{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){wx.getNetworkType({success:function(t){var o=t.networkType;e(o)},fail:function(){e(t.NetworkType.UNKONWN)}})}))}},p=g(),R=function(e){return function(){for(var t=[],o=0;o<arguments.length;o++)t[o]=arguments[o];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 s=my[e]({key:t[0]}).data;return s?JSON.stringify(s):s}catch(e){}}},I={setItem:R("setStorageSync"),getItem:R("getStorageSync"),removeItem:R("removeStorageSync"),clear:R("clearStorageSync")},T={tag:"alipay",httpReq:function(e){var o=e.method||t.HttpMethod.GET,s=e.timeout||t.HTTP_TIMEOUT,n=e.headers,a=e.query,r=e.body,c=t.appendUrl(e.url,a),i=e.dataType||"json";return new Promise((function(e){my.request({url:c,method:o,headers:n,timeout:s,data:r,dataType:i,success:function(t){e({data:t.data,status:t.status})},fail:function(){e({status:t.ErrorCode.RC_HTTP_REQ_FAIL})}})}))},localStorage:I,sessionStorage:I,useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:p,createWebSocket:function(e){return my.connectSocket({url:e}),{onClose:function(e){my.onSocketClose(e)},onError:function(e){my.onSocketError((function(t){e(t.errMsg)}))},onMessage:function(e){my.onSocketMessage((function(t){t.isBuffer?e(my.base64ToArrayBuffer(t.data)):e(t.data)}))},onOpen:function(e){my.onSocketOpen(e)},send:function(e){my.sendSocketMessage({data:my.arrayBufferToBase64(e),isBuffer:!0})},close:function(){my.closeSocket()}}},getNetworkType:function(){return new Promise((function(e){my.getNetworkType({success:function(t){var o=t.networkType;e(o)},fail:function(){e(t.NetworkType.UNKONWN)}})}))}},S=g(),m=function(e){return function(){for(var t=[],o=0;o<arguments.length;o++)t[o]=arguments[o];try{return tt[e].apply(tt,t)}catch(e){}}},v={setItem:m("setStorageSync"),getItem:m("getStorageSync"),removeItem:m("removeStorageSync"),clear:m("clearStorageSync")},M={tag:"toutiao",useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:S,localStorage:v,sessionStorage:v,httpReq:function(e){return new Promise((function(o){tt.request({url:e.url,data:e.body,header:e.headers,method:e.method,success:function(e){var t=(null==e?void 0:e.data)||{},s={data:JSON.stringify(t),status:e.statusCode};o(s)},fail:function(e){o({status:t.ErrorCode.RC_HTTP_REQ_FAIL})}})}))},createWebSocket:function(e,t){var o=tt.connectSocket({url:e,protocols:t});return{onOpen:function(e){o.onOpen(e)},onClose:function(e){o.onClose((function(t){return e(t.code,t.reason)}))},onError:function(e){o.onError((function(t){return e(t.errMsg)}))},onMessage:function(e){o.onMessage((function(t){return e(t.data)}))},send:function(e){o.send({data:e})},close:function(e,t){o.close({code:e,reason:t})}}},getNetworkType:function(){return new Promise((function(e){tt.getNetworkType({success:function(t){var o=t.networkType;e(o)},fail:function(){e(t.NetworkType.UNKONWN)}})}))}},y=g(),E=function(e){return function(){for(var t=[],o=0;o<arguments.length;o++)t[o]=arguments[o];try{return swan[e].apply(swan,t)}catch(e){}}},A={setItem:E("setStorageSync"),getItem:E("getStorageSync"),removeItem:E("removeStorageSync"),clear:E("clearStorageSync")},L={tag:"baidu",useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:y,localStorage:A,sessionStorage:A,httpReq:function(e){return new Promise((function(o,s){swan.request({url:e.url,data:e.body,header:e.headers,method:e.method,success:function(e){var t=(null==e?void 0:e.data)||{},s={data:JSON.stringify(t),status:e.statusCode};o(s)},fail:function(e){o({status:t.ErrorCode.RC_HTTP_REQ_FAIL})}})}))},createWebSocket:function(e,t){var o=swan.connectSocket({url:e,protocols:t});return{onOpen:function(e){o.onOpen(e)},onClose:function(e){o.onClose((function(t){return e(t.code,t.reason)}))},onError:function(e){o.onError((function(t){return e(t.errMsg)}))},onMessage:function(e){o.onMessage((function(t){return e(t.data)}))},send:function(e){o.send({data:e})},close:function(e,t){o.close({code:e,reason:t})}}},getNetworkType:function(){return r(this,void 0,void 0,(function(){return c(this,(function(e){return[2,new Promise((function(e){swan.getNetworkType({success:function(t){var o=t.networkType;e(o)},fail:function(){e(t.NetworkType.UNKONWN)}})}))]}))}))}},O=function(e){return function(){for(var t=[],o=0;o<arguments.length;o++)t[o]=arguments[o];try{return uni[e].apply(uni,t)}catch(e){null===console||void 0===console||console.error(e)}}},U={setItem:O("setStorageSync"),getItem:O("getStorageSync"),removeItem:O("removeStorageSync"),clear:O("clearStorageSync")},N={tag:"uniapp",httpReq:function(e){var o=e.method||t.HttpMethod.GET,s=e.timeout||t.HTTP_TIMEOUT,n=e.headers,a=e.query,r=e.body,c=t.appendUrl(e.url,a);return new Promise((function(e){uni.request({url:c,method:o,header:n,timeout:s,data:r,success:function(t){e({data:t.data,status:t.statusCode})},fail:function(){e({status:t.ErrorCode.RC_HTTP_REQ_FAIL})}})}))},localStorage:U,sessionStorage:U,useNavi:!0,connectPlatform:"",isFromUniapp:!0,createWebSocket:function(e,t){var o={complete:function(){},url:e,protocols:t},s=uni.connectSocket(o);return{onClose:function(e){s.onClose((function(t){e(t.code,t.reason)}))},onError:function(e){s.onError((function(t){e(t.errMsg)}))},onMessage:function(e){s.onMessage((function(t){e(t.data)}))},onOpen:function(e){s.onOpen(e)},send:function(e){s.send({data:e})},close:function(e,t){s.close({code:e,reason:t})}}},getNetworkType:function(){return new Promise((function(e){uni.getNetworkType({success:function(t){var o=t.networkType;e(o)},fail:function(){e(t.NetworkType.UNKONWN)}})}))}},_=function(e){return e&&e.request&&e.getSystemInfo},x="undefined"!=typeof uni&&_(uni)?function(){switch(process.env.VUE_APP_PLATFORM){case"app-plus":return N;case"mp-baidu":return L;case"mp-toutiao":return M;case"mp-alipay":return T;case"mp-weixin":return f;default:return u}}():"undefined"!=typeof my&&_(my)?T:"undefined"!=typeof tt&&_(tt)?M:"undefined"!=typeof swan&&_(swan)?L:"undefined"!=typeof wx&&_(wx)?f:u;function B(e,t,o){return"".concat(e,"_").concat(t,"_").concat(o)}var w=function(){function e(){}return e.set=function(o){if(t.SEND_MESSAGE_TYPE_OPTION[o.messageType]&&t.SEND_MESSAGE_TYPE_OPTION[o.messageType].isPersited){var s=e.get(o.conversationType,o.targetId,o.channelId||"");if(!s||s.sentTime<o.sentTime){var n=B(o.conversationType,o.targetId,o.channelId||"");e.map[n]=o}}},e.get=function(t,o,s){var n=B(t,o,s);return e.map[n]||null},e.remove=function(t,o,s){var n=B(t,o,s);delete e.map[n]},e.clear=function(){e.map={}},e.map={},e}(),P={"RC:TxtMsg":"TextMessage","RC:ImgMsg":"ImageMessage","RC:VcMsg":"VoiceMessage","RC:ImgTextMsg":"RichContentMessage","RC:ReferenceMsg":"ReferenceMessage","RC:FileMsg":"FileMessage","RC:HQVCMsg":"HQVoiceMessage","RC:GIFMsg":"GIFMessage","RC:SightMsg":"SightMessage","RC:LBSMsg":"LocationMessage","RC:InfoNtf":"InformationNotificationMessage","RC:ContactNtf":"ContactNotificationMessage","RC:ProfileNtf":"ProfileNotificationMessage","RC:CmdNtf":"CommandNotificationMessage","RC:DizNtf":"DiscussionNotificationMessage","RC:CmdMsg":"CommandMessage","RC:TypSts":"TypingStatusMessage","RC:CsChaR":"ChangeModeResponseMessage","RC:CsHsR":"HandShakeResponseMessage","RC:CsEnd":"TerminateMessage","RC:CsSp":"SuspendMessage","RC:CsUpdate":"CustomerStatusUpdateMessage","RC:ReadNtf":"ReadReceiptMessage","RC:VCAccept":"AcceptMessage","RC:VCRinging":"RingingMessage","RC:VCSummary":"SummaryMessage","RC:VCHangup":"HungupMessage","RC:VCInvite":"InviteMessage","RC:VCModifyMedia":"MediaModifyMessage","RC:VCModifyMem":"MemberModifyMessage","RC:CsContact":"CustomerContact","RC:PSImgTxtMsg":"PublicServiceRichContentMessage","RC:PSMultiImgTxtMsg":"PublicServiceMultiRichContentMessage","RC:GrpNtf":"GroupNotificationMessage","RC:PSCmd":"PublicServiceCommandMessage","RC:RcCmd":"RecallCommandMessage","RC:SRSMsg":"SyncReadStatusMessage","RC:RRReqMsg":"ReadReceiptRequestMessage","RC:RRRspMsg":"ReadReceiptResponseMessage","RCJrmf:RpMsg":"JrmfRedPacketMessage","RCJrmf:RpOpendMsg":"JrmfRedPacketOpenedMessage","RC:CombineMsg":"RCCombineMessage","RC:chrmKVNotiMsg":"ChrmKVNotificationMessage","RC:LogCmdMsg":"LogCommandMessage","RC:MsgExMsg":"ExpansionCommandMessage","RC:RRMsg":"GroupReadReceiptResponseMessage"},b={},k=new t.AppStorage(x,"API-V2");function D(e){var o=e.channelId,s=e.conversationType,n=e.targetId,a=e.unreadMessageCount,r=e.latestMessage,c=e.isTop,i=e.notificationStatus,g=e.matchCount;if(!t.usingCppEngine()){var d=w.get(s,n,o||"");r?d&&r.sentTime<d.sentTime&&(r=d):r=d}var u=r?G(r):null;return{channelId:o||"",conversationType:s,targetId:n,unreadMessageCount:a,latestMessage:u,latestMessageId:null==u?void 0:u.messageId,objectName:null==u?void 0:u.messageType,sentTime:null==u?void 0:u.sentTime,isTop:c,notificationStatus:i,receivedStatus:null==u?void 0:u.receivedStatus,matchCount:g}}function G(e){var o=e.conversationType,n=e.targetId,a=e.senderUserId,r=e.content,c=e.messageType,i=e.messageUId,g=e.messageDirection,d=e.isOffLineMessage,u=e.sentTime,l=e.receivedStatus,C=e.receivedTime,h=e.canIncludeExpansion,f=e.disableNotification,p=e.expansion,R=e.messageId,I=e.sentStatus,T=e.channelId,S=e.readReceiptInfo,m=e.pushConfig,v="";return c in P?v=P[c]:c in b?v=b[c]:(r={message:{content:r,objectName:c},messageName:"UnknownMessage"},v="UnknownMessage"),l||(l=t.ReceivedStatus.UNREAD),void 0===R&&(R=~~(16777215*Math.random())),{channelId:T||"",conversationType:o,targetId:n,senderUserId:a,content:r,messageType:v,messageUId:i,messageDirection:g,offLineMessage:d,sentTime:u,receivedStatus:l,receivedTime:C,objectName:c,messageId:R,sentStatus:I||s.SENT,disableNotification:f,canIncludeExpansion:h,expansion:p,readReceiptInfo:S,pushConfig:m}}function F(e,o,s,n){var a=new Date(s-1e3*n*60*60*24).getTime()-e.sentTime<0,r=e.messageType,c=e.messageDirection;if("ReadReceiptRequestMessage"===r&&a&&c===t.MessageDirection.SEND){var i="".concat(o).concat(e.content.messageUId,"SENT");k.set(i,{count:0,dealtime:e.sentTime,userIds:{}})}else if("ReadReceiptRequestMessage"===r&&a){var g="".concat(o).concat(e.conversationType).concat(e.targetId,"RECEIVED"),d=k.get(g);if(d)if(e.senderUserId in d)d[e.senderUserId].uIds&&-1===d[e.senderUserId].uIds.indexOf(e.content.messageUId)&&(d[e.senderUserId].uIds.push(e.content.messageUId),d[e.senderUserId].dealtime=e.sentTime,d[e.senderUserId].isResponse=!1,k.set(g,d));else{var u={uIds:[e.content.messageUId],dealtime:e.sentTime,isResponse:!1};d[e.senderUserId]=u,k.set(g,d)}else{var l={};l[e.senderUserId]={uIds:[e.content.messageUId],dealtime:e.sentTime,isResponse:!1},k.set(g,l)}}}function K(e,t,o){try{e(t,o)}catch(e){null===console||void 0===console||console.error(e)}}function H(e,t,o){try{e(t,o)}catch(e){null===console||void 0===console||console.error(e)}}var W=function(e,t,o,s,n){void 0===s&&(s=!0),void 0===n&&(n=!0),this.messageType=e,this.objectName=t,this.content=o,this.isPersited=s,this.isCounted=n};function j(e,t,o,s){void 0===o&&(o=!0),void 0===s&&(s=!0);var n=function(n){return new W(e,t,n,o,s)};return n.MessageType=e,n.ObjectName=t,n}var V,J,q=j("ReadReceiptResponseMessage","RC:RRRspMsg"),Y=function(){function e(e,t,o,s,n){this.logger=e,this._context=t,this.channelId=o,this._isCPPMode=s,this._readReceiptTimeout=n,this._storage=k,this._draftMap={}}return e.prototype.getConversationList=function(e,o,s){var n=this;t.assert("callback",e,t.AssertRules.CALLBACK),t.assert("conversationTypes",o,t.AssertRules.ARRAY),t.assert("count",s,t.AssertRules.NUMBER),this._context.getConversationList(s,void 0,0,0,this.channelId).then((function(s){var a=s.code,r=s.data,c=[];r=r||[],a===t.ErrorCode.SUCCESS?(o?r.forEach((function(e){o.indexOf(e.conversationType)>-1&&c.push(D(e))})):r.forEach((function(e){c.push(D(e))})),K(e.onSuccess,c)):(n.logger.warn(t.LogTagId.O,"getConversationList -> code:".concat(a)),H(e.onError,a))}))},e.prototype.getConversation=function(e,o,s){var n=this;t.assert("callback",s,t.AssertRules.CALLBACK),t.assert("conversationType",e,t.AssertRules.NUMBER,!0),t.assert("targetId",o,t.AssertRules.STRING,!0),this.logger.info(t.LogTagId.O,"getConversation ->targetId:".concat(o,",conversationType:").concat(e)),r(n,void 0,void 0,(function(){var n,a,r;return c(this,(function(c){switch(c.label){case 0:return[4,this._context.getConversation(e,o,this.channelId)];case 1:return n=c.sent(),a=n.code,r=n.data,a!==t.ErrorCode.SUCCESS?(this.logger.warn(t.LogTagId.O,"getConversation ->code:".concat(a,",targetId:").concat(o)),s.onError(a),[2]):(s.onSuccess(r?D(r):null),[2])}}))}))},e.prototype.removeConversation=function(e,o,s){var n=this;t.assert("conversationType",e,t.AssertRules.NUMBER,!0),t.assert("targetId",o,t.AssertRules.STRING,!0),t.assert("callback",s,t.AssertRules.CALLBACK),this.logger.info(t.LogTagId.O,"removeConversation ->targetId:".concat(o,",conversationType:").concat(e)),this._context.removeConversation(e,o,this.channelId).then((function(a){a===t.ErrorCode.SUCCESS?(n._isCPPMode||w.remove(e,o,n.channelId),K(s.onSuccess)):(n.logger.warn(t.LogTagId.O,"removeConversation ->code:".concat(a,",targetId:").concat(o)),H(s.onError,a))}))},e.prototype.saveTextMessageDraft=function(e,o,s){t.assert("conversationType",e,t.AssertRules.NUMBER,!0),t.assert("targetId",o,t.AssertRules.STRING,!0),t.assert("draftText",s,t.AssertRules.STRING,!0),this.logger.info(t.LogTagId.O,"saveTextMessageDraft ->targetId:".concat(o,",conversationType:").concat(e));var n=this._context.getCurrentUserId();return!!n&&((this._draftMap[n]=this._draftMap[n]||{})["".concat(e,"_").concat(o,"_").concat(this.channelId)]=s,!0)},e.prototype.getTextMessageDraft=function(e,o){t.assert("conversationType",e,t.AssertRules.NUMBER,!0),t.assert("targetId",o,t.AssertRules.STRING,!0),this.logger.info(t.LogTagId.O,"getTextMessageDraft ->targetId:".concat(o,",conversationType:").concat(e));var s=this._context.getCurrentUserId();if(s)return(this._draftMap[s]||{})["".concat(e,"_").concat(o,"_").concat(this.channelId)]},e.prototype.clearTextMessageDraft=function(e,o){t.assert("conversationType",e,t.AssertRules.NUMBER,!0),t.assert("targetId",o,t.AssertRules.STRING,!0),this.logger.info(t.LogTagId.O,"clearTextMessageDraft ->targetId:".concat(o,",conversationType:").concat(e));var s=this._context.getCurrentUserId();return!!s&&delete(this._draftMap[s]||{})["".concat(e,"_").concat(o,"_").concat(this.channelId)]},e.prototype.getTotalUnreadCount=function(e,o,s){var n=this;t.assert("callback",e,t.AssertRules.CALLBACK),this.logger.info(t.LogTagId.O,"getTotalUnreadCount ->conversationTypes:".concat(o)),this._context.getTotalUnreadCount(this.channelId,o,s).then((function(o){var s=o.code,a=o.data;s===t.ErrorCode.SUCCESS?K(e.onSuccess,a):(n.logger.warn(t.LogTagId.O,"getTotalUnreadCount ->code:".concat(s)),H(e.onError,s))}))},e.prototype.getUnreadCount=function(e,o,s){var n=this;t.assert("conversationType",e,t.AssertRules.NUMBER,!0),t.assert("targetId",o,t.AssertRules.STRING,!0),t.assert("callback",s,t.AssertRules.CALLBACK),this.logger.info(t.LogTagId.O,"getUnreadCount ->targetId:".concat(o,",conversationType:").concat(e)),this._context.getUnreadCount(e,o,this.channelId).then((function(e){var a=e.code,r=e.data;a===t.ErrorCode.SUCCESS?K(s.onSuccess,r):(n.logger.warn(t.LogTagId.O,"getUnreadCount ->code:".concat(a,",targetId:").concat(o)),H(s.onError,a))}))},e.prototype.clearConversations=function(e,o){var s=this;this.logger.info(t.LogTagId.O,"clearConversations -> conversationTypes:".concat(o)),this._isCPPMode?this._context.clearConversations(o,this.channelId).then((function(o){o===t.ErrorCode.SUCCESS?K(e.onSuccess,!0):(s.logger.warn(t.LogTagId.O,"clearConversations ->code:".concat(o)),H(e.onError,o))})):this.logger.error(t.LogTagId.O,"Method is only available in cppProtocol mode")},e.prototype.clearUnreadCount=function(e,o,s){var n=this;t.assert("conversationType",e,t.AssertRules.NUMBER,!0),t.assert("targetId",o,t.AssertRules.STRING,!0),t.assert("callback",s,t.AssertRules.CALLBACK),this.logger.info(t.LogTagId.O,"clearUnreadCount ->targetId:".concat(o,",conversationType:").concat(e)),this._context.clearUnreadCount(e,o,this.channelId).then((function(e){e===t.ErrorCode.SUCCESS?K(s.onSuccess,!0):(n.logger.warn(t.LogTagId.O,"clearUnreadCount ->code:".concat(e,",targetId:").concat(o)),H(s.onError,e))}))},e.prototype.clearAllUnreadCount=function(e){var o=this;t.assert("callback",e,t.AssertRules.CALLBACK),this.logger.info(t.LogTagId.O,"clearUnreadCount ->"),this._context.clearAllUnreadCount().then((function(s){s===t.ErrorCode.SUCCESS?K(e.onSuccess,!0):(o.logger.warn(t.LogTagId.O,"clearUnreadCount ->code:".concat(s)),H(e.onError,s))}))},e.prototype.getFirstUnreadMessage=function(e,o,s){var n=this;t.assert("conversationType",e,t.AssertRules.NUMBER,!0),t.assert("targetId",o,t.AssertRules.STRING,!0),t.assert("callback",s,t.AssertRules.CALLBACK),this.logger.info(t.LogTagId.O,"getFirstUnreadMessage ->targetId:".concat(o,",conversationType:").concat(e)),this._context.getFirstUnreadMessage(e,o,this.channelId).then((function(e){e.code===t.ErrorCode.SUCCESS?K(s.onSuccess,e.data?G(e.data):null):(n.logger.warn(t.LogTagId.O,"getFirstUnreadMessage ->code:".concat(e.code,",targetId:").concat(o)),H(s.onError,e.code))}))},e.prototype.setConversationStatus=function(e,o,s,n){var a=this;t.assert("conversationType",e,t.AssertRules.NUMBER,!0),t.assert("targetId",o,t.AssertRules.STRING,!0),t.assert("callback",n,t.AssertRules.CALLBACK),t.assert("status",s,t.AssertRules.OBJECT,!0),this.logger.info(t.LogTagId.O,"setConversationStatus ->targetId:".concat(o,",status:").concat(s));var r=s.isTop,c=s.notificationStatus;this._context.setConversationStatus(e,o,r,c,this.channelId).then((function(e){e===t.ErrorCode.SUCCESS?K(n.onSuccess):(a.logger.warn(t.LogTagId.O,"setConversationStatus ->code:".concat(e,",targetId:").concat(o)),H(n.onError,e))}))},e.prototype.sendMessage=function(e,o,n,r,c,i,g,d){var u=this;t.assert("conversationType",e,t.AssertRules.NUMBER,!0),t.assert("targetId",o,t.AssertRules.STRING,!0),t.assert("msg",n,t.AssertRules.OBJECT,!0),t.assert("callback",r,t.AssertRules.CALLBACK),t.assert("isMentioned",c,t.AssertRules.BOOLEAN),t.assert("pushContent",i,t.AssertRules.ONLY_STRING),t.assert("pushData",g,t.AssertRules.ONLY_STRING),t.assert("options.userIds",null==d?void 0:d.userIds,t.AssertRules.ARRAY),t.assert("options.isVoipPush",null==d?void 0:d.isVoipPush,t.AssertRules.BOOLEAN),t.assert("options.disableNotification",null==d?void 0:d.disableNotification,t.AssertRules.BOOLEAN),t.assert("options.canIncludeExpansion",null==d?void 0:d.canIncludeExpansion,t.AssertRules.BOOLEAN),t.assert("options.expansion",null==d?void 0:d.expansion,t.AssertRules.OBJECT),t.assert("options.pushConfig",null==d?void 0:d.pushConfig,t.AssertRules.OBJECT),t.assert("options.resendMessageId",null==d?void 0:d.resendMessageId,t.AssertRules.NUMBER),this.logger.info(t.LogTagId.O,"sendMessage ->targetId:".concat(o,",conversationType:").concat(e));var l=!(!(null==d?void 0:d.isStatusMessage)&&!(null==d?void 0:d.isStatus)),C=function(e,t,o){var s,n=e||{},a=n.userIds,r=n.isVoipPush,c=n.disableNotification,i=n.isFilerWhiteBlacklist,g=n.expansion,d=n.canIncludeExpansion,u=n.pushConfig,l=n.resendMessageId,C=[];if(t){var h=(o||{}).content.mentionedInfo;C=h.userIdList,s=h.type}return{mentionedType:s,mentionedUserIdList:C,directionalUserIdList:a,isVoipPush:r,disableNotification:c,isFilerWhiteBlacklist:i,expansion:g,canIncludeExpansion:d,pushConfig:u,messageId:l}}(d,c,n),h=Object.assign(n,a(a({isMentioned:c,pushContent:i,pushData:g},C),{messageType:n.objectName,channelId:this.channelId,isStatusMessage:l})),f=this._context.getCurrentUserId(),p=this.logger.createTraceId();this.logger.info(t.LogTagId.A_SEND_MSG_T,JSON.stringify({messageType:h.messageType,conversationType:e,targetId:o,channelId:this.channelId}),p),this._context.sendMessage(e,o,h,r.onBefore,p).then((function(a){var c=a.code,i=a.data,g=c===t.ErrorCode.SUCCESS?"info":"warn";if(u.logger[g](t.LogTagId.A_SEND_MSG_R,JSON.stringify({code:c,messageUId:i?i.messageUId:"",messageId:i?i.messageId:""}),p),c===t.ErrorCode.SUCCESS){u._isCPPMode||w.set(i);var C=G(i);F(C,f,u._context.getConnectedTime(),u._readReceiptTimeout),K(r.onSuccess,C)}else u.logger.warn(t.LogTagId.O,"sendMessage ->code:".concat(c,",targetId:").concat(o)),H(r.onError,c,G({isMentioned:!!h.isMentioned,content:n.content,messageType:n.messageType,isPersited:n.isPersited,isCounted:n.isCounted,disableNotification:!!(null==d?void 0:d.disableNotification),canIncludeExpansion:!!(null==d?void 0:d.canIncludeExpansion),expansion:(null==d?void 0:d.expansion)||null,conversationType:e,targetId:o,senderUserId:f,messageUId:"",messageDirection:t.MessageDirection.SEND,isOffLineMessage:!1,sentTime:(null==i?void 0:i.sentTime)||0,receivedTime:0,isStatusMessage:l,receivedStatus:t.ReceivedStatus.UNREAD,messageId:null==i?void 0:i.messageId,sentStatus:s.FAILED}))}))},e.prototype.sendRecallMessage=function(e,o,s){var n=this;t.assert("message.conversationType",e.conversationType,t.AssertRules.NUMBER,!0),t.assert("message.targetId",e.targetId,t.AssertRules.STRING,!0),t.assert("message.messageUId",e.messageUId,t.AssertRules.STRING,!0),t.assert("message.sentTime",e.sentTime,t.AssertRules.NUMBER,!0),t.assert("callback",o,t.AssertRules.CALLBACK),t.assert("options.disableNotification",null==s?void 0:s.disableNotification,t.AssertRules.BOOLEAN),t.assert("options.pushConfig",null==s?void 0:s.pushConfig,t.AssertRules.OBJECT),t.assert("options.extra",null==s?void 0:s.extra,t.AssertRules.STRING);var r=e.conversationType,c=e.targetId,i=e.messageUId,g=e.sentTime;this.logger.info(t.LogTagId.O,"sendRecallMessage ->targetId:".concat(c,",conversationType:").concat(r,",messageUId:").concat(i));var d=a({channelId:this.channelId},s);this._context.recallMessage(r,c,i,g,d).then((function(e){var s=e.code,a=e.data;s===t.ErrorCode.SUCCESS?(n._isCPPMode||w.set(a),K(o.onSuccess,G(a))):(n.logger.warn(t.LogTagId.O,"sendRecallMessage ->code:".concat(s,",targetId:").concat(c,",messageUId:").concat(i)),H(o.onError,s))}))},e.prototype.sendTypingStatusMessage=function(e,o,s,n){var a=this;t.assert("conversationType",e,t.AssertRules.NUMBER,!0),t.assert("targetId",o,t.AssertRules.STRING,!0),t.assert("typingContentType",s,t.AssertRules.STRING,!0),t.assert("callback",n,t.AssertRules.CALLBACK),this.logger.info(t.LogTagId.O,"sendTypingStatusMessage ->targetId:".concat(o,",conversationType:").concat(e));var r={messageType:"RC:TypSts",content:{typingContentType:s},isStatusMessage:!0,channelId:this.channelId},c=this.logger.createTraceId();this.logger.info(t.LogTagId.A_SEND_MSG_T,JSON.stringify({messageType:r.messageType,conversationType:e,targetId:o,channelId:r.channelId}),c),this._context.sendMessage(e,o,r,void 0,c).then((function(e){var s=e.code,r=e.data,i=s===t.ErrorCode.SUCCESS?"info":"warn";a.logger[i](t.LogTagId.A_SEND_MSG_R,JSON.stringify({code:s,messageUId:r?r.messageUId:"",messageId:r?r.messageId:""}),c),s===t.ErrorCode.SUCCESS?K(n.onSuccess,G(r)):(a.logger.warn(t.LogTagId.O,"sendTypingStatusMessage ->code:".concat(s,",targetId:").concat(o)),H(n.onError,s))}))},e.prototype.sendReceiptResponse=function(e,o,s){var n=this;this.logger.info(t.LogTagId.O,"sendReceiptResponse ->targetId:".concat(o,",conversationType:").concat(e));var a=this._context.getCurrentUserId(),r="".concat(a).concat(e).concat(o,"RECEIVED"),c=this._storage.get(r);if(c){var i=[];for(var g in c){var d={};d[g]=c[g].uIds,c[g].isResponse||i.push(d)}if(0===i.length)return void s.onSuccess(null);var u=setInterval((function(){1===i.length&&clearInterval(u);var a=i.splice(0,1)[0],g=new q({receiptMessageDic:a});n.sendMessage(e,o,g,{onSuccess:function(e){var t=Object.keys(a)[0];c[t].isResponse=!0,n._storage.set(r,c),K(s.onSuccess,e)},onError:function(e){n.logger.warn(t.LogTagId.O,"sendReceiptResponse ->code:".concat(e,",targetId:").concat(o)),H(s.onError,e)}})}),200)}else s.onSuccess(null)},e.prototype.sendReadReceiptMessage=function(e,o,s){var n=this;t.assert("messageUIds",e,t.AssertRules.ARRAY,!0),t.assert("targetId",o,t.AssertRules.STRING,!0),this.logger.info(t.LogTagId.O,"sendReadReceiptMessage ->targetId:".concat(o,",messageUIds:").concat(e));for(var a=0,r=e;a<r.length;a++){var c=r[a];t.assert("messageUId",c,t.AssertRules.STRING)}this._context.sendReadReceiptMessage(o,e,this.channelId).then((function(a){var r=a.code;r===t.ErrorCode.SUCCESS?s.onSuccess():(n.logger.warn(t.LogTagId.O,"sendReadReceiptMessage ->code:".concat(r,",targetId:").concat(o,",messageUIds:").concat(e)),s.onError(r))})).catch((function(a){n.logger.warn(t.LogTagId.O,"sendReadReceiptMessage ->code:".concat(a,",targetId:").concat(o,",messageUIds:").concat(e)),s.onError(a)}))},e.prototype.getMessageReader=function(e,o,s){var n=this;t.assert("messageUId",e,t.AssertRules.STRING,!0),t.assert("targetId",o,t.AssertRules.STRING,!0),this.logger.info(t.LogTagId.O,"getMessageReader ->targetId:".concat(o,",messageUId:").concat(e)),this._context.getMessageReader(o,e,this.channelId).then((function(a){var r=a.code,c=a.data;r===t.ErrorCode.SUCCESS?s.onSuccess(c):(n.logger.warn(t.LogTagId.O,"getMessageReader ->code:".concat(r,",targetId:").concat(o,",messageUId:").concat(e)),s.onError(r))})).catch((function(a){n.logger.warn(t.LogTagId.O,"getMessageReader ->code:".concat(a,",targetId:").concat(o,",messageUId:").concat(e)),s.onError(a)}))},e.prototype.updateMessageExpansion=function(e,o,s){var n=this;t.assert("expansion",e,t.AssertRules.OBJECT,!0),t.assert("message",o,t.AssertRules.OBJECT,!0);var a=o.conversationType,r=o.targetId,c=o.messageUId,i=o.canIncludeExpansion,g=o.expansion;this.logger.info(t.LogTagId.O,"updateMessageExpansion ->targetId:".concat(r,",messageUId:").concat(c,",conversationType:").concat(a)),this._context.sendExpansionMessage({conversationType:a,targetId:r,messageUId:c,canIncludeExpansion:i,originExpansion:g,expansion:e,channelId:this.channelId}).then((function(e){var o=e.code;o===t.ErrorCode.SUCCESS?K(s.onSuccess):(n.logger.warn(t.LogTagId.O,"updateMessageExpansion ->code:".concat(o,",targetId:").concat(r,",messageUId:").concat(c)),H(s.onError,o))}))},e.prototype.removeMessageExpansionForKey=function(e,o,s){var n=this;t.assert("keys",e,t.AssertRules.ARRAY,!0),t.assert("message",o,t.AssertRules.OBJECT,!0);var a=o.conversationType,r=o.targetId,c=o.messageUId,i=o.canIncludeExpansion;this.logger.info(t.LogTagId.O,"removeMessageExpansionForKey ->targetId:".concat(r,",messageUId:").concat(c,",conversationType:").concat(a)),this._context.sendExpansionMessage({conversationType:a,targetId:r,messageUId:c,canIncludeExpansion:i,keys:e,channelId:this.channelId}).then((function(e){var o=e.code;o===t.ErrorCode.SUCCESS?K(s.onSuccess):(n.logger.warn(t.LogTagId.O,"removeMessageExpansionForKey ->code:".concat(o,",targetId:").concat(r,",messageUId:").concat(c)),H(s.onError,o))}))},e.prototype.getHistoryMessages=function(e,o,s,n,a,r,c){var i=this;t.assert("conversationType",e,t.AssertRules.NUMBER,!0),t.assert("targetId",o,t.AssertRules.STRING,!0),t.assert("timestamp",s,t.AssertRules.NUMBER,!0),t.assert("count",n,t.AssertRules.NUMBER,!0),t.assert("callback",a,t.AssertRules.CALLBACK,!0),t.assert("order",c,t.AssertRules.NUMBER),this.logger.info(t.LogTagId.O,"getHistoryMessages ->targetId:".concat(o,",conversationType:").concat(e,",timestamp:").concat(s));var g=this.logger.createTraceId();this.logger.info(t.LogTagId.A_GET_HISTORY_MSG_T,JSON.stringify({targetId:o,conversationType:e,channelId:"",timestamp:s,count:n}),g),this._context.getHistoryMessage(e,o,s,n,c,this.channelId,r,g).then((function(e){var o=e.code,s=e.data;if(o===t.ErrorCode.SUCCESS)if(s){var n=s.list,r=s.hasMore,c=[],d=n.map((function(e){return c.push(e.messageUId),G(e)}));i.logger.info(t.LogTagId.A_GET_HISTORY_MSG_R,JSON.stringify({code:o,messageUIds:c.join(",")}),g),K(a.onSuccess,d,r)}else i.logger.info(t.LogTagId.A_GET_HISTORY_MSG_R,JSON.stringify({code:o,messageUIds:""}),g),K(a.onSuccess,[],!1);else i.logger.warn(t.LogTagId.A_GET_HISTORY_MSG_R,JSON.stringify({code:o,messageUIds:""}),g),H(a.onError,o)}))},e.prototype.deleteRemoteMessages=function(e,o,s,n){var a=this;t.assert("conversationType",e,t.AssertRules.NUMBER,!0),t.assert("targetId",o,t.AssertRules.STRING,!0),t.assert("messages",s,t.AssertRules.ARRAY,!0),t.assert("callback",n,t.AssertRules.CALLBACK),this.logger.info(t.LogTagId.O,"deleteRemoteMessages ->targetId:".concat(o,",conversationType:").concat(e)),this._context.deleteRemoteMessage(e,o,s,this.channelId).then((function(r){if(r===t.ErrorCode.SUCCESS){if(!a._isCPPMode){var c=w.get(e,o,a.channelId);c&&s.forEach((function(t){c.messageUId===t.messageUId&&w.remove(e,o,a.channelId)}))}K(n.onSuccess)}else a.logger.warn(t.LogTagId.O,"deleteRemoteMessages ->code:".concat(r,",targetId:").concat(o)),H(n.onError,r)}))},e.prototype.clearRemoteHistoryMessages=function(e,o){var s=this;t.assert("param.conversationType",e.conversationType,t.AssertRules.NUMBER,!0),t.assert("param.targetId",e.targetId,t.AssertRules.STRING,!0),t.assert("param.timestamp",e.timestamp,t.AssertRules.NUMBER,!0),t.assert("callback",o,t.AssertRules.CALLBACK);var n=e.conversationType,a=e.targetId,r=e.timestamp;this.logger.info(t.LogTagId.O,"clearRemoteHistoryMessages ->targetId:".concat(a,",conversationType:").concat(n)),this._context.deleteRemoteMessageByTimestamp(n,a,r,this.channelId).then((function(e){e===t.ErrorCode.SUCCESS?K(o.onSuccess):(s.logger.warn(t.LogTagId.O,"clearRemoteHistoryMessages ->code:".concat(e)),H(o.onError,e))}))},e.prototype.getConversationListWithAllChannel=function(e){t.assert("callback",e,t.AssertRules.CALLBACK),this._context.getConversationListWithAllChannel().then((function(o){var s=o.code,n=o.data;s===t.ErrorCode.SUCCESS?K(e.onSuccess,n.map(D)):H(e.onError,s)}))},e.prototype.getConversationListWithAllChannelByPage=function(e,o,s){t.assert("callback",e,t.AssertRules.CALLBACK),t.assert("index",o,t.AssertRules.NUMBER),t.assert("limit",s,t.AssertRules.NUMBER),this._context.getConversationListWithAllChannelByPage(o,s).then((function(o){var s=o.code,n=o.data;s===t.ErrorCode.SUCCESS?K(e.onSuccess,n.map(D)):H(e.onError,s)}))},e.prototype.insertMessage=function(e,o,s,n,a){var r=this;void 0===a&&(a={});var c=s.senderUserId,i=s.objectName,g=s.content,d=s.messageDirection,u=s.messageUId,l=s.canIncludeExpansion,C=s.expansion,h=s.disableNotification,f=s.sentTime,p=s.sentStatus;this.logger.info(t.LogTagId.O,"insertMessage ->targetId:".concat(o,",conversationType:").concat(e));var R=a.isUnread,I={senderUserId:c,messageType:i,content:g,messageDirection:d,sentTime:f,sentStatus:p,searchContent:a.searchContent,isUnread:R,messageUId:u,disableNotification:h,canIncludeExpansion:l,expansionMsg:JSON.stringify(C),channelId:this.channelId};this._context.insertMessage(e,o,I).then((function(e){var s=e.code,a=e.data;s===t.ErrorCode.SUCCESS?K(n.onSuccess,G(a)):(r.logger.warn(t.LogTagId.O,"insertMessage ->code:".concat(s,",targetId:").concat(o)),H(n.onError,s))}))},e.prototype.deleteLocalMessagesByTimestamp=function(e,o,s,n,a){var r=this;this.logger.info(t.LogTagId.O,"deleteLocalMessagesByTimestamp ->targetId:".concat(o,",conversationType:").concat(e,",timestamp:").concat(s)),this._context.deleteMessagesByTimestamp(e,o,s,n,this.channelId).then((function(e){e===t.ErrorCode.SUCCESS?K(a.onSuccess,!0):(r.logger.warn(t.LogTagId.O,"deleteLocalMessagesByTimestamp ->code:".concat(e,",targetId:").concat(o)),H(a.onError,e))}))},e.prototype.getRemoteHistoryMessages=function(e,o,s,n,a,r){var c=this;this.logger.info(t.LogTagId.O,"getRemoteHistoryMessages ->targetId:".concat(o,",conversationType:").concat(e));var i=r.order||0;this._context.getRemoteHistoryMessages(e,o,s,n,i,this.channelId).then((function(e){var s=e.code,n=e.data;if(s===t.ErrorCode.SUCCESS)if(n){var r=n.list,i=n.hasMore,g=r.map((function(e){return G(e)}));K(a.onSuccess,g,i)}else K(a.onSuccess,[],!1);else c.logger.warn(t.LogTagId.O,"getRemoteHistoryMessages ->code:".concat(s,",targetId:").concat(o)),H(a.onError,s)}))},e.prototype.clearMessages=function(e,o,s){var n=this;this.logger.info(t.LogTagId.O,"clearMessages ->targetId:".concat(o,",conversationType:").concat(e)),this._context.clearMessages(e,o,this.channelId).then((function(a){a===t.ErrorCode.SUCCESS?(n._isCPPMode||w.remove(e,o,n.channelId),K(s.onSuccess,!0)):(n.logger.warn(t.LogTagId.O,"clearMessages ->code:".concat(a,",targetId:").concat(o)),H(s.onError,a))}))},e.prototype.searchConversationByContent=function(e,o,s,n){var a=this;this.logger.info(t.LogTagId.O,"searchConversationByContent ->keyword:".concat(e)),this._context.searchConversationByContent(e,n,this.channelId,s).then((function(s){var n=s.code,r=s.data,c=[];r=r||[],n===t.ErrorCode.SUCCESS?(r.forEach((function(e){c.push(D(e))})),K(o.onSuccess,c)):(a.logger.warn(t.LogTagId.O,"searchConversationByContent ->code:".concat(n,",keyword:").concat(e)),H(o.onError,n))}))},e.prototype.searchConversationByContentWithAllChannel=function(e,o,s,n){var a=this;void 0===s&&(s=[]),this.logger.info("searchConversationByContentWithAllChannel ->keyword:".concat(e)),this._context.searchConversationByContentWithAllChannel(e,s,n).then((function(s){var n=s.code,r=s.data,c=[];r=r||[],n===t.ErrorCode.SUCCESS?(r.forEach((function(e){c.push(D(e))})),K(o.onSuccess,c)):(a.logger.warn(t.LogTagId.O,"searchConversationByContentWithAllChannel ->code:".concat(n,",keyword:").concat(e)),H(o.onError,n))}))},e.prototype.searchMessageByContent=function(e,o,s,n,a,r,c){var i=this;this.logger.info(t.LogTagId.O,"searchMessageByContent ->targetId:".concat(o,",conversationType:").concat(e,",keyword:").concat(s)),this._context.searchMessageByContent(e,o,s,n,a,r,this.channelId).then((function(e){var s=e.code,n=e.data,a=[];if(s===t.ErrorCode.SUCCESS){var r=n=n||{},g=r.messages,d=r.count;g.forEach((function(e){a.push(G(e))})),K(c.onSuccess,a,d)}else i.logger.warn(t.LogTagId.O,"searchMessageByContent ->code:".concat(s,",targetId:").concat(o)),H(c.onError,s)}))},e.prototype.searchMessageByContentWithAllChannel=function(e,o,s,n,a,r){var c=this;this.logger.info("searchMessageByContentWithAllChannel ->targetId: ".concat(o," ,conversationType: ").concat(e," ,keyword: ").concat(s,", timestamp: ").concat(n,", count: ").concat(a)),this._context.searchMessageByContentWithAllChannel(e,o,s,n,a).then((function(e){var s=e.code,n=e.data,a=[];if(s===t.ErrorCode.SUCCESS){var i=n=n||{},g=i.messages,d=i.count;g.forEach((function(e){a.push(G(e))})),K(r.onSuccess,a,d)}else c.logger.warn(t.LogTagId.O,"searchMessageByContentWithAllChannel ->code:".concat(s,",targetId:").concat(o)),H(r.onError,s)}))},e.prototype.searchMessageByContentInTimeRangeWithAllChannel=function(e,o,s,n,a,r,c,i){var g=this;this.logger.info("searchMessageByContentInTimeRangeWithAllChannel ->targetId: ".concat(o," ,conversationType: ").concat(e," ,keyword: ").concat(s,", startTime: ").concat(n,", endTime: ").concat(a,", offset: ").concat(r,", limit: ").concat(c)),this._context.searchMessageByContentInTimeRangeWithAllChannel(e,o,s,n,a,r,c).then((function(e){var s=e.code,n=e.data,a=[];s===t.ErrorCode.SUCCESS?((n=n||{}).messages.forEach((function(e){a.push(G(e))})),K(i.onSuccess,a)):(g.logger.warn(t.LogTagId.O,"searchMessageByContentInTimeRangeWithAllChannel ->code:".concat(s,",targetId:").concat(o)),H(i.onError,s))}))},e.prototype.getUnreadMentionedMessages=function(e,o){return this.logger.info(t.LogTagId.O,"getUnreadMentionedMessages ->targetId:".concat(o,",conversationType:").concat(e)),this._context.getUnreadMentionedMessages(e,o,this.channelId).map((function(e){return G(e)}))},e.prototype.clearUnreadCountByTimestamp=function(e,o,s,n){var a=this;this.logger.info(t.LogTagId.O,"clearUnreadCountByTimestamp ->targetId:".concat(o,",conversationType:").concat(e)),this._context.clearUnreadCountByTimestamp(e,o,s,this.channelId).then((function(e){e===t.ErrorCode.SUCCESS?K(n.onSuccess,!0):(a.logger.warn(t.LogTagId.O,"clearUnreadCountByTimestamp ->code:".concat(e,",targetId:").concat(o)),H(n.onError,e))}))},e.prototype.getConversationNotificationStatus=function(e,o,s){var n=this;this.logger.info(t.LogTagId.O,"getConversationNotificationStatus ->targetId:".concat(o,",conversationType:").concat(e)),this._context.getConversationNotificationStatus(e,o,this.channelId).then((function(e){var a=e.code,r=e.data;a===t.ErrorCode.SUCCESS?K(s.onSuccess,r):(n.logger.warn(t.LogTagId.O,"getConversationNotificationStatus ->code:".concat(a,",targetId:").concat(o)),H(s.onError,a))}))},e.prototype.getGroupMessageDeliverList=function(e,o,s){var n=this;this.logger.info("getGroupMessageDeliverList ->targetId:".concat(e,"',messageUId:").concat(o)),this._context.getGroupMessageDeliverList(e,o,this.channelId).then((function(e){var a=e.code,r=e.data;a===t.ErrorCode.SUCCESS?K(s.onSuccess,r):(n.logger.warn(t.LogTagId.O,"getGroupMessageDeliverList ->code:".concat(a,",messageUId:").concat(o)),H(s.onError,a))}))},e.prototype.getPrivateMessageDeliverTime=function(e,o){var s=this;this.logger.info("getPrivateMessageDeliverTime -> messageUId:".concat(e)),this._context.getPrivateMessageDeliverTime(e,this.channelId).then((function(n){var a=n.code,r=n.data;a===t.ErrorCode.SUCCESS?K(o.onSuccess,r):(s.logger.warn(t.LogTagId.O,"getPrivateMessageDeliverTime ->code:".concat(a,",messageUId:").concat(e)),H(o.onError,a))}))},e}(),Q=function(e){return{targetId:e.targetId,channelId:e.channelId,conversationType:e.type}},X=function(){function e(e,o,s){this._context=e,this._options=o,this.logger=s,this._channelClient={},this._isCPPMode=t.usingCppEngine(),this._defaultChannelClient=new Y(this.logger,e,"",this._isCPPMode,o.readReceiptTimeout)}return e.prototype.assertCPPMode=function(e,o,s){if(!this._isCPPMode)return null==s||s.onError(t.ErrorCode.NOT_SUPPORT),void this.logger.error(t.LogTagId.O,"'".concat(o,"' is unusable!"));e()},e.prototype.install=function(e,t){return this._context.install(e,t)},e.prototype.getChannel=function(e){if(this.logger.info(t.LogTagId.O,"getChannel ->channelId:".concat(e)),!this._isCPPMode)return this.logger.error(t.LogTagId.O,"getChannel method is only available in protocol stack mode"),null;if(t.assert("channelId",e,t.AssertRules.STRING,!0),e.length>20)return this.logger.error(t.LogTagId.O,"The channelId cannot exceed 20 characters"),null;if(e in this._channelClient)return this._channelClient[e];if(Object.keys(this._channelClient).length>1e3)return this.logger.error(t.LogTagId.O,"Only 1000 channels can be obtained"),null;var o=new Y(this.logger,this._context,e,this._isCPPMode,this._options.readReceiptTimeout);return this._channelClient[e]=o,o},e.prototype.deleteChannels=function(e){var o=this;t.assert("channelIds",e,t.AssertRules.ARRAY,!0),this.logger.info(t.LogTagId.O,"deleteChannels ->channelIds:".concat(e)),this.assertCPPMode((function(){e.forEach((function(e){delete o._channelClient[e]}))}),"deleteChannels")},e.prototype.getNavi=function(){return this._context.getInfoFromCache()||{}},e.prototype.getSDKInfo=function(){return{version:this._context.apiVersion}},e.prototype.getAppInfo=function(){return{appKey:this._context.appkey}},e.prototype.getCurrentUserId=function(){return this._context.getCurrentUserId()},e.prototype.disconnect=function(){return r(this,void 0,void 0,(function(){return c(this,(function(e){switch(e.label){case 0:return this.logger.info(t.LogTagId.A_DISCONNECT_O),[4,this._context.disconnect()];case 1:return e.sent(),[2]}}))}))},e.prototype.logout=function(){return this.disconnect()},e.prototype.clearCache=function(){},e.prototype.getDeviceId=function(){return this._context.getDeviceId()},e.prototype.getConversationList=function(e,t,o){this._defaultChannelClient.getConversationList(e,t,o)},e.prototype.getConversationListWithAllChannel=function(e){this._defaultChannelClient.getConversationListWithAllChannel(e)},e.prototype.getConversationListWithAllChannelByPage=function(e,t,o){void 0===o&&(o=30),this._defaultChannelClient.getConversationListWithAllChannelByPage(e,t,o)},e.prototype.getConversation=function(e,t,o){return this._defaultChannelClient.getConversation(e,t,o)},e.prototype.removeConversation=function(e,t,o){return this._defaultChannelClient.removeConversation(e,t,o)},e.prototype.saveTextMessageDraft=function(e,t,o){return this._defaultChannelClient.saveTextMessageDraft(e,t,o)},e.prototype.getTextMessageDraft=function(e,t){return this._defaultChannelClient.getTextMessageDraft(e,t)},e.prototype.clearTextMessageDraft=function(e,t){return this._defaultChannelClient.clearTextMessageDraft(e,t)},e.prototype.getTotalUnreadCount=function(e,t,o){return this._defaultChannelClient.getTotalUnreadCount(e,t,o)},e.prototype.getUnreadCount=function(e,t,o){return this._defaultChannelClient.getUnreadCount(e,t,o)},e.prototype.getConversationUnreadCount=function(e,o){this.logger.error(t.LogTagId.O,"Method is deprecated")},e.prototype.clearConversations=function(e,t){return this._defaultChannelClient.clearConversations(e,t)},e.prototype.clearUnreadCount=function(e,t,o){this._defaultChannelClient.clearUnreadCount(e,t,o)},e.prototype.clearAllUnreadCount=function(e){this._defaultChannelClient.clearAllUnreadCount(e)},e.prototype.setConversationStatus=function(e,t,o,s){return this._defaultChannelClient.setConversationStatus(e,t,o,s)},e.prototype.sendMessage=function(e,t,o,s,n,a,r,c,i){return this._defaultChannelClient.sendMessage(e,t,o,s,n,a,r,i)},e.prototype.sendRecallMessage=function(e,t,o){return this._defaultChannelClient.sendRecallMessage(e,t,o)},e.prototype.sendTypingStatusMessage=function(e,t,o,s){return this._defaultChannelClient.sendTypingStatusMessage(e,t,o,s)},e.prototype.sendReceiptResponse=function(e,t,o){return this._defaultChannelClient.sendReceiptResponse(e,t,o)},e.prototype.sendReadReceiptMessage=function(e,t,o){return this._defaultChannelClient.sendReadReceiptMessage(e,t,o)},e.prototype.getMessageReader=function(e,t,o){this._defaultChannelClient.getMessageReader(e,t,o)},e.prototype.updateMessageExpansion=function(e,t,o){this._defaultChannelClient.updateMessageExpansion(e,t,o)},e.prototype.removeMessageExpansionForKey=function(e,t,o){this._defaultChannelClient.removeMessageExpansionForKey(e,t,o)},e.prototype.getHistoryMessages=function(e,t,o,s,n,a,r){return this._defaultChannelClient.getHistoryMessages(e,t,o,s,n,a,r)},e.prototype.joinChatRoom=function(e,o,s){var n=this;t.assert("chatRoomId",e,t.AssertRules.STRING,!0),t.assert("count",o,t.AssertRules.NUMBER,!0),t.assert("callback",s,t.AssertRules.CALLBACK),this.logger.info(t.LogTagId.O,"joinChatRoom ->chatRoomId:".concat(e));var a=this.logger.createTraceId();this.logger.info(t.LogTagId.A_JOIN_CHATROOM_T,JSON.stringify({chatroomId:e,count:o,joinExist:!1}),a),this._context.joinChatroom(e,o,a).then((function(o){var r=o===t.ErrorCode.SUCCESS?"info":"warn";n.logger[r](t.LogTagId.A_JOIN_CHATROOM_R,JSON.stringify({code:o,timestamp:(new Date).getTime()}),a),o===t.ErrorCode.SUCCESS?K(s.onSuccess):(n.logger.warn(t.LogTagId.O,"joinChatRoom ->code:".concat(o,",chatRoomId:").concat(e)),H(s.onError,o))}))},e.prototype.quitChatRoom=function(e,o){var s=this;t.assert("chatRoomId",e,t.AssertRules.STRING,!0),t.assert("callback",o,t.AssertRules.CALLBACK),this.logger.info(t.LogTagId.O,"quitChatRoom ->chatRoomId:".concat(e));var n=this.logger.createTraceId();this.logger.info(t.LogTagId.A_QUIT_CHATROOM_T,JSON.stringify({chatroomId:e}),n),this._context.quitChatroom(e).then((function(a){var r=a===t.ErrorCode.SUCCESS?"info":"warn";s.logger[r](t.LogTagId.A_QUIT_CHATROOM_R,JSON.stringify({code:a}),n),a===t.ErrorCode.SUCCESS?K(o.onSuccess):(s.logger.warn(t.LogTagId.O,"quitChatRoom ->code:".concat(a,",chatRoomId:").concat(e)),H(o.onError,a))}))},e.prototype.getChatRoomInfo=function(e,o,s,n){var a=this;t.assert("chatRoomId",e,t.AssertRules.STRING,!0),t.assert("count",o,t.AssertRules.NUMBER,!0),t.assert("order",s,t.AssertRules.NUMBER,!0),t.assert("callback",n,t.AssertRules.CALLBACK),this.logger.info(t.LogTagId.O,"getChatRoomInfo ->chatRoomId:".concat(e)),this._context.getChatroomInfo(e,o,s).then((function(o){var s=o.code,r=o.data;s===t.ErrorCode.SUCCESS?K(n.onSuccess,{userInfos:(null==r?void 0:r.userInfos)||[],userTotalNums:(null==r?void 0:r.userCount)||0}):(a.logger.warn(t.LogTagId.O,"getChatRoomInfo ->code:".concat(s,",chatRoomId:").concat(e)),H(n.onError,s))}))},e.prototype.setChatroomEntry=function(e,o,s){var n=this;t.assert("chatRoomId",e,t.AssertRules.STRING,!0),t.assert("chatroomEntry",o,t.AssertRules.OBJECT,!0),t.assert("callback",s,t.AssertRules.CALLBACK),this.logger.info(t.LogTagId.O,"setChatroomEntry ->chatRoomId:".concat(e)),this._context.setChatroomEntry(e,o).then((function(o){o===t.ErrorCode.SUCCESS?K(s.onSuccess):(n.logger.warn(t.LogTagId.O,"setChatroomEntry ->code:".concat(o,",chatRoomId:").concat(e)),H(s.onError,o))}))},e.prototype.setChatRoomEntries=function(e,o,s){var n=this;if(t.assert("chatRoomId",e,t.AssertRules.STRING,!0),function(e){e.entries.forEach((function(e){t.assert("entry.key",e.key,t.AssertRules.STRING,!0),t.assert("entry.value",e.value,t.AssertRules.STRING,!0)})),t.assert("options.isAutoDelete",e.isAutoDelete,t.AssertRules.BOOLEAN)}(o),t.assert("callback",s,t.AssertRules.CALLBACK),o.entries.length>10)H(s.onError,t.ErrorCode.CHATROOM_KV_STORE_OUT_LIMIT);else{var a="id:".concat(e);this.logger.info(t.LogTagId.O,"set chatroom entry->".concat(a)),this._context.setChatroomEntries(e,o).then((function(e){var o=e.code,r=e.data;o===t.ErrorCode.SUCCESS?K(s.onSuccess):(n.logger.warn(t.LogTagId.O,"set chatroom entry fail ->code+:".concat(o,",").concat(a)),H(s.onError,o,r))}))}},e.prototype.forceSetChatroomEntry=function(e,o,s){var n=this;t.assert("chatRoomId",e,t.AssertRules.STRING,!0),t.assert("chatroomEntry",o,t.AssertRules.OBJECT,!0),t.assert("callback",s,t.AssertRules.CALLBACK),this.logger.info(t.LogTagId.O,"forceSetChatroomEntry ->chatRoomId:".concat(e)),this._context.forceSetChatroomEntry(e,o).then((function(o){o===t.ErrorCode.SUCCESS?K(s.onSuccess):(n.logger.warn(t.LogTagId.O,"forceSetChatroomEntry ->code:".concat(o,",chatRoomId:").concat(e)),H(s.onError,o))}))},e.prototype.removeChatroomEntry=function(e,o,s){var n=this;t.assert("chatRoomId",e,t.AssertRules.STRING,!0),t.assert("chatroomEntry",o,t.AssertRules.OBJECT,!0),t.assert("callback",s,t.AssertRules.CALLBACK),this.logger.info(t.LogTagId.O,"removeChatroomEntry ->chatRoomId:".concat(e)),this._context.removeChatroomEntry(e,o).then((function(o){o===t.ErrorCode.SUCCESS?K(s.onSuccess):(n.logger.warn(t.LogTagId.O,"removeChatroomEntry ->code:".concat(o,",chatRoomId:").concat(e)),H(s.onError,o))}))},e.prototype.removeChatRoomEntries=function(e,o,s){var n=this;t.assert("chatRoomId",e,t.AssertRules.STRING,!0),function(e){e.entries.forEach((function(e){t.assert("key",e,t.AssertRules.STRING,!0)}))}(o);var r="id:".concat(e);this.logger.debug(t.LogTagId.O,"remove chatroom entry->".concat(r));var c=a({},o);c.entries=o.entries.map((function(e){return{key:e}})),this._context.removeChatroomEntries(e,c).then((function(e){var o=e.code,a=e.data;o===t.ErrorCode.SUCCESS?K(s.onSuccess):(n.logger.warn(t.LogTagId.O,"remove chatroom entry fail ->code+:".concat(o,",").concat(r)),H(s.onError,o,a))}))},e.prototype.forceRemoveChatroomEntry=function(e,o,s){var n=this;t.assert("chatRoomId",e,t.AssertRules.STRING,!0),t.assert("chatroomEntry",o,t.AssertRules.OBJECT,!0),t.assert("callback",s,t.AssertRules.CALLBACK),this.logger.info(t.LogTagId.O,"forceRemoveChatroomEntry ->chatRoomId:".concat(e)),this._context.forceRemoveChatroomEntry(e,o).then((function(o){o===t.ErrorCode.SUCCESS?K(s.onSuccess):(n.logger.warn(t.LogTagId.O,"forceRemoveChatroomEntry ->code:".concat(o,",chatRoomId:").concat(e)),H(s.onError,o))}))},e.prototype.getChatroomEntry=function(e,o,s){var n=this;t.assert("chatRoomId",e,t.AssertRules.STRING,!0),t.assert("key",o,t.AssertRules.STRING,!0),t.assert("callback",s,t.AssertRules.CALLBACK),this.logger.info(t.LogTagId.O,"getChatroomEntry ->chatRoomId:".concat(e,",key:").concat(o)),this._context.getChatroomEntry(e,o).then((function(o){var a=o.code,r=o.data;a===t.ErrorCode.SUCCESS?K(s.onSuccess,r||""):(n.logger.warn(t.LogTagId.O,"getChatroomEntry ->code:".concat(a,",chatRoomId:").concat(e)),H(s.onError,a))}))},e.prototype.getAllChatroomEntries=function(e,o){var s=this;t.assert("chatRoomId",e,t.AssertRules.STRING,!0),t.assert("callback",o,t.AssertRules.CALLBACK),this.logger.info(t.LogTagId.O,"getAllChatroomEntries ->chatRoomId:".concat(e)),this._context.getAllChatroomEntries(e).then((function(n){var a=n.code,r=n.data;a===t.ErrorCode.SUCCESS?K(o.onSuccess,r):(s.logger.warn(t.LogTagId.O,"getAllChatroomEntries ->code:".concat(a,",chatRoomId:").concat(e)),H(o.onError,a))}))},e.prototype.getChatRoomHistoryMessages=function(e,o,s,n,a){var r=this;void 0===a&&(a=0),t.assert("chatRoomId",e,t.AssertRules.STRING,!0),t.assert("count",o,t.AssertRules.NUMBER,!0),t.assert("order",s,t.AssertRules.NUMBER,!0),t.assert("callback",n,t.AssertRules.CALLBACK),t.assert("timestamp",a,t.AssertRules.NUMBER),this.logger.info(t.LogTagId.O,"getChatRoomHistoryMessages ->chatRoomId:".concat(e)),this._context.getChatRoomHistoryMessages(e,o,s,a).then((function(o){var s=o.code,a=o.data;if(s===t.ErrorCode.SUCCESS)if(a){var c=a.list,i=a.hasMore,g=c.map((function(e){return G(e)}));K(n.onSuccess,g,i)}else K(n.onSuccess,[],!1);else r.logger.warn(t.LogTagId.O,"getChatRoomHistoryMessages ->code:".concat(s,",chatRoomId:").concat(e)),H(n.onError,s)}))},e.prototype.setDeviceInfo=function(e){},e.prototype.getCurrentConnectionStatus=function(){return this._context.getConnectionStatus()},e.prototype.deleteRemoteMessages=function(e,t,o,s){return this._defaultChannelClient.deleteRemoteMessages(e,t,o,s)},e.prototype.clearRemoteHistoryMessages=function(e,t){return this._defaultChannelClient.clearRemoteHistoryMessages(e,t)},e.prototype.getFileToken=function(e,o,s,n,a){t.assert("fileType",e,t.AssertRules.NUMBER,!0),t.assert("fileName",s,t.AssertRules.STRING),t.assert("callback",o,t.AssertRules.CALLBACK),this.logger.info(t.LogTagId.O,"getFileToken ->fileType:".concat(e,",fileName:").concat(s,",queryString:").concat(a)),this._context.getFileToken(e,s,n,a).then(o.onSuccess).catch(o.onError)},e.prototype.getFileUrl=function(e,o,s,n,a,r){t.assert("fileType",e,t.AssertRules.NUMBER,!0),t.assert("fileName",o,t.AssertRules.STRING,!0),t.assert("saveName",s,t.AssertRules.STRING),t.assert("callback",n,t.AssertRules.CALLBACK),t.assert("serverType",r,t.AssertRules.NUMBER),t.assert("uploadRes",a,t.AssertRules.OBJECT),this.logger.info(t.LogTagId.O,"getFileUrl ->fileType:".concat(e,",fileName:").concat(o)),this._context.getFileUrl(e,o,s,a,r).then(n.onSuccess).catch(n.onError)},e.prototype.createTag=function(e,o){var s=this;t.assert("tag.tagId",e.tagId,t.AssertRules.STRING,!0),t.assert("tag.tagId",e.tagId,(function(e){return e.length<=10})),t.assert("tag.tagName",e.tagName,(function(e){return e.length<=15})),t.assert("tag.tagName",e.tagName,t.AssertRules.STRING,!0),t.assert("callback",o,t.AssertRules.CALLBACK),this.logger.info(t.LogTagId.O,"createTag ->tagId:".concat(e.tagId,",tagName:").concat(e.tagName)),this._context.createTag(e).then((function(n){var a=n.code;a===t.ErrorCode.SUCCESS?o.onSuccess():(s.logger.warn(t.LogTagId.O,"createTag ->code:".concat(a,",tagId:").concat(e.tagId)),o.onError(a))})).catch((function(n){s.logger.warn(t.LogTagId.O,"createTag ->code:".concat(n,",tagId:").concat(e.tagId)),o.onError(n)}))},e.prototype.removeTag=function(e,o){var s=this;t.assert("tagId",e,t.AssertRules.STRING,!0),t.assert("callback",o,t.AssertRules.CALLBACK),this.logger.info(t.LogTagId.O,"removeTag ->tagId:".concat(e)),this._context.removeTag(e).then((function(n){var a=n.code;a===t.ErrorCode.SUCCESS?o.onSuccess():(s.logger.warn(t.LogTagId.O,"removeTag ->code:".concat(a,",tagId:").concat(e)),o.onError(a))})).catch((function(n){s.logger.warn(t.LogTagId.O,"removeTag ->code:".concat(n,",tagId:").concat(e)),o.onError(n)}))},e.prototype.updateTag=function(e,o){var s=this;t.assert("tag.tagId",e.tagId,t.AssertRules.STRING,!0),t.assert("tag.tagName",e.tagName,t.AssertRules.STRING,!0),t.assert("tag.tagName",e.tagName,(function(e){return e.length<=15})),t.assert("callback",o,t.AssertRules.CALLBACK),this.logger.info(t.LogTagId.O,"updateTag ->tagId:".concat(e.tagId,",tagName:").concat(e.tagName)),this._context.updateTag(e).then((function(n){var a=n.code;a===t.ErrorCode.SUCCESS?o.onSuccess():(s.logger.warn(t.LogTagId.O,"updateTag ->code:".concat(a,",tagId:").concat(e.tagId)),o.onError(a))})).catch((function(n){s.logger.warn(t.LogTagId.O,"updateTag ->reason:".concat(n,",tagId:").concat(e.tagId)),o.onError(n)}))},e.prototype.getTagList=function(e){var o=this;t.assert("callback",e,t.AssertRules.CALLBACK),this._context.getTagList().then((function(s){var n=s.code,a=s.data;n===t.ErrorCode.SUCCESS?e.onSuccess(a||[]):(o.logger.warn(t.LogTagId.O,"getTagList ->code:".concat(n)),e.onError(n))})).catch((function(s){o.logger.warn(t.LogTagId.O,"getTagList ->reason:".concat(s)),e.onError(s)}))},e.prototype.getTagsForConversation=function(e,o){var s=this;t.assert("conversationType",e.type,t.AssertRules.NUMBER),t.assert("targetId",e.targetId,t.AssertRules.STRING),t.assert("channelId",e.channelId,t.AssertRules.ONLY_STRING),t.assert("callback",o,t.AssertRules.CALLBACK),this.logger.info(t.LogTagId.O,"getTagsForConversation ->targetId:".concat(e.targetId,",conversationType:").concat(e.type)),this._context.getTagsForConversation(Q(e)).then((function(e){var n=e.code,a=e.data;n===t.ErrorCode.SUCCESS?o.onSuccess(a||[]):(s.logger.warn(t.LogTagId.O,"getTagsForConversation ->code:".concat(n)),o.onError(n))})).catch((function(e){s.logger.warn(t.LogTagId.O,"getTagsForConversation ->reason:".concat(e)),o.onError(e)}))},e.prototype.addTagForConversations=function(e,o,s){var n=this;t.assert("tagId",e,t.AssertRules.STRING,!0),t.assert("conversations",o,t.AssertRules.ARRAY,!0),t.assert("callback",s,t.AssertRules.CALLBACK),o.forEach((function(e){t.assert("conversation.type",e.type,t.AssertRules.NUMBER,!0),t.assert("conversation.targetId",e.targetId,t.AssertRules.STRING,!0),t.assert("conversation.channelId",e.channelId,t.AssertRules.ONLY_STRING)})),this.logger.info(t.LogTagId.O,"addTagForConversations ->tagId:".concat(e)),this._context.addTagForConversations(e,o.map((function(e){return Q(e)}))).then((function(o){var a=o.code;o.data,a===t.ErrorCode.SUCCESS?s.onSuccess():(n.logger.warn(t.LogTagId.O,"addTagForConversations ->code:".concat(a,",tagId:").concat(e)),s.onError(a))})).catch((function(o){n.logger.warn(t.LogTagId.O,"addTagForConversations ->reason:".concat(o,",tagId:").concat(e)),s.onError(o)}))},e.prototype.removeTagForConversations=function(e,o,s){var n=this;t.assert("tagId",e,t.AssertRules.STRING,!0),t.assert("conversations",o,t.AssertRules.ARRAY,!0),t.assert("callback",s,t.AssertRules.CALLBACK),o.forEach((function(e){t.assert("conversation.type",e.type,t.AssertRules.NUMBER,!0),t.assert("conversation.targetId",e.targetId,t.AssertRules.STRING,!0),t.assert("conversation.channelId",e.channelId,t.AssertRules.ONLY_STRING)})),this.logger.info(t.LogTagId.O,"removeTagForConversations ->tagId:".concat(e)),this._context.removeTagForConversations(e,o.map((function(e){return Q(e)}))).then((function(o){var a=o.code;o.data,a===t.ErrorCode.SUCCESS?s.onSuccess():(n.logger.warn(t.LogTagId.O,"removeTagForConversations ->code:".concat(a,",tagId:").concat(e)),s.onError(a))})).catch((function(o){n.logger.warn(t.LogTagId.O,"removeTagForConversations ->reason:".concat(o,",tagId:").concat(e)),s.onError(o)}))},e.prototype.removeTagsForConversation=function(e,o,s){var n=this;t.assert("conversation.type",e.type,t.AssertRules.NUMBER,!0),t.assert("conversation.targetId",e.targetId,t.AssertRules.STRING,!0),t.assert("conversation.channelId",e.channelId,t.AssertRules.ONLY_STRING),t.assert("tagIds",o,t.AssertRules.ARRAY,!0),t.assert("callback",s,t.AssertRules.CALLBACK),o.forEach((function(e){t.assert("tagId",e,t.AssertRules.STRING,!0)})),this.logger.info(t.LogTagId.O,"removeTagsForConversation ->tagIds:".concat(o,",targetId:").concat(e.targetId,",type:").concat(e.type)),this._context.removeTagsForConversation(Q(e),o).then((function(e){var a=e.code;e.data,a===t.ErrorCode.SUCCESS?s.onSuccess():(n.logger.warn(t.LogTagId.O,"removeTagsForConversation ->code:".concat(a,",tagIds:").concat(o)),s.onError(a))})).catch((function(e){n.logger.warn(t.LogTagId.O,"removeTagsForConversation ->reason:".concat(e,",tagIds:").concat(o)),s.onError(e)}))},e.prototype.getConversationListByTag=function(e,o,s,n){var a=this;t.assert("tagId",e,t.AssertRules.STRING,!0),t.assert("count",o,t.AssertRules.NUMBER,!0),t.assert("startTime",s,t.AssertRules.NUMBER,!0),t.assert("callback",n,t.AssertRules.CALLBACK,!0),this.logger.info(t.LogTagId.O,"getConversationListByTag ->tagId:".concat(e)),this._context.getConversationListByTag(e,s,o).then((function(o){var s=o.code,r=o.data,c=[];s===t.ErrorCode.SUCCESS?((r=r||[]).forEach((function(e){c.push(function(e){var t=e.channelId,o=e.conversationType,s=e.targetId,n=e.unreadMessageCount,a=e.latestMessage,r=e.isTop,c=e.notificationStatus,i=e.isTopInTag,g=a?G(a):null,d=g||{};return d.messageType,d.sentTime,d.receivedStatus,d.messageId,{channelId:t||"",conversationType:o,targetId:s,unreadMessageCount:n,latestMessage:g,isTopInTag:i,latestMessageId:null==g?void 0:g.messageId,objectName:null==g?void 0:g.messageType,sentTime:null==g?void 0:g.sentTime,isTop:r,notificationStatus:c,receivedStatus:null==g?void 0:g.receivedStatus}}(e))})),n.onSuccess(c)):(a.logger.warn(t.LogTagId.O,"getConversationListByTag ->code:".concat(s,",tagId:").concat(e)),n.onError(s))})).catch((function(o){a.logger.warn(t.LogTagId.O,"getConversationListByTag ->reason:".concat(o,",tagId:").concat(e)),n.onError(o)}))},e.prototype.getUnreadCountByTag=function(e,o,s){var n=this;t.assert("tagId",e,t.AssertRules.STRING,!0),t.assert("containMuted",o,t.AssertRules.BOOLEAN,!0),t.assert("callback",s,t.AssertRules.CALLBACK),this.logger.info(t.LogTagId.O,"getUnreadCountByTag ->tagId:".concat(e)),this._context.getUnreadCountByTag(e,o).then((function(o){var a=o.code,r=o.data;n.logger.info(t.LogTagId.O,JSON.stringify({code:a,data:r})),a===t.ErrorCode.SUCCESS?s.onSuccess(r||0):(n.logger.warn(t.LogTagId.O,"getUnreadCountByTag ->code:".concat(a,",tagId:").concat(e)),s.onError(a))})).catch((function(o){n.logger.warn(t.LogTagId.O,"getUnreadCountByTag ->reason:".concat(o,",tagId:").concat(e)),s.onError(o)}))},e.prototype.setConversationStatusInTag=function(e,o,s,n){var a=this;t.assert("tagId",e,t.AssertRules.STRING,!0),t.assert("conversation.targetId",o.targetId,t.AssertRules.STRING,!0),t.assert("conversation.type",o.type,t.AssertRules.NUMBER,!0),t.assert("conversation.channelId",o.channelId,t.AssertRules.ONLY_STRING),t.assert("status.isTop",null==s?void 0:s.isTop,t.AssertRules.BOOLEAN,!0),t.assert("callback",n,t.AssertRules.CALLBACK),this.logger.info(t.LogTagId.O,"setConversationStatusInTag ->tagId:".concat(e,",targetId:").concat(o.targetId,",type").concat(o.type)),this._context.setConversationStatusInTag(e,Q(o),s).then((function(o){var s=o.code;o.data,s===t.ErrorCode.SUCCESS?n.onSuccess():(a.logger.warn(t.LogTagId.O,"setConversationStatusInTag ->code:".concat(s,",tagId:").concat(e)),n.onError(s))})).catch((function(o){a.logger.warn(t.LogTagId.O,"setConversationStatusInTag ->reason:".concat(o,",tagId:").concat(e)),n.onError(o)}))},e.prototype.callExtra=function(e,o){for(var s,n=this,a=[],r=2;r<arguments.length;r++)a[r-2]=arguments[r];this.logger.info(t.LogTagId.O,"callExtra ->method:".concat(e)),(s=this._context).callExtra.apply(s,i([e],a,!1)).then((function(s){var a=s.code,r=s.data;if(a!==t.ErrorCode.SUCCESS)n.logger.warn(t.LogTagId.O,"callExtra ->code:".concat(a)),o.onError&&H(o.onError,a);else{if("getConversationsByPage"===e&&r.forEach((function(e){e.latestMessage=e.latestMessage?G(e.latestMessage):null})),"getHistoryMessagesByObjectNames"===e){var c=r,i=c.list,g=c.hasMore,d=i.map((function(e){return G(e)}));return void K(o.onSuccess,d,g)}o.onSuccess&&K(o.onSuccess,r)}}))},e.prototype.hasRemoteUnreadMessages=function(e,o){t.assert("callback",o,t.AssertRules.CALLBACK),this.logger.info(t.LogTagId.O,"hasRemoteUnreadMessages ->token:".concat(e)),this.assertCPPMode((function(){K(o.onSuccess,!1)}),"hasRemoteUnreadMessages",o)},e.prototype.setUserStatusListener=function(e,o){var s=this;this.logger.info(t.LogTagId.O,"setUserStatusListener ->userIds:".concat(e.userIds)),this.assertCPPMode((function(){s._context.setUserStatusListener(e,o)}),"setUserStatusListener")},e.prototype.setUserStatus=function(e,o){var s=this;t.assert("status",e,t.AssertRules.NUMBER),t.assert("callback",o,t.AssertRules.CALLBACK),this.logger.info(t.LogTagId.O,"setUserStatus ->status:".concat(e)),this.assertCPPMode((function(){s._context.setUserStatus(e).then((function(e){e===t.ErrorCode.SUCCESS?K(o.onSuccess,!0):(s.logger.warn(t.LogTagId.O,"setUserStatus ->code:".concat(e)),H(o.onError,e))}))}),"setUserStatus",o)},e.prototype.getUserStatus=function(e,o){var s=this;t.assert("userId",e,t.AssertRules.STRING),t.assert("callback",o,t.AssertRules.CALLBACK),this.logger.info(t.LogTagId.O,"getUserStatus ->userId:".concat(e)),this.assertCPPMode((function(){s._context.getUserStatus(e).then((function(n){var a=n.code,r=n.data;a===t.ErrorCode.SUCCESS?K(o.onSuccess,r):(s.logger.warn(t.LogTagId.O,"getUserStatus ->code:".concat(a,",useerId:").concat(e)),H(o.onError,a))}))}),"getUserStatus",o)},e.prototype.addToBlacklist=function(e,o){var s=this;t.assert("userId",e,t.AssertRules.STRING),t.assert("callback",o,t.AssertRules.CALLBACK),this.logger.info(t.LogTagId.O,"addToBlacklist ->userId:".concat(e)),this.assertCPPMode((function(){s._context.addToBlacklist(e).then((function(n){n===t.ErrorCode.SUCCESS?K(o.onSuccess):(s.logger.warn(t.LogTagId.O,"addToBlacklist ->code:".concat(n,",useerId:").concat(e)),H(o.onError,n))}))}),"addToBlacklist",o)},e.prototype.removeFromBlacklist=function(e,o){var s=this;t.assert("userId",e,t.AssertRules.STRING),t.assert("callback",o,t.AssertRules.CALLBACK),this.logger.info(t.LogTagId.O,"removeFromBlacklist ->userId:".concat(e)),this.assertCPPMode((function(){s._context.removeFromBlacklist(e).then((function(n){n===t.ErrorCode.SUCCESS?K(o.onSuccess):(s.logger.warn(t.LogTagId.O,"removeFromBlacklist ->code:".concat(n,",useerId:").concat(e)),H(o.onError,n))}))}),"removeFromBlacklist",o)},e.prototype.getBlacklist=function(e){var o=this;t.assert("callback",e,t.AssertRules.CALLBACK),this.assertCPPMode((function(){o._context.getBlacklist().then((function(s){var n=s.code,a=s.data;n===t.ErrorCode.SUCCESS?K(e.onSuccess,a):(o.logger.warn(t.LogTagId.O,"getBlacklist ->code:".concat(n)),H(e.onError,n))}))}),"getBlacklist",e)},e.prototype.getBlacklistStatus=function(e,o){var s=this;t.assert("userId",e,t.AssertRules.STRING),t.assert("callback",o,t.AssertRules.CALLBACK),this.logger.info(t.LogTagId.O,"getBlacklistStatus ->userId:".concat(e)),this.assertCPPMode((function(){s._context.getBlacklistStatus(e).then((function(n){var a=n.code,r=n.data;a===t.ErrorCode.SUCCESS?K(o.onSuccess,r):(s.logger.warn(t.LogTagId.O,"getBlacklistStatus ->code:".concat(a,",userId:").concat(e)),H(o.onError,a))}))}),"getBlacklistStatus",o)},e.prototype.insertMessage=function(e,o,s,n,a){var r=this;void 0===a&&(a={}),t.assert("conversationType",e,t.AssertRules.NUMBER,!0),t.assert("targetId",o,t.AssertRules.STRING,!0),t.assert("content.senderUserId",s.senderUserId,t.AssertRules.STRING,!0),t.assert("callback",n,t.AssertRules.CALLBACK),this.logger.info(t.LogTagId.O,"insertMessage ->targetId:".concat(o,",conversationType:").concat(e,",senderUserId:").concat(s.senderUserId)),this.assertCPPMode((function(){r._defaultChannelClient.insertMessage(e,o,s,n,a)}),"insertMessage",n)},e.prototype.getRemoteHistoryMessages=function(e,o,s,n,a,r){var c=this;void 0===r&&(r={}),t.assert("conversationType",e,t.AssertRules.NUMBER,!0),t.assert("targetId",o,t.AssertRules.STRING,!0),t.assert("timestamp",s,t.AssertRules.NUMBER,!0),t.assert("count",n,t.AssertRules.NUMBER,!0),t.assert("callback",a,t.AssertRules.CALLBACK),t.assert("options.order",r.order,t.AssertRules.NUMBER),this.assertCPPMode((function(){c._defaultChannelClient.getRemoteHistoryMessages(e,o,s,n,a,r)}),"getRemoteHistoryMessages",a)},e.prototype.deleteLocalMessages=function(e,o,s,n){var a=this;t.assert("messageIds",s,t.AssertRules.ARRAY,!0),t.assert("callback",n,t.AssertRules.CALLBACK),this.logger.info(t.LogTagId.O,"deleteLocalMessages ->messageIds:".concat(s)),this.assertCPPMode((function(){a._context.deleteMessages(s).then((function(e){e===t.ErrorCode.SUCCESS?K(n.onSuccess,!0):(a.logger.warn(t.LogTagId.O,"deleteLocalMessages ->code:".concat(e,",messageIds:").concat(s)),H(n.onError,e))}))}),"deleteLocalMessages",n)},e.prototype.deleteLocalMessagesByTimestamp=function(e,o,s,n,a){var r=this;t.assert("conversationType",e,t.AssertRules.NUMBER,!0),t.assert("targetId",o,t.AssertRules.STRING,!0),t.assert("timestamp",s,t.AssertRules.NUMBER,!0),t.assert("cleanSpace",n,t.AssertRules.BOOLEAN),t.assert("callback",a,t.AssertRules.CALLBACK),this.assertCPPMode((function(){r._defaultChannelClient.deleteLocalMessagesByTimestamp(e,o,s,n,a)}),"deleteLocalMessagesByTimestamp",a)},e.prototype.clearMessages=function(e,o,s){var n=this;t.assert("conversationType",e,t.AssertRules.NUMBER,!0),t.assert("targetId",o,t.AssertRules.STRING,!0),t.assert("callback",s,t.AssertRules.CALLBACK),this.assertCPPMode((function(){n._defaultChannelClient.clearMessages(e,o,s)}),"clearMessages",s)},e.prototype.getMessage=function(e,o){var s=this;t.assert("callback",o,t.AssertRules.CALLBACK),this.assertCPPMode((function(){s._context.getMessage(e).then((function(n){var a=n.code,r=n.data;a===t.ErrorCode.SUCCESS?K(o.onSuccess,G(r)):(s.logger.warn(t.LogTagId.O,"getMessage ->code:".concat(a,",messageId:").concat(e)),H(o.onError,a))}))}),"getMessage",o)},e.prototype.setMessageSentStatus=function(e,o,s){var n=this;t.assert("messageId",e,t.AssertRules.NUMBER,!0),t.assert("sentStatus",o,t.AssertRules.NUMBER,!0),this.logger.info(t.LogTagId.O,"setMessageSentStatus ->messageId:".concat(e,",sentStatus:").concat(o)),this.assertCPPMode((function(){n._context.setMessageSentStatus(e,o).then((function(o){o===t.ErrorCode.SUCCESS?K(s.onSuccess,!0):(n.logger.warn(t.LogTagId.O,"setMessageSentStatus ->code:".concat(o,",messageId:").concat(e)),H(s.onError,o))}))}),"setMessageSentStatus",s)},e.prototype.setMessageReceivedStatus=function(e,o,s){var n=this;t.assert("messageId",e,t.AssertRules.NUMBER,!0),t.assert("receivedStatus",o,t.AssertRules.NUMBER,!0),this.logger.info(t.LogTagId.O,"setMessageReceivedStatus ->messageId:".concat(e,",receivedStatus:").concat(o)),this.assertCPPMode((function(){n._context.setMessageReceivedStatus(e,o).then((function(o){o===t.ErrorCode.SUCCESS?K(s.onSuccess,!0):(n.logger.warn(t.LogTagId.O,"setMessageReceivedStatus ->code:".concat(o,",messageId:").concat(e)),H(s.onError,o))}))}),"setMessageReceivedStatus",s)},e.prototype.setMessageContent=function(e,o,s,n){var a=this;t.assert("messageId",e,t.AssertRules.NUMBER,!0),t.assert("objectName",s,t.AssertRules.ONLY_STRING,!0),this.logger.info(t.LogTagId.O,"setMessageContent ->messageId:".concat(e,",objectName:").concat(s)),this.assertCPPMode((function(){a._context.setMessageContent(e,o,s).then((function(o){o===t.ErrorCode.SUCCESS?K(n.onSuccess,!0):(a.logger.warn(t.LogTagId.O,"setMessageContent ->code:".concat(o,",messageId:").concat(e)),H(n.onError,o))}))}),"setMessageContent",n)},e.prototype.setMessageSearchField=function(e,o,s){var n=this;t.assert("messageId",e,t.AssertRules.NUMBER,!0),t.assert("searchFiles",s,t.AssertRules.STRING,!0),this.logger.info(t.LogTagId.O,"setMessageSearchField ->messageId:".concat(e,",searchFiles:").concat(s)),this.assertCPPMode((function(){n._context.setMessageSearchField(e,o,s)}),"setMessageSearchField")},e.prototype.searchConversationByContent=function(e,o,s,n){var a=this;t.assert("keyword",e,t.AssertRules.STRING,!0),t.assert("callback",o,t.AssertRules.CALLBACK),t.assert("conversationTypes",s,t.AssertRules.ARRAY),t.assert("customMessageType",n,t.AssertRules.ARRAY),this.assertCPPMode((function(){a._defaultChannelClient.searchConversationByContent(e,o,s,n)}),"searchConversationByContent",o)},e.prototype.searchConversationByContentWithAllChannel=function(e,o,s,n){var a=this;void 0===s&&(s=[]),t.assert("keyword",e,t.AssertRules.STRING,!0),t.assert("callback",o,t.AssertRules.CALLBACK),t.assert("conversationTypes",n,t.AssertRules.ARRAY),t.assert("customMessageType",s,t.AssertRules.ARRAY),this.assertCPPMode((function(){a._defaultChannelClient.searchConversationByContentWithAllChannel(e,o,s,n)}),"searchConversationByContentWithAllChannel",o)},e.prototype.searchMessageByContent=function(e,o,s,n,a,r,c){var i=this;t.assert("conversationType",e,t.AssertRules.NUMBER,!0),t.assert("targetId",o,t.AssertRules.STRING,!0),t.assert("keyword",s,t.AssertRules.STRING,!0),t.assert("timestamp",n,t.AssertRules.NUMBER),t.assert("count",a,t.AssertRules.NUMBER),t.assert("total",r,t.AssertRules.NUMBER),t.assert("callback",c,t.AssertRules.CALLBACK),this.assertCPPMode((function(){i._defaultChannelClient.searchMessageByContent(e,o,s,n,a,r,c)}),"searchMessageByContent",c)},e.prototype.searchMessageByContentWithAllChannel=function(e,o,s,n,a,r){var c=this;t.assert("conversationType",e,t.AssertRules.NUMBER,!0),t.assert("targetId",o,t.AssertRules.STRING,!0),t.assert("keyword",s,t.AssertRules.STRING,!0),t.assert("timestamp",n,t.AssertRules.NUMBER),t.assert("count",a,t.AssertRules.NUMBER),t.assert("callback",r,t.AssertRules.CALLBACK),this.assertCPPMode((function(){c._defaultChannelClient.searchMessageByContentWithAllChannel(e,o,s,n,a,r)}),"searchMessageByContentWithAllChannel",r)},e.prototype.searchMessageByContentInTimeRangeWithAllChannel=function(e,o,s,n,a,r,c,i){var g=this;t.assert("conversationType",e,t.AssertRules.NUMBER,!0),t.assert("targetId",o,t.AssertRules.STRING,!0),t.assert("keyword",s,t.AssertRules.STRING,!0),t.assert("startTime",n,t.AssertRules.NUMBER),t.assert("endTime",a,t.AssertRules.NUMBER),t.assert("offset",r,t.AssertRules.NUMBER),t.assert("limit",c,t.AssertRules.NUMBER),t.assert("callback",i,t.AssertRules.CALLBACK),this.assertCPPMode((function(){g._defaultChannelClient.searchMessageByContentInTimeRangeWithAllChannel(e,o,s,n,a,r,c,i)}),"searchMessageByContentInTimeRangeWithAllChannel",i)},e.prototype.getUnreadMentionedMessages=function(e,o){return this._isCPPMode?(t.assert("conversationType",e,t.AssertRules.NUMBER,!0),t.assert("targetId",o,t.AssertRules.STRING,!0),this._defaultChannelClient.getUnreadMentionedMessages(e,o)):(this.logger.error(t.LogTagId.O,"getUnreadMentionedMessages method is not supported in a browser!"),null)},e.prototype.clearUnreadCountByTimestamp=function(e,o,s,n){var a=this;t.assert("conversationType",e,t.AssertRules.NUMBER,!0),t.assert("targetId",o,t.AssertRules.STRING,!0),t.assert("timestamp",s,t.AssertRules.NUMBER,!0),this.assertCPPMode((function(){a._defaultChannelClient.clearUnreadCountByTimestamp(e,o,s,n)}),"clearUnreadCountByTimestamp",n)},e.prototype.getFirstUnreadMessage=function(e,t,o){return this._defaultChannelClient.getFirstUnreadMessage(e,t,o)},e.prototype.getConversationNotificationStatus=function(e,o,s){var n=this;t.assert("conversationType",e,t.AssertRules.NUMBER,!0),t.assert("targetId",o,t.AssertRules.STRING,!0),this.assertCPPMode((function(){n._defaultChannelClient.getConversationNotificationStatus(e,o,s)}),"getConversationNotificationStatus",s)},e.prototype.getServerTime=function(){return this._context.getServerTime()},e.prototype.getGroupMessageDeliverList=function(e,t,o){this._defaultChannelClient.getGroupMessageDeliverList(e,t,o)},e.prototype.getPrivateMessageDeliverTime=function(e,t){this._defaultChannelClient.getPrivateMessageDeliverTime(e,t)},e.prototype.getRTCUserInfoList=function(e,o){var s=this;this.logger.info(t.LogTagId.O,"getRTCUserInfoList ->roomId:".concat(e.id)),this._context.getRTCUserInfoList(e.id).then((function(n){var a=n.code,r=n.data;if(a!==t.ErrorCode.SUCCESS)s.logger.warn(t.LogTagId.O,"getRTCUserInfoList ->code:".concat(a,",roomId:").concat(e.id)),o.onError(a);else{var c=null==r?void 0:r.users;o.onSuccess(c)}})).catch((function(n){s.logger.warn(t.LogTagId.O,"getRTCUserInfoList ->error:".concat(n,",roomId:").concat(e.id)),o.onError(n)}))},e.prototype.getRTCUserList=function(e,o){var s=this;this.logger.info(t.LogTagId.O,"getRTCUserList ->roomId:".concat(e.id)),this._context.getRTCUserList(e.id).then((function(n){var a=n.code,r=n.data;a!==t.ErrorCode.SUCCESS?(s.logger.warn(t.LogTagId.O,"getRTCUserList ->code:".concat(a,",roomId:").concat(e.id)),o.onError(a)):o.onSuccess(r)})).catch((function(n){s.logger.warn(t.LogTagId.O,"getRTCUserList ->error:".concat(n,",roomId:").concat(e.id)),o.onError(n)}))},e.prototype.setRTCUserInfo=function(e,o,s){var n=this;this.logger.info(t.LogTagId.O,"setRTCUserInfo ->roomId:".concat(e.id,",info:").concat(JSON.stringify(o||{}))),this._context.setRTCUserInfo(e.id,o.key,o.value).then((function(a){a!==t.ErrorCode.SUCCESS?(n.logger.warn(t.LogTagId.O,"setRTCUserInfo ->code:".concat(a,",roomId:").concat(e.id,",key:").concat(o.key,",value:").concat(o.value)),s.onError(a)):s.onSuccess(!0)})).catch((function(a){n.logger.warn(t.LogTagId.O,"setRTCUserInfo ->code:".concat(a,",roomId:").concat(e.id,",key:").concat(o.key,",value:").concat(o.value)),s.onError(a)}))},e.prototype.removeRTCUserInfo=function(e,o,s){var n=this;this.logger.info(t.LogTagId.O,"removeRTCUserInfo ->roomId:".concat(e.id,"keys:").concat(o.keys)),this._context.removeRTCUserInfo(e.id,o.keys).then((function(o){o!==t.ErrorCode.SUCCESS?(n.logger.warn(t.LogTagId.O,"removeRTCUserInfo ->code:".concat(o,",roomId:").concat(e.id)),s.onError(o)):s.onSuccess(!0)})).catch((function(o){n.logger.warn(t.LogTagId.O,"removeRTCUserInfo ->error:".concat(o,",roomId:").concat(e.id)),s.onError(o)}))},e.prototype.getRTCRoomInfo=function(e,o){var s=this;this.logger.info(t.LogTagId.O,"getRTCRoomInfo ->roomId:".concat(e.id)),this._context.getRTCRoomInfo(e.id).then((function(n){var a=n.code,r=n.data;a!==t.ErrorCode.SUCCESS?(s.logger.warn(t.LogTagId.O,"getRTCRoomInfo ->code:".concat(a,",roomId:").concat(e.id)),o.onError(a)):o.onSuccess(r)})).catch((function(n){s.logger.warn(t.LogTagId.O,"getRTCRoomInfo ->error:".concat(n,",roomId:").concat(e.id)),o.onError(n)}))},e.prototype.setRTCRoomInfo=function(e,o,s){throw t.todo("setRTCRoomInfo")},e.prototype.removeRTCRoomInfo=function(e,o,s){throw t.todo("removeRTCRoomInfo")},e.prototype.joinRTCRoom=function(e,o){var s=this;this.logger.info(t.LogTagId.O,"joinRTCRoom ->roomId:".concat(e.id));var n=e.mode||0;this._context.joinRTCRoom(e.id,n).then((function(n){var a=n.code,r=n.data;a!==t.ErrorCode.SUCCESS?(s.logger.warn(t.LogTagId.O,"joinRTCRoom ->code:".concat(a,",roomId:").concat(e.id)),o.onError(a)):o.onSuccess(r)})).catch((function(n){s.logger.warn(t.LogTagId.O,"joinRTCRoom ->error:".concat(n,",roomId:").concat(e.id)),o.onError(n)}))},e.prototype.quitRTCRoom=function(e,o){var s=this;this.logger.info(t.LogTagId.O,"quitRTCRoom ->roomId:".concat(e.id)),this._context.quitRTCRoom(e.id).then((function(n){n!==t.ErrorCode.SUCCESS?(s.logger.warn(t.LogTagId.O,"quitRTCRoom ->code:".concat(n,",roomId:").concat(e.id)),o.onError(n)):o.onSuccess(!0)})).catch((function(n){s.logger.warn(t.LogTagId.O,"quitRTCRoom ->error:".concat(n,",roomId:").concat(e.id)),o.onError(n)}))},e.prototype.RTCPing=function(e,o){var s=this;this.logger.info(t.LogTagId.O,"RTCPing ->roomId:".concat(e.id));var n=e.mode||0;this._context.rtcPing(e.id,n).then((function(n){n!==t.ErrorCode.SUCCESS?(s.logger.warn(t.LogTagId.O,"RTCPing ->code:".concat(n,",roomId:").concat(e.id)),o.onError(n)):o.onSuccess(!0)})).catch((function(n){s.logger.warn(t.LogTagId.O,"RTCPing ->error:".concat(n,",roomId:").concat(e.id)),o.onError(n)}))},e.prototype.setRTCData=function(e,o,s,n,a,r,c){var i=this;this.logger.info(t.LogTagId.O,"setRTCData ->roomId:".concat(e,",key:").concat(o)),this._context.setRTCData(e,o,s,n,a,c).then((function(o){o!==t.ErrorCode.SUCCESS?(i.logger.warn(t.LogTagId.O,"setRTCData ->code:".concat(o,",roomId:").concat(e)),r.onError(o)):r.onSuccess(!0)})).catch((function(o){i.logger.warn(t.LogTagId.O,"setRTCData ->error:".concat(o,",roomId:").concat(e)),r.onError(o)}))},e.prototype.getRTCData=function(e,o,s,n,a){var r=this;this.logger.info(t.LogTagId.O,"getRTCData ->roomId:".concat(e,",keys:").concat(o)),this._context.getRTCData(e,o,s,n).then((function(o){var s=o.code,n=o.data;s!==t.ErrorCode.SUCCESS?(r.logger.warn(t.LogTagId.O,"getRTCData ->code:".concat(s,",roomId:").concat(e)),a.onError(s)):a.onSuccess(n)})).catch((function(o){r.logger.warn(t.LogTagId.O,"setRTCUserInfo ->error:".concat(o,",roomId:").concat(e)),a.onError(o)}))},e.prototype.removeRTCData=function(e,o,s,n,a,r){var c=this;this.logger.info(t.LogTagId.O,"removeRTCData ->roomId:".concat(e,",keys:").concat(o)),this._context.removeRTCData(e,o,s,n,r).then((function(o){o!==t.ErrorCode.SUCCESS?(c.logger.warn(t.LogTagId.O,"removeRTCData ->code:".concat(o,",roomId:").concat(e)),a.onError(o)):a.onSuccess(!0)})).catch((function(o){c.logger.warn(t.LogTagId.O,"removeRTCData ->error:".concat(o,",roomId:").concat(e)),a.onError(o)}))},e.prototype.setRTCUserData=function(e,o,s,n,a,r){this.setRTCData(e,o,s,n,t.RTCApiType.PERSON,a,r)},e.prototype.setRTCUserTotalRes=function(e,o,s,n,a){var r=this;this.logger.info(t.LogTagId.O,"setRTCUserTotalRes ->roomId:".concat(e)),this._context.setRTCTotalRes(e,o,s,n).then((function(o){o!==t.ErrorCode.SUCCESS?(r.logger.warn(t.LogTagId.O,"setRTCUserTotalRes ->code:".concat(o,",roomId:").concat(e)),a.onError(o)):a.onSuccess(!0)})).catch((function(o){r.logger.warn(t.LogTagId.O,"setRTCUserTotalRes ->error:".concat(o,",roomId:").concat(e)),a.onError(o)}))},e.prototype.getRTCUserData=function(e,o,s,n){this.getRTCData(e,o,s,t.RTCApiType.PERSON,n)},e.prototype.removeRTCUserData=function(e,o,s,n,a){this.removeRTCData(e,o,s,t.RTCApiType.PERSON,n,a)},e.prototype.setRTCRoomData=function(e,o,s,n,a,r){this.setRTCData(e,o,s,n,t.RTCApiType.ROOM,a,r)},e.prototype.getRTCRoomData=function(e,o,s,n){this.getRTCData(e,o,s,t.RTCApiType.ROOM,n)},e.prototype.removeRTCRoomData=function(e,o,s,n,a){this.removeRTCData(e,o,s,t.RTCApiType.ROOM,n,a)},e.prototype.setRTCOutData=function(e,o,s,n,a){throw t.todo("setRTCOutData")},e.prototype.getRTCOutData=function(e,o,s){throw t.todo("getRTCOutData")},e.prototype.getRTCToken=function(e,o){var s=this;this.logger.info(t.LogTagId.O,"getRTCToken ->roomId:".concat(e.id)),this._context.getRTCToken(e.id,e.mode,e.broadcastType).then((function(n){var a=n.code,r=n.data;a!==t.ErrorCode.SUCCESS?(s.logger.warn(t.LogTagId.O,"getRTCToken ->code:".concat(a,",roomId:").concat(e.id)),o.onError(a)):o.onSuccess(r)})).catch((function(n){s.logger.warn(t.LogTagId.O,"getRTCToken ->error:".concat(n,",roomId:").concat(e.id)),o.onError(n)}))},e.prototype.setRTCState=function(e,o,s){var n=this;this.logger.info(t.LogTagId.O,"setRTCState ->roomId:".concat(e.id)),this._context.setRTCState(e.id,o.report).then((function(o){o!==t.ErrorCode.SUCCESS?(n.logger.warn(t.LogTagId.O,"setRTCState ->code:".concat(o,",roomId:").concat(e.id)),s.onError(o)):s.onSuccess(!0)})).catch((function(o){n.logger.warn(t.LogTagId.O,"setRTCState ->error:".concat(o,",roomId:").concat(e.id)),s.onError(o)}))},e}(),z=[],$=[],Z={message:function(e){z.forEach((function(t){return t(G(e))}))},status:function(e){$.forEach((function(t){return t(e)}))}},ee=1;t.VersionManage.add("imlib-v2-adapter","5.6.0-beem-alpha.2");var te,oe=null,se={init:function(e,o,s){void 0===s&&(s={}),t.assert("appkey",e,t.AssertRules.STRING,!0),J=t.APIContext.init(x,{appkey:e,apiVersion:"5.6.0-beem-alpha.2",navigators:s.navi?[s.navi]:[],miniCMPProxy:[],logOutputLevel:s.logOutputLevel,typingExpireTime:s.typingExpireTime,checkCA:s.checkCA,httpInMainProcess:!!s.httpInMainProcess}),(oe=J.createLogger("RC-IM","IM")).info(t.LogTagId.A_INIT_O,JSON.stringify({appkey:e,navigators:s.navi?[s.navi]:[],typingExpireTime:s.typingExpireTime})),ee=Math.min(15,Math.max(s.readReceiptTimeout||1,1)),V=new X(J,{readReceiptTimeout:ee},oe)},getInstance:function(){return V},setConnectionStatusListener:function(e){var o=null==oe?void 0:oe.createTraceId();J.assignWatcher({connectionState:function(s){null==oe||oe.info(t.LogTagId.A_CONNECT_S,JSON.stringify({status:s}),o),w.clear(),e.onChanged(s)}})},setOnReceiveMessageListener:function(e){J.assignWatcher({message:function(o,s,n){try{var a=G(o),r=J.getCurrentUserId(),c=J.getConnectedTime();F(a,r,c,ee),a=function(e,t,o,s){var n=new Date(o-1e3*s*60*60*24).getTime()-e.sentTime<0;if("ReadReceiptResponseMessage"!==e.messageType||!n)return e;var a=e.content,r=((a=a||{}).receiptMessageDic||{})[t],c="",i={};if(e.receiptResponse=e.receiptResponse||{},r){for(var g=[],d=0;d<r.length;d++)c="".concat(t).concat(r[d],"SENT"),(i=k.get(c))&&!(e.senderUserId in i.userIds)&&(g.push(r[d]),i.count+=1,i.userIds[e.senderUserId]=e.sentTime,e.receiptResponse[r[d]]=i.count,k.set(c,i));a.receiptMessageDic[t]=g,e.content=a}return e}(a,r,c,ee),t.usingCppEngine()||w.set(o),null==oe||oe.info(t.LogTagId.A_PULL_MSG_O,JSON.stringify({message:o.messageUId})),e.onReceived(a,void 0,n)}catch(e){null==oe||oe.error(t.LogTagId.O,"setOnReceiveMessageListener ->error:".concat(e))}}})},setConversationStatusListener:function(e){J.assignWatcher({conversationState:function(o){try{var s=[];o.forEach((function(e){var t=e.updatedItems,o=e.conversationType,n=e.targetId,a=e.channelId,r=(t=t||{}).notificationStatus,c=t.isTop;r&&c&&s.push({notificationStatus:r.val,isTop:c.val,conversationType:o,targetId:n,channelId:a||"",updatedTime:r.time})})),s.length>0&&e.onChanged(s)}catch(e){null==oe||oe.error(t.LogTagId.O,"setConversationStatusListener ->error:".concat(e))}}})},setMessageExpansionListener:function(e){J.assignWatcher({expansion:function(o){try{o.updatedExpansion&&e.onUpdated(o.updatedExpansion),o.deletedExpansion&&e.onDeleted(o.deletedExpansion)}catch(e){null==oe||oe.error(t.LogTagId.O,"setMessageExpansionListener ->error:".concat(e))}}})},setTagListener:function(e){J.assignWatcher({tag:function(){try{e.onChanged()}catch(e){null==oe||oe.error(t.LogTagId.O,"setTagListener ->error:".concat(e))}}})},setConversationTagListener:function(e){J.assignWatcher({conversationTagChanged:function(){try{e.onChanged()}catch(e){null==oe||oe.error(t.LogTagId.O,"setConversationTagListener ->error:".concat(e))}}})},setPullOffLineFinished:function(e){J.assignWatcher({pullFinished:function(){try{e.onFinished()}catch(e){null==oe||oe.error(t.LogTagId.O,"setPullOffLineFinished ->error:".concat(e))}}})},setTypingStatusListener:function(e){J.assignWatcher({typingState:function(o){try{e.onChanged(o)}catch(e){null==oe||oe.error(t.LogTagId.O,"setTypingStatusListener ->error:".concat(e))}}})},setMessageBlockedListener:function(e){J.assignWatcher({messageBlocked:function(t){e.onReceived(t)}})},setChatRoomStatusListener:function(e){J.assignWatcher({chatroomState:function(t){e.onChanged(t)}})},setMessageDeliveredListener:function(e){J.assignWatcher({messageDelivered:function(o){try{e.onDelivered(o)}catch(e){null==oe||oe.error(t.LogTagId.O,"setMessageDeliveredListener ->error:".concat(e))}}})},setGroupMessageDeliveredStatusListener:function(e){J.assignWatcher({groupMessageDeliveredStatus:function(o){try{e.onDelivered(o)}catch(e){null==oe||oe.error(t.LogTagId.O,"setGroupMessageDeliveredStatusListener ->error:".concat(e))}}})},connect:function(e,o,s){return r(this,void 0,void 0,(function(){var n,a,r,i;return c(this,(function(c){switch(c.label){case 0:return n=null==oe?void 0:oe.createTraceId(),null==oe||oe.info(t.LogTagId.A_CONNECT_T,JSON.stringify({token:e,reconnectKickEnable:!1}),n),[4,J.connect(e,!1,s,n)];case 1:return a=c.sent(),r=a.code===t.ErrorCode.SUCCESS?"info":"warn",null==oe||oe[r](t.LogTagId.A_CONNECT_R,JSON.stringify({code:a.code,userId:a.userId}),n),a.code===t.ErrorCode.SUCCESS?(o.onSuccess(a.userId),i=new Date(J.getConnectedTime()-1e3*ee*60*60*24).getTime(),k.getKeys().forEach((function(e){if(/SENT$/.test(e)){var t=k.get(e).dealtime;t&&i-t>0&&k.remove(e)}else if(/RECEIVED$/.test(e)){var o=k.get(e),s=Object.keys(o).length;Object.keys(o).forEach((function(e){var t=o[e].dealtime;t&&i-t>0&&delete o[e]})),Object.keys(o).length!==s&&(0===o.length?k.remove(e):k.set(e,o))}}))):a.code===t.ErrorCode.RC_CONN_USER_OR_PASSWD_ERROR?(null==oe||oe.warn(t.LogTagId.O,"connect ->code:".concat(a.code,",token:").concat(e)),o.onTokenIncorrect()):(null==oe||oe.warn(t.LogTagId.O,"connect ->code:".concat(a.code,",token:").concat(e)),o.onError(a.code)),[2]}}))}))},reconnect:function(e,o,s){var n=null==oe?void 0:oe.createTraceId();null==oe||oe.info(t.LogTagId.A_RECONNECT_T,null,n),J.reconnect(s).then((function(o){var s=o.code===t.ErrorCode.SUCCESS?"info":"warn";null==oe||oe[s](t.LogTagId.A_RECONNECT_R,JSON.stringify({code:o.code,userId:o.userId}),n),o.code===t.ErrorCode.SUCCESS?e.onSuccess(o.userId):(null==oe||oe.warn(t.LogTagId.O,"reconnect ->code:".concat(o.code)),e.onError(o.code))})).catch((function(t){e.onError(t)}))},RegisterMessage:{},RegisterMessageTypeMapping:b,getMessageObjectName:function(e){var t=a(a({},P),b);return Object.keys(t).find((function(o){return t[o]===e}))||e},registerMessageType:function(e,t,o,s){this.RegisterMessage[e]=j(e,t,o.isPersited,o.isCounted),this.RegisterMessageTypeMapping[t]=e,J.registerMessageType(t,o.isPersited,o.isCounted,s)},messageWatch:function(e){var o=this;z.push((function(s){var n,a;null==oe||oe.info(t.LogTagId.O,"messageWatch ->message:".concat(JSON.stringify(s||{})));try{e(s),null===(a=(n=o._voipProvider).onReceived)||void 0===a||a.call(n,s)}catch(e){null==oe||oe.error(t.LogTagId.O,"messageWatch ->error:".concat(e))}})),J.assignWatcher({rtcInnerWatcher:Z})},statusWatch:function(e){$.push((function(o){null==oe||oe.info(t.LogTagId.O,"statusWatch ->status:".concat(o));try{e(o)}catch(e){null==oe||oe.error(t.LogTagId.O,"statusWatch ->error:".concat(e))}}))},MessageType:{TextMessage:"TextMessage",ImageMessage:"ImageMessage",ReferenceMessage:"ReferenceMessage",DiscussionNotificationMessage:"DiscussionNotificationMessage",VoiceMessage:"VoiceMessage",RichContentMessage:"RichContentMessage",HandshakeMessage:"HandshakeMessage",UnknownMessage:"UnknownMessage",LocationMessage:"LocationMessage",InformationNotificationMessage:"InformationNotificationMessage",ContactNotificationMessage:"ContactNotificationMessage",ProfileNotificationMessage:"ProfileNotificationMessage",CommandNotificationMessage:"CommandNotificationMessage",CommandMessage:"CommandMessage",TypingStatusMessage:"TypingStatusMessage",ChangeModeResponseMessage:"ChangeModeResponseMessage",ChangeModeMessage:"ChangeModeMessage",EvaluateMessage:"EvaluateMessage",HandShakeMessage:"HandShakeMessage",HandShakeResponseMessage:"HandShakeResponseMessage",SuspendMessage:"SuspendMessage",TerminateMessage:"TerminateMessage",CustomerContact:"CustomerContact",CustomerStatusUpdateMessage:"CustomerStatusUpdateMessage",SyncReadStatusMessage:"SyncReadStatusMessage",ReadReceiptRequestMessage:"ReadReceiptRequestMessage",ReadReceiptResponseMessage:"ReadReceiptResponseMessage",FileMessage:"FileMessage",HQVoiceMessage:"HQVoiceMessage",GIFMessage:"GIFMessage",SightMessage:"SightMessage",AcceptMessage:"AcceptMessage",RingingMessage:"RingingMessage",SummaryMessage:"SummaryMessage",HungupMessage:"HungupMessage",InviteMessage:"InviteMessage",MediaModifyMessage:"MediaModifyMessage",MemberModifyMessage:"MemberModifyMessage",JrmfRedPacketMessage:"JrmfRedPacketMessage",JrmfRedPacketOpenedMessage:"JrmfRedPacketOpenedMessage",GroupNotificationMessage:"GroupNotificationMessage",PublicServiceRichContentMessage:"PublicServiceRichContentMessage",PublicServiceMultiRichContentMessage:"PublicServiceMultiRichContentMessage",PublicServiceCommandMessage:"PublicServiceCommandMessage",RecallCommandMessage:"RecallCommandMessage",ReadReceiptMessage:"ReadReceiptMessage",RCCombineMessage:"RCCombineMessage",ChrmKVNotificationMessage:"ChrmKVNotificationMessage",LogCommandMessage:"LogCommandMessage"},_voipProvider:{}},ne=function(e,t,o){this.type=e,this.userIdList=t,this.mentionedContent=o},ae=function(e,t){this.isCounted=e,this.isPersited=t},re=j("TextMessage","RC:TxtMsg"),ce=j("LocationMessage","RC:LBSMsg"),ie=j("TypingStatusMessage","RC:TypSts"),ge=j("ImageMessage","RC:ImgMsg"),de=j("RichContentMessage","RC:ImgTextMsg"),ue=j("VoiceMessage","RC:VcMsg"),le=j("HQVoiceMessage","RC:HQVCMsg"),Ce=j("FileMessage","RC:FileMsg"),he=j("SightMessage","RC:SightMsg"),fe=j("GIFMessage","RC:GIFMsg"),pe=j("ReadReceiptMessage","RC:ReadNtf"),Re=j("ReadReceiptRequestMessage","RC:RRReqMsg"),Ie=j("RCCombineMessage","RC:CombineMsg"),Te=function(e,t,o,s,n,a,r,c,i,g,d,u,l,C,h,f,p,R){this.conversationType=e,this.targetId=t,this.senderUserId=o,this.content=s,this.objectName=n,this.messageType=a,this.messageId=r,this.messageUId=c,this.messageDirection=i,this.offLineMessage=g,this.sentStatus=d,this.sentTime=u,this.receivedStatus=l,this.receivedTime=C,this.canIncludeExpansion=h,this.expansion=f,this.receiptResponse=p,this.disableNotification=R};exports.VoIPMediaType=void 0,(te=exports.VoIPMediaType||(exports.VoIPMediaType={}))[te.MEDIA_AUDIO=1]="MEDIA_AUDIO",te[te.MEDIA_VEDIO=2]="MEDIA_VEDIO",te[te.MEDIA_VIDEO=2]="MEDIA_VIDEO";var Se,me=j("AcceptMessage","RC:VCAccept"),ve=j("RingingMessage","RC:VCRinging"),Me=j("SummaryMessage","RC:VCSummary"),ye=j("HungupMessage","RC:VCHangup"),Ee=j("InviteMessage","RC:VCInvite"),Ae=j("MediaModifyMessage","RC:VCModifyMedia"),Le=j("MemberModifyMessage","RC:VCModifyMem"),Oe=j("lastMessageSendTime","RC:SRSMsg"),Ue=j("ReferenceMessage","RC:ReferenceMsg"),Ne=j("PublicServiceRichContentMessage","RC:PSImgTxtMsg"),_e=j("PublicServiceMultiRichContentMessage","RC:PSMultiImgTxtMsg");!function(e){e[e.ALL=1]="ALL",e[e.PART=2]="PART"}(Se||(Se={}));var xe=Se,Be=t.ConnectResultCode;window&&(window.RongIMClient=se),Object.defineProperty(exports,"ChatroomEntryType",{enumerable:!0,get:function(){return t.ChatroomEntryType}}),Object.defineProperty(exports,"ChatroomUserChangeType",{enumerable:!0,get:function(){return t.ChatroomUserChangeType}}),Object.defineProperty(exports,"ConnectionStatus",{enumerable:!0,get:function(){return t.ConnectionStatus}}),Object.defineProperty(exports,"ConversationType",{enumerable:!0,get:function(){return t.ConversationType}}),Object.defineProperty(exports,"ErrorCode",{enumerable:!0,get:function(){return t.ErrorCode}}),Object.defineProperty(exports,"FileType",{enumerable:!0,get:function(){return t.FileType}}),Object.defineProperty(exports,"LogL",{enumerable:!0,get:function(){return t.LogL}}),Object.defineProperty(exports,"LogLevel",{enumerable:!0,get:function(){return t.LogLevel}}),Object.defineProperty(exports,"LogSource",{enumerable:!0,get:function(){return t.LogSource}}),Object.defineProperty(exports,"LogTagId",{enumerable:!0,get:function(){return t.LogTagId}}),Object.defineProperty(exports,"MessageBlockType",{enumerable:!0,get:function(){return t.MessageBlockType}}),Object.defineProperty(exports,"MessageDirection",{enumerable:!0,get:function(){return t.MessageDirection}}),Object.defineProperty(exports,"NotificationStatus",{enumerable:!0,get:function(){return t.NotificationStatus}}),Object.defineProperty(exports,"RTCApiType",{enumerable:!0,get:function(){return t.RTCApiType}}),Object.defineProperty(exports,"RTCMode",{enumerable:!0,get:function(){return t.RTCMode}}),Object.defineProperty(exports,"ReceivedStatus",{enumerable:!0,get:function(){return t.ReceivedStatus}}),Object.defineProperty(exports,"UploadMethod",{enumerable:!0,get:function(){return t.UploadMethod}}),Object.defineProperty(exports,"logger",{enumerable:!0,get:function(){return t.logger}}),exports.AcceptMessage=me,exports.BaseMessage=W,exports.ChannelClient=Y,exports.ConnectionState=Be,exports.FileMessage=Ce,exports.GIFMessage=fe,exports.GetChatRoomType=n,exports.HQVoiceMessage=le,exports.HungupMessage=ye,exports.IMClient=X,exports.ImageMessage=ge,exports.InviteMessage=Ee,exports.LocationMessage=ce,exports.MediaModifyMessage=Ae,exports.MemberModifyMessage=Le,exports.MentionedInfo=ne,exports.MentionedType=xe,exports.Message=Te,exports.MessageTag=ae,exports.PublicServiceMultiRichContentMessage=_e,exports.PublicServiceRichContentMessage=Ne,exports.RCCombineMessage=Ie,exports.ReadReceiptMessage=pe,exports.ReadReceiptRequestMessage=Re,exports.ReadReceiptResponseMessage=q,exports.ReferenceMessage=Ue,exports.RichContentMessage=de,exports.RingingMessage=ve,exports.RongIMClient=se,exports.SentStatus=s,exports.SightMessage=he,exports.SummaryMessage=Me,exports.SyncReadStatusMessage=Oe,exports.TextMessage=re,exports.TypingStatusMessage=ie,exports.VoiceMessage=ue;
|
package/package.json
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
],
|
|
11
11
|
"types": "index.d.ts",
|
|
12
12
|
"module": "index.esm.js",
|
|
13
|
-
"version": "5.
|
|
13
|
+
"version": "5.6.0-beem-alpha.2",
|
|
14
14
|
"author": "pass-web@rongcloud.cn",
|
|
15
15
|
"license": "LGPL 2.1",
|
|
16
16
|
"homepage": "https://www.rongcloud.cn",
|
|
@@ -21,6 +21,6 @@
|
|
|
21
21
|
"globals": "RongIMLib"
|
|
22
22
|
},
|
|
23
23
|
"peerDependencies": {
|
|
24
|
-
"@rongcloud/engine": "=5.
|
|
24
|
+
"@rongcloud/engine": "=5.6.0-beem-alpha.2"
|
|
25
25
|
}
|
|
26
26
|
}
|