@rongcloud/imlib-v2-adapter 5.5.1 → 5.5.3
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 +3 -3
- package/index.esm.js +1 -1
- package/index.js +1 -1
- package/package.json +2 -2
package/index.d.ts
CHANGED
|
@@ -1225,7 +1225,8 @@ declare class IMClient {
|
|
|
1225
1225
|
* @description
|
|
1226
1226
|
* `httpMethod` 与 `queryString` 为 STC S3 分段上传时的专属参数,STC 分段上传包含三个过程:
|
|
1227
1227
|
* 1. 开始分段前调用,此时 `httpMethod` 值应为 `POST`, `queryString` 值为 `uploads`,filename为空
|
|
1228
|
-
* 2. 上传请求前调用,此时 `httpMethod` 值应为 `PUT`,`queryString` 值为 `partNumber={partamNumer}&uploadId={uploadId}`,
|
|
1228
|
+
* 2. 上传请求前调用,此时 `httpMethod` 值应为 `PUT`,`queryString` 值为 `partNumber={partamNumer}&uploadId={uploadId}`,
|
|
1229
|
+
* filename为第一个步骤生成的filename
|
|
1229
1230
|
* 3. 上传结束前调用,此时 `httpMethod` 值应为 `POST`,`queryString` 值为 `uploadId={uploadId}`,filename为第一个步骤生成的filename
|
|
1230
1231
|
* @returns
|
|
1231
1232
|
*/
|
|
@@ -1716,8 +1717,7 @@ declare const _default$i: {
|
|
|
1716
1717
|
PublicServiceRichContentMessage: string;
|
|
1717
1718
|
PublicServiceMultiRichContentMessage: string;
|
|
1718
1719
|
PublicServiceCommandMessage: string;
|
|
1719
|
-
RecallCommandMessage: string;
|
|
1720
|
-
/**
|
|
1720
|
+
RecallCommandMessage: string; /**
|
|
1721
1721
|
* 初始化 IM SDK
|
|
1722
1722
|
* @param appkey
|
|
1723
1723
|
* @param _ 该参数已废弃,为保持向前兼容,保留占位参数
|
package/index.esm.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{WebSocketChannel as e,CometChannel as t,NetworkType as n,HttpMethod as o,appendUrl as a,ErrorCode as s,logger as c,LogTagId as r,Logger as i,SEND_MESSAGE_TYPE_OPTION as d,AppStorage as u,ReceivedStatus as g,MessageDirection as C,usingCppEngine as f,assert as l,AssertRules as p,todo as h,RTCApiType as S,VersionManage as m,CONNECTION_TYPE as I,APIContext as R,ConnectResultCode as M}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 y;!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"}(y||(y={}));var v,T=y;!function(e){e[e.NONE=0]="NONE",e[e.SQQUENCE=1]="SQQUENCE",e[e.REVERSE=2]="REVERSE"}(v||(v={}));var E=v,U=function(){return U=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},U.apply(this,arguments)};function N(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 _(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 A(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 L=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))},w=L();var B={tag:"browser",httpReq:function(e){var t=e.method||o.GET,n=e.timeout||6e4,s=e.headers,c=e.query,r=e.body,i=a(e.url,c);return new Promise((function(e){var o,a=(o="undefined"!=typeof XMLHttpRequest&&"withCredentials"in new XMLHttpRequest,"undefined"!=typeof XMLHttpRequest&&o?new XMLHttpRequest:"undefined"!=typeof XDomainRequest?new XDomainRequest:new ActiveXObject("Microsoft.XMLHTTP")),c="[object XDomainRequest]"===Object.prototype.toString.call(a);if(a.open(t,i),s&&a.setRequestHeader)for(var d in s)a.setRequestHeader(d,s[d]);if(c){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 u="object"==typeof r?JSON.stringify(r):r;a.send(u)}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,isSupportSocket:function(){var e="undefined"!=typeof WebSocket;return e||console.warn("websocket not support"),e},useNavi:!0,connectPlatform:"",isFromUniapp:w,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()}}},createDataChannel:function(n,o){return this.isSupportSocket()&&"websocket"===o?new e(this,n):new t(this,n)},getNetworkType:function(){var e=navigator.connection||navigator.mozConnection||navigator.webkitConnection,t=e.type,o=e.effectiveType,a=t||o||n.UNKONWN;return new Promise((function(e){e(a)}))}},x=L(),k=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var o=c.ID();try{return c.info(r.A_CALLBACK_O,{func_name:e,source:"wechat"},{traceId:o}),wx[e].apply(wx,t)}catch(t){c.error(r.A_CALLBACK_E,{func_name:e,source:"wechat"},{traceId:o}),console.error(t)}}},b={setItem:k("setStorageSync"),getItem:k("getStorageSync"),removeItem:k("removeStorageSync"),clear:k("clearStorageSync")},P={tag:"wechat",httpReq:function(e){var t=e.method||o.GET,n=e.timeout||6e4,c=e.headers,r=e.query,i=e.body,d=a(e.url,r);return new Promise((function(e){wx.request({url:d,method:t,header:c,timeout:n,data:i,success:function(t){e({data:t.data,status:t.statusCode})},fail:function(){e({status:s.RC_HTTP_REQ_TIMEOUT})}})}))},localStorage:b,sessionStorage:b,isSupportSocket:function(){return!0},useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:x,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})}}},createDataChannel:function(n,o){return"websocket"===o?new e(this,n):new t(this,n)},getNetworkType:function(){return new Promise((function(e){wx.getNetworkType({success:function(t){var n=t.networkType;e(n)},fail:function(){e(n.UNKONWN)}})}))}},O=L(),D=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var o=c.ID();try{if(c.info(r.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){c.error(r.A_CALLBACK_E,{func_name:e,source:"alipay"},{traceId:o}),console.error(t)}}},G={setItem:D("setStorageSync"),getItem:D("getStorageSync"),removeItem:D("removeStorageSync"),clear:D("clearStorageSync")},K={tag:"alipay",httpReq:function(e){var t=e.method||o.GET,n=e.timeout||6e4,c=e.headers,r=e.query,i=e.body,d=a(e.url,r),u=e.dataType||"json";return new Promise((function(e){my.request({url:d,method:t,headers:c,timeout:n,data:i,dataType:u,success:function(t){e({data:t.data,status:t.status})},fail:function(){e({status:s.RC_HTTP_REQ_TIMEOUT})}})}))},localStorage:G,sessionStorage:G,isSupportSocket:function(){return!0},useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:O,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()}}},createDataChannel:function(n,o){return"websocket"===o?new e(this,n):new t(this,n)},getNetworkType:function(){return new Promise((function(e){my.getNetworkType({success:function(t){var n=t.networkType;e(n)},fail:function(){e(n.UNKONWN)}})}))}},F=L(),H=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var o=c.ID();try{return c.info(r.A_CALLBACK_O,{func_name:e,source:"toutiao"},{traceId:o}),tt[e].apply(tt,t)}catch(t){c.error(r.A_CALLBACK_E,{func_name:e,source:"toutiao"},{traceId:o}),console.error(t)}}},W={setItem:H("setStorageSync"),getItem:H("getStorageSync"),removeItem:H("removeStorageSync"),clear:H("clearStorageSync")},V={tag:"toutiao",isSupportSocket:function(){return!0},useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:F,localStorage:W,sessionStorage:W,httpReq:function(e){return new Promise((function(t,n){tt.request({url:e.url,data:e.body,header:e.headers,method:e.method,success:function(e){console.log("调用成功",e.data);var n=(null==e?void 0:e.data)||{},o={data:JSON.stringify(n),status:e.statusCode};t(o)},fail:function(e){console.log("调用失败",e.errMsg),n({data:e.errMsg})}})}))},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})}}},createDataChannel:function(n,o){return"websocket"===o?new e(this,n):new t(this,n)},getNetworkType:function(){return new Promise((function(e){tt.getNetworkType({success:function(t){var n=t.networkType;e(n)},fail:function(){e(n.UNKONWN)}})}))}},q=L(),j=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var o=c.ID();try{return c.info(r.A_CALLBACK_O,{func_name:e,source:"baidu"},{traceId:o}),swan[e].apply(swan,t)}catch(t){c.error(r.A_CALLBACK_E,{func_name:e,source:"baidu"},{traceId:o}),console.error(t)}}},J={setItem:j("setStorageSync"),getItem:j("getStorageSync"),removeItem:j("removeStorageSync"),clear:j("clearStorageSync")},Y={tag:"baidu",isSupportSocket:function(){return!0},useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:q,localStorage:J,sessionStorage:J,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){console.log("调用成功",e.data);var n=(null==e?void 0:e.data)||{},o={data:JSON.stringify(n),status:e.statusCode};t(o)},fail:function(e){console.log("调用失败",e.errorCode),n({data:e.errorCode})}})}))},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})}}},createDataChannel:function(n,o){return"websocket"===o?new e(this,n):new t(this,n)},getNetworkType:function(){return N(this,void 0,void 0,(function(){return _(this,(function(e){return[2,new Promise((function(e){swan.getNetworkType({success:function(t){var n=t.networkType;e(n)},fail:function(){e(n.UNKONWN)}})}))]}))}))}},Q=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var o=c.ID();try{return c.info(r.A_CALLBACK_O,{func_name:e,source:"uniapp"},{traceId:o}),uni[e].apply(uni,t)}catch(t){c.error(r.A_CALLBACK_E,{func_name:e,source:"uniapp"},{traceId:o}),console.error(t)}}},X={setItem:Q("setStorageSync"),getItem:Q("getStorageSync"),removeItem:Q("removeStorageSync"),clear:Q("clearStorageSync")},z={tag:"uniapp",httpReq:function(e){var t=e.method||o.GET,n=e.timeout||6e4,c=e.headers,r=e.query,i=e.body,d=a(e.url,r);return new Promise((function(e){uni.request({url:d,method:t,header:c,timeout:n,data:i,success:function(t){e({data:t.data,status:t.statusCode})},fail:function(){e({status:s.RC_HTTP_REQ_TIMEOUT})}})}))},localStorage:X,sessionStorage:X,isSupportSocket:function(){return!0},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})}}},createDataChannel:function(n,o){return"websocket"===o?new e(this,n):new t(this,n)},getNetworkType:function(){return new Promise((function(e){uni.getNetworkType({success:function(t){var n=t.networkType;e(n)},fail:function(){e(n.UNKONWN)}})}))}},$=function(e){return e&&e.request&&e.getSystemInfo},Z="undefined"!=typeof uni&&$(uni)?function(){switch(process.env.VUE_APP_PLATFORM){case"app-plus":return z;case"mp-baidu":return Y;case"mp-toutiao":return V;case"mp-alipay":return K;case"mp-weixin":return P;default:return B}}():"undefined"!=typeof my&&$(my)?K:"undefined"!=typeof tt&&$(tt)?V:"undefined"!=typeof swan&&$(swan)?Y:"undefined"!=typeof wx&&$(wx)?P:B,ee=new i("RCIM");function te(e,t,n){return"".concat(e,"_").concat(t,"_").concat(n)}var ne=function(){function e(){}return e.set=function(t){if(d[t.messageType]&&d[t.messageType].isPersited){var n=e.get(t.conversationType,t.targetId,t.channelId||"");if(!n||n.sentTime<t.sentTime){var o=te(t.conversationType,t.targetId,t.channelId||"");e.map[o]=t}}},e.get=function(t,n,o){var a=te(t,n,o);return e.map[a]||null},e.remove=function(t,n,o){var a=te(t,n,o);delete e.map[a]},e.clear=function(){e.map={}},e.map={},e}(),oe={"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"},ae={},se=new u(Z,"API-V2");function ce(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(!f()){var d=ne.get(n,o,t||"");s?d&&s.sentTime<d.sentTime&&(s=d):s=d}var u=s?re(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 re(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,u=e.receivedStatus,C=e.receivedTime,f=e.canIncludeExpansion,l=e.disableNotification,p=e.expansion,h=e.messageId,S=e.sentStatus,m=e.channelId,I=e.readReceiptInfo,R=e.pushConfig,M="";return s in oe?M=oe[s]:s in ae?M=ae[s]:(a={message:{content:a,objectName:s},messageName:"UnknownMessage"},M="UnknownMessage"),u||(u=g.UNREAD),void 0===h&&(h=~~(16777215*Math.random())),{channelId:m||"",conversationType:t,targetId:n,senderUserId:o,content:a,messageType:M,messageUId:c,messageDirection:r,offLineMessage:i,sentTime:d,receivedStatus:u,receivedTime:C,objectName:s,messageId:h,sentStatus:S||T.SENT,disableNotification:l,canIncludeExpansion:f,expansion:p,readReceiptInfo:I,pushConfig:R}}function ie(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===C.SEND){var r="".concat(t).concat(e.content.messageUId,"SENT");se.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=se.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,se.set(i,d));else{var u={uIds:[e.content.messageUId],dealtime:e.sentTime,isResponse:!1};d[e.senderUserId]=u,se.set(i,d)}else{var g={};g[e.senderUserId]={uIds:[e.content.messageUId],dealtime:e.sentTime,isResponse:!1},se.set(i,g)}}}function de(e,t,n){try{e(t,n)}catch(e){ee.error(e)}}function ue(e,t,n){try{e(t,n)}catch(e){ee.error(e)}}var ge=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 ge(e,t,a,n,o)};return a.MessageType=e,a.ObjectName=t,a}var fe,le,pe=Ce("ReadReceiptResponseMessage","RC:RRRspMsg"),he=function(){function e(e,t,n,o){this._context=e,this.channelId=t,this._isCPPMode=n,this._readReceiptTimeout=o,this._storage=se,this._draftMap={}}return e.prototype.getConversationList=function(e,t,n){l("callback",e,p.CALLBACK),l("conversationTypes",t,p.ARRAY),l("count",n,p.NUMBER),this._context.getConversationList(n,void 0,0,0,this.channelId).then((function(n){var o=n.code,a=n.data,c=[];a=a||[],o===s.SUCCESS?(t?a.forEach((function(e){t.indexOf(e.conversationType)>-1&&c.push(ce(e))})):a.forEach((function(e){c.push(ce(e))})),de(e.onSuccess,c)):(ee.warn("getConversationList -> code:".concat(o)),ue(e.onError,o))}))},e.prototype.getConversation=function(e,t,n){var o=this;l("callback",n,p.CALLBACK),l("conversationType",e,p.NUMBER,!0),l("targetId",t,p.STRING,!0),ee.info("getConversation ->targetId:".concat(t,",conversationType:").concat(e)),N(o,void 0,void 0,(function(){var o,a,c;return _(this,(function(r){switch(r.label){case 0:return[4,this._context.getConversation(e,t,this.channelId)];case 1:return o=r.sent(),a=o.code,c=o.data,a!==s.SUCCESS?(ee.warn("getConversation ->code:".concat(a,",targetId:").concat(t)),n.onError(a),[2]):(n.onSuccess(c?ce(c):null),[2])}}))}))},e.prototype.removeConversation=function(e,t,n){var o=this;l("conversationType",e,p.NUMBER,!0),l("targetId",t,p.STRING,!0),l("callback",n,p.CALLBACK),ee.info("removeConversation ->targetId:".concat(t,",conversationType:").concat(e)),this._context.removeConversation(e,t,this.channelId).then((function(a){a===s.SUCCESS?(o._isCPPMode||ne.remove(e,t,o.channelId),de(n.onSuccess)):(ee.warn("removeConversation ->code:".concat(a,",targetId:").concat(t)),ue(n.onError,a))}))},e.prototype.saveTextMessageDraft=function(e,t,n){l("conversationType",e,p.NUMBER,!0),l("targetId",t,p.STRING,!0),l("draftText",n,p.STRING,!0),ee.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){l("conversationType",e,p.NUMBER,!0),l("targetId",t,p.STRING,!0),ee.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){l("conversationType",e,p.NUMBER,!0),l("targetId",t,p.STRING,!0),ee.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){l("callback",e,p.CALLBACK),ee.info("getTotalUnreadCount ->conversationTypes:".concat(t)),this._context.getTotalUnreadCount(this.channelId,t,n).then((function(t){var n=t.code,o=t.data;n===s.SUCCESS?de(e.onSuccess,o):(ee.warn("getTotalUnreadCount ->code:".concat(n)),ue(e.onError,n))}))},e.prototype.getUnreadCount=function(e,t,n){l("conversationType",e,p.NUMBER,!0),l("targetId",t,p.STRING,!0),l("callback",n,p.CALLBACK),ee.info("getUnreadCount ->targetId:".concat(t,",conversationType:").concat(e)),this._context.getUnreadCount(e,t,this.channelId).then((function(e){var o=e.code,a=e.data;o===s.SUCCESS?de(n.onSuccess,a):(ee.warn("getUnreadCount ->code:".concat(o,",targetId:").concat(t)),ue(n.onError,o))}))},e.prototype.clearConversations=function(e,t){ee.info("clearConversations -> conversationTypes:".concat(t)),this._isCPPMode?this._context.clearConversations(t,this.channelId).then((function(t){t===s.SUCCESS?de(e.onSuccess,!0):(ee.warn("clearConversations ->code:".concat(t)),ue(e.onError,t))})):ee.error("Method is only available in cppProtocol mode")},e.prototype.clearUnreadCount=function(e,t,n){l("conversationType",e,p.NUMBER,!0),l("targetId",t,p.STRING,!0),l("callback",n,p.CALLBACK),ee.info("clearUnreadCount ->targetId:".concat(t,",conversationType:").concat(e)),this._context.clearUnreadCount(e,t,this.channelId).then((function(e){e===s.SUCCESS?de(n.onSuccess,!0):(ee.warn("clearUnreadCount ->code:".concat(e,",targetId:").concat(t)),ue(n.onError,e))}))},e.prototype.clearAllUnreadCount=function(e){l("callback",e,p.CALLBACK),ee.info("clearUnreadCount ->"),this._context.clearAllUnreadCount().then((function(t){t===s.SUCCESS?de(e.onSuccess,!0):(ee.warn("clearUnreadCount ->code:".concat(t)),ue(e.onError,t))}))},e.prototype.getFirstUnreadMessage=function(e,t,n){l("conversationType",e,p.NUMBER,!0),l("targetId",t,p.STRING,!0),l("callback",n,p.CALLBACK),ee.info("getFirstUnreadMessage ->targetId:".concat(t,",conversationType:").concat(e)),this._context.getFirstUnreadMessage(e,t,this.channelId).then((function(e){e.code===s.SUCCESS?de(n.onSuccess,e.data?re(e.data):null):(ee.warn("getFirstUnreadMessage ->code:".concat(e.code,",targetId:").concat(t)),ue(n.onError,e.code))}))},e.prototype.setConversationStatus=function(e,t,n,o){l("conversationType",e,p.NUMBER,!0),l("targetId",t,p.STRING,!0),l("callback",o,p.CALLBACK),l("status",n,p.OBJECT,!0),ee.info("setConversationStatus ->targetId:".concat(t,",status:").concat(n));var a=n.isTop,c=n.notificationStatus;this._context.setConversationStatus(e,t,a,c,this.channelId).then((function(e){e===s.SUCCESS?de(o.onSuccess):(ee.warn("setConversationStatus ->code:".concat(e,",targetId:").concat(t)),ue(o.onError,e))}))},e.prototype.sendMessage=function(e,t,n,o,a,i,d,u){var f=this;l("conversationType",e,p.NUMBER,!0),l("targetId",t,p.STRING,!0),l("msg",n,p.OBJECT,!0),l("callback",o,p.CALLBACK),l("isMentioned",a,p.BOOLEAN),l("pushContent",i,p.ONLY_STRING),l("pushData",d,p.ONLY_STRING),l("options.userIds",null==u?void 0:u.userIds,p.ARRAY),l("options.isVoipPush",null==u?void 0:u.isVoipPush,p.BOOLEAN),l("options.disableNotification",null==u?void 0:u.disableNotification,p.BOOLEAN),l("options.canIncludeExpansion",null==u?void 0:u.canIncludeExpansion,p.BOOLEAN),l("options.expansion",null==u?void 0:u.expansion,p.OBJECT),l("options.pushConfig",null==u?void 0:u.pushConfig,p.OBJECT),l("options.resendMessageId",null==u?void 0:u.resendMessageId,p.NUMBER),ee.info("sendMessage ->targetId:".concat(t,",conversationType:").concat(e));var h=!(!(null==u?void 0:u.isStatusMessage)&&!(null==u?void 0:u.isStatus)),S=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,C=a.resendMessageId,f=[];if(t){var l=(n||{}).content.mentionedInfo;f=l.userIdList,o=l.type}return{mentionedType:o,mentionedUserIdList:f,directionalUserIdList:s,isVoipPush:c,disableNotification:r,isFilerWhiteBlacklist:i,expansion:d,canIncludeExpansion:u,pushConfig:g,messageId:C}}(u,a,n),m=Object.assign(n,U(U({isMentioned:a,pushContent:i,pushData:d},S),{messageType:n.objectName,channelId:this.channelId,isStatusMessage:h})),I=this._context.getCurrentUserId(),R=c.ID();c.info(r.A_SEND_MSG_T,{messageType:m.messageType,conversationType:e,targetId:t,channelId:this.channelId},{traceId:R}),this._context.sendMessage(e,t,m,o.onBefore,R).then((function(a){var i=a.code,d=a.data;if((i===s.SUCCESS?c.info:c.warn)(r.A_SEND_MSG_R,{code:i,messageUId:d?d.messageUId:"",messageId:d?d.messageId:""},{traceId:R}),i===s.SUCCESS){f._isCPPMode||ne.set(d);var l=re(d);ie(l,I,f._context.getConnectedTime(),f._readReceiptTimeout),de(o.onSuccess,l)}else ee.warn("sendMessage ->code:".concat(i,",targetId:").concat(t)),ue(o.onError,i,re({isMentioned:!!m.isMentioned,content:n.content,messageType:n.messageType,isPersited:n.isPersited,isCounted:n.isCounted,disableNotification:!!(null==u?void 0:u.disableNotification),canIncludeExpansion:!!(null==u?void 0:u.canIncludeExpansion),expansion:(null==u?void 0:u.expansion)||null,conversationType:e,targetId:t,senderUserId:I,messageUId:"",messageDirection:C.SEND,isOffLineMessage:!1,sentTime:(null==d?void 0:d.sentTime)||0,receivedTime:0,isStatusMessage:h,receivedStatus:g.UNREAD,messageId:null==d?void 0:d.messageId,sentStatus:T.FAILED}))}))},e.prototype.sendRecallMessage=function(e,t,n){var o=this;l("message.conversationType",e.conversationType,p.NUMBER,!0),l("message.targetId",e.targetId,p.STRING,!0),l("message.messageUId",e.messageUId,p.STRING,!0),l("message.sentTime",e.sentTime,p.NUMBER,!0),l("callback",t,p.CALLBACK),l("options.disableNotification",null==n?void 0:n.disableNotification,p.BOOLEAN),l("options.pushConfig",null==n?void 0:n.pushConfig,p.OBJECT),l("options.extra",null==n?void 0:n.extra,p.STRING);var a=e.conversationType,c=e.targetId,r=e.messageUId,i=e.sentTime;ee.info("sendRecallMessage ->targetId:".concat(c,",conversationType:").concat(a,",messageUId:").concat(r));var d=U({channelId:this.channelId},n);this._context.recallMessage(a,c,r,i,d).then((function(e){var n=e.code,a=e.data;n===s.SUCCESS?(o._isCPPMode||ne.set(a),de(t.onSuccess,re(a))):(ee.warn("sendRecallMessage ->code:".concat(n,",targetId:").concat(c,",messageUId:").concat(r)),ue(t.onError,n))}))},e.prototype.sendTypingStatusMessage=function(e,t,n,o){l("conversationType",e,p.NUMBER,!0),l("targetId",t,p.STRING,!0),l("typingContentType",n,p.STRING,!0),l("callback",o,p.CALLBACK),ee.info("sendTypingStatusMessage ->targetId:".concat(t,",conversationType:").concat(e));var a={messageType:"RC:TypSts",content:{typingContentType:n},isStatusMessage:!0,channelId:this.channelId},i=c.ID();c.info(r.A_SEND_MSG_T,{messageType:a.messageType,conversationType:e,targetId:t,channelId:a.channelId},{traceId:i}),this._context.sendMessage(e,t,a,void 0,i).then((function(e){var n=e.code,a=e.data;(n===s.SUCCESS?c.info:c.warn)(r.A_SEND_MSG_R,{code:n,messageUId:a?a.messageUId:"",messageId:a?a.messageId:""},{traceId:i}),n===s.SUCCESS?de(o.onSuccess,re(a)):(ee.warn("sendTypingStatusMessage ->code:".concat(n,",targetId:").concat(t)),ue(o.onError,n))}))},e.prototype.sendReceiptResponse=function(e,t,n){var o=this;ee.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 pe({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),de(n.onSuccess,e)},onError:function(e){ee.warn("sendReceiptResponse ->code:".concat(e,",targetId:").concat(t)),ue(n.onError,e)}})}),200)}else n.onSuccess(null)},e.prototype.sendReadReceiptMessage=function(e,t,n){l("messageUIds",e,p.ARRAY,!0),l("targetId",t,p.STRING,!0),ee.info("sendReadReceiptMessage ->targetId:".concat(t,",messageUIds:").concat(e));for(var o=0,a=e;o<a.length;o++){var c=a[o];l("messageUId",c,p.STRING)}this._context.sendReadReceiptMessage(t,e,this.channelId).then((function(o){var a=o.code;a===s.SUCCESS?n.onSuccess():(ee.warn("sendReadReceiptMessage ->code:".concat(a,",targetId:").concat(t,",messageUIds:").concat(e)),n.onError(a))})).catch((function(o){ee.warn("sendReadReceiptMessage ->code:".concat(o,",targetId:").concat(t,",messageUIds:").concat(e)),n.onError(o)}))},e.prototype.getMessageReader=function(e,t,n){l("messageUId",e,p.STRING,!0),l("targetId",t,p.STRING,!0),ee.info("getMessageReader ->targetId:".concat(t,",messageUId:").concat(e)),this._context.getMessageReader(t,e,this.channelId).then((function(o){var a=o.code,c=o.data;a===s.SUCCESS?n.onSuccess(c):(ee.warn("getMessageReader ->code:".concat(a,",targetId:").concat(t,",messageUId:").concat(e)),n.onError(a))})).catch((function(o){ee.warn("getMessageReader ->code:".concat(o,",targetId:").concat(t,",messageUId:").concat(e)),n.onError(o)}))},e.prototype.updateMessageExpansion=function(e,t,n){l("expansion",e,p.OBJECT,!0),l("message",t,p.OBJECT,!0);var o=t.conversationType,a=t.targetId,c=t.messageUId,r=t.canIncludeExpansion,i=t.expansion;ee.info("updateMessageExpansion ->targetId:".concat(a,",messageUId:").concat(c,",conversationType:").concat(o)),this._context.sendExpansionMessage({conversationType:o,targetId:a,messageUId:c,canIncludeExpansion:r,originExpansion:i,expansion:e,channelId:this.channelId}).then((function(e){var t=e.code;t===s.SUCCESS?de(n.onSuccess):(ee.warn("updateMessageExpansion ->code:".concat(t,",targetId:").concat(a,",messageUId:").concat(c)),ue(n.onError,t))}))},e.prototype.removeMessageExpansionForKey=function(e,t,n){l("keys",e,p.ARRAY,!0),l("message",t,p.OBJECT,!0);var o=t.conversationType,a=t.targetId,c=t.messageUId,r=t.canIncludeExpansion;ee.info("removeMessageExpansionForKey ->targetId:".concat(a,",messageUId:").concat(c,",conversationType:").concat(o)),this._context.sendExpansionMessage({conversationType:o,targetId:a,messageUId:c,canIncludeExpansion:r,keys:e,channelId:this.channelId}).then((function(e){var t=e.code;t===s.SUCCESS?de(n.onSuccess):(ee.warn("removeMessageExpansionForKey ->code:".concat(t,",targetId:").concat(a,",messageUId:").concat(c)),ue(n.onError,t))}))},e.prototype.getHistoryMessages=function(e,t,n,o,a,i,d){l("conversationType",e,p.NUMBER,!0),l("targetId",t,p.STRING,!0),l("timestamp",n,p.NUMBER,!0),l("count",o,p.NUMBER,!0),l("callback",a,p.CALLBACK,!0),l("order",d,p.NUMBER),ee.info("getHistoryMessages ->targetId:".concat(t,",conversationType:").concat(e,",timestamp:").concat(n));var u=c.ID();c.info(r.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===s.SUCCESS)if(o){var i=o.list,d=o.hasMore,g=[],C=i.map((function(e){return g.push(e.messageUId),re(e)}));c.info(r.A_GET_HISTORY_MSG_R,{code:n,messageUIds:g.join(",")},{traceId:u}),de(a.onSuccess,C,d)}else c.info(r.A_GET_HISTORY_MSG_R,{code:n,messageUIds:""},{traceId:u}),de(a.onSuccess,[],!1);else c.warn(r.A_GET_HISTORY_MSG_R,{code:n,messageUIds:""},{traceId:u}),ee.warn("getHistoryMessages ->code:".concat(n,",targetId:").concat(t)),ue(a.onError,n)}))},e.prototype.deleteRemoteMessages=function(e,t,n,o){var a=this;l("conversationType",e,p.NUMBER,!0),l("targetId",t,p.STRING,!0),l("messages",n,p.ARRAY,!0),l("callback",o,p.CALLBACK),ee.info("deleteRemoteMessages ->targetId:".concat(t,",conversationType:").concat(e)),this._context.deleteRemoteMessage(e,t,n,this.channelId).then((function(c){if(c===s.SUCCESS){if(!a._isCPPMode){var r=ne.get(e,t,a.channelId);r&&n.forEach((function(n){r.messageUId===n.messageUId&&ne.remove(e,t,a.channelId)}))}de(o.onSuccess)}else ee.warn("deleteRemoteMessages ->code:".concat(c,",targetId:").concat(t)),ue(o.onError,c)}))},e.prototype.clearRemoteHistoryMessages=function(e,t){l("param.conversationType",e.conversationType,p.NUMBER,!0),l("param.targetId",e.targetId,p.STRING,!0),l("param.timestamp",e.timestamp,p.NUMBER,!0),l("callback",t,p.CALLBACK);var n=e.conversationType,o=e.targetId,a=e.timestamp;ee.info("clearRemoteHistoryMessages ->targetId:".concat(o,",conversationType:").concat(n)),this._context.deleteRemoteMessageByTimestamp(n,o,a,this.channelId).then((function(e){e===s.SUCCESS?de(t.onSuccess):(ee.warn("clearRemoteHistoryMessages ->code:".concat(e)),ue(t.onError,e))}))},e.prototype.getConversationListWithAllChannel=function(e){l("callback",e,p.CALLBACK),this._context.getConversationListWithAllChannel().then((function(t){var n=t.code,o=t.data;n===s.SUCCESS?de(e.onSuccess,o.map(ce)):ue(e.onError,n)}))},e.prototype.getConversationListWithAllChannelByPage=function(e,t,n){l("callback",e,p.CALLBACK),l("index",t,p.NUMBER),l("limit",n,p.NUMBER),this._context.getConversationListWithAllChannelByPage(t,n).then((function(t){var n=t.code,o=t.data;n===s.SUCCESS?de(e.onSuccess,o.map(ce)):ue(e.onError,n)}))},e.prototype.insertMessage=function(e,t,n,o,a){void 0===a&&(a={});var c=n.senderUserId,r=n.objectName,i=n.content,d=n.messageDirection,u=n.messageUId,g=n.canIncludeExpansion,C=n.expansion,f=n.disableNotification,l=n.sentTime,p=n.sentStatus;ee.info("insertMessage ->targetId:".concat(t,",conversationType:").concat(e));var h=a.isUnread,S={senderUserId:c,messageType:r,content:i,messageDirection:d,sentTime:l,sentStatus:p,searchContent:a.searchContent,isUnread:h,messageUId:u,disableNotification:f,canIncludeExpansion:g,expansionMsg:JSON.stringify(C),channelId:this.channelId};this._context.insertMessage(e,t,S).then((function(e){var n=e.code,a=e.data;n===s.SUCCESS?de(o.onSuccess,re(a)):(ee.warn("insertMessage ->code:".concat(n,",targetId:").concat(t)),ue(o.onError,n))}))},e.prototype.deleteLocalMessagesByTimestamp=function(e,t,n,o,a){ee.info("deleteLocalMessagesByTimestamp ->targetId:".concat(t,",conversationType:").concat(e,",timestamp:").concat(n)),this._context.deleteMessagesByTimestamp(e,t,n,o,this.channelId).then((function(e){e===s.SUCCESS?de(a.onSuccess,!0):(ee.warn("deleteLocalMessagesByTimestamp ->code:".concat(e,",targetId:").concat(t)),ue(a.onError,e))}))},e.prototype.getRemoteHistoryMessages=function(e,t,n,o,a,c){ee.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===s.SUCCESS)if(o){var c=o.list,r=o.hasMore,i=c.map((function(e){return re(e)}));de(a.onSuccess,i,r)}else de(a.onSuccess,[],!1);else ee.warn("getRemoteHistoryMessages ->code:".concat(n,",targetId:").concat(t)),ue(a.onError,n)}))},e.prototype.clearMessages=function(e,t,n){var o=this;ee.info("clearMessages ->targetId:".concat(t,",conversationType:").concat(e)),this._context.clearMessages(e,t,this.channelId).then((function(a){a===s.SUCCESS?(o._isCPPMode||ne.remove(e,t,o.channelId),de(n.onSuccess,!0)):(ee.warn("clearMessages ->code:".concat(a,",targetId:").concat(t)),ue(n.onError,a))}))},e.prototype.searchConversationByContent=function(e,t,n,o){ee.info("searchConversationByContent ->keyword:".concat(e)),this._context.searchConversationByContent(e,o,this.channelId,n).then((function(n){var o=n.code,a=n.data,c=[];a=a||[],o===s.SUCCESS?(a.forEach((function(e){c.push(ce(e))})),de(t.onSuccess,c)):(ee.warn("searchConversationByContent ->code:".concat(o,",keyword:").concat(e)),ue(t.onError,o))}))},e.prototype.searchConversationByContentWithAllChannel=function(e,t,n,o){void 0===n&&(n=[]),c.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===s.SUCCESS?(a.forEach((function(e){r.push(ce(e))})),de(t.onSuccess,r)):(c.warn("searchConversationByContentWithAllChannel ->code:".concat(o,",keyword:").concat(e)),ue(t.onError,o))}))},e.prototype.searchMessageByContent=function(e,t,n,o,a,c,r){ee.info("searchMessageByContent ->targetId:".concat(t,",conversationType:").concat(e,",keyword:").concat(n)),this._context.searchMessageByContent(e,t,n,o,a,c,this.channelId).then((function(e){var n=e.code,o=e.data,a=[];if(n===s.SUCCESS){var c=o=o||{},i=c.messages,d=c.count;i.forEach((function(e){a.push(re(e))})),de(r.onSuccess,a,d)}else ee.warn("searchMessageByContent ->code:".concat(n,",targetId:").concat(t)),ue(r.onError,n)}))},e.prototype.searchMessageByContentWithAllChannel=function(e,t,n,o,a,r){c.info("searchMessageByContentWithAllChannel ->targetId: ".concat(t," ,conversationType: ").concat(e," ,keyword: ").concat(n,", timestamp: ").concat(o,", count: ").concat(a)),this._context.searchMessageByContentWithAllChannel(e,t,n,o,a).then((function(e){var n=e.code,o=e.data,a=[];if(n===s.SUCCESS){var i=o=o||{},d=i.messages,u=i.count;d.forEach((function(e){a.push(re(e))})),de(r.onSuccess,a,u)}else c.warn("searchMessageByContentWithAllChannel ->code:".concat(n,",targetId:").concat(t)),ue(r.onError,n)}))},e.prototype.searchMessageByContentInTimeRangeWithAllChannel=function(e,t,n,o,a,r,i,d){c.info("searchMessageByContentInTimeRangeWithAllChannel ->targetId: ".concat(t," ,conversationType: ").concat(e," ,keyword: ").concat(n,", startTime: ").concat(o,", endTime: ").concat(a,", offset: ").concat(r,", limit: ").concat(i)),this._context.searchMessageByContentInTimeRangeWithAllChannel(e,t,n,o,a,r,i).then((function(e){var n=e.code,o=e.data,a=[];n===s.SUCCESS?((o=o||{}).messages.forEach((function(e){a.push(re(e))})),de(d.onSuccess,a)):(c.warn("searchMessageByContentInTimeRangeWithAllChannel ->code:".concat(n,",targetId:").concat(t)),ue(d.onError,n))}))},e.prototype.getUnreadMentionedMessages=function(e,t){return ee.info("getUnreadMentionedMessages ->targetId:".concat(t,",conversationType:").concat(e)),this._context.getUnreadMentionedMessages(e,t,this.channelId).map((function(e){return re(e)}))},e.prototype.clearUnreadCountByTimestamp=function(e,t,n,o){ee.info("clearUnreadCountByTimestamp ->targetId:".concat(t,",conversationType:").concat(e)),this._context.clearUnreadCountByTimestamp(e,t,n,this.channelId).then((function(e){e===s.SUCCESS?de(o.onSuccess,!0):(ee.warn("clearUnreadCountByTimestamp ->code:".concat(e,",targetId:").concat(t)),ue(o.onError,e))}))},e.prototype.getConversationNotificationStatus=function(e,t,n){ee.info("getConversationNotificationStatus ->targetId:".concat(t,",conversationType:").concat(e)),this._context.getConversationNotificationStatus(e,t,this.channelId).then((function(e){var o=e.code,a=e.data;o===s.SUCCESS?de(n.onSuccess,a):(ee.warn("getConversationNotificationStatus ->code:".concat(o,",targetId:").concat(t)),ue(n.onError,o))}))},e}(),Se=function(e){return{targetId:e.targetId,channelId:e.channelId,conversationType:e.type}},me=function(){function e(e,t){this._context=e,this._options=t,this._channelClient={},this._isCPPMode=f(),this._defaultChannelClient=new he(e,"",this._isCPPMode,t.readReceiptTimeout)}return e.prototype.assertCPPMode=function(e,t,n){if(!this._isCPPMode)return null==n||n.onError(s.NOT_SUPPORT),void ee.error("'".concat(t,"' is unusable!"));e()},e.prototype.install=function(e,t){return this._context.install(e,t)},e.prototype.getChannel=function(e){return ee.info("getChannel ->channelId:".concat(e)),this._isCPPMode?(l("channelId",e,p.STRING,!0),e.length>20?(ee.error("The channelId cannot exceed 20 characters"),null):e in this._channelClient?this._channelClient[e]:Object.keys(this._channelClient).length>1e3?(ee.error("Only 1000 channels can be obtained"),null):(this._channelClient[e]=new he(this._context,e,this._isCPPMode,this._options.readReceiptTimeout),this._channelClient[e])):(ee.error("getChannel method is only available in protocol stack mode"),null)},e.prototype.deleteChannels=function(e){var t=this;l("channelIds",e,p.ARRAY,!0),ee.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 N(this,void 0,void 0,(function(){return _(this,(function(e){switch(e.label){case 0:return c.info(r.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.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){ee.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){l("chatRoomId",e,p.STRING,!0),l("count",t,p.NUMBER,!0),l("callback",n,p.CALLBACK),ee.info("joinChatRoom ->chatRoomId:".concat(e));var o=c.ID();c.info(r.A_JOIN_CHATROOM_T,{chatroomId:e,count:t,joinExist:!1},{traceId:o}),this._context.joinChatroom(e,t,o).then((function(t){(t===s.SUCCESS?c.info:c.warn)(r.A_JOIN_CHATROOM_R,{code:t,timestamp:(new Date).getTime()},{traceId:o}),t===s.SUCCESS?de(n.onSuccess):(ee.warn("joinChatRoom ->code:".concat(t,",chatRoomId:").concat(e)),ue(n.onError,t))}))},e.prototype.quitChatRoom=function(e,t){l("chatRoomId",e,p.STRING,!0),l("callback",t,p.CALLBACK),ee.info("quitChatRoom ->chatRoomId:".concat(e));var n=c.ID();c.info(r.A_QUIT_CHATROOM_T,{chatroomId:e},{traceId:n}),this._context.quitChatroom(e).then((function(o){(o===s.SUCCESS?c.info:c.warn)(r.A_QUIT_CHATROOM_R,{code:o},{traceId:n}),o===s.SUCCESS?de(t.onSuccess):(ee.warn("quitChatRoom ->code:".concat(o,",chatRoomId:").concat(e)),ue(t.onError,o))}))},e.prototype.getChatRoomInfo=function(e,t,n,o){l("chatRoomId",e,p.STRING,!0),l("count",t,p.NUMBER,!0),l("order",n,p.NUMBER,!0),l("callback",o,p.CALLBACK),ee.info("getChatRoomInfo ->chatRoomId:".concat(e)),this._context.getChatroomInfo(e,t,n).then((function(t){var n=t.code,a=t.data;n===s.SUCCESS?de(o.onSuccess,{userInfos:(null==a?void 0:a.userInfos)||[],userTotalNums:(null==a?void 0:a.userCount)||0}):(ee.warn("getChatRoomInfo ->code:".concat(n,",chatRoomId:").concat(e)),ue(o.onError,n))}))},e.prototype.setChatroomEntry=function(e,t,n){l("chatRoomId",e,p.STRING,!0),l("chatroomEntry",t,p.OBJECT,!0),l("callback",n,p.CALLBACK),ee.info("setChatroomEntry ->chatRoomId:".concat(e)),this._context.setChatroomEntry(e,t).then((function(t){t===s.SUCCESS?de(n.onSuccess):(ee.warn("setChatroomEntry ->code:".concat(t,",chatRoomId:").concat(e)),ue(n.onError,t))}))},e.prototype.setChatRoomEntries=function(e,t,n){if(l("chatRoomId",e,p.STRING,!0),function(e){e.entries.forEach((function(e){l("entry.key",e.key,p.STRING,!0),l("entry.value",e.value,p.STRING,!0)})),l("options.isAutoDelete",e.isAutoDelete,p.BOOLEAN)}(t),l("callback",n,p.CALLBACK),t.entries.length>10)ue(n.onError,s.CHATROOM_KV_STORE_OUT_LIMIT);else{var o="id:".concat(e);ee.info("set chatroom entry->".concat(o)),this._context.setChatroomEntries(e,t).then((function(e){var t=e.code,a=e.data;t===s.SUCCESS?de(n.onSuccess):(ee.warn("set chatroom entry fail ->code+:".concat(t,",").concat(o)),ue(n.onError,t,a))}))}},e.prototype.forceSetChatroomEntry=function(e,t,n){l("chatRoomId",e,p.STRING,!0),l("chatroomEntry",t,p.OBJECT,!0),l("callback",n,p.CALLBACK),ee.info("forceSetChatroomEntry ->chatRoomId:".concat(e)),this._context.forceSetChatroomEntry(e,t).then((function(t){t===s.SUCCESS?de(n.onSuccess):(ee.warn("forceSetChatroomEntry ->code:".concat(t,",chatRoomId:").concat(e)),ue(n.onError,t))}))},e.prototype.removeChatroomEntry=function(e,t,n){l("chatRoomId",e,p.STRING,!0),l("chatroomEntry",t,p.OBJECT,!0),l("callback",n,p.CALLBACK),ee.info("removeChatroomEntry ->chatRoomId:".concat(e)),this._context.removeChatroomEntry(e,t).then((function(t){t===s.SUCCESS?de(n.onSuccess):(ee.warn("removeChatroomEntry ->code:".concat(t,",chatRoomId:").concat(e)),ue(n.onError,t))}))},e.prototype.removeChatRoomEntries=function(e,t,n){l("chatRoomId",e,p.STRING,!0),function(e){e.entries.forEach((function(e){l("key",e,p.STRING,!0)}))}(t);var o="id:".concat(e);ee.debug("remove chatroom entry->".concat(o));var a=U({},t);a.entries=t.entries.map((function(e){return{key:e}})),this._context.removeChatroomEntries(e,a).then((function(e){var t=e.code,a=e.data;t===s.SUCCESS?de(n.onSuccess):(ee.warn("remove chatroom entry fail ->code+:".concat(t,",").concat(o)),ue(n.onError,t,a))}))},e.prototype.forceRemoveChatroomEntry=function(e,t,n){l("chatRoomId",e,p.STRING,!0),l("chatroomEntry",t,p.OBJECT,!0),l("callback",n,p.CALLBACK),ee.info("forceRemoveChatroomEntry ->chatRoomId:".concat(e)),this._context.forceRemoveChatroomEntry(e,t).then((function(t){t===s.SUCCESS?de(n.onSuccess):(ee.warn("forceRemoveChatroomEntry ->code:".concat(t,",chatRoomId:").concat(e)),ue(n.onError,t))}))},e.prototype.getChatroomEntry=function(e,t,n){l("chatRoomId",e,p.STRING,!0),l("key",t,p.STRING,!0),l("callback",n,p.CALLBACK),ee.info("getChatroomEntry ->chatRoomId:".concat(e,",key:").concat(t)),this._context.getChatroomEntry(e,t).then((function(t){var o=t.code,a=t.data;o===s.SUCCESS?de(n.onSuccess,a||""):(ee.warn("getChatroomEntry ->code:".concat(o,",chatRoomId:").concat(e)),ue(n.onError,o))}))},e.prototype.getAllChatroomEntries=function(e,t){l("chatRoomId",e,p.STRING,!0),l("callback",t,p.CALLBACK),ee.info("getAllChatroomEntries ->chatRoomId:".concat(e)),this._context.getAllChatroomEntries(e).then((function(n){var o=n.code,a=n.data;o===s.SUCCESS?de(t.onSuccess,a):(ee.warn("getAllChatroomEntries ->code:".concat(o,",chatRoomId:").concat(e)),ue(t.onError,o))}))},e.prototype.getChatRoomHistoryMessages=function(e,t,n,o,a){void 0===a&&(a=0),l("chatRoomId",e,p.STRING,!0),l("count",t,p.NUMBER,!0),l("order",n,p.NUMBER,!0),l("callback",o,p.CALLBACK),l("timestamp",a,p.NUMBER),ee.info("getChatRoomHistoryMessages ->chatRoomId:".concat(e)),this._context.getChatRoomHistoryMessages(e,t,n,a).then((function(t){var n=t.code,a=t.data;if(n===s.SUCCESS)if(a){var c=a.list,r=a.hasMore,i=c.map((function(e){return re(e)}));de(o.onSuccess,i,r)}else de(o.onSuccess,[],!1);else ee.warn("getChatRoomHistoryMessages ->code:".concat(n,",chatRoomId:").concat(e)),ue(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){l("fileType",e,p.NUMBER,!0),l("fileName",n,p.STRING),l("callback",t,p.CALLBACK),ee.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){l("fileType",e,p.NUMBER,!0),l("fileName",t,p.STRING,!0),l("saveName",n,p.STRING),l("callback",o,p.CALLBACK),l("serverType",s,p.NUMBER),l("uploadRes",a,p.OBJECT),ee.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){l("tag.tagId",e.tagId,p.STRING,!0),l("tag.tagId",e.tagId,(function(e){return e.length<=10})),l("tag.tagName",e.tagName,(function(e){return e.length<=15})),l("tag.tagName",e.tagName,p.STRING,!0),l("callback",t,p.CALLBACK),ee.info("createTag ->tagId:".concat(e.tagId,",tagName:").concat(e.tagName)),this._context.createTag(e).then((function(n){var o=n.code;o===s.SUCCESS?t.onSuccess():(ee.warn("createTag ->code:".concat(o,",tagId:").concat(e.tagId)),t.onError(o))})).catch((function(n){ee.warn("createTag ->code:".concat(n,",tagId:").concat(e.tagId)),t.onError(n)}))},e.prototype.removeTag=function(e,t){l("tagId",e,p.STRING,!0),l("callback",t,p.CALLBACK),ee.info("removeTag ->tagId:".concat(e)),this._context.removeTag(e).then((function(n){var o=n.code;o===s.SUCCESS?t.onSuccess():(ee.warn("removeTag ->code:".concat(o,",tagId:").concat(e)),t.onError(o))})).catch((function(n){ee.warn("removeTag ->code:".concat(n,",tagId:").concat(e)),t.onError(n)}))},e.prototype.updateTag=function(e,t){l("tag.tagId",e.tagId,p.STRING,!0),l("tag.tagName",e.tagName,p.STRING,!0),l("tag.tagName",e.tagName,(function(e){return e.length<=15})),l("callback",t,p.CALLBACK),ee.info("updateTag ->tagId:".concat(e.tagId,",tagName:").concat(e.tagName)),this._context.updateTag(e).then((function(n){var o=n.code;o===s.SUCCESS?t.onSuccess():(ee.warn("updateTag ->code:".concat(o,",tagId:").concat(e.tagId)),t.onError(o))})).catch((function(n){ee.warn("updateTag ->reason:".concat(n,",tagId:").concat(e.tagId)),t.onError(n)}))},e.prototype.getTagList=function(e){l("callback",e,p.CALLBACK),this._context.getTagList().then((function(t){var n=t.code,o=t.data;n===s.SUCCESS?e.onSuccess(o||[]):(ee.warn("getTagList ->code:".concat(n)),e.onError(n))})).catch((function(t){ee.warn("getTagList ->reason:".concat(t)),e.onError(t)}))},e.prototype.getTagsForConversation=function(e,t){l("conversationType",e.type,p.NUMBER),l("targetId",e.targetId,p.STRING),l("channelId",e.channelId,p.ONLY_STRING),l("callback",t,p.CALLBACK),ee.info("getTagsForConversation ->targetId:".concat(e.targetId,",conversationType:").concat(e.type)),this._context.getTagsForConversation(Se(e)).then((function(e){var n=e.code,o=e.data;n===s.SUCCESS?t.onSuccess(o||[]):(ee.warn("getTagsForConversation ->code:".concat(n)),t.onError(n))})).catch((function(e){ee.warn("getTagsForConversation ->reason:".concat(e)),t.onError(e)}))},e.prototype.addTagForConversations=function(e,t,n){l("tagId",e,p.STRING,!0),l("conversations",t,p.ARRAY,!0),l("callback",n,p.CALLBACK),t.forEach((function(e){l("conversation.type",e.type,p.NUMBER,!0),l("conversation.targetId",e.targetId,p.STRING,!0),l("conversation.channelId",e.channelId,p.ONLY_STRING)})),ee.info("addTagForConversations ->tagId:".concat(e)),this._context.addTagForConversations(e,t.map((function(e){return Se(e)}))).then((function(t){var o=t.code;t.data,o===s.SUCCESS?n.onSuccess():(ee.warn("addTagForConversations ->code:".concat(o,",tagId:").concat(e)),n.onError(o))})).catch((function(t){ee.warn("addTagForConversations ->reason:".concat(t,",tagId:").concat(e)),n.onError(t)}))},e.prototype.removeTagForConversations=function(e,t,n){l("tagId",e,p.STRING,!0),l("conversations",t,p.ARRAY,!0),l("callback",n,p.CALLBACK),t.forEach((function(e){l("conversation.type",e.type,p.NUMBER,!0),l("conversation.targetId",e.targetId,p.STRING,!0),l("conversation.channelId",e.channelId,p.ONLY_STRING)})),ee.info("removeTagForConversations ->tagId:".concat(e)),this._context.removeTagForConversations(e,t.map((function(e){return Se(e)}))).then((function(t){var o=t.code;t.data,o===s.SUCCESS?n.onSuccess():(ee.warn("removeTagForConversations ->code:".concat(o,",tagId:").concat(e)),n.onError(o))})).catch((function(t){ee.warn("removeTagForConversations ->reason:".concat(t,",tagId:").concat(e)),n.onError(t)}))},e.prototype.removeTagsForConversation=function(e,t,n){l("conversation.type",e.type,p.NUMBER,!0),l("conversation.targetId",e.targetId,p.STRING,!0),l("conversation.channelId",e.channelId,p.ONLY_STRING),l("tagIds",t,p.ARRAY,!0),l("callback",n,p.CALLBACK),t.forEach((function(e){l("tagId",e,p.STRING,!0)})),ee.info("removeTagsForConversation ->tagIds:".concat(t,",targetId:").concat(e.targetId,",type:").concat(e.type)),this._context.removeTagsForConversation(Se(e),t).then((function(e){var o=e.code;e.data,o===s.SUCCESS?n.onSuccess():(ee.warn("removeTagsForConversation ->code:".concat(o,",tagIds:").concat(t)),n.onError(o))})).catch((function(e){ee.warn("removeTagsForConversation ->reason:".concat(e,",tagIds:").concat(t)),n.onError(e)}))},e.prototype.getConversationListByTag=function(e,t,n,o){l("tagId",e,p.STRING,!0),l("count",t,p.NUMBER,!0),l("startTime",n,p.NUMBER,!0),l("callback",o,p.CALLBACK,!0),ee.info("getConversationListByTag ->tagId:".concat(e)),this._context.getConversationListByTag(e,n,t).then((function(t){var n=t.code,a=t.data,c=[];n===s.SUCCESS?((a=a||[]).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?re(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)):(ee.warn("getConversationListByTag ->code:".concat(n,",tagId:").concat(e)),o.onError(n))})).catch((function(t){ee.warn("getConversationListByTag ->reason:".concat(t,",tagId:").concat(e)),o.onError(t)}))},e.prototype.getUnreadCountByTag=function(e,t,n){l("tagId",e,p.STRING,!0),l("containMuted",t,p.BOOLEAN,!0),l("callback",n,p.CALLBACK),ee.info("getUnreadCountByTag ->tagId:".concat(e)),this._context.getUnreadCountByTag(e,t).then((function(t){var o=t.code,a=t.data;ee.info(o,a),o===s.SUCCESS?n.onSuccess(a||0):(ee.warn("getUnreadCountByTag ->code:".concat(o,",tagId:").concat(e)),n.onError(o))})).catch((function(t){ee.warn("getUnreadCountByTag ->reason:".concat(t,",tagId:").concat(e)),n.onError(t)}))},e.prototype.setConversationStatusInTag=function(e,t,n,o){l("tagId",e,p.STRING,!0),l("conversation.targetId",t.targetId,p.STRING,!0),l("conversation.type",t.type,p.NUMBER,!0),l("conversation.channelId",t.channelId,p.ONLY_STRING),l("status.isTop",null==n?void 0:n.isTop,p.BOOLEAN,!0),l("callback",o,p.CALLBACK),ee.info("setConversationStatusInTag ->tagId:".concat(e,",targetId:").concat(t.targetId,",type").concat(t.type)),this._context.setConversationStatusInTag(e,Se(t),n).then((function(t){var n=t.code;t.data,n===s.SUCCESS?o.onSuccess():(ee.warn("setConversationStatusInTag ->code:".concat(n,",tagId:").concat(e)),o.onError(n))})).catch((function(t){ee.warn("setConversationStatusInTag ->reason:".concat(t,",tagId:").concat(e)),o.onError(t)}))},e.prototype.callExtra=function(e,t){for(var n,o=[],a=2;a<arguments.length;a++)o[a-2]=arguments[a];ee.info("callExtra ->method:".concat(e)),(n=this._context).callExtra.apply(n,A([e],o,!1)).then((function(n){var o=n.code,a=n.data;if(o!==s.SUCCESS)ee.warn("callExtra ->code:".concat(o)),t.onError&&ue(t.onError,o);else{if("getConversationsByPage"===e&&a.forEach((function(e){e.latestMessage=e.latestMessage?re(e.latestMessage):null})),"getHistoryMessagesByObjectNames"===e){var c=a,r=c.list,i=c.hasMore,d=r.map((function(e){return re(e)}));return void de(t.onSuccess,d,i)}t.onSuccess&&de(t.onSuccess,a)}}))},e.prototype.hasRemoteUnreadMessages=function(e,t){l("callback",t,p.CALLBACK),ee.info("hasRemoteUnreadMessages ->token:".concat(e)),this.assertCPPMode((function(){de(t.onSuccess,!1)}),"hasRemoteUnreadMessages",t)},e.prototype.setUserStatusListener=function(e,t){var n=this;ee.info("setUserStatusListener ->userIds:".concat(e.userIds)),this.assertCPPMode((function(){n._context.setUserStatusListener(e,t)}),"setUserStatusListener")},e.prototype.setUserStatus=function(e,t){var n=this;l("status",e,p.NUMBER),l("callback",t,p.CALLBACK),ee.info("setUserStatus ->status:".concat(e)),this.assertCPPMode((function(){n._context.setUserStatus(e).then((function(e){e===s.SUCCESS?de(t.onSuccess,!0):(ee.warn("setUserStatus ->code:".concat(e)),ue(t.onError,e))}))}),"setUserStatus",t)},e.prototype.getUserStatus=function(e,t){var n=this;l("userId",e,p.STRING),l("callback",t,p.CALLBACK),ee.info("getUserStatus ->userId:".concat(e)),this.assertCPPMode((function(){n._context.getUserStatus(e).then((function(n){var o=n.code,a=n.data;o===s.SUCCESS?de(t.onSuccess,a):(ee.warn("getUserStatus ->code:".concat(o,",useerId:").concat(e)),ue(t.onError,o))}))}),"getUserStatus",t)},e.prototype.addToBlacklist=function(e,t){var n=this;l("userId",e,p.STRING),l("callback",t,p.CALLBACK),ee.info("addToBlacklist ->userId:".concat(e)),this.assertCPPMode((function(){n._context.addToBlacklist(e).then((function(n){n===s.SUCCESS?de(t.onSuccess):(ee.warn("addToBlacklist ->code:".concat(n,",useerId:").concat(e)),ue(t.onError,n))}))}),"addToBlacklist",t)},e.prototype.removeFromBlacklist=function(e,t){var n=this;l("userId",e,p.STRING),l("callback",t,p.CALLBACK),ee.info("removeFromBlacklist ->userId:".concat(e)),this.assertCPPMode((function(){n._context.removeFromBlacklist(e).then((function(n){n===s.SUCCESS?de(t.onSuccess):(ee.warn("removeFromBlacklist ->code:".concat(n,",useerId:").concat(e)),ue(t.onError,n))}))}),"removeFromBlacklist",t)},e.prototype.getBlacklist=function(e){var t=this;l("callback",e,p.CALLBACK),this.assertCPPMode((function(){t._context.getBlacklist().then((function(t){var n=t.code,o=t.data;n===s.SUCCESS?de(e.onSuccess,o):(ee.warn("getBlacklist ->code:".concat(n)),ue(e.onError,n))}))}),"getBlacklist",e)},e.prototype.getBlacklistStatus=function(e,t){var n=this;l("userId",e,p.STRING),l("callback",t,p.CALLBACK),ee.info("getBlacklistStatus ->userId:".concat(e)),this.assertCPPMode((function(){n._context.getBlacklistStatus(e).then((function(n){var o=n.code,a=n.data;o===s.SUCCESS?de(t.onSuccess,a):(ee.warn("getBlacklistStatus ->code:".concat(o,",userId:").concat(e)),ue(t.onError,o))}))}),"getBlacklistStatus",t)},e.prototype.insertMessage=function(e,t,n,o,a){var s=this;void 0===a&&(a={}),l("conversationType",e,p.NUMBER,!0),l("targetId",t,p.STRING,!0),l("content.senderUserId",n.senderUserId,p.STRING,!0),l("callback",o,p.CALLBACK),ee.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={}),l("conversationType",e,p.NUMBER,!0),l("targetId",t,p.STRING,!0),l("timestamp",n,p.NUMBER,!0),l("count",o,p.NUMBER,!0),l("callback",a,p.CALLBACK),l("options.order",s.order,p.NUMBER),this.assertCPPMode((function(){c._defaultChannelClient.getRemoteHistoryMessages(e,t,n,o,a,s)}),"getRemoteHistoryMessages",a)},e.prototype.deleteLocalMessages=function(e,t,n,o){var a=this;l("messageIds",n,p.ARRAY,!0),l("callback",o,p.CALLBACK),ee.info("deleteLocalMessages ->messageIds:".concat(n)),this.assertCPPMode((function(){a._context.deleteMessages(n).then((function(e){e===s.SUCCESS?de(o.onSuccess,!0):(ee.warn("deleteLocalMessages ->code:".concat(e,",messageIds:").concat(n)),ue(o.onError,e))}))}),"deleteLocalMessages",o)},e.prototype.deleteLocalMessagesByTimestamp=function(e,t,n,o,a){var s=this;l("conversationType",e,p.NUMBER,!0),l("targetId",t,p.STRING,!0),l("timestamp",n,p.NUMBER,!0),l("cleanSpace",o,p.BOOLEAN),l("callback",a,p.CALLBACK),this.assertCPPMode((function(){s._defaultChannelClient.deleteLocalMessagesByTimestamp(e,t,n,o,a)}),"deleteLocalMessagesByTimestamp",a)},e.prototype.clearMessages=function(e,t,n){var o=this;l("conversationType",e,p.NUMBER,!0),l("targetId",t,p.STRING,!0),l("callback",n,p.CALLBACK),this.assertCPPMode((function(){o._defaultChannelClient.clearMessages(e,t,n)}),"clearMessages",n)},e.prototype.getMessage=function(e,t){var n=this;l("callback",t,p.CALLBACK),this.assertCPPMode((function(){n._context.getMessage(e).then((function(n){var o=n.code,a=n.data;o===s.SUCCESS?de(t.onSuccess,re(a)):(ee.warn("getMessage ->code:".concat(o,",messageId:").concat(e)),ue(t.onError,o))}))}),"getMessage",t)},e.prototype.setMessageSentStatus=function(e,t,n){var o=this;l("messageId",e,p.NUMBER,!0),l("sentStatus",t,p.NUMBER,!0),ee.info("setMessageSentStatus ->messageId:".concat(e,",sentStatus:").concat(t)),this.assertCPPMode((function(){o._context.setMessageSentStatus(e,t).then((function(t){t===s.SUCCESS?de(n.onSuccess,!0):(ee.warn("setMessageSentStatus ->code:".concat(t,",messageId:").concat(e)),ue(n.onError,t))}))}),"setMessageSentStatus",n)},e.prototype.setMessageReceivedStatus=function(e,t,n){var o=this;l("messageId",e,p.NUMBER,!0),l("receivedStatus",t,p.NUMBER,!0),ee.info("setMessageReceivedStatus ->messageId:".concat(e,",receivedStatus:").concat(t)),this.assertCPPMode((function(){o._context.setMessageReceivedStatus(e,t).then((function(t){t===s.SUCCESS?de(n.onSuccess,!0):(ee.warn("setMessageReceivedStatus ->code:".concat(t,",messageId:").concat(e)),ue(n.onError,t))}))}),"setMessageReceivedStatus",n)},e.prototype.setMessageContent=function(e,t,n){var o=this;l("messageId",e,p.NUMBER,!0),l("objectName",n,p.ONLY_STRING,!0),ee.info("setMessageContent ->messageId:".concat(e,",objectName:").concat(n)),this.assertCPPMode((function(){o._context.setMessageContent(e,t,n)}),"setMessageContent")},e.prototype.setMessageSearchField=function(e,t,n){var o=this;l("messageId",e,p.NUMBER,!0),l("searchFiles",n,p.STRING,!0),ee.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;l("keyword",e,p.STRING,!0),l("callback",t,p.CALLBACK),l("conversationTypes",n,p.ARRAY),l("customMessageType",o,p.ARRAY),this.assertCPPMode((function(){a._defaultChannelClient.searchConversationByContent(e,t,n,o)}),"searchConversationByContent",t)},e.prototype.searchMessageByContent=function(e,t,n,o,a,s,c){var r=this;l("conversationType",e,p.NUMBER,!0),l("targetId",t,p.STRING,!0),l("keyword",n,p.STRING,!0),l("timestamp",o,p.NUMBER),l("count",a,p.NUMBER),l("total",s,p.NUMBER),l("callback",c,p.CALLBACK),this.assertCPPMode((function(){r._defaultChannelClient.searchMessageByContent(e,t,n,o,a,s,c)}),"searchMessageByContent",c)},e.prototype.getUnreadMentionedMessages=function(e,t){return this._isCPPMode?(l("conversationType",e,p.NUMBER,!0),l("targetId",t,p.STRING,!0),this._defaultChannelClient.getUnreadMentionedMessages(e,t)):(ee.error("getUnreadMentionedMessages method is not supported in a browser!"),null)},e.prototype.clearUnreadCountByTimestamp=function(e,t,n,o){var a=this;l("conversationType",e,p.NUMBER,!0),l("targetId",t,p.STRING,!0),l("timestamp",n,p.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;l("conversationType",e,p.NUMBER,!0),l("targetId",t,p.STRING,!0),this.assertCPPMode((function(){o._defaultChannelClient.getConversationNotificationStatus(e,t,n)}),"getConversationNotificationStatus",n)},e.prototype.getServerTime=function(){return this._context.getServerTime()},e.prototype.getRTCUserInfoList=function(e,t){ee.info("getRTCUserInfoList ->roomId:".concat(e.id)),this._context.getRTCUserInfoList(e.id).then((function(n){var o=n.code,a=n.data;if(o!==s.SUCCESS)ee.warn("getRTCUserInfoList ->code:".concat(o,",roomId:").concat(e.id)),t.onError(o);else{var c=null==a?void 0:a.users;t.onSuccess(c)}})).catch((function(n){ee.warn("getRTCUserInfoList ->error:".concat(n,",roomId:").concat(e.id)),t.onError(n)}))},e.prototype.getRTCUserList=function(e,t){ee.info("getRTCUserList ->roomId:".concat(e.id)),this._context.getRTCUserList(e.id).then((function(n){var o=n.code,a=n.data;o!==s.SUCCESS?(ee.warn("getRTCUserList ->code:".concat(o,",roomId:").concat(e.id)),t.onError(o)):t.onSuccess(a)})).catch((function(n){ee.warn("getRTCUserList ->error:".concat(n,",roomId:").concat(e.id)),t.onError(n)}))},e.prototype.setRTCUserInfo=function(e,t,n){ee.info("setRTCUserInfo ->roomId:".concat(e.id,",info:").concat(JSON.stringify(t||{}))),this._context.setRTCUserInfo(e.id,t.key,t.value).then((function(o){o!==s.SUCCESS?(ee.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){ee.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){ee.info("removeRTCUserInfo ->roomId:".concat(e.id,"keys:").concat(t.keys)),this._context.removeRTCUserInfo(e.id,t.keys).then((function(t){t!==s.SUCCESS?(ee.warn("removeRTCUserInfo ->code:".concat(t,",roomId:").concat(e.id)),n.onError(t)):n.onSuccess(!0)})).catch((function(t){ee.warn("removeRTCUserInfo ->error:".concat(t,",roomId:").concat(e.id)),n.onError(t)}))},e.prototype.getRTCRoomInfo=function(e,t){ee.info("getRTCRoomInfo ->roomId:".concat(e.id)),this._context.getRTCRoomInfo(e.id).then((function(n){var o=n.code,a=n.data;o!==s.SUCCESS?(ee.warn("getRTCRoomInfo ->code:".concat(o,",roomId:").concat(e.id)),t.onError(o)):t.onSuccess(a)})).catch((function(n){ee.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){ee.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!==s.SUCCESS?(ee.warn("joinRTCRoom ->code:".concat(o,",roomId:").concat(e.id)),t.onError(o)):t.onSuccess(a)})).catch((function(n){ee.warn("joinRTCRoom ->error:".concat(n,",roomId:").concat(e.id)),t.onError(n)}))},e.prototype.quitRTCRoom=function(e,t){ee.info("quitRTCRoom ->roomId:".concat(e.id)),this._context.quitRTCRoom(e.id).then((function(n){n!==s.SUCCESS?(ee.warn("quitRTCRoom ->code:".concat(n,",roomId:").concat(e.id)),t.onError(n)):t.onSuccess(!0)})).catch((function(n){ee.warn("quitRTCRoom ->error:".concat(n,",roomId:").concat(e.id)),t.onError(n)}))},e.prototype.RTCPing=function(e,t){ee.info("RTCPing ->roomId:".concat(e.id));var n=e.mode||0;this._context.rtcPing(e.id,n).then((function(n){n!==s.SUCCESS?(ee.warn("RTCPing ->code:".concat(n,",roomId:").concat(e.id)),t.onError(n)):t.onSuccess(!0)})).catch((function(n){ee.warn("RTCPing ->error:".concat(n,",roomId:").concat(e.id)),t.onError(n)}))},e.prototype.setRTCData=function(e,t,n,o,a,c,r){ee.info("setRTCData ->roomId:".concat(e,",key:").concat(t)),this._context.setRTCData(e,t,n,o,a,r).then((function(t){t!==s.SUCCESS?(ee.warn("setRTCData ->code:".concat(t,",roomId:").concat(e)),c.onError(t)):c.onSuccess(!0)})).catch((function(t){ee.warn("setRTCData ->error:".concat(t,",roomId:").concat(e)),c.onError(t)}))},e.prototype.getRTCData=function(e,t,n,o,a){ee.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!==s.SUCCESS?(ee.warn("getRTCData ->code:".concat(n,",roomId:").concat(e)),a.onError(n)):a.onSuccess(o)})).catch((function(t){ee.warn("setRTCUserInfo ->error:".concat(t,",roomId:").concat(e)),a.onError(t)}))},e.prototype.removeRTCData=function(e,t,n,o,a,c){ee.info("removeRTCData ->roomId:".concat(e,",keys:").concat(t)),this._context.removeRTCData(e,t,n,o,c).then((function(t){t!==s.SUCCESS?(ee.warn("removeRTCData ->code:".concat(t,",roomId:").concat(e)),a.onError(t)):a.onSuccess(!0)})).catch((function(t){ee.warn("removeRTCData ->error:".concat(t,",roomId:").concat(e)),a.onError(t)}))},e.prototype.setRTCUserData=function(e,t,n,o,a,s){this.setRTCData(e,t,n,o,S.PERSON,a,s)},e.prototype.setRTCUserTotalRes=function(e,t,n,o,a){ee.info("setRTCUserTotalRes ->roomId:".concat(e)),this._context.setRTCTotalRes(e,t,n,o).then((function(t){t!==s.SUCCESS?(ee.warn("setRTCUserTotalRes ->code:".concat(t,",roomId:").concat(e)),a.onError(t)):a.onSuccess(!0)})).catch((function(t){ee.warn("setRTCUserTotalRes ->error:".concat(t,",roomId:").concat(e)),a.onError(t)}))},e.prototype.getRTCUserData=function(e,t,n,o){this.getRTCData(e,t,n,S.PERSON,o)},e.prototype.removeRTCUserData=function(e,t,n,o,a){this.removeRTCData(e,t,n,S.PERSON,o,a)},e.prototype.setRTCRoomData=function(e,t,n,o,a,s){this.setRTCData(e,t,n,o,S.ROOM,a,s)},e.prototype.getRTCRoomData=function(e,t,n,o){this.getRTCData(e,t,n,S.ROOM,o)},e.prototype.removeRTCRoomData=function(e,t,n,o,a){this.removeRTCData(e,t,n,S.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){ee.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!==s.SUCCESS?(ee.warn("getRTCToken ->code:".concat(o,",roomId:").concat(e.id)),t.onError(o)):t.onSuccess(a)})).catch((function(n){ee.warn("getRTCToken ->error:".concat(n,",roomId:").concat(e.id)),t.onError(n)}))},e.prototype.setRTCState=function(e,t,n){ee.info("setRTCState ->roomId:".concat(e.id)),this._context.setRTCState(e.id,t.report).then((function(t){t!==s.SUCCESS?(ee.warn("setRTCState ->code:".concat(t,",roomId:").concat(e.id)),n.onError(t)):n.onSuccess(!0)})).catch((function(t){ee.warn("setRTCState ->error:".concat(t,",roomId:").concat(e.id)),n.onError(t)}))},e}(),Ie=[],Re=[],Me={message:function(e){Ie.forEach((function(t){return t(re(e))}))},status:function(e){Re.forEach((function(t){return t(e)}))}},ye=1;m.add("imlib-v2-adapter","5.5.1");var ve,Te={init:function(e,t,n){void 0===n&&(n={}),l("appkey",e,p.STRING,!0),ee.setLogLevel(n.logLevel),ee.setLogStdout(n.logStdout),ee.info("RongIMLib Version: ".concat("5.5.1",", Commit: ").concat("70d3b5ba00858e4afab4a3c616424ad5879a8131",",appkey:").concat(e));var o=null==n?void 0:n.connectionType;o?I.WEBSOCKET!==o&&I.COMET!==o&&(ee.warn("RongIMLib connectionType must be ".concat(I.WEBSOCKET," or ").concat(I.COMET)),o=I.WEBSOCKET):o=I.WEBSOCKET,c.info(r.A_INIT_O,{appkey:e,navigators:n.navi?[n.navi]:[],connectionType:o,logLevel:n.logLevel,typingExpireTime:n.typingExpireTime}),le=R.init(Z,{appkey:e,apiVersion:"5.5.1",navigators:n.navi?[n.navi]:[],miniCMPProxy:[],connectionType:o,logLevel:n.logLevel,logStdout:n.logStdout,typingExpireTime:n.typingExpireTime,indexDBSwitch:n.indexDBSwitch,checkCA:n.checkCA}),ye=Math.min(15,Math.max(n.readReceiptTimeout||1,1)),fe=new me(le,{readReceiptTimeout:ye})},getInstance:function(){return fe},setConnectionStatusListener:function(e){var t=c.ID();le.assignWatcher({connectionState:function(n){c.info(r.A_CONNECT_S,{status:n},{traceId:t}),ne.clear(),e.onChanged(n)}})},setOnReceiveMessageListener:function(e){le.assignWatcher({message:function(t,n,o){try{var a=re(t),s=le.getCurrentUserId(),i=le.getConnectedTime();ie(a,s,i,ye),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=se.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,se.set(r,i));s.receiptMessageDic[t]=d,e.content=s}return e}(a,s,i,ye),f()||ne.set(t),c.info(r.A_PULL_MSG_O,{message:t.messageUId}),e.onReceived(a,void 0,o)}catch(e){ee.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){ee.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){ee.error("setMessageExpansionListener ->error:".concat(e))}}})},setTagListener:function(e){le.assignWatcher({tag:function(){e.onChanged()}})},setConversationTagListener:function(e){le.assignWatcher({conversationTagChanged:function(){e.onChanged()}})},setPullOffLineFinished:function(e){le.assignWatcher({pullFinished:function(){e.onFinished()}})},setTypingStatusListener:function(e){le.assignWatcher({typingState:function(t){e.onChanged(t)}})},setMessageBlockedListener:function(e){le.assignWatcher({messageBlocked:function(t){e.onReceived(t)}})},setChatRoomStatusListener:function(e){le.assignWatcher({chatroomState:function(t){e.onChanged(t)}})},connect:function(e,t){return N(this,void 0,void 0,(function(){var n,o,a;return _(this,(function(i){switch(i.label){case 0:return n=c.ID(),c.info(r.A_CONNECT_T,{token:e,reconnectKickEnable:!1},{traceId:n}),ee.info("connect ->token:".concat(e)),[4,le.connect(e,!1,!1,n)];case 1:return o=i.sent(),(o.code===s.SUCCESS?c.info:c.warn)(r.A_CONNECT_R,{code:o.code,userId:o.userId},{traceId:n}),o.code===s.SUCCESS?(t.onSuccess(o.userId),a=new Date(le.getConnectedTime()-1e3*ye*60*60*24).getTime(),se.getKeys().forEach((function(e){if(/SENT$/.test(e)){var t=se.get(e).dealtime;t&&a-t>0&&se.remove(e)}else if(/RECEIVED$/.test(e)){var n=se.get(e),o=Object.keys(n).length;Object.keys(n).forEach((function(e){var t=n[e].dealtime;t&&a-t>0&&delete n[e]})),Object.keys(n).length!==o&&(0===n.length?se.remove(e):se.set(e,n))}}))):o.code===s.RC_CONN_USER_OR_PASSWD_ERROR?(ee.warn("connect ->code:".concat(o.code,",token:").concat(e)),t.onTokenIncorrect()):(ee.warn("connect ->code:".concat(o.code,",token:").concat(e)),t.onError(o.code)),[2]}}))}))},reconnect:function(e,t){var n=c.ID();c.info(r.A_RECONNECT_T,{},{traceId:n}),le.reconnect().then((function(t){(t.code===s.SUCCESS?c.info:c.warn)(r.A_RECONNECT_R,{code:t.code,userId:t.userId},{traceId:n}),t.code===s.SUCCESS?e.onSuccess(t.userId):(ee.warn("reconnect ->code:".concat(t.code)),e.onError(t.code))})).catch((function(t){e.onError(t)}))},RegisterMessage:{},RegisterMessageTypeMapping:ae,getMessageObjectName:function(e){var t=U(U({},oe),ae);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,le.registerMessageType(t,n.isPersited,n.isCounted,o)},createLogger:function(e,t){return/^(RC)/.test(e)?(ee.error("Tag error. Tags that start with RC are used internally by the SDK !"),null):["IM","RTC"].includes(t)?new i(e,t,"A"):(ee.error("The parameter type must be one of IM, or RTC !"),null)},messageWatch:function(e){var t=this;Ie.push((function(n){var o,a;ee.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){ee.error("messageWatch ->error:".concat(e))}})),le.assignWatcher({rtcInnerWatcher:Me})},statusWatch:function(e){Re.push((function(t){ee.info("statusWatch ->status:".concat(t));try{e(t)}catch(e){ee.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:{}},Ee=function(e,t,n){this.type=e,this.userIdList=t,this.mentionedContent=n},Ue=function(e,t){this.isCounted=e,this.isPersited=t},Ne=Ce("TextMessage","RC:TxtMsg"),_e=Ce("LocationMessage","RC:LBSMsg"),Ae=Ce("TypingStatusMessage","RC:TypSts"),Le=Ce("ImageMessage","RC:ImgMsg"),we=Ce("RichContentMessage","RC:ImgTextMsg"),Be=Ce("VoiceMessage","RC:VcMsg"),xe=Ce("HQVoiceMessage","RC:HQVCMsg"),ke=Ce("FileMessage","RC:FileMsg"),be=Ce("SightMessage","RC:SightMsg"),Pe=Ce("GIFMessage","RC:GIFMsg"),Oe=Ce("ReadReceiptMessage","RC:ReadNtf"),De=Ce("ReadReceiptRequestMessage","RC:RRReqMsg"),Ge=Ce("RCCombineMessage","RC:CombineMsg"),Ke=function(e,t,n,o,a,s,c,r,i,d,u,g,C,f,l,p,h,S){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=C,this.receivedTime=f,this.canIncludeExpansion=l,this.expansion=p,this.receiptResponse=h,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"}(ve||(ve={}));var Fe,He=Ce("AcceptMessage","RC:VCAccept"),We=Ce("RingingMessage","RC:VCRinging"),Ve=Ce("SummaryMessage","RC:VCSummary"),qe=Ce("HungupMessage","RC:VCHangup"),je=Ce("InviteMessage","RC:VCInvite"),Je=Ce("MediaModifyMessage","RC:VCModifyMedia"),Ye=Ce("MemberModifyMessage","RC:VCModifyMem"),Qe=Ce("lastMessageSendTime","RC:SRSMsg"),Xe=Ce("ReferenceMessage","RC:ReferenceMsg"),ze=Ce("PublicServiceRichContentMessage","RC:PSImgTxtMsg"),$e=Ce("PublicServiceMultiRichContentMessage","RC:PSMultiImgTxtMsg");!function(e){e[e.ALL=1]="ALL",e[e.PART=2]="PART"}(Fe||(Fe={}));var Ze=Fe,et=M;window&&(window.RongIMClient=Te);export{He as AcceptMessage,ge as BaseMessage,he as ChannelClient,et as ConnectionState,ke as FileMessage,Pe as GIFMessage,E as GetChatRoomType,xe as HQVoiceMessage,qe as HungupMessage,me as IMClient,Le as ImageMessage,je as InviteMessage,_e as LocationMessage,Je as MediaModifyMessage,Ye as MemberModifyMessage,Ee as MentionedInfo,Ze as MentionedType,Ke as Message,Ue as MessageTag,$e as PublicServiceMultiRichContentMessage,ze as PublicServiceRichContentMessage,Ge as RCCombineMessage,Oe as ReadReceiptMessage,De as ReadReceiptRequestMessage,pe as ReadReceiptResponseMessage,Xe as ReferenceMessage,we as RichContentMessage,We as RingingMessage,Te as RongIMClient,T as SentStatus,be as SightMessage,Ve as SummaryMessage,Qe as SyncReadStatusMessage,Ne as TextMessage,Ae as TypingStatusMessage,ve as VoIPMediaType,Be as VoiceMessage};
|
|
1
|
+
import{WebSocketChannel as e,CometChannel as t,NetworkType as n,HttpMethod as o,appendUrl as a,ErrorCode as s,logger as c,LogTagId as r,Logger as i,SEND_MESSAGE_TYPE_OPTION as d,AppStorage as u,ReceivedStatus as g,MessageDirection as f,usingCppEngine as C,assert as l,AssertRules as p,todo as h,RTCApiType as S,VersionManage as m,CONNECTION_TYPE as I,APIContext as R,ConnectResultCode as y}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 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,T=M;!function(e){e[e.NONE=0]="NONE",e[e.SQQUENCE=1]="SQQUENCE",e[e.REVERSE=2]="REVERSE"}(v||(v={}));var E=v,U=function(){return U=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},U.apply(this,arguments)};function N(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 _(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 A(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 L=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))},w=L();var B={tag:"browser",httpReq:function(e){var t=e.method||o.GET,n=e.timeout||6e4,s=e.headers,c=e.query,r=e.body,i=a(e.url,c);return new Promise((function(e){var o,a=(o="undefined"!=typeof XMLHttpRequest&&"withCredentials"in new XMLHttpRequest,"undefined"!=typeof XMLHttpRequest&&o?new XMLHttpRequest:"undefined"!=typeof XDomainRequest?new XDomainRequest:new ActiveXObject("Microsoft.XMLHTTP")),c="[object XDomainRequest]"===Object.prototype.toString.call(a);if(a.open(t,i),s&&a.setRequestHeader)for(var d in s)a.setRequestHeader(d,s[d]);if(c){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 u="object"==typeof r?JSON.stringify(r):r;a.send(u)}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,isSupportSocket:function(){return"undefined"!=typeof WebSocket},useNavi:!0,connectPlatform:"",isFromUniapp:w,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()}}},createDataChannel:function(n,o){return this.isSupportSocket()&&"websocket"===o?new e(this,n):new t(this,n)},getNetworkType:function(){var e=navigator.connection||navigator.mozConnection||navigator.webkitConnection,t=e.type,o=e.effectiveType,a=t||o||n.UNKONWN;return new Promise((function(e){e(a)}))}},x=L(),k=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var o=c.ID();try{return c.info(r.A_CALLBACK_O,{func_name:e,source:"wechat"},{traceId:o}),wx[e].apply(wx,t)}catch(t){c.error(r.A_CALLBACK_E,{func_name:e,source:"wechat"},{traceId:o}),console.error(t)}}},b={setItem:k("setStorageSync"),getItem:k("getStorageSync"),removeItem:k("removeStorageSync"),clear:k("clearStorageSync")},P={tag:"wechat",httpReq:function(e){var t=e.method||o.GET,n=e.timeout||6e4,c=e.headers,r=e.query,i=e.body,d=a(e.url,r);return new Promise((function(e){wx.request({url:d,method:t,header:c,timeout:n,data:i,success:function(t){e({data:t.data,status:t.statusCode})},fail:function(){e({status:s.RC_HTTP_REQ_FAIL})}})}))},localStorage:b,sessionStorage:b,isSupportSocket:function(){return!0},useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:x,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})}}},createDataChannel:function(n,o){return"websocket"===o?new e(this,n):new t(this,n)},getNetworkType:function(){return new Promise((function(e){wx.getNetworkType({success:function(t){var n=t.networkType;e(n)},fail:function(){e(n.UNKONWN)}})}))}},O=L(),D=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var o=c.ID();try{if(c.info(r.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){c.error(r.A_CALLBACK_E,{func_name:e,source:"alipay"},{traceId:o}),console.error(t)}}},G={setItem:D("setStorageSync"),getItem:D("getStorageSync"),removeItem:D("removeStorageSync"),clear:D("clearStorageSync")},K={tag:"alipay",httpReq:function(e){var t=e.method||o.GET,n=e.timeout||6e4,c=e.headers,r=e.query,i=e.body,d=a(e.url,r),u=e.dataType||"json";return new Promise((function(e){my.request({url:d,method:t,headers:c,timeout:n,data:i,dataType:u,success:function(t){e({data:t.data,status:t.status})},fail:function(){e({status:s.RC_HTTP_REQ_FAIL})}})}))},localStorage:G,sessionStorage:G,isSupportSocket:function(){return!0},useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:O,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()}}},createDataChannel:function(n,o){return"websocket"===o?new e(this,n):new t(this,n)},getNetworkType:function(){return new Promise((function(e){my.getNetworkType({success:function(t){var n=t.networkType;e(n)},fail:function(){e(n.UNKONWN)}})}))}},F=L(),H=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var o=c.ID();try{return c.info(r.A_CALLBACK_O,{func_name:e,source:"toutiao"},{traceId:o}),tt[e].apply(tt,t)}catch(t){c.error(r.A_CALLBACK_E,{func_name:e,source:"toutiao"},{traceId:o}),console.error(t)}}},W={setItem:H("setStorageSync"),getItem:H("getStorageSync"),removeItem:H("removeStorageSync"),clear:H("clearStorageSync")},V={tag:"toutiao",isSupportSocket:function(){return!0},useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:F,localStorage:W,sessionStorage:W,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){console.log("调用成功",e.data);var n=(null==e?void 0:e.data)||{},o={data:JSON.stringify(n),status:e.statusCode};t(o)},fail:function(e){t({status:s.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})}}},createDataChannel:function(n,o){return"websocket"===o?new e(this,n):new t(this,n)},getNetworkType:function(){return new Promise((function(e){tt.getNetworkType({success:function(t){var n=t.networkType;e(n)},fail:function(){e(n.UNKONWN)}})}))}},q=L(),j=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var o=c.ID();try{return c.info(r.A_CALLBACK_O,{func_name:e,source:"baidu"},{traceId:o}),swan[e].apply(swan,t)}catch(t){c.error(r.A_CALLBACK_E,{func_name:e,source:"baidu"},{traceId:o}),console.error(t)}}},J={setItem:j("setStorageSync"),getItem:j("getStorageSync"),removeItem:j("removeStorageSync"),clear:j("clearStorageSync")},Y={tag:"baidu",isSupportSocket:function(){return!0},useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:q,localStorage:J,sessionStorage:J,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){console.log("调用成功",e.data);var n=(null==e?void 0:e.data)||{},o={data:JSON.stringify(n),status:e.statusCode};t(o)},fail:function(e){t({status:s.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})}}},createDataChannel:function(n,o){return"websocket"===o?new e(this,n):new t(this,n)},getNetworkType:function(){return N(this,void 0,void 0,(function(){return _(this,(function(e){return[2,new Promise((function(e){swan.getNetworkType({success:function(t){var n=t.networkType;e(n)},fail:function(){e(n.UNKONWN)}})}))]}))}))}},Q=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var o=c.ID();try{return c.info(r.A_CALLBACK_O,{func_name:e,source:"uniapp"},{traceId:o}),uni[e].apply(uni,t)}catch(t){c.error(r.A_CALLBACK_E,{func_name:e,source:"uniapp"},{traceId:o}),console.error(t)}}},X={setItem:Q("setStorageSync"),getItem:Q("getStorageSync"),removeItem:Q("removeStorageSync"),clear:Q("clearStorageSync")},z={tag:"uniapp",httpReq:function(e){var t=e.method||o.GET,n=e.timeout||6e4,c=e.headers,r=e.query,i=e.body,d=a(e.url,r);return new Promise((function(e){uni.request({url:d,method:t,header:c,timeout:n,data:i,success:function(t){e({data:t.data,status:t.statusCode})},fail:function(){e({status:s.RC_HTTP_REQ_FAIL})}})}))},localStorage:X,sessionStorage:X,isSupportSocket:function(){return!0},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})}}},createDataChannel:function(n,o){return"websocket"===o?new e(this,n):new t(this,n)},getNetworkType:function(){return new Promise((function(e){uni.getNetworkType({success:function(t){var n=t.networkType;e(n)},fail:function(){e(n.UNKONWN)}})}))}},$=function(e){return e&&e.request&&e.getSystemInfo},Z="undefined"!=typeof uni&&$(uni)?function(){switch(process.env.VUE_APP_PLATFORM){case"app-plus":return z;case"mp-baidu":return Y;case"mp-toutiao":return V;case"mp-alipay":return K;case"mp-weixin":return P;default:return B}}():"undefined"!=typeof my&&$(my)?K:"undefined"!=typeof tt&&$(tt)?V:"undefined"!=typeof swan&&$(swan)?Y:"undefined"!=typeof wx&&$(wx)?P:B,ee=new i("RCIM");function te(e,t,n){return"".concat(e,"_").concat(t,"_").concat(n)}var ne=function(){function e(){}return e.set=function(t){if(d[t.messageType]&&d[t.messageType].isPersited){var n=e.get(t.conversationType,t.targetId,t.channelId||"");if(!n||n.sentTime<t.sentTime){var o=te(t.conversationType,t.targetId,t.channelId||"");e.map[o]=t}}},e.get=function(t,n,o){var a=te(t,n,o);return e.map[a]||null},e.remove=function(t,n,o){var a=te(t,n,o);delete e.map[a]},e.clear=function(){e.map={}},e.map={},e}(),oe={"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"},ae={},se=new u(Z,"API-V2");function ce(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(!C()){var d=ne.get(n,o,t||"");s?d&&s.sentTime<d.sentTime&&(s=d):s=d}var u=s?re(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 re(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,u=e.receivedStatus,f=e.receivedTime,C=e.canIncludeExpansion,l=e.disableNotification,p=e.expansion,h=e.messageId,S=e.sentStatus,m=e.channelId,I=e.readReceiptInfo,R=e.pushConfig,y="";return s in oe?y=oe[s]:s in ae?y=ae[s]:(a={message:{content:a,objectName:s},messageName:"UnknownMessage"},y="UnknownMessage"),u||(u=g.UNREAD),void 0===h&&(h=~~(16777215*Math.random())),{channelId:m||"",conversationType:t,targetId:n,senderUserId:o,content:a,messageType:y,messageUId:c,messageDirection:r,offLineMessage:i,sentTime:d,receivedStatus:u,receivedTime:f,objectName:s,messageId:h,sentStatus:S||T.SENT,disableNotification:l,canIncludeExpansion:C,expansion:p,readReceiptInfo:I,pushConfig:R}}function ie(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===f.SEND){var r="".concat(t).concat(e.content.messageUId,"SENT");se.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=se.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,se.set(i,d));else{var u={uIds:[e.content.messageUId],dealtime:e.sentTime,isResponse:!1};d[e.senderUserId]=u,se.set(i,d)}else{var g={};g[e.senderUserId]={uIds:[e.content.messageUId],dealtime:e.sentTime,isResponse:!1},se.set(i,g)}}}function de(e,t,n){try{e(t,n)}catch(e){ee.error(e)}}function ue(e,t,n){try{e(t,n)}catch(e){ee.error(e)}}var ge=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 fe(e,t,n,o){void 0===n&&(n=!0),void 0===o&&(o=!0);var a=function(a){return new ge(e,t,a,n,o)};return a.MessageType=e,a.ObjectName=t,a}var Ce,le,pe=fe("ReadReceiptResponseMessage","RC:RRRspMsg"),he=function(){function e(e,t,n,o){this._context=e,this.channelId=t,this._isCPPMode=n,this._readReceiptTimeout=o,this._storage=se,this._draftMap={}}return e.prototype.getConversationList=function(e,t,n){l("callback",e,p.CALLBACK),l("conversationTypes",t,p.ARRAY),l("count",n,p.NUMBER),this._context.getConversationList(n,void 0,0,0,this.channelId).then((function(n){var o=n.code,a=n.data,c=[];a=a||[],o===s.SUCCESS?(t?a.forEach((function(e){t.indexOf(e.conversationType)>-1&&c.push(ce(e))})):a.forEach((function(e){c.push(ce(e))})),de(e.onSuccess,c)):(ee.warn("getConversationList -> code:".concat(o)),ue(e.onError,o))}))},e.prototype.getConversation=function(e,t,n){var o=this;l("callback",n,p.CALLBACK),l("conversationType",e,p.NUMBER,!0),l("targetId",t,p.STRING,!0),ee.info("getConversation ->targetId:".concat(t,",conversationType:").concat(e)),N(o,void 0,void 0,(function(){var o,a,c;return _(this,(function(r){switch(r.label){case 0:return[4,this._context.getConversation(e,t,this.channelId)];case 1:return o=r.sent(),a=o.code,c=o.data,a!==s.SUCCESS?(ee.warn("getConversation ->code:".concat(a,",targetId:").concat(t)),n.onError(a),[2]):(n.onSuccess(c?ce(c):null),[2])}}))}))},e.prototype.removeConversation=function(e,t,n){var o=this;l("conversationType",e,p.NUMBER,!0),l("targetId",t,p.STRING,!0),l("callback",n,p.CALLBACK),ee.info("removeConversation ->targetId:".concat(t,",conversationType:").concat(e)),this._context.removeConversation(e,t,this.channelId).then((function(a){a===s.SUCCESS?(o._isCPPMode||ne.remove(e,t,o.channelId),de(n.onSuccess)):(ee.warn("removeConversation ->code:".concat(a,",targetId:").concat(t)),ue(n.onError,a))}))},e.prototype.saveTextMessageDraft=function(e,t,n){l("conversationType",e,p.NUMBER,!0),l("targetId",t,p.STRING,!0),l("draftText",n,p.STRING,!0),ee.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){l("conversationType",e,p.NUMBER,!0),l("targetId",t,p.STRING,!0),ee.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){l("conversationType",e,p.NUMBER,!0),l("targetId",t,p.STRING,!0),ee.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){l("callback",e,p.CALLBACK),ee.info("getTotalUnreadCount ->conversationTypes:".concat(t)),this._context.getTotalUnreadCount(this.channelId,t,n).then((function(t){var n=t.code,o=t.data;n===s.SUCCESS?de(e.onSuccess,o):(ee.warn("getTotalUnreadCount ->code:".concat(n)),ue(e.onError,n))}))},e.prototype.getUnreadCount=function(e,t,n){l("conversationType",e,p.NUMBER,!0),l("targetId",t,p.STRING,!0),l("callback",n,p.CALLBACK),ee.info("getUnreadCount ->targetId:".concat(t,",conversationType:").concat(e)),this._context.getUnreadCount(e,t,this.channelId).then((function(e){var o=e.code,a=e.data;o===s.SUCCESS?de(n.onSuccess,a):(ee.warn("getUnreadCount ->code:".concat(o,",targetId:").concat(t)),ue(n.onError,o))}))},e.prototype.clearConversations=function(e,t){ee.info("clearConversations -> conversationTypes:".concat(t)),this._isCPPMode?this._context.clearConversations(t,this.channelId).then((function(t){t===s.SUCCESS?de(e.onSuccess,!0):(ee.warn("clearConversations ->code:".concat(t)),ue(e.onError,t))})):ee.error("Method is only available in cppProtocol mode")},e.prototype.clearUnreadCount=function(e,t,n){l("conversationType",e,p.NUMBER,!0),l("targetId",t,p.STRING,!0),l("callback",n,p.CALLBACK),ee.info("clearUnreadCount ->targetId:".concat(t,",conversationType:").concat(e)),this._context.clearUnreadCount(e,t,this.channelId).then((function(e){e===s.SUCCESS?de(n.onSuccess,!0):(ee.warn("clearUnreadCount ->code:".concat(e,",targetId:").concat(t)),ue(n.onError,e))}))},e.prototype.clearAllUnreadCount=function(e){l("callback",e,p.CALLBACK),ee.info("clearUnreadCount ->"),this._context.clearAllUnreadCount().then((function(t){t===s.SUCCESS?de(e.onSuccess,!0):(ee.warn("clearUnreadCount ->code:".concat(t)),ue(e.onError,t))}))},e.prototype.getFirstUnreadMessage=function(e,t,n){l("conversationType",e,p.NUMBER,!0),l("targetId",t,p.STRING,!0),l("callback",n,p.CALLBACK),ee.info("getFirstUnreadMessage ->targetId:".concat(t,",conversationType:").concat(e)),this._context.getFirstUnreadMessage(e,t,this.channelId).then((function(e){e.code===s.SUCCESS?de(n.onSuccess,e.data?re(e.data):null):(ee.warn("getFirstUnreadMessage ->code:".concat(e.code,",targetId:").concat(t)),ue(n.onError,e.code))}))},e.prototype.setConversationStatus=function(e,t,n,o){l("conversationType",e,p.NUMBER,!0),l("targetId",t,p.STRING,!0),l("callback",o,p.CALLBACK),l("status",n,p.OBJECT,!0),ee.info("setConversationStatus ->targetId:".concat(t,",status:").concat(n));var a=n.isTop,c=n.notificationStatus;this._context.setConversationStatus(e,t,a,c,this.channelId).then((function(e){e===s.SUCCESS?de(o.onSuccess):(ee.warn("setConversationStatus ->code:".concat(e,",targetId:").concat(t)),ue(o.onError,e))}))},e.prototype.sendMessage=function(e,t,n,o,a,i,d,u){var C=this;l("conversationType",e,p.NUMBER,!0),l("targetId",t,p.STRING,!0),l("msg",n,p.OBJECT,!0),l("callback",o,p.CALLBACK),l("isMentioned",a,p.BOOLEAN),l("pushContent",i,p.ONLY_STRING),l("pushData",d,p.ONLY_STRING),l("options.userIds",null==u?void 0:u.userIds,p.ARRAY),l("options.isVoipPush",null==u?void 0:u.isVoipPush,p.BOOLEAN),l("options.disableNotification",null==u?void 0:u.disableNotification,p.BOOLEAN),l("options.canIncludeExpansion",null==u?void 0:u.canIncludeExpansion,p.BOOLEAN),l("options.expansion",null==u?void 0:u.expansion,p.OBJECT),l("options.pushConfig",null==u?void 0:u.pushConfig,p.OBJECT),l("options.resendMessageId",null==u?void 0:u.resendMessageId,p.NUMBER),ee.info("sendMessage ->targetId:".concat(t,",conversationType:").concat(e));var h=!(!(null==u?void 0:u.isStatusMessage)&&!(null==u?void 0:u.isStatus)),S=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,f=a.resendMessageId,C=[];if(t){var l=(n||{}).content.mentionedInfo;C=l.userIdList,o=l.type}return{mentionedType:o,mentionedUserIdList:C,directionalUserIdList:s,isVoipPush:c,disableNotification:r,isFilerWhiteBlacklist:i,expansion:d,canIncludeExpansion:u,pushConfig:g,messageId:f}}(u,a,n),m=Object.assign(n,U(U({isMentioned:a,pushContent:i,pushData:d},S),{messageType:n.objectName,channelId:this.channelId,isStatusMessage:h})),I=this._context.getCurrentUserId(),R=c.ID();c.info(r.A_SEND_MSG_T,{messageType:m.messageType,conversationType:e,targetId:t,channelId:this.channelId},{traceId:R}),this._context.sendMessage(e,t,m,o.onBefore,R).then((function(a){var i=a.code,d=a.data;if((i===s.SUCCESS?c.info:c.warn)(r.A_SEND_MSG_R,{code:i,messageUId:d?d.messageUId:"",messageId:d?d.messageId:""},{traceId:R}),i===s.SUCCESS){C._isCPPMode||ne.set(d);var l=re(d);ie(l,I,C._context.getConnectedTime(),C._readReceiptTimeout),de(o.onSuccess,l)}else ee.warn("sendMessage ->code:".concat(i,",targetId:").concat(t)),ue(o.onError,i,re({isMentioned:!!m.isMentioned,content:n.content,messageType:n.messageType,isPersited:n.isPersited,isCounted:n.isCounted,disableNotification:!!(null==u?void 0:u.disableNotification),canIncludeExpansion:!!(null==u?void 0:u.canIncludeExpansion),expansion:(null==u?void 0:u.expansion)||null,conversationType:e,targetId:t,senderUserId:I,messageUId:"",messageDirection:f.SEND,isOffLineMessage:!1,sentTime:(null==d?void 0:d.sentTime)||0,receivedTime:0,isStatusMessage:h,receivedStatus:g.UNREAD,messageId:null==d?void 0:d.messageId,sentStatus:T.FAILED}))}))},e.prototype.sendRecallMessage=function(e,t,n){var o=this;l("message.conversationType",e.conversationType,p.NUMBER,!0),l("message.targetId",e.targetId,p.STRING,!0),l("message.messageUId",e.messageUId,p.STRING,!0),l("message.sentTime",e.sentTime,p.NUMBER,!0),l("callback",t,p.CALLBACK),l("options.disableNotification",null==n?void 0:n.disableNotification,p.BOOLEAN),l("options.pushConfig",null==n?void 0:n.pushConfig,p.OBJECT),l("options.extra",null==n?void 0:n.extra,p.STRING);var a=e.conversationType,c=e.targetId,r=e.messageUId,i=e.sentTime;ee.info("sendRecallMessage ->targetId:".concat(c,",conversationType:").concat(a,",messageUId:").concat(r));var d=U({channelId:this.channelId},n);this._context.recallMessage(a,c,r,i,d).then((function(e){var n=e.code,a=e.data;n===s.SUCCESS?(o._isCPPMode||ne.set(a),de(t.onSuccess,re(a))):(ee.warn("sendRecallMessage ->code:".concat(n,",targetId:").concat(c,",messageUId:").concat(r)),ue(t.onError,n))}))},e.prototype.sendTypingStatusMessage=function(e,t,n,o){l("conversationType",e,p.NUMBER,!0),l("targetId",t,p.STRING,!0),l("typingContentType",n,p.STRING,!0),l("callback",o,p.CALLBACK),ee.info("sendTypingStatusMessage ->targetId:".concat(t,",conversationType:").concat(e));var a={messageType:"RC:TypSts",content:{typingContentType:n},isStatusMessage:!0,channelId:this.channelId},i=c.ID();c.info(r.A_SEND_MSG_T,{messageType:a.messageType,conversationType:e,targetId:t,channelId:a.channelId},{traceId:i}),this._context.sendMessage(e,t,a,void 0,i).then((function(e){var n=e.code,a=e.data;(n===s.SUCCESS?c.info:c.warn)(r.A_SEND_MSG_R,{code:n,messageUId:a?a.messageUId:"",messageId:a?a.messageId:""},{traceId:i}),n===s.SUCCESS?de(o.onSuccess,re(a)):(ee.warn("sendTypingStatusMessage ->code:".concat(n,",targetId:").concat(t)),ue(o.onError,n))}))},e.prototype.sendReceiptResponse=function(e,t,n){var o=this;ee.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 pe({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),de(n.onSuccess,e)},onError:function(e){ee.warn("sendReceiptResponse ->code:".concat(e,",targetId:").concat(t)),ue(n.onError,e)}})}),200)}else n.onSuccess(null)},e.prototype.sendReadReceiptMessage=function(e,t,n){l("messageUIds",e,p.ARRAY,!0),l("targetId",t,p.STRING,!0),ee.info("sendReadReceiptMessage ->targetId:".concat(t,",messageUIds:").concat(e));for(var o=0,a=e;o<a.length;o++){var c=a[o];l("messageUId",c,p.STRING)}this._context.sendReadReceiptMessage(t,e,this.channelId).then((function(o){var a=o.code;a===s.SUCCESS?n.onSuccess():(ee.warn("sendReadReceiptMessage ->code:".concat(a,",targetId:").concat(t,",messageUIds:").concat(e)),n.onError(a))})).catch((function(o){ee.warn("sendReadReceiptMessage ->code:".concat(o,",targetId:").concat(t,",messageUIds:").concat(e)),n.onError(o)}))},e.prototype.getMessageReader=function(e,t,n){l("messageUId",e,p.STRING,!0),l("targetId",t,p.STRING,!0),ee.info("getMessageReader ->targetId:".concat(t,",messageUId:").concat(e)),this._context.getMessageReader(t,e,this.channelId).then((function(o){var a=o.code,c=o.data;a===s.SUCCESS?n.onSuccess(c):(ee.warn("getMessageReader ->code:".concat(a,",targetId:").concat(t,",messageUId:").concat(e)),n.onError(a))})).catch((function(o){ee.warn("getMessageReader ->code:".concat(o,",targetId:").concat(t,",messageUId:").concat(e)),n.onError(o)}))},e.prototype.updateMessageExpansion=function(e,t,n){l("expansion",e,p.OBJECT,!0),l("message",t,p.OBJECT,!0);var o=t.conversationType,a=t.targetId,c=t.messageUId,r=t.canIncludeExpansion,i=t.expansion;ee.info("updateMessageExpansion ->targetId:".concat(a,",messageUId:").concat(c,",conversationType:").concat(o)),this._context.sendExpansionMessage({conversationType:o,targetId:a,messageUId:c,canIncludeExpansion:r,originExpansion:i,expansion:e,channelId:this.channelId}).then((function(e){var t=e.code;t===s.SUCCESS?de(n.onSuccess):(ee.warn("updateMessageExpansion ->code:".concat(t,",targetId:").concat(a,",messageUId:").concat(c)),ue(n.onError,t))}))},e.prototype.removeMessageExpansionForKey=function(e,t,n){l("keys",e,p.ARRAY,!0),l("message",t,p.OBJECT,!0);var o=t.conversationType,a=t.targetId,c=t.messageUId,r=t.canIncludeExpansion;ee.info("removeMessageExpansionForKey ->targetId:".concat(a,",messageUId:").concat(c,",conversationType:").concat(o)),this._context.sendExpansionMessage({conversationType:o,targetId:a,messageUId:c,canIncludeExpansion:r,keys:e,channelId:this.channelId}).then((function(e){var t=e.code;t===s.SUCCESS?de(n.onSuccess):(ee.warn("removeMessageExpansionForKey ->code:".concat(t,",targetId:").concat(a,",messageUId:").concat(c)),ue(n.onError,t))}))},e.prototype.getHistoryMessages=function(e,t,n,o,a,i,d){l("conversationType",e,p.NUMBER,!0),l("targetId",t,p.STRING,!0),l("timestamp",n,p.NUMBER,!0),l("count",o,p.NUMBER,!0),l("callback",a,p.CALLBACK,!0),l("order",d,p.NUMBER),ee.info("getHistoryMessages ->targetId:".concat(t,",conversationType:").concat(e,",timestamp:").concat(n));var u=c.ID();c.info(r.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===s.SUCCESS)if(o){var i=o.list,d=o.hasMore,g=[],f=i.map((function(e){return g.push(e.messageUId),re(e)}));c.info(r.A_GET_HISTORY_MSG_R,{code:n,messageUIds:g.join(",")},{traceId:u}),de(a.onSuccess,f,d)}else c.info(r.A_GET_HISTORY_MSG_R,{code:n,messageUIds:""},{traceId:u}),de(a.onSuccess,[],!1);else c.warn(r.A_GET_HISTORY_MSG_R,{code:n,messageUIds:""},{traceId:u}),ee.warn("getHistoryMessages ->code:".concat(n,",targetId:").concat(t)),ue(a.onError,n)}))},e.prototype.deleteRemoteMessages=function(e,t,n,o){var a=this;l("conversationType",e,p.NUMBER,!0),l("targetId",t,p.STRING,!0),l("messages",n,p.ARRAY,!0),l("callback",o,p.CALLBACK),ee.info("deleteRemoteMessages ->targetId:".concat(t,",conversationType:").concat(e)),this._context.deleteRemoteMessage(e,t,n,this.channelId).then((function(c){if(c===s.SUCCESS){if(!a._isCPPMode){var r=ne.get(e,t,a.channelId);r&&n.forEach((function(n){r.messageUId===n.messageUId&&ne.remove(e,t,a.channelId)}))}de(o.onSuccess)}else ee.warn("deleteRemoteMessages ->code:".concat(c,",targetId:").concat(t)),ue(o.onError,c)}))},e.prototype.clearRemoteHistoryMessages=function(e,t){l("param.conversationType",e.conversationType,p.NUMBER,!0),l("param.targetId",e.targetId,p.STRING,!0),l("param.timestamp",e.timestamp,p.NUMBER,!0),l("callback",t,p.CALLBACK);var n=e.conversationType,o=e.targetId,a=e.timestamp;ee.info("clearRemoteHistoryMessages ->targetId:".concat(o,",conversationType:").concat(n)),this._context.deleteRemoteMessageByTimestamp(n,o,a,this.channelId).then((function(e){e===s.SUCCESS?de(t.onSuccess):(ee.warn("clearRemoteHistoryMessages ->code:".concat(e)),ue(t.onError,e))}))},e.prototype.getConversationListWithAllChannel=function(e){l("callback",e,p.CALLBACK),this._context.getConversationListWithAllChannel().then((function(t){var n=t.code,o=t.data;n===s.SUCCESS?de(e.onSuccess,o.map(ce)):ue(e.onError,n)}))},e.prototype.getConversationListWithAllChannelByPage=function(e,t,n){l("callback",e,p.CALLBACK),l("index",t,p.NUMBER),l("limit",n,p.NUMBER),this._context.getConversationListWithAllChannelByPage(t,n).then((function(t){var n=t.code,o=t.data;n===s.SUCCESS?de(e.onSuccess,o.map(ce)):ue(e.onError,n)}))},e.prototype.insertMessage=function(e,t,n,o,a){void 0===a&&(a={});var c=n.senderUserId,r=n.objectName,i=n.content,d=n.messageDirection,u=n.messageUId,g=n.canIncludeExpansion,f=n.expansion,C=n.disableNotification,l=n.sentTime,p=n.sentStatus;ee.info("insertMessage ->targetId:".concat(t,",conversationType:").concat(e));var h=a.isUnread,S={senderUserId:c,messageType:r,content:i,messageDirection:d,sentTime:l,sentStatus:p,searchContent:a.searchContent,isUnread:h,messageUId:u,disableNotification:C,canIncludeExpansion:g,expansionMsg:JSON.stringify(f),channelId:this.channelId};this._context.insertMessage(e,t,S).then((function(e){var n=e.code,a=e.data;n===s.SUCCESS?de(o.onSuccess,re(a)):(ee.warn("insertMessage ->code:".concat(n,",targetId:").concat(t)),ue(o.onError,n))}))},e.prototype.deleteLocalMessagesByTimestamp=function(e,t,n,o,a){ee.info("deleteLocalMessagesByTimestamp ->targetId:".concat(t,",conversationType:").concat(e,",timestamp:").concat(n)),this._context.deleteMessagesByTimestamp(e,t,n,o,this.channelId).then((function(e){e===s.SUCCESS?de(a.onSuccess,!0):(ee.warn("deleteLocalMessagesByTimestamp ->code:".concat(e,",targetId:").concat(t)),ue(a.onError,e))}))},e.prototype.getRemoteHistoryMessages=function(e,t,n,o,a,c){ee.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===s.SUCCESS)if(o){var c=o.list,r=o.hasMore,i=c.map((function(e){return re(e)}));de(a.onSuccess,i,r)}else de(a.onSuccess,[],!1);else ee.warn("getRemoteHistoryMessages ->code:".concat(n,",targetId:").concat(t)),ue(a.onError,n)}))},e.prototype.clearMessages=function(e,t,n){var o=this;ee.info("clearMessages ->targetId:".concat(t,",conversationType:").concat(e)),this._context.clearMessages(e,t,this.channelId).then((function(a){a===s.SUCCESS?(o._isCPPMode||ne.remove(e,t,o.channelId),de(n.onSuccess,!0)):(ee.warn("clearMessages ->code:".concat(a,",targetId:").concat(t)),ue(n.onError,a))}))},e.prototype.searchConversationByContent=function(e,t,n,o){ee.info("searchConversationByContent ->keyword:".concat(e)),this._context.searchConversationByContent(e,o,this.channelId,n).then((function(n){var o=n.code,a=n.data,c=[];a=a||[],o===s.SUCCESS?(a.forEach((function(e){c.push(ce(e))})),de(t.onSuccess,c)):(ee.warn("searchConversationByContent ->code:".concat(o,",keyword:").concat(e)),ue(t.onError,o))}))},e.prototype.searchConversationByContentWithAllChannel=function(e,t,n,o){void 0===n&&(n=[]),c.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===s.SUCCESS?(a.forEach((function(e){r.push(ce(e))})),de(t.onSuccess,r)):(c.warn("searchConversationByContentWithAllChannel ->code:".concat(o,",keyword:").concat(e)),ue(t.onError,o))}))},e.prototype.searchMessageByContent=function(e,t,n,o,a,c,r){ee.info("searchMessageByContent ->targetId:".concat(t,",conversationType:").concat(e,",keyword:").concat(n)),this._context.searchMessageByContent(e,t,n,o,a,c,this.channelId).then((function(e){var n=e.code,o=e.data,a=[];if(n===s.SUCCESS){var c=o=o||{},i=c.messages,d=c.count;i.forEach((function(e){a.push(re(e))})),de(r.onSuccess,a,d)}else ee.warn("searchMessageByContent ->code:".concat(n,",targetId:").concat(t)),ue(r.onError,n)}))},e.prototype.searchMessageByContentWithAllChannel=function(e,t,n,o,a,r){c.info("searchMessageByContentWithAllChannel ->targetId: ".concat(t," ,conversationType: ").concat(e," ,keyword: ").concat(n,", timestamp: ").concat(o,", count: ").concat(a)),this._context.searchMessageByContentWithAllChannel(e,t,n,o,a).then((function(e){var n=e.code,o=e.data,a=[];if(n===s.SUCCESS){var i=o=o||{},d=i.messages,u=i.count;d.forEach((function(e){a.push(re(e))})),de(r.onSuccess,a,u)}else c.warn("searchMessageByContentWithAllChannel ->code:".concat(n,",targetId:").concat(t)),ue(r.onError,n)}))},e.prototype.searchMessageByContentInTimeRangeWithAllChannel=function(e,t,n,o,a,r,i,d){c.info("searchMessageByContentInTimeRangeWithAllChannel ->targetId: ".concat(t," ,conversationType: ").concat(e," ,keyword: ").concat(n,", startTime: ").concat(o,", endTime: ").concat(a,", offset: ").concat(r,", limit: ").concat(i)),this._context.searchMessageByContentInTimeRangeWithAllChannel(e,t,n,o,a,r,i).then((function(e){var n=e.code,o=e.data,a=[];n===s.SUCCESS?((o=o||{}).messages.forEach((function(e){a.push(re(e))})),de(d.onSuccess,a)):(c.warn("searchMessageByContentInTimeRangeWithAllChannel ->code:".concat(n,",targetId:").concat(t)),ue(d.onError,n))}))},e.prototype.getUnreadMentionedMessages=function(e,t){return ee.info("getUnreadMentionedMessages ->targetId:".concat(t,",conversationType:").concat(e)),this._context.getUnreadMentionedMessages(e,t,this.channelId).map((function(e){return re(e)}))},e.prototype.clearUnreadCountByTimestamp=function(e,t,n,o){ee.info("clearUnreadCountByTimestamp ->targetId:".concat(t,",conversationType:").concat(e)),this._context.clearUnreadCountByTimestamp(e,t,n,this.channelId).then((function(e){e===s.SUCCESS?de(o.onSuccess,!0):(ee.warn("clearUnreadCountByTimestamp ->code:".concat(e,",targetId:").concat(t)),ue(o.onError,e))}))},e.prototype.getConversationNotificationStatus=function(e,t,n){ee.info("getConversationNotificationStatus ->targetId:".concat(t,",conversationType:").concat(e)),this._context.getConversationNotificationStatus(e,t,this.channelId).then((function(e){var o=e.code,a=e.data;o===s.SUCCESS?de(n.onSuccess,a):(ee.warn("getConversationNotificationStatus ->code:".concat(o,",targetId:").concat(t)),ue(n.onError,o))}))},e}(),Se=function(e){return{targetId:e.targetId,channelId:e.channelId,conversationType:e.type}},me=function(){function e(e,t){this._context=e,this._options=t,this._channelClient={},this._isCPPMode=C(),this._defaultChannelClient=new he(e,"",this._isCPPMode,t.readReceiptTimeout)}return e.prototype.assertCPPMode=function(e,t,n){if(!this._isCPPMode)return null==n||n.onError(s.NOT_SUPPORT),void ee.error("'".concat(t,"' is unusable!"));e()},e.prototype.install=function(e,t){return this._context.install(e,t)},e.prototype.getChannel=function(e){if(ee.info("getChannel ->channelId:".concat(e)),!this._isCPPMode)return ee.error("getChannel method is only available in protocol stack mode"),null;if(l("channelId",e,p.STRING,!0),e.length>20)return ee.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 ee.error("Only 1000 channels can be obtained"),null;var t=new he(this._context,e,this._isCPPMode,this._options.readReceiptTimeout);return this._channelClient[e]=t,t},e.prototype.deleteChannels=function(e){var t=this;l("channelIds",e,p.ARRAY,!0),ee.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 N(this,void 0,void 0,(function(){return _(this,(function(e){switch(e.label){case 0:return c.info(r.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.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){ee.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){l("chatRoomId",e,p.STRING,!0),l("count",t,p.NUMBER,!0),l("callback",n,p.CALLBACK),ee.info("joinChatRoom ->chatRoomId:".concat(e));var o=c.ID();c.info(r.A_JOIN_CHATROOM_T,{chatroomId:e,count:t,joinExist:!1},{traceId:o}),this._context.joinChatroom(e,t,o).then((function(t){(t===s.SUCCESS?c.info:c.warn)(r.A_JOIN_CHATROOM_R,{code:t,timestamp:(new Date).getTime()},{traceId:o}),t===s.SUCCESS?de(n.onSuccess):(ee.warn("joinChatRoom ->code:".concat(t,",chatRoomId:").concat(e)),ue(n.onError,t))}))},e.prototype.quitChatRoom=function(e,t){l("chatRoomId",e,p.STRING,!0),l("callback",t,p.CALLBACK),ee.info("quitChatRoom ->chatRoomId:".concat(e));var n=c.ID();c.info(r.A_QUIT_CHATROOM_T,{chatroomId:e},{traceId:n}),this._context.quitChatroom(e).then((function(o){(o===s.SUCCESS?c.info:c.warn)(r.A_QUIT_CHATROOM_R,{code:o},{traceId:n}),o===s.SUCCESS?de(t.onSuccess):(ee.warn("quitChatRoom ->code:".concat(o,",chatRoomId:").concat(e)),ue(t.onError,o))}))},e.prototype.getChatRoomInfo=function(e,t,n,o){l("chatRoomId",e,p.STRING,!0),l("count",t,p.NUMBER,!0),l("order",n,p.NUMBER,!0),l("callback",o,p.CALLBACK),ee.info("getChatRoomInfo ->chatRoomId:".concat(e)),this._context.getChatroomInfo(e,t,n).then((function(t){var n=t.code,a=t.data;n===s.SUCCESS?de(o.onSuccess,{userInfos:(null==a?void 0:a.userInfos)||[],userTotalNums:(null==a?void 0:a.userCount)||0}):(ee.warn("getChatRoomInfo ->code:".concat(n,",chatRoomId:").concat(e)),ue(o.onError,n))}))},e.prototype.setChatroomEntry=function(e,t,n){l("chatRoomId",e,p.STRING,!0),l("chatroomEntry",t,p.OBJECT,!0),l("callback",n,p.CALLBACK),ee.info("setChatroomEntry ->chatRoomId:".concat(e)),this._context.setChatroomEntry(e,t).then((function(t){t===s.SUCCESS?de(n.onSuccess):(ee.warn("setChatroomEntry ->code:".concat(t,",chatRoomId:").concat(e)),ue(n.onError,t))}))},e.prototype.setChatRoomEntries=function(e,t,n){if(l("chatRoomId",e,p.STRING,!0),function(e){e.entries.forEach((function(e){l("entry.key",e.key,p.STRING,!0),l("entry.value",e.value,p.STRING,!0)})),l("options.isAutoDelete",e.isAutoDelete,p.BOOLEAN)}(t),l("callback",n,p.CALLBACK),t.entries.length>10)ue(n.onError,s.CHATROOM_KV_STORE_OUT_LIMIT);else{var o="id:".concat(e);ee.info("set chatroom entry->".concat(o)),this._context.setChatroomEntries(e,t).then((function(e){var t=e.code,a=e.data;t===s.SUCCESS?de(n.onSuccess):(ee.warn("set chatroom entry fail ->code+:".concat(t,",").concat(o)),ue(n.onError,t,a))}))}},e.prototype.forceSetChatroomEntry=function(e,t,n){l("chatRoomId",e,p.STRING,!0),l("chatroomEntry",t,p.OBJECT,!0),l("callback",n,p.CALLBACK),ee.info("forceSetChatroomEntry ->chatRoomId:".concat(e)),this._context.forceSetChatroomEntry(e,t).then((function(t){t===s.SUCCESS?de(n.onSuccess):(ee.warn("forceSetChatroomEntry ->code:".concat(t,",chatRoomId:").concat(e)),ue(n.onError,t))}))},e.prototype.removeChatroomEntry=function(e,t,n){l("chatRoomId",e,p.STRING,!0),l("chatroomEntry",t,p.OBJECT,!0),l("callback",n,p.CALLBACK),ee.info("removeChatroomEntry ->chatRoomId:".concat(e)),this._context.removeChatroomEntry(e,t).then((function(t){t===s.SUCCESS?de(n.onSuccess):(ee.warn("removeChatroomEntry ->code:".concat(t,",chatRoomId:").concat(e)),ue(n.onError,t))}))},e.prototype.removeChatRoomEntries=function(e,t,n){l("chatRoomId",e,p.STRING,!0),function(e){e.entries.forEach((function(e){l("key",e,p.STRING,!0)}))}(t);var o="id:".concat(e);ee.debug("remove chatroom entry->".concat(o));var a=U({},t);a.entries=t.entries.map((function(e){return{key:e}})),this._context.removeChatroomEntries(e,a).then((function(e){var t=e.code,a=e.data;t===s.SUCCESS?de(n.onSuccess):(ee.warn("remove chatroom entry fail ->code+:".concat(t,",").concat(o)),ue(n.onError,t,a))}))},e.prototype.forceRemoveChatroomEntry=function(e,t,n){l("chatRoomId",e,p.STRING,!0),l("chatroomEntry",t,p.OBJECT,!0),l("callback",n,p.CALLBACK),ee.info("forceRemoveChatroomEntry ->chatRoomId:".concat(e)),this._context.forceRemoveChatroomEntry(e,t).then((function(t){t===s.SUCCESS?de(n.onSuccess):(ee.warn("forceRemoveChatroomEntry ->code:".concat(t,",chatRoomId:").concat(e)),ue(n.onError,t))}))},e.prototype.getChatroomEntry=function(e,t,n){l("chatRoomId",e,p.STRING,!0),l("key",t,p.STRING,!0),l("callback",n,p.CALLBACK),ee.info("getChatroomEntry ->chatRoomId:".concat(e,",key:").concat(t)),this._context.getChatroomEntry(e,t).then((function(t){var o=t.code,a=t.data;o===s.SUCCESS?de(n.onSuccess,a||""):(ee.warn("getChatroomEntry ->code:".concat(o,",chatRoomId:").concat(e)),ue(n.onError,o))}))},e.prototype.getAllChatroomEntries=function(e,t){l("chatRoomId",e,p.STRING,!0),l("callback",t,p.CALLBACK),ee.info("getAllChatroomEntries ->chatRoomId:".concat(e)),this._context.getAllChatroomEntries(e).then((function(n){var o=n.code,a=n.data;o===s.SUCCESS?de(t.onSuccess,a):(ee.warn("getAllChatroomEntries ->code:".concat(o,",chatRoomId:").concat(e)),ue(t.onError,o))}))},e.prototype.getChatRoomHistoryMessages=function(e,t,n,o,a){void 0===a&&(a=0),l("chatRoomId",e,p.STRING,!0),l("count",t,p.NUMBER,!0),l("order",n,p.NUMBER,!0),l("callback",o,p.CALLBACK),l("timestamp",a,p.NUMBER),ee.info("getChatRoomHistoryMessages ->chatRoomId:".concat(e)),this._context.getChatRoomHistoryMessages(e,t,n,a).then((function(t){var n=t.code,a=t.data;if(n===s.SUCCESS)if(a){var c=a.list,r=a.hasMore,i=c.map((function(e){return re(e)}));de(o.onSuccess,i,r)}else de(o.onSuccess,[],!1);else ee.warn("getChatRoomHistoryMessages ->code:".concat(n,",chatRoomId:").concat(e)),ue(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){l("fileType",e,p.NUMBER,!0),l("fileName",n,p.STRING),l("callback",t,p.CALLBACK),ee.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){l("fileType",e,p.NUMBER,!0),l("fileName",t,p.STRING,!0),l("saveName",n,p.STRING),l("callback",o,p.CALLBACK),l("serverType",s,p.NUMBER),l("uploadRes",a,p.OBJECT),ee.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){l("tag.tagId",e.tagId,p.STRING,!0),l("tag.tagId",e.tagId,(function(e){return e.length<=10})),l("tag.tagName",e.tagName,(function(e){return e.length<=15})),l("tag.tagName",e.tagName,p.STRING,!0),l("callback",t,p.CALLBACK),ee.info("createTag ->tagId:".concat(e.tagId,",tagName:").concat(e.tagName)),this._context.createTag(e).then((function(n){var o=n.code;o===s.SUCCESS?t.onSuccess():(ee.warn("createTag ->code:".concat(o,",tagId:").concat(e.tagId)),t.onError(o))})).catch((function(n){ee.warn("createTag ->code:".concat(n,",tagId:").concat(e.tagId)),t.onError(n)}))},e.prototype.removeTag=function(e,t){l("tagId",e,p.STRING,!0),l("callback",t,p.CALLBACK),ee.info("removeTag ->tagId:".concat(e)),this._context.removeTag(e).then((function(n){var o=n.code;o===s.SUCCESS?t.onSuccess():(ee.warn("removeTag ->code:".concat(o,",tagId:").concat(e)),t.onError(o))})).catch((function(n){ee.warn("removeTag ->code:".concat(n,",tagId:").concat(e)),t.onError(n)}))},e.prototype.updateTag=function(e,t){l("tag.tagId",e.tagId,p.STRING,!0),l("tag.tagName",e.tagName,p.STRING,!0),l("tag.tagName",e.tagName,(function(e){return e.length<=15})),l("callback",t,p.CALLBACK),ee.info("updateTag ->tagId:".concat(e.tagId,",tagName:").concat(e.tagName)),this._context.updateTag(e).then((function(n){var o=n.code;o===s.SUCCESS?t.onSuccess():(ee.warn("updateTag ->code:".concat(o,",tagId:").concat(e.tagId)),t.onError(o))})).catch((function(n){ee.warn("updateTag ->reason:".concat(n,",tagId:").concat(e.tagId)),t.onError(n)}))},e.prototype.getTagList=function(e){l("callback",e,p.CALLBACK),this._context.getTagList().then((function(t){var n=t.code,o=t.data;n===s.SUCCESS?e.onSuccess(o||[]):(ee.warn("getTagList ->code:".concat(n)),e.onError(n))})).catch((function(t){ee.warn("getTagList ->reason:".concat(t)),e.onError(t)}))},e.prototype.getTagsForConversation=function(e,t){l("conversationType",e.type,p.NUMBER),l("targetId",e.targetId,p.STRING),l("channelId",e.channelId,p.ONLY_STRING),l("callback",t,p.CALLBACK),ee.info("getTagsForConversation ->targetId:".concat(e.targetId,",conversationType:").concat(e.type)),this._context.getTagsForConversation(Se(e)).then((function(e){var n=e.code,o=e.data;n===s.SUCCESS?t.onSuccess(o||[]):(ee.warn("getTagsForConversation ->code:".concat(n)),t.onError(n))})).catch((function(e){ee.warn("getTagsForConversation ->reason:".concat(e)),t.onError(e)}))},e.prototype.addTagForConversations=function(e,t,n){l("tagId",e,p.STRING,!0),l("conversations",t,p.ARRAY,!0),l("callback",n,p.CALLBACK),t.forEach((function(e){l("conversation.type",e.type,p.NUMBER,!0),l("conversation.targetId",e.targetId,p.STRING,!0),l("conversation.channelId",e.channelId,p.ONLY_STRING)})),ee.info("addTagForConversations ->tagId:".concat(e)),this._context.addTagForConversations(e,t.map((function(e){return Se(e)}))).then((function(t){var o=t.code;t.data,o===s.SUCCESS?n.onSuccess():(ee.warn("addTagForConversations ->code:".concat(o,",tagId:").concat(e)),n.onError(o))})).catch((function(t){ee.warn("addTagForConversations ->reason:".concat(t,",tagId:").concat(e)),n.onError(t)}))},e.prototype.removeTagForConversations=function(e,t,n){l("tagId",e,p.STRING,!0),l("conversations",t,p.ARRAY,!0),l("callback",n,p.CALLBACK),t.forEach((function(e){l("conversation.type",e.type,p.NUMBER,!0),l("conversation.targetId",e.targetId,p.STRING,!0),l("conversation.channelId",e.channelId,p.ONLY_STRING)})),ee.info("removeTagForConversations ->tagId:".concat(e)),this._context.removeTagForConversations(e,t.map((function(e){return Se(e)}))).then((function(t){var o=t.code;t.data,o===s.SUCCESS?n.onSuccess():(ee.warn("removeTagForConversations ->code:".concat(o,",tagId:").concat(e)),n.onError(o))})).catch((function(t){ee.warn("removeTagForConversations ->reason:".concat(t,",tagId:").concat(e)),n.onError(t)}))},e.prototype.removeTagsForConversation=function(e,t,n){l("conversation.type",e.type,p.NUMBER,!0),l("conversation.targetId",e.targetId,p.STRING,!0),l("conversation.channelId",e.channelId,p.ONLY_STRING),l("tagIds",t,p.ARRAY,!0),l("callback",n,p.CALLBACK),t.forEach((function(e){l("tagId",e,p.STRING,!0)})),ee.info("removeTagsForConversation ->tagIds:".concat(t,",targetId:").concat(e.targetId,",type:").concat(e.type)),this._context.removeTagsForConversation(Se(e),t).then((function(e){var o=e.code;e.data,o===s.SUCCESS?n.onSuccess():(ee.warn("removeTagsForConversation ->code:".concat(o,",tagIds:").concat(t)),n.onError(o))})).catch((function(e){ee.warn("removeTagsForConversation ->reason:".concat(e,",tagIds:").concat(t)),n.onError(e)}))},e.prototype.getConversationListByTag=function(e,t,n,o){l("tagId",e,p.STRING,!0),l("count",t,p.NUMBER,!0),l("startTime",n,p.NUMBER,!0),l("callback",o,p.CALLBACK,!0),ee.info("getConversationListByTag ->tagId:".concat(e)),this._context.getConversationListByTag(e,n,t).then((function(t){var n=t.code,a=t.data,c=[];n===s.SUCCESS?((a=a||[]).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?re(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)):(ee.warn("getConversationListByTag ->code:".concat(n,",tagId:").concat(e)),o.onError(n))})).catch((function(t){ee.warn("getConversationListByTag ->reason:".concat(t,",tagId:").concat(e)),o.onError(t)}))},e.prototype.getUnreadCountByTag=function(e,t,n){l("tagId",e,p.STRING,!0),l("containMuted",t,p.BOOLEAN,!0),l("callback",n,p.CALLBACK),ee.info("getUnreadCountByTag ->tagId:".concat(e)),this._context.getUnreadCountByTag(e,t).then((function(t){var o=t.code,a=t.data;ee.info(o,a),o===s.SUCCESS?n.onSuccess(a||0):(ee.warn("getUnreadCountByTag ->code:".concat(o,",tagId:").concat(e)),n.onError(o))})).catch((function(t){ee.warn("getUnreadCountByTag ->reason:".concat(t,",tagId:").concat(e)),n.onError(t)}))},e.prototype.setConversationStatusInTag=function(e,t,n,o){l("tagId",e,p.STRING,!0),l("conversation.targetId",t.targetId,p.STRING,!0),l("conversation.type",t.type,p.NUMBER,!0),l("conversation.channelId",t.channelId,p.ONLY_STRING),l("status.isTop",null==n?void 0:n.isTop,p.BOOLEAN,!0),l("callback",o,p.CALLBACK),ee.info("setConversationStatusInTag ->tagId:".concat(e,",targetId:").concat(t.targetId,",type").concat(t.type)),this._context.setConversationStatusInTag(e,Se(t),n).then((function(t){var n=t.code;t.data,n===s.SUCCESS?o.onSuccess():(ee.warn("setConversationStatusInTag ->code:".concat(n,",tagId:").concat(e)),o.onError(n))})).catch((function(t){ee.warn("setConversationStatusInTag ->reason:".concat(t,",tagId:").concat(e)),o.onError(t)}))},e.prototype.callExtra=function(e,t){for(var n,o=[],a=2;a<arguments.length;a++)o[a-2]=arguments[a];ee.info("callExtra ->method:".concat(e)),(n=this._context).callExtra.apply(n,A([e],o,!1)).then((function(n){var o=n.code,a=n.data;if(o!==s.SUCCESS)ee.warn("callExtra ->code:".concat(o)),t.onError&&ue(t.onError,o);else{if("getConversationsByPage"===e&&a.forEach((function(e){e.latestMessage=e.latestMessage?re(e.latestMessage):null})),"getHistoryMessagesByObjectNames"===e){var c=a,r=c.list,i=c.hasMore,d=r.map((function(e){return re(e)}));return void de(t.onSuccess,d,i)}t.onSuccess&&de(t.onSuccess,a)}}))},e.prototype.hasRemoteUnreadMessages=function(e,t){l("callback",t,p.CALLBACK),ee.info("hasRemoteUnreadMessages ->token:".concat(e)),this.assertCPPMode((function(){de(t.onSuccess,!1)}),"hasRemoteUnreadMessages",t)},e.prototype.setUserStatusListener=function(e,t){var n=this;ee.info("setUserStatusListener ->userIds:".concat(e.userIds)),this.assertCPPMode((function(){n._context.setUserStatusListener(e,t)}),"setUserStatusListener")},e.prototype.setUserStatus=function(e,t){var n=this;l("status",e,p.NUMBER),l("callback",t,p.CALLBACK),ee.info("setUserStatus ->status:".concat(e)),this.assertCPPMode((function(){n._context.setUserStatus(e).then((function(e){e===s.SUCCESS?de(t.onSuccess,!0):(ee.warn("setUserStatus ->code:".concat(e)),ue(t.onError,e))}))}),"setUserStatus",t)},e.prototype.getUserStatus=function(e,t){var n=this;l("userId",e,p.STRING),l("callback",t,p.CALLBACK),ee.info("getUserStatus ->userId:".concat(e)),this.assertCPPMode((function(){n._context.getUserStatus(e).then((function(n){var o=n.code,a=n.data;o===s.SUCCESS?de(t.onSuccess,a):(ee.warn("getUserStatus ->code:".concat(o,",useerId:").concat(e)),ue(t.onError,o))}))}),"getUserStatus",t)},e.prototype.addToBlacklist=function(e,t){var n=this;l("userId",e,p.STRING),l("callback",t,p.CALLBACK),ee.info("addToBlacklist ->userId:".concat(e)),this.assertCPPMode((function(){n._context.addToBlacklist(e).then((function(n){n===s.SUCCESS?de(t.onSuccess):(ee.warn("addToBlacklist ->code:".concat(n,",useerId:").concat(e)),ue(t.onError,n))}))}),"addToBlacklist",t)},e.prototype.removeFromBlacklist=function(e,t){var n=this;l("userId",e,p.STRING),l("callback",t,p.CALLBACK),ee.info("removeFromBlacklist ->userId:".concat(e)),this.assertCPPMode((function(){n._context.removeFromBlacklist(e).then((function(n){n===s.SUCCESS?de(t.onSuccess):(ee.warn("removeFromBlacklist ->code:".concat(n,",useerId:").concat(e)),ue(t.onError,n))}))}),"removeFromBlacklist",t)},e.prototype.getBlacklist=function(e){var t=this;l("callback",e,p.CALLBACK),this.assertCPPMode((function(){t._context.getBlacklist().then((function(t){var n=t.code,o=t.data;n===s.SUCCESS?de(e.onSuccess,o):(ee.warn("getBlacklist ->code:".concat(n)),ue(e.onError,n))}))}),"getBlacklist",e)},e.prototype.getBlacklistStatus=function(e,t){var n=this;l("userId",e,p.STRING),l("callback",t,p.CALLBACK),ee.info("getBlacklistStatus ->userId:".concat(e)),this.assertCPPMode((function(){n._context.getBlacklistStatus(e).then((function(n){var o=n.code,a=n.data;o===s.SUCCESS?de(t.onSuccess,a):(ee.warn("getBlacklistStatus ->code:".concat(o,",userId:").concat(e)),ue(t.onError,o))}))}),"getBlacklistStatus",t)},e.prototype.insertMessage=function(e,t,n,o,a){var s=this;void 0===a&&(a={}),l("conversationType",e,p.NUMBER,!0),l("targetId",t,p.STRING,!0),l("content.senderUserId",n.senderUserId,p.STRING,!0),l("callback",o,p.CALLBACK),ee.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={}),l("conversationType",e,p.NUMBER,!0),l("targetId",t,p.STRING,!0),l("timestamp",n,p.NUMBER,!0),l("count",o,p.NUMBER,!0),l("callback",a,p.CALLBACK),l("options.order",s.order,p.NUMBER),this.assertCPPMode((function(){c._defaultChannelClient.getRemoteHistoryMessages(e,t,n,o,a,s)}),"getRemoteHistoryMessages",a)},e.prototype.deleteLocalMessages=function(e,t,n,o){var a=this;l("messageIds",n,p.ARRAY,!0),l("callback",o,p.CALLBACK),ee.info("deleteLocalMessages ->messageIds:".concat(n)),this.assertCPPMode((function(){a._context.deleteMessages(n).then((function(e){e===s.SUCCESS?de(o.onSuccess,!0):(ee.warn("deleteLocalMessages ->code:".concat(e,",messageIds:").concat(n)),ue(o.onError,e))}))}),"deleteLocalMessages",o)},e.prototype.deleteLocalMessagesByTimestamp=function(e,t,n,o,a){var s=this;l("conversationType",e,p.NUMBER,!0),l("targetId",t,p.STRING,!0),l("timestamp",n,p.NUMBER,!0),l("cleanSpace",o,p.BOOLEAN),l("callback",a,p.CALLBACK),this.assertCPPMode((function(){s._defaultChannelClient.deleteLocalMessagesByTimestamp(e,t,n,o,a)}),"deleteLocalMessagesByTimestamp",a)},e.prototype.clearMessages=function(e,t,n){var o=this;l("conversationType",e,p.NUMBER,!0),l("targetId",t,p.STRING,!0),l("callback",n,p.CALLBACK),this.assertCPPMode((function(){o._defaultChannelClient.clearMessages(e,t,n)}),"clearMessages",n)},e.prototype.getMessage=function(e,t){var n=this;l("callback",t,p.CALLBACK),this.assertCPPMode((function(){n._context.getMessage(e).then((function(n){var o=n.code,a=n.data;o===s.SUCCESS?de(t.onSuccess,re(a)):(ee.warn("getMessage ->code:".concat(o,",messageId:").concat(e)),ue(t.onError,o))}))}),"getMessage",t)},e.prototype.setMessageSentStatus=function(e,t,n){var o=this;l("messageId",e,p.NUMBER,!0),l("sentStatus",t,p.NUMBER,!0),ee.info("setMessageSentStatus ->messageId:".concat(e,",sentStatus:").concat(t)),this.assertCPPMode((function(){o._context.setMessageSentStatus(e,t).then((function(t){t===s.SUCCESS?de(n.onSuccess,!0):(ee.warn("setMessageSentStatus ->code:".concat(t,",messageId:").concat(e)),ue(n.onError,t))}))}),"setMessageSentStatus",n)},e.prototype.setMessageReceivedStatus=function(e,t,n){var o=this;l("messageId",e,p.NUMBER,!0),l("receivedStatus",t,p.NUMBER,!0),ee.info("setMessageReceivedStatus ->messageId:".concat(e,",receivedStatus:").concat(t)),this.assertCPPMode((function(){o._context.setMessageReceivedStatus(e,t).then((function(t){t===s.SUCCESS?de(n.onSuccess,!0):(ee.warn("setMessageReceivedStatus ->code:".concat(t,",messageId:").concat(e)),ue(n.onError,t))}))}),"setMessageReceivedStatus",n)},e.prototype.setMessageContent=function(e,t,n){var o=this;l("messageId",e,p.NUMBER,!0),l("objectName",n,p.ONLY_STRING,!0),ee.info("setMessageContent ->messageId:".concat(e,",objectName:").concat(n)),this.assertCPPMode((function(){o._context.setMessageContent(e,t,n)}),"setMessageContent")},e.prototype.setMessageSearchField=function(e,t,n){var o=this;l("messageId",e,p.NUMBER,!0),l("searchFiles",n,p.STRING,!0),ee.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;l("keyword",e,p.STRING,!0),l("callback",t,p.CALLBACK),l("conversationTypes",n,p.ARRAY),l("customMessageType",o,p.ARRAY),this.assertCPPMode((function(){a._defaultChannelClient.searchConversationByContent(e,t,n,o)}),"searchConversationByContent",t)},e.prototype.searchMessageByContent=function(e,t,n,o,a,s,c){var r=this;l("conversationType",e,p.NUMBER,!0),l("targetId",t,p.STRING,!0),l("keyword",n,p.STRING,!0),l("timestamp",o,p.NUMBER),l("count",a,p.NUMBER),l("total",s,p.NUMBER),l("callback",c,p.CALLBACK),this.assertCPPMode((function(){r._defaultChannelClient.searchMessageByContent(e,t,n,o,a,s,c)}),"searchMessageByContent",c)},e.prototype.getUnreadMentionedMessages=function(e,t){return this._isCPPMode?(l("conversationType",e,p.NUMBER,!0),l("targetId",t,p.STRING,!0),this._defaultChannelClient.getUnreadMentionedMessages(e,t)):(ee.error("getUnreadMentionedMessages method is not supported in a browser!"),null)},e.prototype.clearUnreadCountByTimestamp=function(e,t,n,o){var a=this;l("conversationType",e,p.NUMBER,!0),l("targetId",t,p.STRING,!0),l("timestamp",n,p.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;l("conversationType",e,p.NUMBER,!0),l("targetId",t,p.STRING,!0),this.assertCPPMode((function(){o._defaultChannelClient.getConversationNotificationStatus(e,t,n)}),"getConversationNotificationStatus",n)},e.prototype.getServerTime=function(){return this._context.getServerTime()},e.prototype.getRTCUserInfoList=function(e,t){ee.info("getRTCUserInfoList ->roomId:".concat(e.id)),this._context.getRTCUserInfoList(e.id).then((function(n){var o=n.code,a=n.data;if(o!==s.SUCCESS)ee.warn("getRTCUserInfoList ->code:".concat(o,",roomId:").concat(e.id)),t.onError(o);else{var c=null==a?void 0:a.users;t.onSuccess(c)}})).catch((function(n){ee.warn("getRTCUserInfoList ->error:".concat(n,",roomId:").concat(e.id)),t.onError(n)}))},e.prototype.getRTCUserList=function(e,t){ee.info("getRTCUserList ->roomId:".concat(e.id)),this._context.getRTCUserList(e.id).then((function(n){var o=n.code,a=n.data;o!==s.SUCCESS?(ee.warn("getRTCUserList ->code:".concat(o,",roomId:").concat(e.id)),t.onError(o)):t.onSuccess(a)})).catch((function(n){ee.warn("getRTCUserList ->error:".concat(n,",roomId:").concat(e.id)),t.onError(n)}))},e.prototype.setRTCUserInfo=function(e,t,n){ee.info("setRTCUserInfo ->roomId:".concat(e.id,",info:").concat(JSON.stringify(t||{}))),this._context.setRTCUserInfo(e.id,t.key,t.value).then((function(o){o!==s.SUCCESS?(ee.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){ee.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){ee.info("removeRTCUserInfo ->roomId:".concat(e.id,"keys:").concat(t.keys)),this._context.removeRTCUserInfo(e.id,t.keys).then((function(t){t!==s.SUCCESS?(ee.warn("removeRTCUserInfo ->code:".concat(t,",roomId:").concat(e.id)),n.onError(t)):n.onSuccess(!0)})).catch((function(t){ee.warn("removeRTCUserInfo ->error:".concat(t,",roomId:").concat(e.id)),n.onError(t)}))},e.prototype.getRTCRoomInfo=function(e,t){ee.info("getRTCRoomInfo ->roomId:".concat(e.id)),this._context.getRTCRoomInfo(e.id).then((function(n){var o=n.code,a=n.data;o!==s.SUCCESS?(ee.warn("getRTCRoomInfo ->code:".concat(o,",roomId:").concat(e.id)),t.onError(o)):t.onSuccess(a)})).catch((function(n){ee.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){ee.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!==s.SUCCESS?(ee.warn("joinRTCRoom ->code:".concat(o,",roomId:").concat(e.id)),t.onError(o)):t.onSuccess(a)})).catch((function(n){ee.warn("joinRTCRoom ->error:".concat(n,",roomId:").concat(e.id)),t.onError(n)}))},e.prototype.quitRTCRoom=function(e,t){ee.info("quitRTCRoom ->roomId:".concat(e.id)),this._context.quitRTCRoom(e.id).then((function(n){n!==s.SUCCESS?(ee.warn("quitRTCRoom ->code:".concat(n,",roomId:").concat(e.id)),t.onError(n)):t.onSuccess(!0)})).catch((function(n){ee.warn("quitRTCRoom ->error:".concat(n,",roomId:").concat(e.id)),t.onError(n)}))},e.prototype.RTCPing=function(e,t){ee.info("RTCPing ->roomId:".concat(e.id));var n=e.mode||0;this._context.rtcPing(e.id,n).then((function(n){n!==s.SUCCESS?(ee.warn("RTCPing ->code:".concat(n,",roomId:").concat(e.id)),t.onError(n)):t.onSuccess(!0)})).catch((function(n){ee.warn("RTCPing ->error:".concat(n,",roomId:").concat(e.id)),t.onError(n)}))},e.prototype.setRTCData=function(e,t,n,o,a,c,r){ee.info("setRTCData ->roomId:".concat(e,",key:").concat(t)),this._context.setRTCData(e,t,n,o,a,r).then((function(t){t!==s.SUCCESS?(ee.warn("setRTCData ->code:".concat(t,",roomId:").concat(e)),c.onError(t)):c.onSuccess(!0)})).catch((function(t){ee.warn("setRTCData ->error:".concat(t,",roomId:").concat(e)),c.onError(t)}))},e.prototype.getRTCData=function(e,t,n,o,a){ee.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!==s.SUCCESS?(ee.warn("getRTCData ->code:".concat(n,",roomId:").concat(e)),a.onError(n)):a.onSuccess(o)})).catch((function(t){ee.warn("setRTCUserInfo ->error:".concat(t,",roomId:").concat(e)),a.onError(t)}))},e.prototype.removeRTCData=function(e,t,n,o,a,c){ee.info("removeRTCData ->roomId:".concat(e,",keys:").concat(t)),this._context.removeRTCData(e,t,n,o,c).then((function(t){t!==s.SUCCESS?(ee.warn("removeRTCData ->code:".concat(t,",roomId:").concat(e)),a.onError(t)):a.onSuccess(!0)})).catch((function(t){ee.warn("removeRTCData ->error:".concat(t,",roomId:").concat(e)),a.onError(t)}))},e.prototype.setRTCUserData=function(e,t,n,o,a,s){this.setRTCData(e,t,n,o,S.PERSON,a,s)},e.prototype.setRTCUserTotalRes=function(e,t,n,o,a){ee.info("setRTCUserTotalRes ->roomId:".concat(e)),this._context.setRTCTotalRes(e,t,n,o).then((function(t){t!==s.SUCCESS?(ee.warn("setRTCUserTotalRes ->code:".concat(t,",roomId:").concat(e)),a.onError(t)):a.onSuccess(!0)})).catch((function(t){ee.warn("setRTCUserTotalRes ->error:".concat(t,",roomId:").concat(e)),a.onError(t)}))},e.prototype.getRTCUserData=function(e,t,n,o){this.getRTCData(e,t,n,S.PERSON,o)},e.prototype.removeRTCUserData=function(e,t,n,o,a){this.removeRTCData(e,t,n,S.PERSON,o,a)},e.prototype.setRTCRoomData=function(e,t,n,o,a,s){this.setRTCData(e,t,n,o,S.ROOM,a,s)},e.prototype.getRTCRoomData=function(e,t,n,o){this.getRTCData(e,t,n,S.ROOM,o)},e.prototype.removeRTCRoomData=function(e,t,n,o,a){this.removeRTCData(e,t,n,S.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){ee.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!==s.SUCCESS?(ee.warn("getRTCToken ->code:".concat(o,",roomId:").concat(e.id)),t.onError(o)):t.onSuccess(a)})).catch((function(n){ee.warn("getRTCToken ->error:".concat(n,",roomId:").concat(e.id)),t.onError(n)}))},e.prototype.setRTCState=function(e,t,n){ee.info("setRTCState ->roomId:".concat(e.id)),this._context.setRTCState(e.id,t.report).then((function(t){t!==s.SUCCESS?(ee.warn("setRTCState ->code:".concat(t,",roomId:").concat(e.id)),n.onError(t)):n.onSuccess(!0)})).catch((function(t){ee.warn("setRTCState ->error:".concat(t,",roomId:").concat(e.id)),n.onError(t)}))},e}(),Ie=[],Re=[],ye={message:function(e){Ie.forEach((function(t){return t(re(e))}))},status:function(e){Re.forEach((function(t){return t(e)}))}},Me=1;m.add("imlib-v2-adapter","5.5.3");var ve,Te={init:function(e,t,n){void 0===n&&(n={}),l("appkey",e,p.STRING,!0),ee.setLogLevel(n.logLevel),ee.setLogStdout(n.logStdout),ee.info("RongIMLib Version: ".concat("5.5.3",", Commit: ").concat("91c274754ff48547d8f76b79194ed406200cffe4",",appkey:").concat(e));var o=null==n?void 0:n.connectionType;o?I.WEBSOCKET!==o&&I.COMET!==o&&(ee.warn("RongIMLib connectionType must be ".concat(I.WEBSOCKET," or ").concat(I.COMET)),o=I.WEBSOCKET):o=I.WEBSOCKET,c.info(r.A_INIT_O,{appkey:e,navigators:n.navi?[n.navi]:[],connectionType:o,logLevel:n.logLevel,typingExpireTime:n.typingExpireTime}),le=R.init(Z,{appkey:e,apiVersion:"5.5.3",navigators:n.navi?[n.navi]:[],miniCMPProxy:[],connectionType:o,logLevel:n.logLevel,logStdout:n.logStdout,typingExpireTime:n.typingExpireTime,indexDBSwitch:n.indexDBSwitch,checkCA:n.checkCA}),Me=Math.min(15,Math.max(n.readReceiptTimeout||1,1)),Ce=new me(le,{readReceiptTimeout:Me})},getInstance:function(){return Ce},setConnectionStatusListener:function(e){var t=c.ID();le.assignWatcher({connectionState:function(n){c.info(r.A_CONNECT_S,{status:n},{traceId:t}),ne.clear(),e.onChanged(n)}})},setOnReceiveMessageListener:function(e){le.assignWatcher({message:function(t,n,o){try{var a=re(t),s=le.getCurrentUserId(),i=le.getConnectedTime();ie(a,s,i,Me),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=se.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,se.set(r,i));s.receiptMessageDic[t]=d,e.content=s}return e}(a,s,i,Me),C()||ne.set(t),c.info(r.A_PULL_MSG_O,{message:t.messageUId}),e.onReceived(a,void 0,o)}catch(e){ee.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){ee.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){ee.error("setMessageExpansionListener ->error:".concat(e))}}})},setTagListener:function(e){le.assignWatcher({tag:function(){e.onChanged()}})},setConversationTagListener:function(e){le.assignWatcher({conversationTagChanged:function(){e.onChanged()}})},setPullOffLineFinished:function(e){le.assignWatcher({pullFinished:function(){e.onFinished()}})},setTypingStatusListener:function(e){le.assignWatcher({typingState:function(t){e.onChanged(t)}})},setMessageBlockedListener:function(e){le.assignWatcher({messageBlocked:function(t){e.onReceived(t)}})},setChatRoomStatusListener:function(e){le.assignWatcher({chatroomState:function(t){e.onChanged(t)}})},connect:function(e,t){return N(this,void 0,void 0,(function(){var n,o,a;return _(this,(function(i){switch(i.label){case 0:return n=c.ID(),c.info(r.A_CONNECT_T,{token:e,reconnectKickEnable:!1},{traceId:n}),ee.info("connect ->token:".concat(e)),[4,le.connect(e,!1,!1,n)];case 1:return o=i.sent(),(o.code===s.SUCCESS?c.info:c.warn)(r.A_CONNECT_R,{code:o.code,userId:o.userId},{traceId:n}),o.code===s.SUCCESS?(t.onSuccess(o.userId),a=new Date(le.getConnectedTime()-1e3*Me*60*60*24).getTime(),se.getKeys().forEach((function(e){if(/SENT$/.test(e)){var t=se.get(e).dealtime;t&&a-t>0&&se.remove(e)}else if(/RECEIVED$/.test(e)){var n=se.get(e),o=Object.keys(n).length;Object.keys(n).forEach((function(e){var t=n[e].dealtime;t&&a-t>0&&delete n[e]})),Object.keys(n).length!==o&&(0===n.length?se.remove(e):se.set(e,n))}}))):o.code===s.RC_CONN_USER_OR_PASSWD_ERROR?(ee.warn("connect ->code:".concat(o.code,",token:").concat(e)),t.onTokenIncorrect()):(ee.warn("connect ->code:".concat(o.code,",token:").concat(e)),t.onError(o.code)),[2]}}))}))},reconnect:function(e,t){var n=c.ID();c.info(r.A_RECONNECT_T,{},{traceId:n}),le.reconnect().then((function(t){(t.code===s.SUCCESS?c.info:c.warn)(r.A_RECONNECT_R,{code:t.code,userId:t.userId},{traceId:n}),t.code===s.SUCCESS?e.onSuccess(t.userId):(ee.warn("reconnect ->code:".concat(t.code)),e.onError(t.code))})).catch((function(t){e.onError(t)}))},RegisterMessage:{},RegisterMessageTypeMapping:ae,getMessageObjectName:function(e){var t=U(U({},oe),ae);return Object.keys(t).find((function(n){return t[n]===e}))||e},registerMessageType:function(e,t,n,o){this.RegisterMessage[e]=fe(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)?(ee.error("Tag error. Tags that start with RC are used internally by the SDK !"),null):["IM","RTC"].includes(t)?new i(e,t,"A"):(ee.error("The parameter type must be one of IM, or RTC !"),null)},messageWatch:function(e){var t=this;Ie.push((function(n){var o,a;ee.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){ee.error("messageWatch ->error:".concat(e))}})),le.assignWatcher({rtcInnerWatcher:ye})},statusWatch:function(e){Re.push((function(t){ee.info("statusWatch ->status:".concat(t));try{e(t)}catch(e){ee.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:{}},Ee=function(e,t,n){this.type=e,this.userIdList=t,this.mentionedContent=n},Ue=function(e,t){this.isCounted=e,this.isPersited=t},Ne=fe("TextMessage","RC:TxtMsg"),_e=fe("LocationMessage","RC:LBSMsg"),Ae=fe("TypingStatusMessage","RC:TypSts"),Le=fe("ImageMessage","RC:ImgMsg"),we=fe("RichContentMessage","RC:ImgTextMsg"),Be=fe("VoiceMessage","RC:VcMsg"),xe=fe("HQVoiceMessage","RC:HQVCMsg"),ke=fe("FileMessage","RC:FileMsg"),be=fe("SightMessage","RC:SightMsg"),Pe=fe("GIFMessage","RC:GIFMsg"),Oe=fe("ReadReceiptMessage","RC:ReadNtf"),De=fe("ReadReceiptRequestMessage","RC:RRReqMsg"),Ge=fe("RCCombineMessage","RC:CombineMsg"),Ke=function(e,t,n,o,a,s,c,r,i,d,u,g,f,C,l,p,h,S){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=f,this.receivedTime=C,this.canIncludeExpansion=l,this.expansion=p,this.receiptResponse=h,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"}(ve||(ve={}));var Fe,He=fe("AcceptMessage","RC:VCAccept"),We=fe("RingingMessage","RC:VCRinging"),Ve=fe("SummaryMessage","RC:VCSummary"),qe=fe("HungupMessage","RC:VCHangup"),je=fe("InviteMessage","RC:VCInvite"),Je=fe("MediaModifyMessage","RC:VCModifyMedia"),Ye=fe("MemberModifyMessage","RC:VCModifyMem"),Qe=fe("lastMessageSendTime","RC:SRSMsg"),Xe=fe("ReferenceMessage","RC:ReferenceMsg"),ze=fe("PublicServiceRichContentMessage","RC:PSImgTxtMsg"),$e=fe("PublicServiceMultiRichContentMessage","RC:PSMultiImgTxtMsg");!function(e){e[e.ALL=1]="ALL",e[e.PART=2]="PART"}(Fe||(Fe={}));var Ze=Fe,et=y;window&&(window.RongIMClient=Te);export{He as AcceptMessage,ge as BaseMessage,he as ChannelClient,et as ConnectionState,ke as FileMessage,Pe as GIFMessage,E as GetChatRoomType,xe as HQVoiceMessage,qe as HungupMessage,me as IMClient,Le as ImageMessage,je as InviteMessage,_e as LocationMessage,Je as MediaModifyMessage,Ye as MemberModifyMessage,Ee as MentionedInfo,Ze as MentionedType,Ke as Message,Ue as MessageTag,$e as PublicServiceMultiRichContentMessage,ze as PublicServiceRichContentMessage,Ge as RCCombineMessage,Oe as ReadReceiptMessage,De as ReadReceiptRequestMessage,pe as ReadReceiptResponseMessage,Xe as ReferenceMessage,we as RichContentMessage,We as RingingMessage,Te as RongIMClient,T as SentStatus,be as SightMessage,Ve as SummaryMessage,Qe as SyncReadStatusMessage,Ne as TextMessage,Ae as TypingStatusMessage,ve as VoIPMediaType,Be 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 n,o=e;!function(e){e[e.NONE=0]="NONE",e[e.SQQUENCE=1]="SQQUENCE",e[e.REVERSE=2]="REVERSE"}(n||(n={}));var s=n,a=function(){return a=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var s in t=arguments[n])Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s]);return e},a.apply(this,arguments)};function r(e,t,n,o){return new(n||(n=Promise))((function(s,a){function r(e){try{i(o.next(e))}catch(e){a(e)}}function c(e){try{i(o.throw(e))}catch(e){a(e)}}function i(e){var t;e.done?s(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 c(e,t){var n,o,s,a,r={label:0,sent:function(){if(1&s[0])throw s[1];return s[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(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,o&&(s=2&a[0]?o.return:a[0]?o.throw||((s=o.return)&&s.call(o),0):o.next)&&!(s=s.call(o,a[1])).done)return s;switch(o=0,s&&(a=[2&a[0],s.value]),a[0]){case 0:case 1:s=a;break;case 4:return r.label++,{value:a[1],done:!1};case 5:r.label++,o=a[1],a=[0];continue;case 7:a=r.ops.pop(),r.trys.pop();continue;default:if(!(s=r.trys,(s=s.length>0&&s[s.length-1])||6!==a[0]&&2!==a[0])){r=0;continue}if(3===a[0]&&(!s||a[1]>s[0]&&a[1]<s[3])){r.label=a[1];break}if(6===a[0]&&r.label<s[1]){r.label=s[1],s=a;break}if(s&&r.label<s[2]){r.label=s[2],r.ops.push(a);break}s[2]&&r.ops.pop(),r.trys.pop();continue}a=t.call(e,r)}catch(e){a=[6,e],o=0}finally{n=s=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}}function i(e,t,n){if(n||2===arguments.length)for(var o,s=0,a=t.length;s<a;s++)!o&&s in t||(o||(o=Array.prototype.slice.call(t,0,s)),o[s]=t[s]);return e.concat(o||Array.prototype.slice.call(t))}var u=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))},d=u();var g={tag:"browser",httpReq:function(e){var n=e.method||t.HttpMethod.GET,o=e.timeout||6e4,s=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(n,c),s&&a.setRequestHeader)for(var u in s)a.setRequestHeader(u,s[u]);if(i){a.timeout=o,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})}),o),a.send(r)}))},localStorage:null===window||void 0===window?void 0:window.localStorage,sessionStorage:null===window||void 0===window?void 0:window.sessionStorage,isSupportSocket:function(){var e="undefined"!=typeof WebSocket;return e||console.warn("websocket not support"),e},useNavi:!0,connectPlatform:"",isFromUniapp:d,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()}}},createDataChannel:function(e,n){return this.isSupportSocket()&&"websocket"===n?new t.WebSocketChannel(this,e):new t.CometChannel(this,e)},getNetworkType:function(){var e=navigator.connection||navigator.mozConnection||navigator.webkitConnection,n=e.type,o=e.effectiveType,s=n||o||t.NetworkType.UNKONWN;return new Promise((function(e){e(s)}))}},l=u(),C=function(e){return function(){for(var n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];var s=t.logger.ID();try{return t.logger.info(t.LogTagId.A_CALLBACK_O,{func_name:e,source:"wechat"},{traceId:s}),wx[e].apply(wx,n)}catch(n){t.logger.error(t.LogTagId.A_CALLBACK_E,{func_name:e,source:"wechat"},{traceId:s}),console.error(n)}}},f={setItem:C("setStorageSync"),getItem:C("getStorageSync"),removeItem:C("removeStorageSync"),clear:C("clearStorageSync")},p={tag:"wechat",httpReq:function(e){var n=e.method||t.HttpMethod.GET,o=e.timeout||6e4,s=e.headers,a=e.query,r=e.body,c=t.appendUrl(e.url,a);return new Promise((function(e){wx.request({url:c,method:n,header:s,timeout:o,data:r,success:function(t){e({data:t.data,status:t.statusCode})},fail:function(){e({status:t.ErrorCode.RC_HTTP_REQ_TIMEOUT})}})}))},localStorage:f,sessionStorage:f,isSupportSocket:function(){return!0},useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:l,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})}}},createDataChannel:function(e,n){return"websocket"===n?new t.WebSocketChannel(this,e):new t.CometChannel(this,e)},getNetworkType:function(){return new Promise((function(e){wx.getNetworkType({success:function(t){var n=t.networkType;e(n)},fail:function(){e(t.NetworkType.UNKONWN)}})}))}},R=u(),h=function(e){return function(){for(var n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];var s=t.logger.ID();try{if(t.logger.info(t.LogTagId.A_CALLBACK_O,{func_name:e,source:"alipay"},{traceId:s}),"setStorageSync"===e)return my[e]({key:n[0],data:JSON.parse(n[1])});if("clearStorageSync"===e)return my[e]();if("removeStorageSync"===e)return my[e]({key:n[0]});var a=my[e]({key:n[0]}).data;return a?JSON.stringify(a):a}catch(n){t.logger.error(t.LogTagId.A_CALLBACK_E,{func_name:e,source:"alipay"},{traceId:s}),console.error(n)}}},S={setItem:h("setStorageSync"),getItem:h("getStorageSync"),removeItem:h("removeStorageSync"),clear:h("clearStorageSync")},m={tag:"alipay",httpReq:function(e){var n=e.method||t.HttpMethod.GET,o=e.timeout||6e4,s=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:n,headers:s,timeout:o,data:r,dataType:i,success:function(t){e({data:t.data,status:t.status})},fail:function(){e({status:t.ErrorCode.RC_HTTP_REQ_TIMEOUT})}})}))},localStorage:S,sessionStorage:S,isSupportSocket:function(){return!0},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()}}},createDataChannel:function(e,n){return"websocket"===n?new t.WebSocketChannel(this,e):new t.CometChannel(this,e)},getNetworkType:function(){return new Promise((function(e){my.getNetworkType({success:function(t){var n=t.networkType;e(n)},fail:function(){e(t.NetworkType.UNKONWN)}})}))}},I=u(),T=function(e){return function(){for(var n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];var s=t.logger.ID();try{return t.logger.info(t.LogTagId.A_CALLBACK_O,{func_name:e,source:"toutiao"},{traceId:s}),tt[e].apply(tt,n)}catch(n){t.logger.error(t.LogTagId.A_CALLBACK_E,{func_name:e,source:"toutiao"},{traceId:s}),console.error(n)}}},M={setItem:T("setStorageSync"),getItem:T("getStorageSync"),removeItem:T("removeStorageSync"),clear:T("clearStorageSync")},y={tag:"toutiao",isSupportSocket:function(){return!0},useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:I,localStorage:M,sessionStorage:M,httpReq:function(e){return new Promise((function(t,n){tt.request({url:e.url,data:e.body,header:e.headers,method:e.method,success:function(e){console.log("调用成功",e.data);var n=(null==e?void 0:e.data)||{},o={data:JSON.stringify(n),status:e.statusCode};t(o)},fail:function(e){console.log("调用失败",e.errMsg),n({data:e.errMsg})}})}))},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})}}},createDataChannel:function(e,n){return"websocket"===n?new t.WebSocketChannel(this,e):new t.CometChannel(this,e)},getNetworkType:function(){return new Promise((function(e){tt.getNetworkType({success:function(t){var n=t.networkType;e(n)},fail:function(){e(t.NetworkType.UNKONWN)}})}))}},v=u(),E=function(e){return function(){for(var n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];var s=t.logger.ID();try{return t.logger.info(t.LogTagId.A_CALLBACK_O,{func_name:e,source:"baidu"},{traceId:s}),swan[e].apply(swan,n)}catch(n){t.logger.error(t.LogTagId.A_CALLBACK_E,{func_name:e,source:"baidu"},{traceId:s}),console.error(n)}}},A={setItem:E("setStorageSync"),getItem:E("getStorageSync"),removeItem:E("removeStorageSync"),clear:E("clearStorageSync")},U={tag:"baidu",isSupportSocket:function(){return!0},useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:v,localStorage:A,sessionStorage:A,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){console.log("调用成功",e.data);var n=(null==e?void 0:e.data)||{},o={data:JSON.stringify(n),status:e.statusCode};t(o)},fail:function(e){console.log("调用失败",e.errorCode),n({data:e.errorCode})}})}))},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})}}},createDataChannel:function(e,n){return"websocket"===n?new t.WebSocketChannel(this,e):new t.CometChannel(this,e)},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 n=t.networkType;e(n)},fail:function(){e(t.NetworkType.UNKONWN)}})}))]}))}))}},N=function(e){return function(){for(var n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];var s=t.logger.ID();try{return t.logger.info(t.LogTagId.A_CALLBACK_O,{func_name:e,source:"uniapp"},{traceId:s}),uni[e].apply(uni,n)}catch(n){t.logger.error(t.LogTagId.A_CALLBACK_E,{func_name:e,source:"uniapp"},{traceId:s}),console.error(n)}}},_={setItem:N("setStorageSync"),getItem:N("getStorageSync"),removeItem:N("removeStorageSync"),clear:N("clearStorageSync")},L={tag:"uniapp",httpReq:function(e){var n=e.method||t.HttpMethod.GET,o=e.timeout||6e4,s=e.headers,a=e.query,r=e.body,c=t.appendUrl(e.url,a);return new Promise((function(e){uni.request({url:c,method:n,header:s,timeout:o,data:r,success:function(t){e({data:t.data,status:t.statusCode})},fail:function(){e({status:t.ErrorCode.RC_HTTP_REQ_TIMEOUT})}})}))},localStorage:_,sessionStorage:_,isSupportSocket:function(){return!0},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})}}},createDataChannel:function(e,n){return"websocket"===n?new t.WebSocketChannel(this,e):new t.CometChannel(this,e)},getNetworkType:function(){return new Promise((function(e){uni.getNetworkType({success:function(t){var n=t.networkType;e(n)},fail:function(){e(t.NetworkType.UNKONWN)}})}))}},x=function(e){return e&&e.request&&e.getSystemInfo},w="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 m;case"mp-weixin":return p;default:return g}}():"undefined"!=typeof my&&x(my)?m:"undefined"!=typeof tt&&x(tt)?y:"undefined"!=typeof swan&&x(swan)?U:"undefined"!=typeof wx&&x(wx)?p:g,B=new t.Logger("RCIM");function b(e,t,n){return"".concat(e,"_").concat(t,"_").concat(n)}var k=function(){function e(){}return e.set=function(n){if(t.SEND_MESSAGE_TYPE_OPTION[n.messageType]&&t.SEND_MESSAGE_TYPE_OPTION[n.messageType].isPersited){var o=e.get(n.conversationType,n.targetId,n.channelId||"");if(!o||o.sentTime<n.sentTime){var s=b(n.conversationType,n.targetId,n.channelId||"");e.map[s]=n}}},e.get=function(t,n,o){var s=b(t,n,o);return e.map[s]||null},e.remove=function(t,n,o){var s=b(t,n,o);delete e.map[s]},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"},O={},D=new t.AppStorage(w,"API-V2");function G(e){var n=e.channelId,o=e.conversationType,s=e.targetId,a=e.unreadMessageCount,r=e.latestMessage,c=e.isTop,i=e.notificationStatus,u=e.matchCount;if(!t.usingCppEngine()){var d=k.get(o,s,n||"");r?d&&r.sentTime<d.sentTime&&(r=d):r=d}var g=r?K(r):null;return{channelId:n||"",conversationType:o,targetId:s,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 n=e.conversationType,s=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,S=e.sentStatus,m=e.channelId,I=e.readReceiptInfo,T=e.pushConfig,M="";return c in P?M=P[c]:c in O?M=O[c]:(r={message:{content:r,objectName:c},messageName:"UnknownMessage"},M="UnknownMessage"),l||(l=t.ReceivedStatus.UNREAD),void 0===h&&(h=~~(16777215*Math.random())),{channelId:m||"",conversationType:n,targetId:s,senderUserId:a,content:r,messageType:M,messageUId:i,messageDirection:u,offLineMessage:d,sentTime:g,receivedStatus:l,receivedTime:C,objectName:c,messageId:h,sentStatus:S||o.SENT,disableNotification:p,canIncludeExpansion:f,expansion:R,readReceiptInfo:I,pushConfig:T}}function F(e,n,o,s){var a=new Date(o-1e3*s*60*60*24).getTime()-e.sentTime<0,r=e.messageType,c=e.messageDirection;if("ReadReceiptRequestMessage"===r&&a&&c===t.MessageDirection.SEND){var i="".concat(n).concat(e.content.messageUId,"SENT");D.set(i,{count:0,dealtime:e.sentTime,userIds:{}})}else if("ReadReceiptRequestMessage"===r&&a){var u="".concat(n).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,n){try{e(t,n)}catch(e){B.error(e)}}function W(e,t,n){try{e(t,n)}catch(e){B.error(e)}}var j=function(e,t,n,o,s){void 0===o&&(o=!0),void 0===s&&(s=!0),this.messageType=e,this.objectName=t,this.content=n,this.isPersited=o,this.isCounted=s};function V(e,t,n,o){void 0===n&&(n=!0),void 0===o&&(o=!0);var s=function(s){return new j(e,t,s,n,o)};return s.MessageType=e,s.ObjectName=t,s}var q,Y,J=V("ReadReceiptResponseMessage","RC:RRRspMsg"),Q=function(){function e(e,t,n,o){this._context=e,this.channelId=t,this._isCPPMode=n,this._readReceiptTimeout=o,this._storage=D,this._draftMap={}}return e.prototype.getConversationList=function(e,n,o){t.assert("callback",e,t.AssertRules.CALLBACK),t.assert("conversationTypes",n,t.AssertRules.ARRAY),t.assert("count",o,t.AssertRules.NUMBER),this._context.getConversationList(o,void 0,0,0,this.channelId).then((function(o){var s=o.code,a=o.data,r=[];a=a||[],s===t.ErrorCode.SUCCESS?(n?a.forEach((function(e){n.indexOf(e.conversationType)>-1&&r.push(G(e))})):a.forEach((function(e){r.push(G(e))})),H(e.onSuccess,r)):(B.warn("getConversationList -> code:".concat(s)),W(e.onError,s))}))},e.prototype.getConversation=function(e,n,o){var s=this;t.assert("callback",o,t.AssertRules.CALLBACK),t.assert("conversationType",e,t.AssertRules.NUMBER,!0),t.assert("targetId",n,t.AssertRules.STRING,!0),B.info("getConversation ->targetId:".concat(n,",conversationType:").concat(e)),r(s,void 0,void 0,(function(){var s,a,r;return c(this,(function(c){switch(c.label){case 0:return[4,this._context.getConversation(e,n,this.channelId)];case 1:return s=c.sent(),a=s.code,r=s.data,a!==t.ErrorCode.SUCCESS?(B.warn("getConversation ->code:".concat(a,",targetId:").concat(n)),o.onError(a),[2]):(o.onSuccess(r?G(r):null),[2])}}))}))},e.prototype.removeConversation=function(e,n,o){var s=this;t.assert("conversationType",e,t.AssertRules.NUMBER,!0),t.assert("targetId",n,t.AssertRules.STRING,!0),t.assert("callback",o,t.AssertRules.CALLBACK),B.info("removeConversation ->targetId:".concat(n,",conversationType:").concat(e)),this._context.removeConversation(e,n,this.channelId).then((function(a){a===t.ErrorCode.SUCCESS?(s._isCPPMode||k.remove(e,n,s.channelId),H(o.onSuccess)):(B.warn("removeConversation ->code:".concat(a,",targetId:").concat(n)),W(o.onError,a))}))},e.prototype.saveTextMessageDraft=function(e,n,o){t.assert("conversationType",e,t.AssertRules.NUMBER,!0),t.assert("targetId",n,t.AssertRules.STRING,!0),t.assert("draftText",o,t.AssertRules.STRING,!0),B.info("saveTextMessageDraft ->targetId:".concat(n,",conversationType:").concat(e));var s=this._context.getCurrentUserId();return!!s&&((this._draftMap[s]=this._draftMap[s]||{})["".concat(e,"_").concat(n,"_").concat(this.channelId)]=o,!0)},e.prototype.getTextMessageDraft=function(e,n){t.assert("conversationType",e,t.AssertRules.NUMBER,!0),t.assert("targetId",n,t.AssertRules.STRING,!0),B.info("getTextMessageDraft ->targetId:".concat(n,",conversationType:").concat(e));var o=this._context.getCurrentUserId();if(o)return(this._draftMap[o]||{})["".concat(e,"_").concat(n,"_").concat(this.channelId)]},e.prototype.clearTextMessageDraft=function(e,n){t.assert("conversationType",e,t.AssertRules.NUMBER,!0),t.assert("targetId",n,t.AssertRules.STRING,!0),B.info("clearTextMessageDraft ->targetId:".concat(n,",conversationType:").concat(e));var o=this._context.getCurrentUserId();return!!o&&delete(this._draftMap[o]||{})["".concat(e,"_").concat(n,"_").concat(this.channelId)]},e.prototype.getTotalUnreadCount=function(e,n,o){t.assert("callback",e,t.AssertRules.CALLBACK),B.info("getTotalUnreadCount ->conversationTypes:".concat(n)),this._context.getTotalUnreadCount(this.channelId,n,o).then((function(n){var o=n.code,s=n.data;o===t.ErrorCode.SUCCESS?H(e.onSuccess,s):(B.warn("getTotalUnreadCount ->code:".concat(o)),W(e.onError,o))}))},e.prototype.getUnreadCount=function(e,n,o){t.assert("conversationType",e,t.AssertRules.NUMBER,!0),t.assert("targetId",n,t.AssertRules.STRING,!0),t.assert("callback",o,t.AssertRules.CALLBACK),B.info("getUnreadCount ->targetId:".concat(n,",conversationType:").concat(e)),this._context.getUnreadCount(e,n,this.channelId).then((function(e){var s=e.code,a=e.data;s===t.ErrorCode.SUCCESS?H(o.onSuccess,a):(B.warn("getUnreadCount ->code:".concat(s,",targetId:").concat(n)),W(o.onError,s))}))},e.prototype.clearConversations=function(e,n){B.info("clearConversations -> conversationTypes:".concat(n)),this._isCPPMode?this._context.clearConversations(n,this.channelId).then((function(n){n===t.ErrorCode.SUCCESS?H(e.onSuccess,!0):(B.warn("clearConversations ->code:".concat(n)),W(e.onError,n))})):B.error("Method is only available in cppProtocol mode")},e.prototype.clearUnreadCount=function(e,n,o){t.assert("conversationType",e,t.AssertRules.NUMBER,!0),t.assert("targetId",n,t.AssertRules.STRING,!0),t.assert("callback",o,t.AssertRules.CALLBACK),B.info("clearUnreadCount ->targetId:".concat(n,",conversationType:").concat(e)),this._context.clearUnreadCount(e,n,this.channelId).then((function(e){e===t.ErrorCode.SUCCESS?H(o.onSuccess,!0):(B.warn("clearUnreadCount ->code:".concat(e,",targetId:").concat(n)),W(o.onError,e))}))},e.prototype.clearAllUnreadCount=function(e){t.assert("callback",e,t.AssertRules.CALLBACK),B.info("clearUnreadCount ->"),this._context.clearAllUnreadCount().then((function(n){n===t.ErrorCode.SUCCESS?H(e.onSuccess,!0):(B.warn("clearUnreadCount ->code:".concat(n)),W(e.onError,n))}))},e.prototype.getFirstUnreadMessage=function(e,n,o){t.assert("conversationType",e,t.AssertRules.NUMBER,!0),t.assert("targetId",n,t.AssertRules.STRING,!0),t.assert("callback",o,t.AssertRules.CALLBACK),B.info("getFirstUnreadMessage ->targetId:".concat(n,",conversationType:").concat(e)),this._context.getFirstUnreadMessage(e,n,this.channelId).then((function(e){e.code===t.ErrorCode.SUCCESS?H(o.onSuccess,e.data?K(e.data):null):(B.warn("getFirstUnreadMessage ->code:".concat(e.code,",targetId:").concat(n)),W(o.onError,e.code))}))},e.prototype.setConversationStatus=function(e,n,o,s){t.assert("conversationType",e,t.AssertRules.NUMBER,!0),t.assert("targetId",n,t.AssertRules.STRING,!0),t.assert("callback",s,t.AssertRules.CALLBACK),t.assert("status",o,t.AssertRules.OBJECT,!0),B.info("setConversationStatus ->targetId:".concat(n,",status:").concat(o));var a=o.isTop,r=o.notificationStatus;this._context.setConversationStatus(e,n,a,r,this.channelId).then((function(e){e===t.ErrorCode.SUCCESS?H(s.onSuccess):(B.warn("setConversationStatus ->code:".concat(e,",targetId:").concat(n)),W(s.onError,e))}))},e.prototype.sendMessage=function(e,n,s,r,c,i,u,d){var g=this;t.assert("conversationType",e,t.AssertRules.NUMBER,!0),t.assert("targetId",n,t.AssertRules.STRING,!0),t.assert("msg",s,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),B.info("sendMessage ->targetId:".concat(n,",conversationType:").concat(e));var l=!(!(null==d?void 0:d.isStatusMessage)&&!(null==d?void 0:d.isStatus)),C=function(e,t,n){var o,s=e||{},a=s.userIds,r=s.isVoipPush,c=s.disableNotification,i=s.isFilerWhiteBlacklist,u=s.expansion,d=s.canIncludeExpansion,g=s.pushConfig,l=s.resendMessageId,C=[];if(t){var f=(n||{}).content.mentionedInfo;C=f.userIdList,o=f.type}return{mentionedType:o,mentionedUserIdList:C,directionalUserIdList:a,isVoipPush:r,disableNotification:c,isFilerWhiteBlacklist:i,expansion:u,canIncludeExpansion:d,pushConfig:g,messageId:l}}(d,c,s),f=Object.assign(s,a(a({isMentioned:c,pushContent:i,pushData:u},C),{messageType:s.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:n,channelId:this.channelId},{traceId:R}),this._context.sendMessage(e,n,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||k.set(i);var u=K(i);F(u,p,g._context.getConnectedTime(),g._readReceiptTimeout),H(r.onSuccess,u)}else B.warn("sendMessage ->code:".concat(c,",targetId:").concat(n)),W(r.onError,c,K({isMentioned:!!f.isMentioned,content:s.content,messageType:s.messageType,isPersited:s.isPersited,isCounted:s.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:n,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:o.FAILED}))}))},e.prototype.sendRecallMessage=function(e,n,o){var s=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",n,t.AssertRules.CALLBACK),t.assert("options.disableNotification",null==o?void 0:o.disableNotification,t.AssertRules.BOOLEAN),t.assert("options.pushConfig",null==o?void 0:o.pushConfig,t.AssertRules.OBJECT),t.assert("options.extra",null==o?void 0:o.extra,t.AssertRules.STRING);var r=e.conversationType,c=e.targetId,i=e.messageUId,u=e.sentTime;B.info("sendRecallMessage ->targetId:".concat(c,",conversationType:").concat(r,",messageUId:").concat(i));var d=a({channelId:this.channelId},o);this._context.recallMessage(r,c,i,u,d).then((function(e){var o=e.code,a=e.data;o===t.ErrorCode.SUCCESS?(s._isCPPMode||k.set(a),H(n.onSuccess,K(a))):(B.warn("sendRecallMessage ->code:".concat(o,",targetId:").concat(c,",messageUId:").concat(i)),W(n.onError,o))}))},e.prototype.sendTypingStatusMessage=function(e,n,o,s){t.assert("conversationType",e,t.AssertRules.NUMBER,!0),t.assert("targetId",n,t.AssertRules.STRING,!0),t.assert("typingContentType",o,t.AssertRules.STRING,!0),t.assert("callback",s,t.AssertRules.CALLBACK),B.info("sendTypingStatusMessage ->targetId:".concat(n,",conversationType:").concat(e));var a={messageType:"RC:TypSts",content:{typingContentType:o},isStatusMessage:!0,channelId:this.channelId},r=t.logger.ID();t.logger.info(t.LogTagId.A_SEND_MSG_T,{messageType:a.messageType,conversationType:e,targetId:n,channelId:a.channelId},{traceId:r}),this._context.sendMessage(e,n,a,void 0,r).then((function(e){var o=e.code,a=e.data;(o===t.ErrorCode.SUCCESS?t.logger.info:t.logger.warn)(t.LogTagId.A_SEND_MSG_R,{code:o,messageUId:a?a.messageUId:"",messageId:a?a.messageId:""},{traceId:r}),o===t.ErrorCode.SUCCESS?H(s.onSuccess,K(a)):(B.warn("sendTypingStatusMessage ->code:".concat(o,",targetId:").concat(n)),W(s.onError,o))}))},e.prototype.sendReceiptResponse=function(e,t,n){var o=this;B.info("sendReceiptResponse ->targetId:".concat(t,",conversationType:").concat(e));var s=this._context.getCurrentUserId(),a="".concat(s).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 n.onSuccess(null);var d=setInterval((function(){1===c.length&&clearInterval(d);var s=c.splice(0,1)[0],i=new J({receiptMessageDic:s});o.sendMessage(e,t,i,{onSuccess:function(e){var t=Object.keys(s)[0];r[t].isResponse=!0,o._storage.set(a,r),H(n.onSuccess,e)},onError:function(e){B.warn("sendReceiptResponse ->code:".concat(e,",targetId:").concat(t)),W(n.onError,e)}})}),200)}else n.onSuccess(null)},e.prototype.sendReadReceiptMessage=function(e,n,o){t.assert("messageUIds",e,t.AssertRules.ARRAY,!0),t.assert("targetId",n,t.AssertRules.STRING,!0),B.info("sendReadReceiptMessage ->targetId:".concat(n,",messageUIds:").concat(e));for(var s=0,a=e;s<a.length;s++){var r=a[s];t.assert("messageUId",r,t.AssertRules.STRING)}this._context.sendReadReceiptMessage(n,e,this.channelId).then((function(s){var a=s.code;a===t.ErrorCode.SUCCESS?o.onSuccess():(B.warn("sendReadReceiptMessage ->code:".concat(a,",targetId:").concat(n,",messageUIds:").concat(e)),o.onError(a))})).catch((function(t){B.warn("sendReadReceiptMessage ->code:".concat(t,",targetId:").concat(n,",messageUIds:").concat(e)),o.onError(t)}))},e.prototype.getMessageReader=function(e,n,o){t.assert("messageUId",e,t.AssertRules.STRING,!0),t.assert("targetId",n,t.AssertRules.STRING,!0),B.info("getMessageReader ->targetId:".concat(n,",messageUId:").concat(e)),this._context.getMessageReader(n,e,this.channelId).then((function(s){var a=s.code,r=s.data;a===t.ErrorCode.SUCCESS?o.onSuccess(r):(B.warn("getMessageReader ->code:".concat(a,",targetId:").concat(n,",messageUId:").concat(e)),o.onError(a))})).catch((function(t){B.warn("getMessageReader ->code:".concat(t,",targetId:").concat(n,",messageUId:").concat(e)),o.onError(t)}))},e.prototype.updateMessageExpansion=function(e,n,o){t.assert("expansion",e,t.AssertRules.OBJECT,!0),t.assert("message",n,t.AssertRules.OBJECT,!0);var s=n.conversationType,a=n.targetId,r=n.messageUId,c=n.canIncludeExpansion,i=n.expansion;B.info("updateMessageExpansion ->targetId:".concat(a,",messageUId:").concat(r,",conversationType:").concat(s)),this._context.sendExpansionMessage({conversationType:s,targetId:a,messageUId:r,canIncludeExpansion:c,originExpansion:i,expansion:e,channelId:this.channelId}).then((function(e){var n=e.code;n===t.ErrorCode.SUCCESS?H(o.onSuccess):(B.warn("updateMessageExpansion ->code:".concat(n,",targetId:").concat(a,",messageUId:").concat(r)),W(o.onError,n))}))},e.prototype.removeMessageExpansionForKey=function(e,n,o){t.assert("keys",e,t.AssertRules.ARRAY,!0),t.assert("message",n,t.AssertRules.OBJECT,!0);var s=n.conversationType,a=n.targetId,r=n.messageUId,c=n.canIncludeExpansion;B.info("removeMessageExpansionForKey ->targetId:".concat(a,",messageUId:").concat(r,",conversationType:").concat(s)),this._context.sendExpansionMessage({conversationType:s,targetId:a,messageUId:r,canIncludeExpansion:c,keys:e,channelId:this.channelId}).then((function(e){var n=e.code;n===t.ErrorCode.SUCCESS?H(o.onSuccess):(B.warn("removeMessageExpansionForKey ->code:".concat(n,",targetId:").concat(a,",messageUId:").concat(r)),W(o.onError,n))}))},e.prototype.getHistoryMessages=function(e,n,o,s,a,r,c){t.assert("conversationType",e,t.AssertRules.NUMBER,!0),t.assert("targetId",n,t.AssertRules.STRING,!0),t.assert("timestamp",o,t.AssertRules.NUMBER,!0),t.assert("count",s,t.AssertRules.NUMBER,!0),t.assert("callback",a,t.AssertRules.CALLBACK,!0),t.assert("order",c,t.AssertRules.NUMBER),B.info("getHistoryMessages ->targetId:".concat(n,",conversationType:").concat(e,",timestamp:").concat(o));var i=t.logger.ID();t.logger.info(t.LogTagId.A_GET_HISTORY_MSG_T,{targetId:n,conversationType:e,channelId:"",timestamp:o,count:s},{traceId:i}),this._context.getHistoryMessage(e,n,o,s,c,this.channelId,r,i).then((function(e){var o=e.code,s=e.data;if(o===t.ErrorCode.SUCCESS)if(s){var r=s.list,c=s.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:o,messageUIds:u.join(",")},{traceId:i}),H(a.onSuccess,d,c)}else t.logger.info(t.LogTagId.A_GET_HISTORY_MSG_R,{code:o,messageUIds:""},{traceId:i}),H(a.onSuccess,[],!1);else t.logger.warn(t.LogTagId.A_GET_HISTORY_MSG_R,{code:o,messageUIds:""},{traceId:i}),B.warn("getHistoryMessages ->code:".concat(o,",targetId:").concat(n)),W(a.onError,o)}))},e.prototype.deleteRemoteMessages=function(e,n,o,s){var a=this;t.assert("conversationType",e,t.AssertRules.NUMBER,!0),t.assert("targetId",n,t.AssertRules.STRING,!0),t.assert("messages",o,t.AssertRules.ARRAY,!0),t.assert("callback",s,t.AssertRules.CALLBACK),B.info("deleteRemoteMessages ->targetId:".concat(n,",conversationType:").concat(e)),this._context.deleteRemoteMessage(e,n,o,this.channelId).then((function(r){if(r===t.ErrorCode.SUCCESS){if(!a._isCPPMode){var c=k.get(e,n,a.channelId);c&&o.forEach((function(t){c.messageUId===t.messageUId&&k.remove(e,n,a.channelId)}))}H(s.onSuccess)}else B.warn("deleteRemoteMessages ->code:".concat(r,",targetId:").concat(n)),W(s.onError,r)}))},e.prototype.clearRemoteHistoryMessages=function(e,n){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",n,t.AssertRules.CALLBACK);var o=e.conversationType,s=e.targetId,a=e.timestamp;B.info("clearRemoteHistoryMessages ->targetId:".concat(s,",conversationType:").concat(o)),this._context.deleteRemoteMessageByTimestamp(o,s,a,this.channelId).then((function(e){e===t.ErrorCode.SUCCESS?H(n.onSuccess):(B.warn("clearRemoteHistoryMessages ->code:".concat(e)),W(n.onError,e))}))},e.prototype.getConversationListWithAllChannel=function(e){t.assert("callback",e,t.AssertRules.CALLBACK),this._context.getConversationListWithAllChannel().then((function(n){var o=n.code,s=n.data;o===t.ErrorCode.SUCCESS?H(e.onSuccess,s.map(G)):W(e.onError,o)}))},e.prototype.getConversationListWithAllChannelByPage=function(e,n,o){t.assert("callback",e,t.AssertRules.CALLBACK),t.assert("index",n,t.AssertRules.NUMBER),t.assert("limit",o,t.AssertRules.NUMBER),this._context.getConversationListWithAllChannelByPage(n,o).then((function(n){var o=n.code,s=n.data;o===t.ErrorCode.SUCCESS?H(e.onSuccess,s.map(G)):W(e.onError,o)}))},e.prototype.insertMessage=function(e,n,o,s,a){void 0===a&&(a={});var r=o.senderUserId,c=o.objectName,i=o.content,u=o.messageDirection,d=o.messageUId,g=o.canIncludeExpansion,l=o.expansion,C=o.disableNotification,f=o.sentTime,p=o.sentStatus;B.info("insertMessage ->targetId:".concat(n,",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,n,h).then((function(e){var o=e.code,a=e.data;o===t.ErrorCode.SUCCESS?H(s.onSuccess,K(a)):(B.warn("insertMessage ->code:".concat(o,",targetId:").concat(n)),W(s.onError,o))}))},e.prototype.deleteLocalMessagesByTimestamp=function(e,n,o,s,a){B.info("deleteLocalMessagesByTimestamp ->targetId:".concat(n,",conversationType:").concat(e,",timestamp:").concat(o)),this._context.deleteMessagesByTimestamp(e,n,o,s,this.channelId).then((function(e){e===t.ErrorCode.SUCCESS?H(a.onSuccess,!0):(B.warn("deleteLocalMessagesByTimestamp ->code:".concat(e,",targetId:").concat(n)),W(a.onError,e))}))},e.prototype.getRemoteHistoryMessages=function(e,n,o,s,a,r){B.info("getRemoteHistoryMessages ->targetId:".concat(n,",conversationType:").concat(e));var c=r.order||0;this._context.getRemoteHistoryMessages(e,n,o,s,c,this.channelId).then((function(e){var o=e.code,s=e.data;if(o===t.ErrorCode.SUCCESS)if(s){var r=s.list,c=s.hasMore,i=r.map((function(e){return K(e)}));H(a.onSuccess,i,c)}else H(a.onSuccess,[],!1);else B.warn("getRemoteHistoryMessages ->code:".concat(o,",targetId:").concat(n)),W(a.onError,o)}))},e.prototype.clearMessages=function(e,n,o){var s=this;B.info("clearMessages ->targetId:".concat(n,",conversationType:").concat(e)),this._context.clearMessages(e,n,this.channelId).then((function(a){a===t.ErrorCode.SUCCESS?(s._isCPPMode||k.remove(e,n,s.channelId),H(o.onSuccess,!0)):(B.warn("clearMessages ->code:".concat(a,",targetId:").concat(n)),W(o.onError,a))}))},e.prototype.searchConversationByContent=function(e,n,o,s){B.info("searchConversationByContent ->keyword:".concat(e)),this._context.searchConversationByContent(e,s,this.channelId,o).then((function(o){var s=o.code,a=o.data,r=[];a=a||[],s===t.ErrorCode.SUCCESS?(a.forEach((function(e){r.push(G(e))})),H(n.onSuccess,r)):(B.warn("searchConversationByContent ->code:".concat(s,",keyword:").concat(e)),W(n.onError,s))}))},e.prototype.searchConversationByContentWithAllChannel=function(e,n,o,s){void 0===o&&(o=[]),t.logger.info("searchConversationByContentWithAllChannel ->keyword:".concat(e)),this._context.searchConversationByContentWithAllChannel(e,o,s).then((function(o){var s=o.code,a=o.data,r=[];a=a||[],s===t.ErrorCode.SUCCESS?(a.forEach((function(e){r.push(G(e))})),H(n.onSuccess,r)):(t.logger.warn("searchConversationByContentWithAllChannel ->code:".concat(s,",keyword:").concat(e)),W(n.onError,s))}))},e.prototype.searchMessageByContent=function(e,n,o,s,a,r,c){B.info("searchMessageByContent ->targetId:".concat(n,",conversationType:").concat(e,",keyword:").concat(o)),this._context.searchMessageByContent(e,n,o,s,a,r,this.channelId).then((function(e){var o=e.code,s=e.data,a=[];if(o===t.ErrorCode.SUCCESS){var r=s=s||{},i=r.messages,u=r.count;i.forEach((function(e){a.push(K(e))})),H(c.onSuccess,a,u)}else B.warn("searchMessageByContent ->code:".concat(o,",targetId:").concat(n)),W(c.onError,o)}))},e.prototype.searchMessageByContentWithAllChannel=function(e,n,o,s,a,r){t.logger.info("searchMessageByContentWithAllChannel ->targetId: ".concat(n," ,conversationType: ").concat(e," ,keyword: ").concat(o,", timestamp: ").concat(s,", count: ").concat(a)),this._context.searchMessageByContentWithAllChannel(e,n,o,s,a).then((function(e){var o=e.code,s=e.data,a=[];if(o===t.ErrorCode.SUCCESS){var c=s=s||{},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(o,",targetId:").concat(n)),W(r.onError,o)}))},e.prototype.searchMessageByContentInTimeRangeWithAllChannel=function(e,n,o,s,a,r,c,i){t.logger.info("searchMessageByContentInTimeRangeWithAllChannel ->targetId: ".concat(n," ,conversationType: ").concat(e," ,keyword: ").concat(o,", startTime: ").concat(s,", endTime: ").concat(a,", offset: ").concat(r,", limit: ").concat(c)),this._context.searchMessageByContentInTimeRangeWithAllChannel(e,n,o,s,a,r,c).then((function(e){var o=e.code,s=e.data,a=[];o===t.ErrorCode.SUCCESS?((s=s||{}).messages.forEach((function(e){a.push(K(e))})),H(i.onSuccess,a)):(t.logger.warn("searchMessageByContentInTimeRangeWithAllChannel ->code:".concat(o,",targetId:").concat(n)),W(i.onError,o))}))},e.prototype.getUnreadMentionedMessages=function(e,t){return B.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,n,o,s){B.info("clearUnreadCountByTimestamp ->targetId:".concat(n,",conversationType:").concat(e)),this._context.clearUnreadCountByTimestamp(e,n,o,this.channelId).then((function(e){e===t.ErrorCode.SUCCESS?H(s.onSuccess,!0):(B.warn("clearUnreadCountByTimestamp ->code:".concat(e,",targetId:").concat(n)),W(s.onError,e))}))},e.prototype.getConversationNotificationStatus=function(e,n,o){B.info("getConversationNotificationStatus ->targetId:".concat(n,",conversationType:").concat(e)),this._context.getConversationNotificationStatus(e,n,this.channelId).then((function(e){var s=e.code,a=e.data;s===t.ErrorCode.SUCCESS?H(o.onSuccess,a):(B.warn("getConversationNotificationStatus ->code:".concat(s,",targetId:").concat(n)),W(o.onError,s))}))},e}(),X=function(e){return{targetId:e.targetId,channelId:e.channelId,conversationType:e.type}},z=function(){function e(e,n){this._context=e,this._options=n,this._channelClient={},this._isCPPMode=t.usingCppEngine(),this._defaultChannelClient=new Q(e,"",this._isCPPMode,n.readReceiptTimeout)}return e.prototype.assertCPPMode=function(e,n,o){if(!this._isCPPMode)return null==o||o.onError(t.ErrorCode.NOT_SUPPORT),void B.error("'".concat(n,"' is unusable!"));e()},e.prototype.install=function(e,t){return this._context.install(e,t)},e.prototype.getChannel=function(e){return B.info("getChannel ->channelId:".concat(e)),this._isCPPMode?(t.assert("channelId",e,t.AssertRules.STRING,!0),e.length>20?(B.error("The channelId cannot exceed 20 characters"),null):e in this._channelClient?this._channelClient[e]:Object.keys(this._channelClient).length>1e3?(B.error("Only 1000 channels can be obtained"),null):(this._channelClient[e]=new Q(this._context,e,this._isCPPMode,this._options.readReceiptTimeout),this._channelClient[e])):(B.error("getChannel method is only available in protocol stack mode"),null)},e.prototype.deleteChannels=function(e){var n=this;t.assert("channelIds",e,t.AssertRules.ARRAY,!0),B.info("deleteChannels ->channelIds:".concat(e)),this.assertCPPMode((function(){e.forEach((function(e){delete n._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.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){B.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,s,a,r,c,i){return this._defaultChannelClient.sendMessage(e,t,n,o,s,a,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,s,a,r){return this._defaultChannelClient.getHistoryMessages(e,t,n,o,s,a,r)},e.prototype.joinChatRoom=function(e,n,o){t.assert("chatRoomId",e,t.AssertRules.STRING,!0),t.assert("count",n,t.AssertRules.NUMBER,!0),t.assert("callback",o,t.AssertRules.CALLBACK),B.info("joinChatRoom ->chatRoomId:".concat(e));var s=t.logger.ID();t.logger.info(t.LogTagId.A_JOIN_CHATROOM_T,{chatroomId:e,count:n,joinExist:!1},{traceId:s}),this._context.joinChatroom(e,n,s).then((function(n){(n===t.ErrorCode.SUCCESS?t.logger.info:t.logger.warn)(t.LogTagId.A_JOIN_CHATROOM_R,{code:n,timestamp:(new Date).getTime()},{traceId:s}),n===t.ErrorCode.SUCCESS?H(o.onSuccess):(B.warn("joinChatRoom ->code:".concat(n,",chatRoomId:").concat(e)),W(o.onError,n))}))},e.prototype.quitChatRoom=function(e,n){t.assert("chatRoomId",e,t.AssertRules.STRING,!0),t.assert("callback",n,t.AssertRules.CALLBACK),B.info("quitChatRoom ->chatRoomId:".concat(e));var o=t.logger.ID();t.logger.info(t.LogTagId.A_QUIT_CHATROOM_T,{chatroomId:e},{traceId:o}),this._context.quitChatroom(e).then((function(s){(s===t.ErrorCode.SUCCESS?t.logger.info:t.logger.warn)(t.LogTagId.A_QUIT_CHATROOM_R,{code:s},{traceId:o}),s===t.ErrorCode.SUCCESS?H(n.onSuccess):(B.warn("quitChatRoom ->code:".concat(s,",chatRoomId:").concat(e)),W(n.onError,s))}))},e.prototype.getChatRoomInfo=function(e,n,o,s){t.assert("chatRoomId",e,t.AssertRules.STRING,!0),t.assert("count",n,t.AssertRules.NUMBER,!0),t.assert("order",o,t.AssertRules.NUMBER,!0),t.assert("callback",s,t.AssertRules.CALLBACK),B.info("getChatRoomInfo ->chatRoomId:".concat(e)),this._context.getChatroomInfo(e,n,o).then((function(n){var o=n.code,a=n.data;o===t.ErrorCode.SUCCESS?H(s.onSuccess,{userInfos:(null==a?void 0:a.userInfos)||[],userTotalNums:(null==a?void 0:a.userCount)||0}):(B.warn("getChatRoomInfo ->code:".concat(o,",chatRoomId:").concat(e)),W(s.onError,o))}))},e.prototype.setChatroomEntry=function(e,n,o){t.assert("chatRoomId",e,t.AssertRules.STRING,!0),t.assert("chatroomEntry",n,t.AssertRules.OBJECT,!0),t.assert("callback",o,t.AssertRules.CALLBACK),B.info("setChatroomEntry ->chatRoomId:".concat(e)),this._context.setChatroomEntry(e,n).then((function(n){n===t.ErrorCode.SUCCESS?H(o.onSuccess):(B.warn("setChatroomEntry ->code:".concat(n,",chatRoomId:").concat(e)),W(o.onError,n))}))},e.prototype.setChatRoomEntries=function(e,n,o){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)}(n),t.assert("callback",o,t.AssertRules.CALLBACK),n.entries.length>10)W(o.onError,t.ErrorCode.CHATROOM_KV_STORE_OUT_LIMIT);else{var s="id:".concat(e);B.info("set chatroom entry->".concat(s)),this._context.setChatroomEntries(e,n).then((function(e){var n=e.code,a=e.data;n===t.ErrorCode.SUCCESS?H(o.onSuccess):(B.warn("set chatroom entry fail ->code+:".concat(n,",").concat(s)),W(o.onError,n,a))}))}},e.prototype.forceSetChatroomEntry=function(e,n,o){t.assert("chatRoomId",e,t.AssertRules.STRING,!0),t.assert("chatroomEntry",n,t.AssertRules.OBJECT,!0),t.assert("callback",o,t.AssertRules.CALLBACK),B.info("forceSetChatroomEntry ->chatRoomId:".concat(e)),this._context.forceSetChatroomEntry(e,n).then((function(n){n===t.ErrorCode.SUCCESS?H(o.onSuccess):(B.warn("forceSetChatroomEntry ->code:".concat(n,",chatRoomId:").concat(e)),W(o.onError,n))}))},e.prototype.removeChatroomEntry=function(e,n,o){t.assert("chatRoomId",e,t.AssertRules.STRING,!0),t.assert("chatroomEntry",n,t.AssertRules.OBJECT,!0),t.assert("callback",o,t.AssertRules.CALLBACK),B.info("removeChatroomEntry ->chatRoomId:".concat(e)),this._context.removeChatroomEntry(e,n).then((function(n){n===t.ErrorCode.SUCCESS?H(o.onSuccess):(B.warn("removeChatroomEntry ->code:".concat(n,",chatRoomId:").concat(e)),W(o.onError,n))}))},e.prototype.removeChatRoomEntries=function(e,n,o){t.assert("chatRoomId",e,t.AssertRules.STRING,!0),function(e){e.entries.forEach((function(e){t.assert("key",e,t.AssertRules.STRING,!0)}))}(n);var s="id:".concat(e);B.debug("remove chatroom entry->".concat(s));var r=a({},n);r.entries=n.entries.map((function(e){return{key:e}})),this._context.removeChatroomEntries(e,r).then((function(e){var n=e.code,a=e.data;n===t.ErrorCode.SUCCESS?H(o.onSuccess):(B.warn("remove chatroom entry fail ->code+:".concat(n,",").concat(s)),W(o.onError,n,a))}))},e.prototype.forceRemoveChatroomEntry=function(e,n,o){t.assert("chatRoomId",e,t.AssertRules.STRING,!0),t.assert("chatroomEntry",n,t.AssertRules.OBJECT,!0),t.assert("callback",o,t.AssertRules.CALLBACK),B.info("forceRemoveChatroomEntry ->chatRoomId:".concat(e)),this._context.forceRemoveChatroomEntry(e,n).then((function(n){n===t.ErrorCode.SUCCESS?H(o.onSuccess):(B.warn("forceRemoveChatroomEntry ->code:".concat(n,",chatRoomId:").concat(e)),W(o.onError,n))}))},e.prototype.getChatroomEntry=function(e,n,o){t.assert("chatRoomId",e,t.AssertRules.STRING,!0),t.assert("key",n,t.AssertRules.STRING,!0),t.assert("callback",o,t.AssertRules.CALLBACK),B.info("getChatroomEntry ->chatRoomId:".concat(e,",key:").concat(n)),this._context.getChatroomEntry(e,n).then((function(n){var s=n.code,a=n.data;s===t.ErrorCode.SUCCESS?H(o.onSuccess,a||""):(B.warn("getChatroomEntry ->code:".concat(s,",chatRoomId:").concat(e)),W(o.onError,s))}))},e.prototype.getAllChatroomEntries=function(e,n){t.assert("chatRoomId",e,t.AssertRules.STRING,!0),t.assert("callback",n,t.AssertRules.CALLBACK),B.info("getAllChatroomEntries ->chatRoomId:".concat(e)),this._context.getAllChatroomEntries(e).then((function(o){var s=o.code,a=o.data;s===t.ErrorCode.SUCCESS?H(n.onSuccess,a):(B.warn("getAllChatroomEntries ->code:".concat(s,",chatRoomId:").concat(e)),W(n.onError,s))}))},e.prototype.getChatRoomHistoryMessages=function(e,n,o,s,a){void 0===a&&(a=0),t.assert("chatRoomId",e,t.AssertRules.STRING,!0),t.assert("count",n,t.AssertRules.NUMBER,!0),t.assert("order",o,t.AssertRules.NUMBER,!0),t.assert("callback",s,t.AssertRules.CALLBACK),t.assert("timestamp",a,t.AssertRules.NUMBER),B.info("getChatRoomHistoryMessages ->chatRoomId:".concat(e)),this._context.getChatRoomHistoryMessages(e,n,o,a).then((function(n){var o=n.code,a=n.data;if(o===t.ErrorCode.SUCCESS)if(a){var r=a.list,c=a.hasMore,i=r.map((function(e){return K(e)}));H(s.onSuccess,i,c)}else H(s.onSuccess,[],!1);else B.warn("getChatRoomHistoryMessages ->code:".concat(o,",chatRoomId:").concat(e)),W(s.onError,o)}))},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,n,o,s,a){t.assert("fileType",e,t.AssertRules.NUMBER,!0),t.assert("fileName",o,t.AssertRules.STRING),t.assert("callback",n,t.AssertRules.CALLBACK),B.info("getFileToken ->fileType:".concat(e,",fileName:").concat(o,",queryString:").concat(a)),this._context.getFileToken(e,o,s,a).then(n.onSuccess).catch(n.onError)},e.prototype.getFileUrl=function(e,n,o,s,a,r){t.assert("fileType",e,t.AssertRules.NUMBER,!0),t.assert("fileName",n,t.AssertRules.STRING,!0),t.assert("saveName",o,t.AssertRules.STRING),t.assert("callback",s,t.AssertRules.CALLBACK),t.assert("serverType",r,t.AssertRules.NUMBER),t.assert("uploadRes",a,t.AssertRules.OBJECT),B.info("getFileUrl ->fileType:".concat(e,",fileName:").concat(n)),this._context.getFileUrl(e,n,o,a,r).then(s.onSuccess).catch(s.onError)},e.prototype.createTag=function(e,n){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",n,t.AssertRules.CALLBACK),B.info("createTag ->tagId:".concat(e.tagId,",tagName:").concat(e.tagName)),this._context.createTag(e).then((function(o){var s=o.code;s===t.ErrorCode.SUCCESS?n.onSuccess():(B.warn("createTag ->code:".concat(s,",tagId:").concat(e.tagId)),n.onError(s))})).catch((function(t){B.warn("createTag ->code:".concat(t,",tagId:").concat(e.tagId)),n.onError(t)}))},e.prototype.removeTag=function(e,n){t.assert("tagId",e,t.AssertRules.STRING,!0),t.assert("callback",n,t.AssertRules.CALLBACK),B.info("removeTag ->tagId:".concat(e)),this._context.removeTag(e).then((function(o){var s=o.code;s===t.ErrorCode.SUCCESS?n.onSuccess():(B.warn("removeTag ->code:".concat(s,",tagId:").concat(e)),n.onError(s))})).catch((function(t){B.warn("removeTag ->code:".concat(t,",tagId:").concat(e)),n.onError(t)}))},e.prototype.updateTag=function(e,n){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",n,t.AssertRules.CALLBACK),B.info("updateTag ->tagId:".concat(e.tagId,",tagName:").concat(e.tagName)),this._context.updateTag(e).then((function(o){var s=o.code;s===t.ErrorCode.SUCCESS?n.onSuccess():(B.warn("updateTag ->code:".concat(s,",tagId:").concat(e.tagId)),n.onError(s))})).catch((function(t){B.warn("updateTag ->reason:".concat(t,",tagId:").concat(e.tagId)),n.onError(t)}))},e.prototype.getTagList=function(e){t.assert("callback",e,t.AssertRules.CALLBACK),this._context.getTagList().then((function(n){var o=n.code,s=n.data;o===t.ErrorCode.SUCCESS?e.onSuccess(s||[]):(B.warn("getTagList ->code:".concat(o)),e.onError(o))})).catch((function(t){B.warn("getTagList ->reason:".concat(t)),e.onError(t)}))},e.prototype.getTagsForConversation=function(e,n){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",n,t.AssertRules.CALLBACK),B.info("getTagsForConversation ->targetId:".concat(e.targetId,",conversationType:").concat(e.type)),this._context.getTagsForConversation(X(e)).then((function(e){var o=e.code,s=e.data;o===t.ErrorCode.SUCCESS?n.onSuccess(s||[]):(B.warn("getTagsForConversation ->code:".concat(o)),n.onError(o))})).catch((function(e){B.warn("getTagsForConversation ->reason:".concat(e)),n.onError(e)}))},e.prototype.addTagForConversations=function(e,n,o){t.assert("tagId",e,t.AssertRules.STRING,!0),t.assert("conversations",n,t.AssertRules.ARRAY,!0),t.assert("callback",o,t.AssertRules.CALLBACK),n.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)})),B.info("addTagForConversations ->tagId:".concat(e)),this._context.addTagForConversations(e,n.map((function(e){return X(e)}))).then((function(n){var s=n.code;n.data,s===t.ErrorCode.SUCCESS?o.onSuccess():(B.warn("addTagForConversations ->code:".concat(s,",tagId:").concat(e)),o.onError(s))})).catch((function(t){B.warn("addTagForConversations ->reason:".concat(t,",tagId:").concat(e)),o.onError(t)}))},e.prototype.removeTagForConversations=function(e,n,o){t.assert("tagId",e,t.AssertRules.STRING,!0),t.assert("conversations",n,t.AssertRules.ARRAY,!0),t.assert("callback",o,t.AssertRules.CALLBACK),n.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)})),B.info("removeTagForConversations ->tagId:".concat(e)),this._context.removeTagForConversations(e,n.map((function(e){return X(e)}))).then((function(n){var s=n.code;n.data,s===t.ErrorCode.SUCCESS?o.onSuccess():(B.warn("removeTagForConversations ->code:".concat(s,",tagId:").concat(e)),o.onError(s))})).catch((function(t){B.warn("removeTagForConversations ->reason:".concat(t,",tagId:").concat(e)),o.onError(t)}))},e.prototype.removeTagsForConversation=function(e,n,o){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",n,t.AssertRules.ARRAY,!0),t.assert("callback",o,t.AssertRules.CALLBACK),n.forEach((function(e){t.assert("tagId",e,t.AssertRules.STRING,!0)})),B.info("removeTagsForConversation ->tagIds:".concat(n,",targetId:").concat(e.targetId,",type:").concat(e.type)),this._context.removeTagsForConversation(X(e),n).then((function(e){var s=e.code;e.data,s===t.ErrorCode.SUCCESS?o.onSuccess():(B.warn("removeTagsForConversation ->code:".concat(s,",tagIds:").concat(n)),o.onError(s))})).catch((function(e){B.warn("removeTagsForConversation ->reason:".concat(e,",tagIds:").concat(n)),o.onError(e)}))},e.prototype.getConversationListByTag=function(e,n,o,s){t.assert("tagId",e,t.AssertRules.STRING,!0),t.assert("count",n,t.AssertRules.NUMBER,!0),t.assert("startTime",o,t.AssertRules.NUMBER,!0),t.assert("callback",s,t.AssertRules.CALLBACK,!0),B.info("getConversationListByTag ->tagId:".concat(e)),this._context.getConversationListByTag(e,o,n).then((function(n){var o=n.code,a=n.data,r=[];o===t.ErrorCode.SUCCESS?((a=a||[]).forEach((function(e){r.push(function(e){var t=e.channelId,n=e.conversationType,o=e.targetId,s=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:n,targetId:o,unreadMessageCount:s,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))})),s.onSuccess(r)):(B.warn("getConversationListByTag ->code:".concat(o,",tagId:").concat(e)),s.onError(o))})).catch((function(t){B.warn("getConversationListByTag ->reason:".concat(t,",tagId:").concat(e)),s.onError(t)}))},e.prototype.getUnreadCountByTag=function(e,n,o){t.assert("tagId",e,t.AssertRules.STRING,!0),t.assert("containMuted",n,t.AssertRules.BOOLEAN,!0),t.assert("callback",o,t.AssertRules.CALLBACK),B.info("getUnreadCountByTag ->tagId:".concat(e)),this._context.getUnreadCountByTag(e,n).then((function(n){var s=n.code,a=n.data;B.info(s,a),s===t.ErrorCode.SUCCESS?o.onSuccess(a||0):(B.warn("getUnreadCountByTag ->code:".concat(s,",tagId:").concat(e)),o.onError(s))})).catch((function(t){B.warn("getUnreadCountByTag ->reason:".concat(t,",tagId:").concat(e)),o.onError(t)}))},e.prototype.setConversationStatusInTag=function(e,n,o,s){t.assert("tagId",e,t.AssertRules.STRING,!0),t.assert("conversation.targetId",n.targetId,t.AssertRules.STRING,!0),t.assert("conversation.type",n.type,t.AssertRules.NUMBER,!0),t.assert("conversation.channelId",n.channelId,t.AssertRules.ONLY_STRING),t.assert("status.isTop",null==o?void 0:o.isTop,t.AssertRules.BOOLEAN,!0),t.assert("callback",s,t.AssertRules.CALLBACK),B.info("setConversationStatusInTag ->tagId:".concat(e,",targetId:").concat(n.targetId,",type").concat(n.type)),this._context.setConversationStatusInTag(e,X(n),o).then((function(n){var o=n.code;n.data,o===t.ErrorCode.SUCCESS?s.onSuccess():(B.warn("setConversationStatusInTag ->code:".concat(o,",tagId:").concat(e)),s.onError(o))})).catch((function(t){B.warn("setConversationStatusInTag ->reason:".concat(t,",tagId:").concat(e)),s.onError(t)}))},e.prototype.callExtra=function(e,n){for(var o,s=[],a=2;a<arguments.length;a++)s[a-2]=arguments[a];B.info("callExtra ->method:".concat(e)),(o=this._context).callExtra.apply(o,i([e],s,!1)).then((function(o){var s=o.code,a=o.data;if(s!==t.ErrorCode.SUCCESS)B.warn("callExtra ->code:".concat(s)),n.onError&&W(n.onError,s);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(n.onSuccess,u,i)}n.onSuccess&&H(n.onSuccess,a)}}))},e.prototype.hasRemoteUnreadMessages=function(e,n){t.assert("callback",n,t.AssertRules.CALLBACK),B.info("hasRemoteUnreadMessages ->token:".concat(e)),this.assertCPPMode((function(){H(n.onSuccess,!1)}),"hasRemoteUnreadMessages",n)},e.prototype.setUserStatusListener=function(e,t){var n=this;B.info("setUserStatusListener ->userIds:".concat(e.userIds)),this.assertCPPMode((function(){n._context.setUserStatusListener(e,t)}),"setUserStatusListener")},e.prototype.setUserStatus=function(e,n){var o=this;t.assert("status",e,t.AssertRules.NUMBER),t.assert("callback",n,t.AssertRules.CALLBACK),B.info("setUserStatus ->status:".concat(e)),this.assertCPPMode((function(){o._context.setUserStatus(e).then((function(e){e===t.ErrorCode.SUCCESS?H(n.onSuccess,!0):(B.warn("setUserStatus ->code:".concat(e)),W(n.onError,e))}))}),"setUserStatus",n)},e.prototype.getUserStatus=function(e,n){var o=this;t.assert("userId",e,t.AssertRules.STRING),t.assert("callback",n,t.AssertRules.CALLBACK),B.info("getUserStatus ->userId:".concat(e)),this.assertCPPMode((function(){o._context.getUserStatus(e).then((function(o){var s=o.code,a=o.data;s===t.ErrorCode.SUCCESS?H(n.onSuccess,a):(B.warn("getUserStatus ->code:".concat(s,",useerId:").concat(e)),W(n.onError,s))}))}),"getUserStatus",n)},e.prototype.addToBlacklist=function(e,n){var o=this;t.assert("userId",e,t.AssertRules.STRING),t.assert("callback",n,t.AssertRules.CALLBACK),B.info("addToBlacklist ->userId:".concat(e)),this.assertCPPMode((function(){o._context.addToBlacklist(e).then((function(o){o===t.ErrorCode.SUCCESS?H(n.onSuccess):(B.warn("addToBlacklist ->code:".concat(o,",useerId:").concat(e)),W(n.onError,o))}))}),"addToBlacklist",n)},e.prototype.removeFromBlacklist=function(e,n){var o=this;t.assert("userId",e,t.AssertRules.STRING),t.assert("callback",n,t.AssertRules.CALLBACK),B.info("removeFromBlacklist ->userId:".concat(e)),this.assertCPPMode((function(){o._context.removeFromBlacklist(e).then((function(o){o===t.ErrorCode.SUCCESS?H(n.onSuccess):(B.warn("removeFromBlacklist ->code:".concat(o,",useerId:").concat(e)),W(n.onError,o))}))}),"removeFromBlacklist",n)},e.prototype.getBlacklist=function(e){var n=this;t.assert("callback",e,t.AssertRules.CALLBACK),this.assertCPPMode((function(){n._context.getBlacklist().then((function(n){var o=n.code,s=n.data;o===t.ErrorCode.SUCCESS?H(e.onSuccess,s):(B.warn("getBlacklist ->code:".concat(o)),W(e.onError,o))}))}),"getBlacklist",e)},e.prototype.getBlacklistStatus=function(e,n){var o=this;t.assert("userId",e,t.AssertRules.STRING),t.assert("callback",n,t.AssertRules.CALLBACK),B.info("getBlacklistStatus ->userId:".concat(e)),this.assertCPPMode((function(){o._context.getBlacklistStatus(e).then((function(o){var s=o.code,a=o.data;s===t.ErrorCode.SUCCESS?H(n.onSuccess,a):(B.warn("getBlacklistStatus ->code:".concat(s,",userId:").concat(e)),W(n.onError,s))}))}),"getBlacklistStatus",n)},e.prototype.insertMessage=function(e,n,o,s,a){var r=this;void 0===a&&(a={}),t.assert("conversationType",e,t.AssertRules.NUMBER,!0),t.assert("targetId",n,t.AssertRules.STRING,!0),t.assert("content.senderUserId",o.senderUserId,t.AssertRules.STRING,!0),t.assert("callback",s,t.AssertRules.CALLBACK),B.info("insertMessage ->targetId:".concat(n,",conversationType:").concat(e,",senderUserId:").concat(o.senderUserId)),this.assertCPPMode((function(){r._defaultChannelClient.insertMessage(e,n,o,s,a)}),"insertMessage",s)},e.prototype.getRemoteHistoryMessages=function(e,n,o,s,a,r){var c=this;void 0===r&&(r={}),t.assert("conversationType",e,t.AssertRules.NUMBER,!0),t.assert("targetId",n,t.AssertRules.STRING,!0),t.assert("timestamp",o,t.AssertRules.NUMBER,!0),t.assert("count",s,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,n,o,s,a,r)}),"getRemoteHistoryMessages",a)},e.prototype.deleteLocalMessages=function(e,n,o,s){var a=this;t.assert("messageIds",o,t.AssertRules.ARRAY,!0),t.assert("callback",s,t.AssertRules.CALLBACK),B.info("deleteLocalMessages ->messageIds:".concat(o)),this.assertCPPMode((function(){a._context.deleteMessages(o).then((function(e){e===t.ErrorCode.SUCCESS?H(s.onSuccess,!0):(B.warn("deleteLocalMessages ->code:".concat(e,",messageIds:").concat(o)),W(s.onError,e))}))}),"deleteLocalMessages",s)},e.prototype.deleteLocalMessagesByTimestamp=function(e,n,o,s,a){var r=this;t.assert("conversationType",e,t.AssertRules.NUMBER,!0),t.assert("targetId",n,t.AssertRules.STRING,!0),t.assert("timestamp",o,t.AssertRules.NUMBER,!0),t.assert("cleanSpace",s,t.AssertRules.BOOLEAN),t.assert("callback",a,t.AssertRules.CALLBACK),this.assertCPPMode((function(){r._defaultChannelClient.deleteLocalMessagesByTimestamp(e,n,o,s,a)}),"deleteLocalMessagesByTimestamp",a)},e.prototype.clearMessages=function(e,n,o){var s=this;t.assert("conversationType",e,t.AssertRules.NUMBER,!0),t.assert("targetId",n,t.AssertRules.STRING,!0),t.assert("callback",o,t.AssertRules.CALLBACK),this.assertCPPMode((function(){s._defaultChannelClient.clearMessages(e,n,o)}),"clearMessages",o)},e.prototype.getMessage=function(e,n){var o=this;t.assert("callback",n,t.AssertRules.CALLBACK),this.assertCPPMode((function(){o._context.getMessage(e).then((function(o){var s=o.code,a=o.data;s===t.ErrorCode.SUCCESS?H(n.onSuccess,K(a)):(B.warn("getMessage ->code:".concat(s,",messageId:").concat(e)),W(n.onError,s))}))}),"getMessage",n)},e.prototype.setMessageSentStatus=function(e,n,o){var s=this;t.assert("messageId",e,t.AssertRules.NUMBER,!0),t.assert("sentStatus",n,t.AssertRules.NUMBER,!0),B.info("setMessageSentStatus ->messageId:".concat(e,",sentStatus:").concat(n)),this.assertCPPMode((function(){s._context.setMessageSentStatus(e,n).then((function(n){n===t.ErrorCode.SUCCESS?H(o.onSuccess,!0):(B.warn("setMessageSentStatus ->code:".concat(n,",messageId:").concat(e)),W(o.onError,n))}))}),"setMessageSentStatus",o)},e.prototype.setMessageReceivedStatus=function(e,n,o){var s=this;t.assert("messageId",e,t.AssertRules.NUMBER,!0),t.assert("receivedStatus",n,t.AssertRules.NUMBER,!0),B.info("setMessageReceivedStatus ->messageId:".concat(e,",receivedStatus:").concat(n)),this.assertCPPMode((function(){s._context.setMessageReceivedStatus(e,n).then((function(n){n===t.ErrorCode.SUCCESS?H(o.onSuccess,!0):(B.warn("setMessageReceivedStatus ->code:".concat(n,",messageId:").concat(e)),W(o.onError,n))}))}),"setMessageReceivedStatus",o)},e.prototype.setMessageContent=function(e,n,o){var s=this;t.assert("messageId",e,t.AssertRules.NUMBER,!0),t.assert("objectName",o,t.AssertRules.ONLY_STRING,!0),B.info("setMessageContent ->messageId:".concat(e,",objectName:").concat(o)),this.assertCPPMode((function(){s._context.setMessageContent(e,n,o)}),"setMessageContent")},e.prototype.setMessageSearchField=function(e,n,o){var s=this;t.assert("messageId",e,t.AssertRules.NUMBER,!0),t.assert("searchFiles",o,t.AssertRules.STRING,!0),B.info("setMessageSearchField ->messageId:".concat(e,",searchFiles:").concat(o)),this.assertCPPMode((function(){s._context.setMessageSearchField(e,n,o)}),"setMessageSearchField")},e.prototype.searchConversationByContent=function(e,n,o,s){var a=this;t.assert("keyword",e,t.AssertRules.STRING,!0),t.assert("callback",n,t.AssertRules.CALLBACK),t.assert("conversationTypes",o,t.AssertRules.ARRAY),t.assert("customMessageType",s,t.AssertRules.ARRAY),this.assertCPPMode((function(){a._defaultChannelClient.searchConversationByContent(e,n,o,s)}),"searchConversationByContent",n)},e.prototype.searchMessageByContent=function(e,n,o,s,a,r,c){var i=this;t.assert("conversationType",e,t.AssertRules.NUMBER,!0),t.assert("targetId",n,t.AssertRules.STRING,!0),t.assert("keyword",o,t.AssertRules.STRING,!0),t.assert("timestamp",s,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,n,o,s,a,r,c)}),"searchMessageByContent",c)},e.prototype.getUnreadMentionedMessages=function(e,n){return this._isCPPMode?(t.assert("conversationType",e,t.AssertRules.NUMBER,!0),t.assert("targetId",n,t.AssertRules.STRING,!0),this._defaultChannelClient.getUnreadMentionedMessages(e,n)):(B.error("getUnreadMentionedMessages method is not supported in a browser!"),null)},e.prototype.clearUnreadCountByTimestamp=function(e,n,o,s){var a=this;t.assert("conversationType",e,t.AssertRules.NUMBER,!0),t.assert("targetId",n,t.AssertRules.STRING,!0),t.assert("timestamp",o,t.AssertRules.NUMBER,!0),this.assertCPPMode((function(){a._defaultChannelClient.clearUnreadCountByTimestamp(e,n,o,s)}),"clearUnreadCountByTimestamp",s)},e.prototype.getFirstUnreadMessage=function(e,t,n){return this._defaultChannelClient.getFirstUnreadMessage(e,t,n)},e.prototype.getConversationNotificationStatus=function(e,n,o){var s=this;t.assert("conversationType",e,t.AssertRules.NUMBER,!0),t.assert("targetId",n,t.AssertRules.STRING,!0),this.assertCPPMode((function(){s._defaultChannelClient.getConversationNotificationStatus(e,n,o)}),"getConversationNotificationStatus",o)},e.prototype.getServerTime=function(){return this._context.getServerTime()},e.prototype.getRTCUserInfoList=function(e,n){B.info("getRTCUserInfoList ->roomId:".concat(e.id)),this._context.getRTCUserInfoList(e.id).then((function(o){var s=o.code,a=o.data;if(s!==t.ErrorCode.SUCCESS)B.warn("getRTCUserInfoList ->code:".concat(s,",roomId:").concat(e.id)),n.onError(s);else{var r=null==a?void 0:a.users;n.onSuccess(r)}})).catch((function(t){B.warn("getRTCUserInfoList ->error:".concat(t,",roomId:").concat(e.id)),n.onError(t)}))},e.prototype.getRTCUserList=function(e,n){B.info("getRTCUserList ->roomId:".concat(e.id)),this._context.getRTCUserList(e.id).then((function(o){var s=o.code,a=o.data;s!==t.ErrorCode.SUCCESS?(B.warn("getRTCUserList ->code:".concat(s,",roomId:").concat(e.id)),n.onError(s)):n.onSuccess(a)})).catch((function(t){B.warn("getRTCUserList ->error:".concat(t,",roomId:").concat(e.id)),n.onError(t)}))},e.prototype.setRTCUserInfo=function(e,n,o){B.info("setRTCUserInfo ->roomId:".concat(e.id,",info:").concat(JSON.stringify(n||{}))),this._context.setRTCUserInfo(e.id,n.key,n.value).then((function(s){s!==t.ErrorCode.SUCCESS?(B.warn("setRTCUserInfo ->code:".concat(s,",roomId:").concat(e.id,",key:").concat(n.key,",value:").concat(n.value)),o.onError(s)):o.onSuccess(!0)})).catch((function(t){B.warn("setRTCUserInfo ->code:".concat(t,",roomId:").concat(e.id,",key:").concat(n.key,",value:").concat(n.value)),o.onError(t)}))},e.prototype.removeRTCUserInfo=function(e,n,o){B.info("removeRTCUserInfo ->roomId:".concat(e.id,"keys:").concat(n.keys)),this._context.removeRTCUserInfo(e.id,n.keys).then((function(n){n!==t.ErrorCode.SUCCESS?(B.warn("removeRTCUserInfo ->code:".concat(n,",roomId:").concat(e.id)),o.onError(n)):o.onSuccess(!0)})).catch((function(t){B.warn("removeRTCUserInfo ->error:".concat(t,",roomId:").concat(e.id)),o.onError(t)}))},e.prototype.getRTCRoomInfo=function(e,n){B.info("getRTCRoomInfo ->roomId:".concat(e.id)),this._context.getRTCRoomInfo(e.id).then((function(o){var s=o.code,a=o.data;s!==t.ErrorCode.SUCCESS?(B.warn("getRTCRoomInfo ->code:".concat(s,",roomId:").concat(e.id)),n.onError(s)):n.onSuccess(a)})).catch((function(t){B.warn("getRTCRoomInfo ->error:".concat(t,",roomId:").concat(e.id)),n.onError(t)}))},e.prototype.setRTCRoomInfo=function(e,n,o){throw t.todo("setRTCRoomInfo")},e.prototype.removeRTCRoomInfo=function(e,n,o){throw t.todo("removeRTCRoomInfo")},e.prototype.joinRTCRoom=function(e,n){B.info("joinRTCRoom ->roomId:".concat(e.id));var o=e.mode||0;this._context.joinRTCRoom(e.id,o).then((function(o){var s=o.code,a=o.data;s!==t.ErrorCode.SUCCESS?(B.warn("joinRTCRoom ->code:".concat(s,",roomId:").concat(e.id)),n.onError(s)):n.onSuccess(a)})).catch((function(t){B.warn("joinRTCRoom ->error:".concat(t,",roomId:").concat(e.id)),n.onError(t)}))},e.prototype.quitRTCRoom=function(e,n){B.info("quitRTCRoom ->roomId:".concat(e.id)),this._context.quitRTCRoom(e.id).then((function(o){o!==t.ErrorCode.SUCCESS?(B.warn("quitRTCRoom ->code:".concat(o,",roomId:").concat(e.id)),n.onError(o)):n.onSuccess(!0)})).catch((function(t){B.warn("quitRTCRoom ->error:".concat(t,",roomId:").concat(e.id)),n.onError(t)}))},e.prototype.RTCPing=function(e,n){B.info("RTCPing ->roomId:".concat(e.id));var o=e.mode||0;this._context.rtcPing(e.id,o).then((function(o){o!==t.ErrorCode.SUCCESS?(B.warn("RTCPing ->code:".concat(o,",roomId:").concat(e.id)),n.onError(o)):n.onSuccess(!0)})).catch((function(t){B.warn("RTCPing ->error:".concat(t,",roomId:").concat(e.id)),n.onError(t)}))},e.prototype.setRTCData=function(e,n,o,s,a,r,c){B.info("setRTCData ->roomId:".concat(e,",key:").concat(n)),this._context.setRTCData(e,n,o,s,a,c).then((function(n){n!==t.ErrorCode.SUCCESS?(B.warn("setRTCData ->code:".concat(n,",roomId:").concat(e)),r.onError(n)):r.onSuccess(!0)})).catch((function(t){B.warn("setRTCData ->error:".concat(t,",roomId:").concat(e)),r.onError(t)}))},e.prototype.getRTCData=function(e,n,o,s,a){B.info("getRTCData ->roomId:".concat(e,",keys:").concat(n)),this._context.getRTCData(e,n,o,s).then((function(n){var o=n.code,s=n.data;o!==t.ErrorCode.SUCCESS?(B.warn("getRTCData ->code:".concat(o,",roomId:").concat(e)),a.onError(o)):a.onSuccess(s)})).catch((function(t){B.warn("setRTCUserInfo ->error:".concat(t,",roomId:").concat(e)),a.onError(t)}))},e.prototype.removeRTCData=function(e,n,o,s,a,r){B.info("removeRTCData ->roomId:".concat(e,",keys:").concat(n)),this._context.removeRTCData(e,n,o,s,r).then((function(n){n!==t.ErrorCode.SUCCESS?(B.warn("removeRTCData ->code:".concat(n,",roomId:").concat(e)),a.onError(n)):a.onSuccess(!0)})).catch((function(t){B.warn("removeRTCData ->error:".concat(t,",roomId:").concat(e)),a.onError(t)}))},e.prototype.setRTCUserData=function(e,n,o,s,a,r){this.setRTCData(e,n,o,s,t.RTCApiType.PERSON,a,r)},e.prototype.setRTCUserTotalRes=function(e,n,o,s,a){B.info("setRTCUserTotalRes ->roomId:".concat(e)),this._context.setRTCTotalRes(e,n,o,s).then((function(n){n!==t.ErrorCode.SUCCESS?(B.warn("setRTCUserTotalRes ->code:".concat(n,",roomId:").concat(e)),a.onError(n)):a.onSuccess(!0)})).catch((function(t){B.warn("setRTCUserTotalRes ->error:".concat(t,",roomId:").concat(e)),a.onError(t)}))},e.prototype.getRTCUserData=function(e,n,o,s){this.getRTCData(e,n,o,t.RTCApiType.PERSON,s)},e.prototype.removeRTCUserData=function(e,n,o,s,a){this.removeRTCData(e,n,o,t.RTCApiType.PERSON,s,a)},e.prototype.setRTCRoomData=function(e,n,o,s,a,r){this.setRTCData(e,n,o,s,t.RTCApiType.ROOM,a,r)},e.prototype.getRTCRoomData=function(e,n,o,s){this.getRTCData(e,n,o,t.RTCApiType.ROOM,s)},e.prototype.removeRTCRoomData=function(e,n,o,s,a){this.removeRTCData(e,n,o,t.RTCApiType.ROOM,s,a)},e.prototype.setRTCOutData=function(e,n,o,s,a){throw t.todo("setRTCOutData")},e.prototype.getRTCOutData=function(e,n,o){throw t.todo("getRTCOutData")},e.prototype.getRTCToken=function(e,n){B.info("getRTCToken ->roomId:".concat(e.id)),this._context.getRTCToken(e.id,e.mode,e.broadcastType).then((function(o){var s=o.code,a=o.data;s!==t.ErrorCode.SUCCESS?(B.warn("getRTCToken ->code:".concat(s,",roomId:").concat(e.id)),n.onError(s)):n.onSuccess(a)})).catch((function(t){B.warn("getRTCToken ->error:".concat(t,",roomId:").concat(e.id)),n.onError(t)}))},e.prototype.setRTCState=function(e,n,o){B.info("setRTCState ->roomId:".concat(e.id)),this._context.setRTCState(e.id,n.report).then((function(n){n!==t.ErrorCode.SUCCESS?(B.warn("setRTCState ->code:".concat(n,",roomId:").concat(e.id)),o.onError(n)):o.onSuccess(!0)})).catch((function(t){B.warn("setRTCState ->error:".concat(t,",roomId:").concat(e.id)),o.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.1");var ne,oe={init:function(e,n,o){void 0===o&&(o={}),t.assert("appkey",e,t.AssertRules.STRING,!0),B.setLogLevel(o.logLevel),B.setLogStdout(o.logStdout),B.info("RongIMLib Version: ".concat("5.5.1",", Commit: ").concat("70d3b5ba00858e4afab4a3c616424ad5879a8131",",appkey:").concat(e));var s=null==o?void 0:o.connectionType;s?t.CONNECTION_TYPE.WEBSOCKET!==s&&t.CONNECTION_TYPE.COMET!==s&&(B.warn("RongIMLib connectionType must be ".concat(t.CONNECTION_TYPE.WEBSOCKET," or ").concat(t.CONNECTION_TYPE.COMET)),s=t.CONNECTION_TYPE.WEBSOCKET):s=t.CONNECTION_TYPE.WEBSOCKET,t.logger.info(t.LogTagId.A_INIT_O,{appkey:e,navigators:o.navi?[o.navi]:[],connectionType:s,logLevel:o.logLevel,typingExpireTime:o.typingExpireTime}),Y=t.APIContext.init(w,{appkey:e,apiVersion:"5.5.1",navigators:o.navi?[o.navi]:[],miniCMPProxy:[],connectionType:s,logLevel:o.logLevel,logStdout:o.logStdout,typingExpireTime:o.typingExpireTime,indexDBSwitch:o.indexDBSwitch,checkCA:o.checkCA}),te=Math.min(15,Math.max(o.readReceiptTimeout||1,1)),q=new z(Y,{readReceiptTimeout:te})},getInstance:function(){return q},setConnectionStatusListener:function(e){var n=t.logger.ID();Y.assignWatcher({connectionState:function(o){t.logger.info(t.LogTagId.A_CONNECT_S,{status:o},{traceId:n}),k.clear(),e.onChanged(o)}})},setOnReceiveMessageListener:function(e){Y.assignWatcher({message:function(n,o,s){try{var a=K(n),r=Y.getCurrentUserId(),c=Y.getConnectedTime();F(a,r,c,te),a=function(e,t,n,o){var s=new Date(n-1e3*o*60*60*24).getTime()-e.sentTime<0;if("ReadReceiptResponseMessage"!==e.messageType||!s)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()||k.set(n),t.logger.info(t.LogTagId.A_PULL_MSG_O,{message:n.messageUId}),e.onReceived(a,void 0,s)}catch(e){B.error("setOnReceiveMessageListener ->error:".concat(e))}}})},setConversationStatusListener:function(e){Y.assignWatcher({conversationState:function(t){try{var n=[];t.forEach((function(e){var t=e.updatedItems,o=e.conversationType,s=e.targetId,a=e.channelId,r=(t=t||{}).notificationStatus,c=t.isTop;r&&c&&n.push({notificationStatus:r.val,isTop:c.val,conversationType:o,targetId:s,channelId:a||"",updatedTime:r.time})})),n.length>0&&e.onChanged(n)}catch(e){B.error("setConversationStatusListener ->error:".concat(e))}}})},setMessageExpansionListener:function(e){Y.assignWatcher({expansion:function(t){try{t.updatedExpansion&&e.onUpdated(t.updatedExpansion),t.deletedExpansion&&e.onDeleted(t.deletedExpansion)}catch(e){B.error("setMessageExpansionListener ->error:".concat(e))}}})},setTagListener:function(e){Y.assignWatcher({tag:function(){e.onChanged()}})},setConversationTagListener:function(e){Y.assignWatcher({conversationTagChanged:function(){e.onChanged()}})},setPullOffLineFinished:function(e){Y.assignWatcher({pullFinished:function(){e.onFinished()}})},setTypingStatusListener:function(e){Y.assignWatcher({typingState:function(t){e.onChanged(t)}})},setMessageBlockedListener:function(e){Y.assignWatcher({messageBlocked:function(t){e.onReceived(t)}})},setChatRoomStatusListener:function(e){Y.assignWatcher({chatroomState:function(t){e.onChanged(t)}})},connect:function(e,n){return r(this,void 0,void 0,(function(){var o,s,a;return c(this,(function(r){switch(r.label){case 0:return o=t.logger.ID(),t.logger.info(t.LogTagId.A_CONNECT_T,{token:e,reconnectKickEnable:!1},{traceId:o}),B.info("connect ->token:".concat(e)),[4,Y.connect(e,!1,!1,o)];case 1:return s=r.sent(),(s.code===t.ErrorCode.SUCCESS?t.logger.info:t.logger.warn)(t.LogTagId.A_CONNECT_R,{code:s.code,userId:s.userId},{traceId:o}),s.code===t.ErrorCode.SUCCESS?(n.onSuccess(s.userId),a=new Date(Y.getConnectedTime()-1e3*te*60*60*24).getTime(),D.getKeys().forEach((function(e){if(/SENT$/.test(e)){var t=D.get(e).dealtime;t&&a-t>0&&D.remove(e)}else if(/RECEIVED$/.test(e)){var n=D.get(e),o=Object.keys(n).length;Object.keys(n).forEach((function(e){var t=n[e].dealtime;t&&a-t>0&&delete n[e]})),Object.keys(n).length!==o&&(0===n.length?D.remove(e):D.set(e,n))}}))):s.code===t.ErrorCode.RC_CONN_USER_OR_PASSWD_ERROR?(B.warn("connect ->code:".concat(s.code,",token:").concat(e)),n.onTokenIncorrect()):(B.warn("connect ->code:".concat(s.code,",token:").concat(e)),n.onError(s.code)),[2]}}))}))},reconnect:function(e,n){var o=t.logger.ID();t.logger.info(t.LogTagId.A_RECONNECT_T,{},{traceId:o}),Y.reconnect().then((function(n){(n.code===t.ErrorCode.SUCCESS?t.logger.info:t.logger.warn)(t.LogTagId.A_RECONNECT_R,{code:n.code,userId:n.userId},{traceId:o}),n.code===t.ErrorCode.SUCCESS?e.onSuccess(n.userId):(B.warn("reconnect ->code:".concat(n.code)),e.onError(n.code))})).catch((function(t){e.onError(t)}))},RegisterMessage:{},RegisterMessageTypeMapping:O,getMessageObjectName:function(e){var t=a(a({},P),O);return Object.keys(t).find((function(n){return t[n]===e}))||e},registerMessageType:function(e,t,n,o){this.RegisterMessage[e]=V(e,t,n.isPersited,n.isCounted),this.RegisterMessageTypeMapping[t]=e,Y.registerMessageType(t,n.isPersited,n.isCounted,o)},createLogger:function(e,n){return/^(RC)/.test(e)?(B.error("Tag error. Tags that start with RC are used internally by the SDK !"),null):["IM","RTC"].includes(n)?new t.Logger(e,n,"A"):(B.error("The parameter type must be one of IM, or RTC !"),null)},messageWatch:function(e){var t=this;$.push((function(n){var o,s;B.info("messageWatch ->message:".concat(JSON.stringify(n||{})));try{e(n),null===(s=(o=t._voipProvider).onReceived)||void 0===s||s.call(o,n)}catch(e){B.error("messageWatch ->error:".concat(e))}})),Y.assignWatcher({rtcInnerWatcher:ee})},statusWatch:function(e){Z.push((function(t){B.info("statusWatch ->status:".concat(t));try{e(t)}catch(e){B.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:{}},se=function(e,t,n){this.type=e,this.userIdList=t,this.mentionedContent=n},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"),Se=V("RCCombineMessage","RC:CombineMsg"),me=function(e,t,n,o,s,a,r,c,i,u,d,g,l,C,f,p,R,h){this.conversationType=e,this.targetId=t,this.senderUserId=n,this.content=o,this.objectName=s,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,(ne=exports.VoIPMediaType||(exports.VoIPMediaType={}))[ne.MEDIA_AUDIO=1]="MEDIA_AUDIO",ne[ne.MEDIA_VEDIO=2]="MEDIA_VEDIO",ne[ne.MEDIA_VIDEO=2]="MEDIA_VIDEO";var Ie,Te=V("AcceptMessage","RC:VCAccept"),Me=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"}(Ie||(Ie={}));var we=Ie,Be=t.ConnectResultCode;window&&(window.RongIMClient=oe),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=Te,exports.BaseMessage=j,exports.ChannelClient=Q,exports.ConnectionState=Be,exports.FileMessage=Ce,exports.GIFMessage=pe,exports.GetChatRoomType=s,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=se,exports.MentionedType=we,exports.Message=me,exports.MessageTag=ae,exports.PublicServiceMultiRichContentMessage=xe,exports.PublicServiceRichContentMessage=Le,exports.RCCombineMessage=Se,exports.ReadReceiptMessage=Re,exports.ReadReceiptRequestMessage=he,exports.ReadReceiptResponseMessage=J,exports.ReferenceMessage=_e,exports.RichContentMessage=de,exports.RingingMessage=Me,exports.RongIMClient=oe,exports.SentStatus=o,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 n,o=e;!function(e){e[e.NONE=0]="NONE",e[e.SQQUENCE=1]="SQQUENCE",e[e.REVERSE=2]="REVERSE"}(n||(n={}));var s=n,a=function(){return a=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var s in t=arguments[n])Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s]);return e},a.apply(this,arguments)};function r(e,t,n,o){return new(n||(n=Promise))((function(s,a){function r(e){try{i(o.next(e))}catch(e){a(e)}}function c(e){try{i(o.throw(e))}catch(e){a(e)}}function i(e){var t;e.done?s(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 c(e,t){var n,o,s,a,r={label:0,sent:function(){if(1&s[0])throw s[1];return s[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(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,o&&(s=2&a[0]?o.return:a[0]?o.throw||((s=o.return)&&s.call(o),0):o.next)&&!(s=s.call(o,a[1])).done)return s;switch(o=0,s&&(a=[2&a[0],s.value]),a[0]){case 0:case 1:s=a;break;case 4:return r.label++,{value:a[1],done:!1};case 5:r.label++,o=a[1],a=[0];continue;case 7:a=r.ops.pop(),r.trys.pop();continue;default:if(!(s=r.trys,(s=s.length>0&&s[s.length-1])||6!==a[0]&&2!==a[0])){r=0;continue}if(3===a[0]&&(!s||a[1]>s[0]&&a[1]<s[3])){r.label=a[1];break}if(6===a[0]&&r.label<s[1]){r.label=s[1],s=a;break}if(s&&r.label<s[2]){r.label=s[2],r.ops.push(a);break}s[2]&&r.ops.pop(),r.trys.pop();continue}a=t.call(e,r)}catch(e){a=[6,e],o=0}finally{n=s=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}}function i(e,t,n){if(n||2===arguments.length)for(var o,s=0,a=t.length;s<a;s++)!o&&s in t||(o||(o=Array.prototype.slice.call(t,0,s)),o[s]=t[s]);return e.concat(o||Array.prototype.slice.call(t))}var u=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))},d=u();var g={tag:"browser",httpReq:function(e){var n=e.method||t.HttpMethod.GET,o=e.timeout||6e4,s=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(n,c),s&&a.setRequestHeader)for(var u in s)a.setRequestHeader(u,s[u]);if(i){a.timeout=o,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})}),o),a.send(r)}))},localStorage:null===window||void 0===window?void 0:window.localStorage,sessionStorage:null===window||void 0===window?void 0:window.sessionStorage,isSupportSocket:function(){return"undefined"!=typeof WebSocket},useNavi:!0,connectPlatform:"",isFromUniapp:d,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()}}},createDataChannel:function(e,n){return this.isSupportSocket()&&"websocket"===n?new t.WebSocketChannel(this,e):new t.CometChannel(this,e)},getNetworkType:function(){var e=navigator.connection||navigator.mozConnection||navigator.webkitConnection,n=e.type,o=e.effectiveType,s=n||o||t.NetworkType.UNKONWN;return new Promise((function(e){e(s)}))}},l=u(),C=function(e){return function(){for(var n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];var s=t.logger.ID();try{return t.logger.info(t.LogTagId.A_CALLBACK_O,{func_name:e,source:"wechat"},{traceId:s}),wx[e].apply(wx,n)}catch(n){t.logger.error(t.LogTagId.A_CALLBACK_E,{func_name:e,source:"wechat"},{traceId:s}),console.error(n)}}},f={setItem:C("setStorageSync"),getItem:C("getStorageSync"),removeItem:C("removeStorageSync"),clear:C("clearStorageSync")},p={tag:"wechat",httpReq:function(e){var n=e.method||t.HttpMethod.GET,o=e.timeout||6e4,s=e.headers,a=e.query,r=e.body,c=t.appendUrl(e.url,a);return new Promise((function(e){wx.request({url:c,method:n,header:s,timeout:o,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,isSupportSocket:function(){return!0},useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:l,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})}}},createDataChannel:function(e,n){return"websocket"===n?new t.WebSocketChannel(this,e):new t.CometChannel(this,e)},getNetworkType:function(){return new Promise((function(e){wx.getNetworkType({success:function(t){var n=t.networkType;e(n)},fail:function(){e(t.NetworkType.UNKONWN)}})}))}},R=u(),h=function(e){return function(){for(var n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];var s=t.logger.ID();try{if(t.logger.info(t.LogTagId.A_CALLBACK_O,{func_name:e,source:"alipay"},{traceId:s}),"setStorageSync"===e)return my[e]({key:n[0],data:JSON.parse(n[1])});if("clearStorageSync"===e)return my[e]();if("removeStorageSync"===e)return my[e]({key:n[0]});var a=my[e]({key:n[0]}).data;return a?JSON.stringify(a):a}catch(n){t.logger.error(t.LogTagId.A_CALLBACK_E,{func_name:e,source:"alipay"},{traceId:s}),console.error(n)}}},S={setItem:h("setStorageSync"),getItem:h("getStorageSync"),removeItem:h("removeStorageSync"),clear:h("clearStorageSync")},m={tag:"alipay",httpReq:function(e){var n=e.method||t.HttpMethod.GET,o=e.timeout||6e4,s=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:n,headers:s,timeout:o,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:S,sessionStorage:S,isSupportSocket:function(){return!0},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()}}},createDataChannel:function(e,n){return"websocket"===n?new t.WebSocketChannel(this,e):new t.CometChannel(this,e)},getNetworkType:function(){return new Promise((function(e){my.getNetworkType({success:function(t){var n=t.networkType;e(n)},fail:function(){e(t.NetworkType.UNKONWN)}})}))}},I=u(),T=function(e){return function(){for(var n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];var s=t.logger.ID();try{return t.logger.info(t.LogTagId.A_CALLBACK_O,{func_name:e,source:"toutiao"},{traceId:s}),tt[e].apply(tt,n)}catch(n){t.logger.error(t.LogTagId.A_CALLBACK_E,{func_name:e,source:"toutiao"},{traceId:s}),console.error(n)}}},M={setItem:T("setStorageSync"),getItem:T("getStorageSync"),removeItem:T("removeStorageSync"),clear:T("clearStorageSync")},y={tag:"toutiao",isSupportSocket:function(){return!0},useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:I,localStorage:M,sessionStorage:M,httpReq:function(e){return new Promise((function(n){tt.request({url:e.url,data:e.body,header:e.headers,method:e.method,success:function(e){console.log("调用成功",e.data);var t=(null==e?void 0:e.data)||{},o={data:JSON.stringify(t),status:e.statusCode};n(o)},fail:function(e){n({status:t.ErrorCode.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})}}},createDataChannel:function(e,n){return"websocket"===n?new t.WebSocketChannel(this,e):new t.CometChannel(this,e)},getNetworkType:function(){return new Promise((function(e){tt.getNetworkType({success:function(t){var n=t.networkType;e(n)},fail:function(){e(t.NetworkType.UNKONWN)}})}))}},v=u(),E=function(e){return function(){for(var n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];var s=t.logger.ID();try{return t.logger.info(t.LogTagId.A_CALLBACK_O,{func_name:e,source:"baidu"},{traceId:s}),swan[e].apply(swan,n)}catch(n){t.logger.error(t.LogTagId.A_CALLBACK_E,{func_name:e,source:"baidu"},{traceId:s}),console.error(n)}}},A={setItem:E("setStorageSync"),getItem:E("getStorageSync"),removeItem:E("removeStorageSync"),clear:E("clearStorageSync")},U={tag:"baidu",isSupportSocket:function(){return!0},useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:v,localStorage:A,sessionStorage:A,httpReq:function(e){return new Promise((function(n,o){swan.request({url:e.url,data:e.body,header:e.headers,method:e.method,success:function(e){console.log("调用成功",e.data);var t=(null==e?void 0:e.data)||{},o={data:JSON.stringify(t),status:e.statusCode};n(o)},fail:function(e){n({status:t.ErrorCode.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})}}},createDataChannel:function(e,n){return"websocket"===n?new t.WebSocketChannel(this,e):new t.CometChannel(this,e)},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 n=t.networkType;e(n)},fail:function(){e(t.NetworkType.UNKONWN)}})}))]}))}))}},N=function(e){return function(){for(var n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];var s=t.logger.ID();try{return t.logger.info(t.LogTagId.A_CALLBACK_O,{func_name:e,source:"uniapp"},{traceId:s}),uni[e].apply(uni,n)}catch(n){t.logger.error(t.LogTagId.A_CALLBACK_E,{func_name:e,source:"uniapp"},{traceId:s}),console.error(n)}}},_={setItem:N("setStorageSync"),getItem:N("getStorageSync"),removeItem:N("removeStorageSync"),clear:N("clearStorageSync")},L={tag:"uniapp",httpReq:function(e){var n=e.method||t.HttpMethod.GET,o=e.timeout||6e4,s=e.headers,a=e.query,r=e.body,c=t.appendUrl(e.url,a);return new Promise((function(e){uni.request({url:c,method:n,header:s,timeout:o,data:r,success:function(t){e({data:t.data,status:t.statusCode})},fail:function(){e({status:t.ErrorCode.RC_HTTP_REQ_FAIL})}})}))},localStorage:_,sessionStorage:_,isSupportSocket:function(){return!0},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})}}},createDataChannel:function(e,n){return"websocket"===n?new t.WebSocketChannel(this,e):new t.CometChannel(this,e)},getNetworkType:function(){return new Promise((function(e){uni.getNetworkType({success:function(t){var n=t.networkType;e(n)},fail:function(){e(t.NetworkType.UNKONWN)}})}))}},x=function(e){return e&&e.request&&e.getSystemInfo},w="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 m;case"mp-weixin":return p;default:return g}}():"undefined"!=typeof my&&x(my)?m:"undefined"!=typeof tt&&x(tt)?y:"undefined"!=typeof swan&&x(swan)?U:"undefined"!=typeof wx&&x(wx)?p:g,B=new t.Logger("RCIM");function b(e,t,n){return"".concat(e,"_").concat(t,"_").concat(n)}var k=function(){function e(){}return e.set=function(n){if(t.SEND_MESSAGE_TYPE_OPTION[n.messageType]&&t.SEND_MESSAGE_TYPE_OPTION[n.messageType].isPersited){var o=e.get(n.conversationType,n.targetId,n.channelId||"");if(!o||o.sentTime<n.sentTime){var s=b(n.conversationType,n.targetId,n.channelId||"");e.map[s]=n}}},e.get=function(t,n,o){var s=b(t,n,o);return e.map[s]||null},e.remove=function(t,n,o){var s=b(t,n,o);delete e.map[s]},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"},O={},D=new t.AppStorage(w,"API-V2");function G(e){var n=e.channelId,o=e.conversationType,s=e.targetId,a=e.unreadMessageCount,r=e.latestMessage,c=e.isTop,i=e.notificationStatus,u=e.matchCount;if(!t.usingCppEngine()){var d=k.get(o,s,n||"");r?d&&r.sentTime<d.sentTime&&(r=d):r=d}var g=r?K(r):null;return{channelId:n||"",conversationType:o,targetId:s,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 n=e.conversationType,s=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,S=e.sentStatus,m=e.channelId,I=e.readReceiptInfo,T=e.pushConfig,M="";return c in P?M=P[c]:c in O?M=O[c]:(r={message:{content:r,objectName:c},messageName:"UnknownMessage"},M="UnknownMessage"),l||(l=t.ReceivedStatus.UNREAD),void 0===h&&(h=~~(16777215*Math.random())),{channelId:m||"",conversationType:n,targetId:s,senderUserId:a,content:r,messageType:M,messageUId:i,messageDirection:u,offLineMessage:d,sentTime:g,receivedStatus:l,receivedTime:C,objectName:c,messageId:h,sentStatus:S||o.SENT,disableNotification:p,canIncludeExpansion:f,expansion:R,readReceiptInfo:I,pushConfig:T}}function F(e,n,o,s){var a=new Date(o-1e3*s*60*60*24).getTime()-e.sentTime<0,r=e.messageType,c=e.messageDirection;if("ReadReceiptRequestMessage"===r&&a&&c===t.MessageDirection.SEND){var i="".concat(n).concat(e.content.messageUId,"SENT");D.set(i,{count:0,dealtime:e.sentTime,userIds:{}})}else if("ReadReceiptRequestMessage"===r&&a){var u="".concat(n).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,n){try{e(t,n)}catch(e){B.error(e)}}function W(e,t,n){try{e(t,n)}catch(e){B.error(e)}}var j=function(e,t,n,o,s){void 0===o&&(o=!0),void 0===s&&(s=!0),this.messageType=e,this.objectName=t,this.content=n,this.isPersited=o,this.isCounted=s};function V(e,t,n,o){void 0===n&&(n=!0),void 0===o&&(o=!0);var s=function(s){return new j(e,t,s,n,o)};return s.MessageType=e,s.ObjectName=t,s}var q,Y,J=V("ReadReceiptResponseMessage","RC:RRRspMsg"),Q=function(){function e(e,t,n,o){this._context=e,this.channelId=t,this._isCPPMode=n,this._readReceiptTimeout=o,this._storage=D,this._draftMap={}}return e.prototype.getConversationList=function(e,n,o){t.assert("callback",e,t.AssertRules.CALLBACK),t.assert("conversationTypes",n,t.AssertRules.ARRAY),t.assert("count",o,t.AssertRules.NUMBER),this._context.getConversationList(o,void 0,0,0,this.channelId).then((function(o){var s=o.code,a=o.data,r=[];a=a||[],s===t.ErrorCode.SUCCESS?(n?a.forEach((function(e){n.indexOf(e.conversationType)>-1&&r.push(G(e))})):a.forEach((function(e){r.push(G(e))})),H(e.onSuccess,r)):(B.warn("getConversationList -> code:".concat(s)),W(e.onError,s))}))},e.prototype.getConversation=function(e,n,o){var s=this;t.assert("callback",o,t.AssertRules.CALLBACK),t.assert("conversationType",e,t.AssertRules.NUMBER,!0),t.assert("targetId",n,t.AssertRules.STRING,!0),B.info("getConversation ->targetId:".concat(n,",conversationType:").concat(e)),r(s,void 0,void 0,(function(){var s,a,r;return c(this,(function(c){switch(c.label){case 0:return[4,this._context.getConversation(e,n,this.channelId)];case 1:return s=c.sent(),a=s.code,r=s.data,a!==t.ErrorCode.SUCCESS?(B.warn("getConversation ->code:".concat(a,",targetId:").concat(n)),o.onError(a),[2]):(o.onSuccess(r?G(r):null),[2])}}))}))},e.prototype.removeConversation=function(e,n,o){var s=this;t.assert("conversationType",e,t.AssertRules.NUMBER,!0),t.assert("targetId",n,t.AssertRules.STRING,!0),t.assert("callback",o,t.AssertRules.CALLBACK),B.info("removeConversation ->targetId:".concat(n,",conversationType:").concat(e)),this._context.removeConversation(e,n,this.channelId).then((function(a){a===t.ErrorCode.SUCCESS?(s._isCPPMode||k.remove(e,n,s.channelId),H(o.onSuccess)):(B.warn("removeConversation ->code:".concat(a,",targetId:").concat(n)),W(o.onError,a))}))},e.prototype.saveTextMessageDraft=function(e,n,o){t.assert("conversationType",e,t.AssertRules.NUMBER,!0),t.assert("targetId",n,t.AssertRules.STRING,!0),t.assert("draftText",o,t.AssertRules.STRING,!0),B.info("saveTextMessageDraft ->targetId:".concat(n,",conversationType:").concat(e));var s=this._context.getCurrentUserId();return!!s&&((this._draftMap[s]=this._draftMap[s]||{})["".concat(e,"_").concat(n,"_").concat(this.channelId)]=o,!0)},e.prototype.getTextMessageDraft=function(e,n){t.assert("conversationType",e,t.AssertRules.NUMBER,!0),t.assert("targetId",n,t.AssertRules.STRING,!0),B.info("getTextMessageDraft ->targetId:".concat(n,",conversationType:").concat(e));var o=this._context.getCurrentUserId();if(o)return(this._draftMap[o]||{})["".concat(e,"_").concat(n,"_").concat(this.channelId)]},e.prototype.clearTextMessageDraft=function(e,n){t.assert("conversationType",e,t.AssertRules.NUMBER,!0),t.assert("targetId",n,t.AssertRules.STRING,!0),B.info("clearTextMessageDraft ->targetId:".concat(n,",conversationType:").concat(e));var o=this._context.getCurrentUserId();return!!o&&delete(this._draftMap[o]||{})["".concat(e,"_").concat(n,"_").concat(this.channelId)]},e.prototype.getTotalUnreadCount=function(e,n,o){t.assert("callback",e,t.AssertRules.CALLBACK),B.info("getTotalUnreadCount ->conversationTypes:".concat(n)),this._context.getTotalUnreadCount(this.channelId,n,o).then((function(n){var o=n.code,s=n.data;o===t.ErrorCode.SUCCESS?H(e.onSuccess,s):(B.warn("getTotalUnreadCount ->code:".concat(o)),W(e.onError,o))}))},e.prototype.getUnreadCount=function(e,n,o){t.assert("conversationType",e,t.AssertRules.NUMBER,!0),t.assert("targetId",n,t.AssertRules.STRING,!0),t.assert("callback",o,t.AssertRules.CALLBACK),B.info("getUnreadCount ->targetId:".concat(n,",conversationType:").concat(e)),this._context.getUnreadCount(e,n,this.channelId).then((function(e){var s=e.code,a=e.data;s===t.ErrorCode.SUCCESS?H(o.onSuccess,a):(B.warn("getUnreadCount ->code:".concat(s,",targetId:").concat(n)),W(o.onError,s))}))},e.prototype.clearConversations=function(e,n){B.info("clearConversations -> conversationTypes:".concat(n)),this._isCPPMode?this._context.clearConversations(n,this.channelId).then((function(n){n===t.ErrorCode.SUCCESS?H(e.onSuccess,!0):(B.warn("clearConversations ->code:".concat(n)),W(e.onError,n))})):B.error("Method is only available in cppProtocol mode")},e.prototype.clearUnreadCount=function(e,n,o){t.assert("conversationType",e,t.AssertRules.NUMBER,!0),t.assert("targetId",n,t.AssertRules.STRING,!0),t.assert("callback",o,t.AssertRules.CALLBACK),B.info("clearUnreadCount ->targetId:".concat(n,",conversationType:").concat(e)),this._context.clearUnreadCount(e,n,this.channelId).then((function(e){e===t.ErrorCode.SUCCESS?H(o.onSuccess,!0):(B.warn("clearUnreadCount ->code:".concat(e,",targetId:").concat(n)),W(o.onError,e))}))},e.prototype.clearAllUnreadCount=function(e){t.assert("callback",e,t.AssertRules.CALLBACK),B.info("clearUnreadCount ->"),this._context.clearAllUnreadCount().then((function(n){n===t.ErrorCode.SUCCESS?H(e.onSuccess,!0):(B.warn("clearUnreadCount ->code:".concat(n)),W(e.onError,n))}))},e.prototype.getFirstUnreadMessage=function(e,n,o){t.assert("conversationType",e,t.AssertRules.NUMBER,!0),t.assert("targetId",n,t.AssertRules.STRING,!0),t.assert("callback",o,t.AssertRules.CALLBACK),B.info("getFirstUnreadMessage ->targetId:".concat(n,",conversationType:").concat(e)),this._context.getFirstUnreadMessage(e,n,this.channelId).then((function(e){e.code===t.ErrorCode.SUCCESS?H(o.onSuccess,e.data?K(e.data):null):(B.warn("getFirstUnreadMessage ->code:".concat(e.code,",targetId:").concat(n)),W(o.onError,e.code))}))},e.prototype.setConversationStatus=function(e,n,o,s){t.assert("conversationType",e,t.AssertRules.NUMBER,!0),t.assert("targetId",n,t.AssertRules.STRING,!0),t.assert("callback",s,t.AssertRules.CALLBACK),t.assert("status",o,t.AssertRules.OBJECT,!0),B.info("setConversationStatus ->targetId:".concat(n,",status:").concat(o));var a=o.isTop,r=o.notificationStatus;this._context.setConversationStatus(e,n,a,r,this.channelId).then((function(e){e===t.ErrorCode.SUCCESS?H(s.onSuccess):(B.warn("setConversationStatus ->code:".concat(e,",targetId:").concat(n)),W(s.onError,e))}))},e.prototype.sendMessage=function(e,n,s,r,c,i,u,d){var g=this;t.assert("conversationType",e,t.AssertRules.NUMBER,!0),t.assert("targetId",n,t.AssertRules.STRING,!0),t.assert("msg",s,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),B.info("sendMessage ->targetId:".concat(n,",conversationType:").concat(e));var l=!(!(null==d?void 0:d.isStatusMessage)&&!(null==d?void 0:d.isStatus)),C=function(e,t,n){var o,s=e||{},a=s.userIds,r=s.isVoipPush,c=s.disableNotification,i=s.isFilerWhiteBlacklist,u=s.expansion,d=s.canIncludeExpansion,g=s.pushConfig,l=s.resendMessageId,C=[];if(t){var f=(n||{}).content.mentionedInfo;C=f.userIdList,o=f.type}return{mentionedType:o,mentionedUserIdList:C,directionalUserIdList:a,isVoipPush:r,disableNotification:c,isFilerWhiteBlacklist:i,expansion:u,canIncludeExpansion:d,pushConfig:g,messageId:l}}(d,c,s),f=Object.assign(s,a(a({isMentioned:c,pushContent:i,pushData:u},C),{messageType:s.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:n,channelId:this.channelId},{traceId:R}),this._context.sendMessage(e,n,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||k.set(i);var u=K(i);F(u,p,g._context.getConnectedTime(),g._readReceiptTimeout),H(r.onSuccess,u)}else B.warn("sendMessage ->code:".concat(c,",targetId:").concat(n)),W(r.onError,c,K({isMentioned:!!f.isMentioned,content:s.content,messageType:s.messageType,isPersited:s.isPersited,isCounted:s.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:n,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:o.FAILED}))}))},e.prototype.sendRecallMessage=function(e,n,o){var s=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",n,t.AssertRules.CALLBACK),t.assert("options.disableNotification",null==o?void 0:o.disableNotification,t.AssertRules.BOOLEAN),t.assert("options.pushConfig",null==o?void 0:o.pushConfig,t.AssertRules.OBJECT),t.assert("options.extra",null==o?void 0:o.extra,t.AssertRules.STRING);var r=e.conversationType,c=e.targetId,i=e.messageUId,u=e.sentTime;B.info("sendRecallMessage ->targetId:".concat(c,",conversationType:").concat(r,",messageUId:").concat(i));var d=a({channelId:this.channelId},o);this._context.recallMessage(r,c,i,u,d).then((function(e){var o=e.code,a=e.data;o===t.ErrorCode.SUCCESS?(s._isCPPMode||k.set(a),H(n.onSuccess,K(a))):(B.warn("sendRecallMessage ->code:".concat(o,",targetId:").concat(c,",messageUId:").concat(i)),W(n.onError,o))}))},e.prototype.sendTypingStatusMessage=function(e,n,o,s){t.assert("conversationType",e,t.AssertRules.NUMBER,!0),t.assert("targetId",n,t.AssertRules.STRING,!0),t.assert("typingContentType",o,t.AssertRules.STRING,!0),t.assert("callback",s,t.AssertRules.CALLBACK),B.info("sendTypingStatusMessage ->targetId:".concat(n,",conversationType:").concat(e));var a={messageType:"RC:TypSts",content:{typingContentType:o},isStatusMessage:!0,channelId:this.channelId},r=t.logger.ID();t.logger.info(t.LogTagId.A_SEND_MSG_T,{messageType:a.messageType,conversationType:e,targetId:n,channelId:a.channelId},{traceId:r}),this._context.sendMessage(e,n,a,void 0,r).then((function(e){var o=e.code,a=e.data;(o===t.ErrorCode.SUCCESS?t.logger.info:t.logger.warn)(t.LogTagId.A_SEND_MSG_R,{code:o,messageUId:a?a.messageUId:"",messageId:a?a.messageId:""},{traceId:r}),o===t.ErrorCode.SUCCESS?H(s.onSuccess,K(a)):(B.warn("sendTypingStatusMessage ->code:".concat(o,",targetId:").concat(n)),W(s.onError,o))}))},e.prototype.sendReceiptResponse=function(e,t,n){var o=this;B.info("sendReceiptResponse ->targetId:".concat(t,",conversationType:").concat(e));var s=this._context.getCurrentUserId(),a="".concat(s).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 n.onSuccess(null);var d=setInterval((function(){1===c.length&&clearInterval(d);var s=c.splice(0,1)[0],i=new J({receiptMessageDic:s});o.sendMessage(e,t,i,{onSuccess:function(e){var t=Object.keys(s)[0];r[t].isResponse=!0,o._storage.set(a,r),H(n.onSuccess,e)},onError:function(e){B.warn("sendReceiptResponse ->code:".concat(e,",targetId:").concat(t)),W(n.onError,e)}})}),200)}else n.onSuccess(null)},e.prototype.sendReadReceiptMessage=function(e,n,o){t.assert("messageUIds",e,t.AssertRules.ARRAY,!0),t.assert("targetId",n,t.AssertRules.STRING,!0),B.info("sendReadReceiptMessage ->targetId:".concat(n,",messageUIds:").concat(e));for(var s=0,a=e;s<a.length;s++){var r=a[s];t.assert("messageUId",r,t.AssertRules.STRING)}this._context.sendReadReceiptMessage(n,e,this.channelId).then((function(s){var a=s.code;a===t.ErrorCode.SUCCESS?o.onSuccess():(B.warn("sendReadReceiptMessage ->code:".concat(a,",targetId:").concat(n,",messageUIds:").concat(e)),o.onError(a))})).catch((function(t){B.warn("sendReadReceiptMessage ->code:".concat(t,",targetId:").concat(n,",messageUIds:").concat(e)),o.onError(t)}))},e.prototype.getMessageReader=function(e,n,o){t.assert("messageUId",e,t.AssertRules.STRING,!0),t.assert("targetId",n,t.AssertRules.STRING,!0),B.info("getMessageReader ->targetId:".concat(n,",messageUId:").concat(e)),this._context.getMessageReader(n,e,this.channelId).then((function(s){var a=s.code,r=s.data;a===t.ErrorCode.SUCCESS?o.onSuccess(r):(B.warn("getMessageReader ->code:".concat(a,",targetId:").concat(n,",messageUId:").concat(e)),o.onError(a))})).catch((function(t){B.warn("getMessageReader ->code:".concat(t,",targetId:").concat(n,",messageUId:").concat(e)),o.onError(t)}))},e.prototype.updateMessageExpansion=function(e,n,o){t.assert("expansion",e,t.AssertRules.OBJECT,!0),t.assert("message",n,t.AssertRules.OBJECT,!0);var s=n.conversationType,a=n.targetId,r=n.messageUId,c=n.canIncludeExpansion,i=n.expansion;B.info("updateMessageExpansion ->targetId:".concat(a,",messageUId:").concat(r,",conversationType:").concat(s)),this._context.sendExpansionMessage({conversationType:s,targetId:a,messageUId:r,canIncludeExpansion:c,originExpansion:i,expansion:e,channelId:this.channelId}).then((function(e){var n=e.code;n===t.ErrorCode.SUCCESS?H(o.onSuccess):(B.warn("updateMessageExpansion ->code:".concat(n,",targetId:").concat(a,",messageUId:").concat(r)),W(o.onError,n))}))},e.prototype.removeMessageExpansionForKey=function(e,n,o){t.assert("keys",e,t.AssertRules.ARRAY,!0),t.assert("message",n,t.AssertRules.OBJECT,!0);var s=n.conversationType,a=n.targetId,r=n.messageUId,c=n.canIncludeExpansion;B.info("removeMessageExpansionForKey ->targetId:".concat(a,",messageUId:").concat(r,",conversationType:").concat(s)),this._context.sendExpansionMessage({conversationType:s,targetId:a,messageUId:r,canIncludeExpansion:c,keys:e,channelId:this.channelId}).then((function(e){var n=e.code;n===t.ErrorCode.SUCCESS?H(o.onSuccess):(B.warn("removeMessageExpansionForKey ->code:".concat(n,",targetId:").concat(a,",messageUId:").concat(r)),W(o.onError,n))}))},e.prototype.getHistoryMessages=function(e,n,o,s,a,r,c){t.assert("conversationType",e,t.AssertRules.NUMBER,!0),t.assert("targetId",n,t.AssertRules.STRING,!0),t.assert("timestamp",o,t.AssertRules.NUMBER,!0),t.assert("count",s,t.AssertRules.NUMBER,!0),t.assert("callback",a,t.AssertRules.CALLBACK,!0),t.assert("order",c,t.AssertRules.NUMBER),B.info("getHistoryMessages ->targetId:".concat(n,",conversationType:").concat(e,",timestamp:").concat(o));var i=t.logger.ID();t.logger.info(t.LogTagId.A_GET_HISTORY_MSG_T,{targetId:n,conversationType:e,channelId:"",timestamp:o,count:s},{traceId:i}),this._context.getHistoryMessage(e,n,o,s,c,this.channelId,r,i).then((function(e){var o=e.code,s=e.data;if(o===t.ErrorCode.SUCCESS)if(s){var r=s.list,c=s.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:o,messageUIds:u.join(",")},{traceId:i}),H(a.onSuccess,d,c)}else t.logger.info(t.LogTagId.A_GET_HISTORY_MSG_R,{code:o,messageUIds:""},{traceId:i}),H(a.onSuccess,[],!1);else t.logger.warn(t.LogTagId.A_GET_HISTORY_MSG_R,{code:o,messageUIds:""},{traceId:i}),B.warn("getHistoryMessages ->code:".concat(o,",targetId:").concat(n)),W(a.onError,o)}))},e.prototype.deleteRemoteMessages=function(e,n,o,s){var a=this;t.assert("conversationType",e,t.AssertRules.NUMBER,!0),t.assert("targetId",n,t.AssertRules.STRING,!0),t.assert("messages",o,t.AssertRules.ARRAY,!0),t.assert("callback",s,t.AssertRules.CALLBACK),B.info("deleteRemoteMessages ->targetId:".concat(n,",conversationType:").concat(e)),this._context.deleteRemoteMessage(e,n,o,this.channelId).then((function(r){if(r===t.ErrorCode.SUCCESS){if(!a._isCPPMode){var c=k.get(e,n,a.channelId);c&&o.forEach((function(t){c.messageUId===t.messageUId&&k.remove(e,n,a.channelId)}))}H(s.onSuccess)}else B.warn("deleteRemoteMessages ->code:".concat(r,",targetId:").concat(n)),W(s.onError,r)}))},e.prototype.clearRemoteHistoryMessages=function(e,n){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",n,t.AssertRules.CALLBACK);var o=e.conversationType,s=e.targetId,a=e.timestamp;B.info("clearRemoteHistoryMessages ->targetId:".concat(s,",conversationType:").concat(o)),this._context.deleteRemoteMessageByTimestamp(o,s,a,this.channelId).then((function(e){e===t.ErrorCode.SUCCESS?H(n.onSuccess):(B.warn("clearRemoteHistoryMessages ->code:".concat(e)),W(n.onError,e))}))},e.prototype.getConversationListWithAllChannel=function(e){t.assert("callback",e,t.AssertRules.CALLBACK),this._context.getConversationListWithAllChannel().then((function(n){var o=n.code,s=n.data;o===t.ErrorCode.SUCCESS?H(e.onSuccess,s.map(G)):W(e.onError,o)}))},e.prototype.getConversationListWithAllChannelByPage=function(e,n,o){t.assert("callback",e,t.AssertRules.CALLBACK),t.assert("index",n,t.AssertRules.NUMBER),t.assert("limit",o,t.AssertRules.NUMBER),this._context.getConversationListWithAllChannelByPage(n,o).then((function(n){var o=n.code,s=n.data;o===t.ErrorCode.SUCCESS?H(e.onSuccess,s.map(G)):W(e.onError,o)}))},e.prototype.insertMessage=function(e,n,o,s,a){void 0===a&&(a={});var r=o.senderUserId,c=o.objectName,i=o.content,u=o.messageDirection,d=o.messageUId,g=o.canIncludeExpansion,l=o.expansion,C=o.disableNotification,f=o.sentTime,p=o.sentStatus;B.info("insertMessage ->targetId:".concat(n,",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,n,h).then((function(e){var o=e.code,a=e.data;o===t.ErrorCode.SUCCESS?H(s.onSuccess,K(a)):(B.warn("insertMessage ->code:".concat(o,",targetId:").concat(n)),W(s.onError,o))}))},e.prototype.deleteLocalMessagesByTimestamp=function(e,n,o,s,a){B.info("deleteLocalMessagesByTimestamp ->targetId:".concat(n,",conversationType:").concat(e,",timestamp:").concat(o)),this._context.deleteMessagesByTimestamp(e,n,o,s,this.channelId).then((function(e){e===t.ErrorCode.SUCCESS?H(a.onSuccess,!0):(B.warn("deleteLocalMessagesByTimestamp ->code:".concat(e,",targetId:").concat(n)),W(a.onError,e))}))},e.prototype.getRemoteHistoryMessages=function(e,n,o,s,a,r){B.info("getRemoteHistoryMessages ->targetId:".concat(n,",conversationType:").concat(e));var c=r.order||0;this._context.getRemoteHistoryMessages(e,n,o,s,c,this.channelId).then((function(e){var o=e.code,s=e.data;if(o===t.ErrorCode.SUCCESS)if(s){var r=s.list,c=s.hasMore,i=r.map((function(e){return K(e)}));H(a.onSuccess,i,c)}else H(a.onSuccess,[],!1);else B.warn("getRemoteHistoryMessages ->code:".concat(o,",targetId:").concat(n)),W(a.onError,o)}))},e.prototype.clearMessages=function(e,n,o){var s=this;B.info("clearMessages ->targetId:".concat(n,",conversationType:").concat(e)),this._context.clearMessages(e,n,this.channelId).then((function(a){a===t.ErrorCode.SUCCESS?(s._isCPPMode||k.remove(e,n,s.channelId),H(o.onSuccess,!0)):(B.warn("clearMessages ->code:".concat(a,",targetId:").concat(n)),W(o.onError,a))}))},e.prototype.searchConversationByContent=function(e,n,o,s){B.info("searchConversationByContent ->keyword:".concat(e)),this._context.searchConversationByContent(e,s,this.channelId,o).then((function(o){var s=o.code,a=o.data,r=[];a=a||[],s===t.ErrorCode.SUCCESS?(a.forEach((function(e){r.push(G(e))})),H(n.onSuccess,r)):(B.warn("searchConversationByContent ->code:".concat(s,",keyword:").concat(e)),W(n.onError,s))}))},e.prototype.searchConversationByContentWithAllChannel=function(e,n,o,s){void 0===o&&(o=[]),t.logger.info("searchConversationByContentWithAllChannel ->keyword:".concat(e)),this._context.searchConversationByContentWithAllChannel(e,o,s).then((function(o){var s=o.code,a=o.data,r=[];a=a||[],s===t.ErrorCode.SUCCESS?(a.forEach((function(e){r.push(G(e))})),H(n.onSuccess,r)):(t.logger.warn("searchConversationByContentWithAllChannel ->code:".concat(s,",keyword:").concat(e)),W(n.onError,s))}))},e.prototype.searchMessageByContent=function(e,n,o,s,a,r,c){B.info("searchMessageByContent ->targetId:".concat(n,",conversationType:").concat(e,",keyword:").concat(o)),this._context.searchMessageByContent(e,n,o,s,a,r,this.channelId).then((function(e){var o=e.code,s=e.data,a=[];if(o===t.ErrorCode.SUCCESS){var r=s=s||{},i=r.messages,u=r.count;i.forEach((function(e){a.push(K(e))})),H(c.onSuccess,a,u)}else B.warn("searchMessageByContent ->code:".concat(o,",targetId:").concat(n)),W(c.onError,o)}))},e.prototype.searchMessageByContentWithAllChannel=function(e,n,o,s,a,r){t.logger.info("searchMessageByContentWithAllChannel ->targetId: ".concat(n," ,conversationType: ").concat(e," ,keyword: ").concat(o,", timestamp: ").concat(s,", count: ").concat(a)),this._context.searchMessageByContentWithAllChannel(e,n,o,s,a).then((function(e){var o=e.code,s=e.data,a=[];if(o===t.ErrorCode.SUCCESS){var c=s=s||{},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(o,",targetId:").concat(n)),W(r.onError,o)}))},e.prototype.searchMessageByContentInTimeRangeWithAllChannel=function(e,n,o,s,a,r,c,i){t.logger.info("searchMessageByContentInTimeRangeWithAllChannel ->targetId: ".concat(n," ,conversationType: ").concat(e," ,keyword: ").concat(o,", startTime: ").concat(s,", endTime: ").concat(a,", offset: ").concat(r,", limit: ").concat(c)),this._context.searchMessageByContentInTimeRangeWithAllChannel(e,n,o,s,a,r,c).then((function(e){var o=e.code,s=e.data,a=[];o===t.ErrorCode.SUCCESS?((s=s||{}).messages.forEach((function(e){a.push(K(e))})),H(i.onSuccess,a)):(t.logger.warn("searchMessageByContentInTimeRangeWithAllChannel ->code:".concat(o,",targetId:").concat(n)),W(i.onError,o))}))},e.prototype.getUnreadMentionedMessages=function(e,t){return B.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,n,o,s){B.info("clearUnreadCountByTimestamp ->targetId:".concat(n,",conversationType:").concat(e)),this._context.clearUnreadCountByTimestamp(e,n,o,this.channelId).then((function(e){e===t.ErrorCode.SUCCESS?H(s.onSuccess,!0):(B.warn("clearUnreadCountByTimestamp ->code:".concat(e,",targetId:").concat(n)),W(s.onError,e))}))},e.prototype.getConversationNotificationStatus=function(e,n,o){B.info("getConversationNotificationStatus ->targetId:".concat(n,",conversationType:").concat(e)),this._context.getConversationNotificationStatus(e,n,this.channelId).then((function(e){var s=e.code,a=e.data;s===t.ErrorCode.SUCCESS?H(o.onSuccess,a):(B.warn("getConversationNotificationStatus ->code:".concat(s,",targetId:").concat(n)),W(o.onError,s))}))},e}(),X=function(e){return{targetId:e.targetId,channelId:e.channelId,conversationType:e.type}},z=function(){function e(e,n){this._context=e,this._options=n,this._channelClient={},this._isCPPMode=t.usingCppEngine(),this._defaultChannelClient=new Q(e,"",this._isCPPMode,n.readReceiptTimeout)}return e.prototype.assertCPPMode=function(e,n,o){if(!this._isCPPMode)return null==o||o.onError(t.ErrorCode.NOT_SUPPORT),void B.error("'".concat(n,"' is unusable!"));e()},e.prototype.install=function(e,t){return this._context.install(e,t)},e.prototype.getChannel=function(e){if(B.info("getChannel ->channelId:".concat(e)),!this._isCPPMode)return B.error("getChannel method is only available in protocol stack mode"),null;if(t.assert("channelId",e,t.AssertRules.STRING,!0),e.length>20)return B.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 B.error("Only 1000 channels can be obtained"),null;var n=new Q(this._context,e,this._isCPPMode,this._options.readReceiptTimeout);return this._channelClient[e]=n,n},e.prototype.deleteChannels=function(e){var n=this;t.assert("channelIds",e,t.AssertRules.ARRAY,!0),B.info("deleteChannels ->channelIds:".concat(e)),this.assertCPPMode((function(){e.forEach((function(e){delete n._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.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){B.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,s,a,r,c,i){return this._defaultChannelClient.sendMessage(e,t,n,o,s,a,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,s,a,r){return this._defaultChannelClient.getHistoryMessages(e,t,n,o,s,a,r)},e.prototype.joinChatRoom=function(e,n,o){t.assert("chatRoomId",e,t.AssertRules.STRING,!0),t.assert("count",n,t.AssertRules.NUMBER,!0),t.assert("callback",o,t.AssertRules.CALLBACK),B.info("joinChatRoom ->chatRoomId:".concat(e));var s=t.logger.ID();t.logger.info(t.LogTagId.A_JOIN_CHATROOM_T,{chatroomId:e,count:n,joinExist:!1},{traceId:s}),this._context.joinChatroom(e,n,s).then((function(n){(n===t.ErrorCode.SUCCESS?t.logger.info:t.logger.warn)(t.LogTagId.A_JOIN_CHATROOM_R,{code:n,timestamp:(new Date).getTime()},{traceId:s}),n===t.ErrorCode.SUCCESS?H(o.onSuccess):(B.warn("joinChatRoom ->code:".concat(n,",chatRoomId:").concat(e)),W(o.onError,n))}))},e.prototype.quitChatRoom=function(e,n){t.assert("chatRoomId",e,t.AssertRules.STRING,!0),t.assert("callback",n,t.AssertRules.CALLBACK),B.info("quitChatRoom ->chatRoomId:".concat(e));var o=t.logger.ID();t.logger.info(t.LogTagId.A_QUIT_CHATROOM_T,{chatroomId:e},{traceId:o}),this._context.quitChatroom(e).then((function(s){(s===t.ErrorCode.SUCCESS?t.logger.info:t.logger.warn)(t.LogTagId.A_QUIT_CHATROOM_R,{code:s},{traceId:o}),s===t.ErrorCode.SUCCESS?H(n.onSuccess):(B.warn("quitChatRoom ->code:".concat(s,",chatRoomId:").concat(e)),W(n.onError,s))}))},e.prototype.getChatRoomInfo=function(e,n,o,s){t.assert("chatRoomId",e,t.AssertRules.STRING,!0),t.assert("count",n,t.AssertRules.NUMBER,!0),t.assert("order",o,t.AssertRules.NUMBER,!0),t.assert("callback",s,t.AssertRules.CALLBACK),B.info("getChatRoomInfo ->chatRoomId:".concat(e)),this._context.getChatroomInfo(e,n,o).then((function(n){var o=n.code,a=n.data;o===t.ErrorCode.SUCCESS?H(s.onSuccess,{userInfos:(null==a?void 0:a.userInfos)||[],userTotalNums:(null==a?void 0:a.userCount)||0}):(B.warn("getChatRoomInfo ->code:".concat(o,",chatRoomId:").concat(e)),W(s.onError,o))}))},e.prototype.setChatroomEntry=function(e,n,o){t.assert("chatRoomId",e,t.AssertRules.STRING,!0),t.assert("chatroomEntry",n,t.AssertRules.OBJECT,!0),t.assert("callback",o,t.AssertRules.CALLBACK),B.info("setChatroomEntry ->chatRoomId:".concat(e)),this._context.setChatroomEntry(e,n).then((function(n){n===t.ErrorCode.SUCCESS?H(o.onSuccess):(B.warn("setChatroomEntry ->code:".concat(n,",chatRoomId:").concat(e)),W(o.onError,n))}))},e.prototype.setChatRoomEntries=function(e,n,o){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)}(n),t.assert("callback",o,t.AssertRules.CALLBACK),n.entries.length>10)W(o.onError,t.ErrorCode.CHATROOM_KV_STORE_OUT_LIMIT);else{var s="id:".concat(e);B.info("set chatroom entry->".concat(s)),this._context.setChatroomEntries(e,n).then((function(e){var n=e.code,a=e.data;n===t.ErrorCode.SUCCESS?H(o.onSuccess):(B.warn("set chatroom entry fail ->code+:".concat(n,",").concat(s)),W(o.onError,n,a))}))}},e.prototype.forceSetChatroomEntry=function(e,n,o){t.assert("chatRoomId",e,t.AssertRules.STRING,!0),t.assert("chatroomEntry",n,t.AssertRules.OBJECT,!0),t.assert("callback",o,t.AssertRules.CALLBACK),B.info("forceSetChatroomEntry ->chatRoomId:".concat(e)),this._context.forceSetChatroomEntry(e,n).then((function(n){n===t.ErrorCode.SUCCESS?H(o.onSuccess):(B.warn("forceSetChatroomEntry ->code:".concat(n,",chatRoomId:").concat(e)),W(o.onError,n))}))},e.prototype.removeChatroomEntry=function(e,n,o){t.assert("chatRoomId",e,t.AssertRules.STRING,!0),t.assert("chatroomEntry",n,t.AssertRules.OBJECT,!0),t.assert("callback",o,t.AssertRules.CALLBACK),B.info("removeChatroomEntry ->chatRoomId:".concat(e)),this._context.removeChatroomEntry(e,n).then((function(n){n===t.ErrorCode.SUCCESS?H(o.onSuccess):(B.warn("removeChatroomEntry ->code:".concat(n,",chatRoomId:").concat(e)),W(o.onError,n))}))},e.prototype.removeChatRoomEntries=function(e,n,o){t.assert("chatRoomId",e,t.AssertRules.STRING,!0),function(e){e.entries.forEach((function(e){t.assert("key",e,t.AssertRules.STRING,!0)}))}(n);var s="id:".concat(e);B.debug("remove chatroom entry->".concat(s));var r=a({},n);r.entries=n.entries.map((function(e){return{key:e}})),this._context.removeChatroomEntries(e,r).then((function(e){var n=e.code,a=e.data;n===t.ErrorCode.SUCCESS?H(o.onSuccess):(B.warn("remove chatroom entry fail ->code+:".concat(n,",").concat(s)),W(o.onError,n,a))}))},e.prototype.forceRemoveChatroomEntry=function(e,n,o){t.assert("chatRoomId",e,t.AssertRules.STRING,!0),t.assert("chatroomEntry",n,t.AssertRules.OBJECT,!0),t.assert("callback",o,t.AssertRules.CALLBACK),B.info("forceRemoveChatroomEntry ->chatRoomId:".concat(e)),this._context.forceRemoveChatroomEntry(e,n).then((function(n){n===t.ErrorCode.SUCCESS?H(o.onSuccess):(B.warn("forceRemoveChatroomEntry ->code:".concat(n,",chatRoomId:").concat(e)),W(o.onError,n))}))},e.prototype.getChatroomEntry=function(e,n,o){t.assert("chatRoomId",e,t.AssertRules.STRING,!0),t.assert("key",n,t.AssertRules.STRING,!0),t.assert("callback",o,t.AssertRules.CALLBACK),B.info("getChatroomEntry ->chatRoomId:".concat(e,",key:").concat(n)),this._context.getChatroomEntry(e,n).then((function(n){var s=n.code,a=n.data;s===t.ErrorCode.SUCCESS?H(o.onSuccess,a||""):(B.warn("getChatroomEntry ->code:".concat(s,",chatRoomId:").concat(e)),W(o.onError,s))}))},e.prototype.getAllChatroomEntries=function(e,n){t.assert("chatRoomId",e,t.AssertRules.STRING,!0),t.assert("callback",n,t.AssertRules.CALLBACK),B.info("getAllChatroomEntries ->chatRoomId:".concat(e)),this._context.getAllChatroomEntries(e).then((function(o){var s=o.code,a=o.data;s===t.ErrorCode.SUCCESS?H(n.onSuccess,a):(B.warn("getAllChatroomEntries ->code:".concat(s,",chatRoomId:").concat(e)),W(n.onError,s))}))},e.prototype.getChatRoomHistoryMessages=function(e,n,o,s,a){void 0===a&&(a=0),t.assert("chatRoomId",e,t.AssertRules.STRING,!0),t.assert("count",n,t.AssertRules.NUMBER,!0),t.assert("order",o,t.AssertRules.NUMBER,!0),t.assert("callback",s,t.AssertRules.CALLBACK),t.assert("timestamp",a,t.AssertRules.NUMBER),B.info("getChatRoomHistoryMessages ->chatRoomId:".concat(e)),this._context.getChatRoomHistoryMessages(e,n,o,a).then((function(n){var o=n.code,a=n.data;if(o===t.ErrorCode.SUCCESS)if(a){var r=a.list,c=a.hasMore,i=r.map((function(e){return K(e)}));H(s.onSuccess,i,c)}else H(s.onSuccess,[],!1);else B.warn("getChatRoomHistoryMessages ->code:".concat(o,",chatRoomId:").concat(e)),W(s.onError,o)}))},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,n,o,s,a){t.assert("fileType",e,t.AssertRules.NUMBER,!0),t.assert("fileName",o,t.AssertRules.STRING),t.assert("callback",n,t.AssertRules.CALLBACK),B.info("getFileToken ->fileType:".concat(e,",fileName:").concat(o,",queryString:").concat(a)),this._context.getFileToken(e,o,s,a).then(n.onSuccess).catch(n.onError)},e.prototype.getFileUrl=function(e,n,o,s,a,r){t.assert("fileType",e,t.AssertRules.NUMBER,!0),t.assert("fileName",n,t.AssertRules.STRING,!0),t.assert("saveName",o,t.AssertRules.STRING),t.assert("callback",s,t.AssertRules.CALLBACK),t.assert("serverType",r,t.AssertRules.NUMBER),t.assert("uploadRes",a,t.AssertRules.OBJECT),B.info("getFileUrl ->fileType:".concat(e,",fileName:").concat(n)),this._context.getFileUrl(e,n,o,a,r).then(s.onSuccess).catch(s.onError)},e.prototype.createTag=function(e,n){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",n,t.AssertRules.CALLBACK),B.info("createTag ->tagId:".concat(e.tagId,",tagName:").concat(e.tagName)),this._context.createTag(e).then((function(o){var s=o.code;s===t.ErrorCode.SUCCESS?n.onSuccess():(B.warn("createTag ->code:".concat(s,",tagId:").concat(e.tagId)),n.onError(s))})).catch((function(t){B.warn("createTag ->code:".concat(t,",tagId:").concat(e.tagId)),n.onError(t)}))},e.prototype.removeTag=function(e,n){t.assert("tagId",e,t.AssertRules.STRING,!0),t.assert("callback",n,t.AssertRules.CALLBACK),B.info("removeTag ->tagId:".concat(e)),this._context.removeTag(e).then((function(o){var s=o.code;s===t.ErrorCode.SUCCESS?n.onSuccess():(B.warn("removeTag ->code:".concat(s,",tagId:").concat(e)),n.onError(s))})).catch((function(t){B.warn("removeTag ->code:".concat(t,",tagId:").concat(e)),n.onError(t)}))},e.prototype.updateTag=function(e,n){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",n,t.AssertRules.CALLBACK),B.info("updateTag ->tagId:".concat(e.tagId,",tagName:").concat(e.tagName)),this._context.updateTag(e).then((function(o){var s=o.code;s===t.ErrorCode.SUCCESS?n.onSuccess():(B.warn("updateTag ->code:".concat(s,",tagId:").concat(e.tagId)),n.onError(s))})).catch((function(t){B.warn("updateTag ->reason:".concat(t,",tagId:").concat(e.tagId)),n.onError(t)}))},e.prototype.getTagList=function(e){t.assert("callback",e,t.AssertRules.CALLBACK),this._context.getTagList().then((function(n){var o=n.code,s=n.data;o===t.ErrorCode.SUCCESS?e.onSuccess(s||[]):(B.warn("getTagList ->code:".concat(o)),e.onError(o))})).catch((function(t){B.warn("getTagList ->reason:".concat(t)),e.onError(t)}))},e.prototype.getTagsForConversation=function(e,n){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",n,t.AssertRules.CALLBACK),B.info("getTagsForConversation ->targetId:".concat(e.targetId,",conversationType:").concat(e.type)),this._context.getTagsForConversation(X(e)).then((function(e){var o=e.code,s=e.data;o===t.ErrorCode.SUCCESS?n.onSuccess(s||[]):(B.warn("getTagsForConversation ->code:".concat(o)),n.onError(o))})).catch((function(e){B.warn("getTagsForConversation ->reason:".concat(e)),n.onError(e)}))},e.prototype.addTagForConversations=function(e,n,o){t.assert("tagId",e,t.AssertRules.STRING,!0),t.assert("conversations",n,t.AssertRules.ARRAY,!0),t.assert("callback",o,t.AssertRules.CALLBACK),n.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)})),B.info("addTagForConversations ->tagId:".concat(e)),this._context.addTagForConversations(e,n.map((function(e){return X(e)}))).then((function(n){var s=n.code;n.data,s===t.ErrorCode.SUCCESS?o.onSuccess():(B.warn("addTagForConversations ->code:".concat(s,",tagId:").concat(e)),o.onError(s))})).catch((function(t){B.warn("addTagForConversations ->reason:".concat(t,",tagId:").concat(e)),o.onError(t)}))},e.prototype.removeTagForConversations=function(e,n,o){t.assert("tagId",e,t.AssertRules.STRING,!0),t.assert("conversations",n,t.AssertRules.ARRAY,!0),t.assert("callback",o,t.AssertRules.CALLBACK),n.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)})),B.info("removeTagForConversations ->tagId:".concat(e)),this._context.removeTagForConversations(e,n.map((function(e){return X(e)}))).then((function(n){var s=n.code;n.data,s===t.ErrorCode.SUCCESS?o.onSuccess():(B.warn("removeTagForConversations ->code:".concat(s,",tagId:").concat(e)),o.onError(s))})).catch((function(t){B.warn("removeTagForConversations ->reason:".concat(t,",tagId:").concat(e)),o.onError(t)}))},e.prototype.removeTagsForConversation=function(e,n,o){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",n,t.AssertRules.ARRAY,!0),t.assert("callback",o,t.AssertRules.CALLBACK),n.forEach((function(e){t.assert("tagId",e,t.AssertRules.STRING,!0)})),B.info("removeTagsForConversation ->tagIds:".concat(n,",targetId:").concat(e.targetId,",type:").concat(e.type)),this._context.removeTagsForConversation(X(e),n).then((function(e){var s=e.code;e.data,s===t.ErrorCode.SUCCESS?o.onSuccess():(B.warn("removeTagsForConversation ->code:".concat(s,",tagIds:").concat(n)),o.onError(s))})).catch((function(e){B.warn("removeTagsForConversation ->reason:".concat(e,",tagIds:").concat(n)),o.onError(e)}))},e.prototype.getConversationListByTag=function(e,n,o,s){t.assert("tagId",e,t.AssertRules.STRING,!0),t.assert("count",n,t.AssertRules.NUMBER,!0),t.assert("startTime",o,t.AssertRules.NUMBER,!0),t.assert("callback",s,t.AssertRules.CALLBACK,!0),B.info("getConversationListByTag ->tagId:".concat(e)),this._context.getConversationListByTag(e,o,n).then((function(n){var o=n.code,a=n.data,r=[];o===t.ErrorCode.SUCCESS?((a=a||[]).forEach((function(e){r.push(function(e){var t=e.channelId,n=e.conversationType,o=e.targetId,s=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:n,targetId:o,unreadMessageCount:s,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))})),s.onSuccess(r)):(B.warn("getConversationListByTag ->code:".concat(o,",tagId:").concat(e)),s.onError(o))})).catch((function(t){B.warn("getConversationListByTag ->reason:".concat(t,",tagId:").concat(e)),s.onError(t)}))},e.prototype.getUnreadCountByTag=function(e,n,o){t.assert("tagId",e,t.AssertRules.STRING,!0),t.assert("containMuted",n,t.AssertRules.BOOLEAN,!0),t.assert("callback",o,t.AssertRules.CALLBACK),B.info("getUnreadCountByTag ->tagId:".concat(e)),this._context.getUnreadCountByTag(e,n).then((function(n){var s=n.code,a=n.data;B.info(s,a),s===t.ErrorCode.SUCCESS?o.onSuccess(a||0):(B.warn("getUnreadCountByTag ->code:".concat(s,",tagId:").concat(e)),o.onError(s))})).catch((function(t){B.warn("getUnreadCountByTag ->reason:".concat(t,",tagId:").concat(e)),o.onError(t)}))},e.prototype.setConversationStatusInTag=function(e,n,o,s){t.assert("tagId",e,t.AssertRules.STRING,!0),t.assert("conversation.targetId",n.targetId,t.AssertRules.STRING,!0),t.assert("conversation.type",n.type,t.AssertRules.NUMBER,!0),t.assert("conversation.channelId",n.channelId,t.AssertRules.ONLY_STRING),t.assert("status.isTop",null==o?void 0:o.isTop,t.AssertRules.BOOLEAN,!0),t.assert("callback",s,t.AssertRules.CALLBACK),B.info("setConversationStatusInTag ->tagId:".concat(e,",targetId:").concat(n.targetId,",type").concat(n.type)),this._context.setConversationStatusInTag(e,X(n),o).then((function(n){var o=n.code;n.data,o===t.ErrorCode.SUCCESS?s.onSuccess():(B.warn("setConversationStatusInTag ->code:".concat(o,",tagId:").concat(e)),s.onError(o))})).catch((function(t){B.warn("setConversationStatusInTag ->reason:".concat(t,",tagId:").concat(e)),s.onError(t)}))},e.prototype.callExtra=function(e,n){for(var o,s=[],a=2;a<arguments.length;a++)s[a-2]=arguments[a];B.info("callExtra ->method:".concat(e)),(o=this._context).callExtra.apply(o,i([e],s,!1)).then((function(o){var s=o.code,a=o.data;if(s!==t.ErrorCode.SUCCESS)B.warn("callExtra ->code:".concat(s)),n.onError&&W(n.onError,s);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(n.onSuccess,u,i)}n.onSuccess&&H(n.onSuccess,a)}}))},e.prototype.hasRemoteUnreadMessages=function(e,n){t.assert("callback",n,t.AssertRules.CALLBACK),B.info("hasRemoteUnreadMessages ->token:".concat(e)),this.assertCPPMode((function(){H(n.onSuccess,!1)}),"hasRemoteUnreadMessages",n)},e.prototype.setUserStatusListener=function(e,t){var n=this;B.info("setUserStatusListener ->userIds:".concat(e.userIds)),this.assertCPPMode((function(){n._context.setUserStatusListener(e,t)}),"setUserStatusListener")},e.prototype.setUserStatus=function(e,n){var o=this;t.assert("status",e,t.AssertRules.NUMBER),t.assert("callback",n,t.AssertRules.CALLBACK),B.info("setUserStatus ->status:".concat(e)),this.assertCPPMode((function(){o._context.setUserStatus(e).then((function(e){e===t.ErrorCode.SUCCESS?H(n.onSuccess,!0):(B.warn("setUserStatus ->code:".concat(e)),W(n.onError,e))}))}),"setUserStatus",n)},e.prototype.getUserStatus=function(e,n){var o=this;t.assert("userId",e,t.AssertRules.STRING),t.assert("callback",n,t.AssertRules.CALLBACK),B.info("getUserStatus ->userId:".concat(e)),this.assertCPPMode((function(){o._context.getUserStatus(e).then((function(o){var s=o.code,a=o.data;s===t.ErrorCode.SUCCESS?H(n.onSuccess,a):(B.warn("getUserStatus ->code:".concat(s,",useerId:").concat(e)),W(n.onError,s))}))}),"getUserStatus",n)},e.prototype.addToBlacklist=function(e,n){var o=this;t.assert("userId",e,t.AssertRules.STRING),t.assert("callback",n,t.AssertRules.CALLBACK),B.info("addToBlacklist ->userId:".concat(e)),this.assertCPPMode((function(){o._context.addToBlacklist(e).then((function(o){o===t.ErrorCode.SUCCESS?H(n.onSuccess):(B.warn("addToBlacklist ->code:".concat(o,",useerId:").concat(e)),W(n.onError,o))}))}),"addToBlacklist",n)},e.prototype.removeFromBlacklist=function(e,n){var o=this;t.assert("userId",e,t.AssertRules.STRING),t.assert("callback",n,t.AssertRules.CALLBACK),B.info("removeFromBlacklist ->userId:".concat(e)),this.assertCPPMode((function(){o._context.removeFromBlacklist(e).then((function(o){o===t.ErrorCode.SUCCESS?H(n.onSuccess):(B.warn("removeFromBlacklist ->code:".concat(o,",useerId:").concat(e)),W(n.onError,o))}))}),"removeFromBlacklist",n)},e.prototype.getBlacklist=function(e){var n=this;t.assert("callback",e,t.AssertRules.CALLBACK),this.assertCPPMode((function(){n._context.getBlacklist().then((function(n){var o=n.code,s=n.data;o===t.ErrorCode.SUCCESS?H(e.onSuccess,s):(B.warn("getBlacklist ->code:".concat(o)),W(e.onError,o))}))}),"getBlacklist",e)},e.prototype.getBlacklistStatus=function(e,n){var o=this;t.assert("userId",e,t.AssertRules.STRING),t.assert("callback",n,t.AssertRules.CALLBACK),B.info("getBlacklistStatus ->userId:".concat(e)),this.assertCPPMode((function(){o._context.getBlacklistStatus(e).then((function(o){var s=o.code,a=o.data;s===t.ErrorCode.SUCCESS?H(n.onSuccess,a):(B.warn("getBlacklistStatus ->code:".concat(s,",userId:").concat(e)),W(n.onError,s))}))}),"getBlacklistStatus",n)},e.prototype.insertMessage=function(e,n,o,s,a){var r=this;void 0===a&&(a={}),t.assert("conversationType",e,t.AssertRules.NUMBER,!0),t.assert("targetId",n,t.AssertRules.STRING,!0),t.assert("content.senderUserId",o.senderUserId,t.AssertRules.STRING,!0),t.assert("callback",s,t.AssertRules.CALLBACK),B.info("insertMessage ->targetId:".concat(n,",conversationType:").concat(e,",senderUserId:").concat(o.senderUserId)),this.assertCPPMode((function(){r._defaultChannelClient.insertMessage(e,n,o,s,a)}),"insertMessage",s)},e.prototype.getRemoteHistoryMessages=function(e,n,o,s,a,r){var c=this;void 0===r&&(r={}),t.assert("conversationType",e,t.AssertRules.NUMBER,!0),t.assert("targetId",n,t.AssertRules.STRING,!0),t.assert("timestamp",o,t.AssertRules.NUMBER,!0),t.assert("count",s,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,n,o,s,a,r)}),"getRemoteHistoryMessages",a)},e.prototype.deleteLocalMessages=function(e,n,o,s){var a=this;t.assert("messageIds",o,t.AssertRules.ARRAY,!0),t.assert("callback",s,t.AssertRules.CALLBACK),B.info("deleteLocalMessages ->messageIds:".concat(o)),this.assertCPPMode((function(){a._context.deleteMessages(o).then((function(e){e===t.ErrorCode.SUCCESS?H(s.onSuccess,!0):(B.warn("deleteLocalMessages ->code:".concat(e,",messageIds:").concat(o)),W(s.onError,e))}))}),"deleteLocalMessages",s)},e.prototype.deleteLocalMessagesByTimestamp=function(e,n,o,s,a){var r=this;t.assert("conversationType",e,t.AssertRules.NUMBER,!0),t.assert("targetId",n,t.AssertRules.STRING,!0),t.assert("timestamp",o,t.AssertRules.NUMBER,!0),t.assert("cleanSpace",s,t.AssertRules.BOOLEAN),t.assert("callback",a,t.AssertRules.CALLBACK),this.assertCPPMode((function(){r._defaultChannelClient.deleteLocalMessagesByTimestamp(e,n,o,s,a)}),"deleteLocalMessagesByTimestamp",a)},e.prototype.clearMessages=function(e,n,o){var s=this;t.assert("conversationType",e,t.AssertRules.NUMBER,!0),t.assert("targetId",n,t.AssertRules.STRING,!0),t.assert("callback",o,t.AssertRules.CALLBACK),this.assertCPPMode((function(){s._defaultChannelClient.clearMessages(e,n,o)}),"clearMessages",o)},e.prototype.getMessage=function(e,n){var o=this;t.assert("callback",n,t.AssertRules.CALLBACK),this.assertCPPMode((function(){o._context.getMessage(e).then((function(o){var s=o.code,a=o.data;s===t.ErrorCode.SUCCESS?H(n.onSuccess,K(a)):(B.warn("getMessage ->code:".concat(s,",messageId:").concat(e)),W(n.onError,s))}))}),"getMessage",n)},e.prototype.setMessageSentStatus=function(e,n,o){var s=this;t.assert("messageId",e,t.AssertRules.NUMBER,!0),t.assert("sentStatus",n,t.AssertRules.NUMBER,!0),B.info("setMessageSentStatus ->messageId:".concat(e,",sentStatus:").concat(n)),this.assertCPPMode((function(){s._context.setMessageSentStatus(e,n).then((function(n){n===t.ErrorCode.SUCCESS?H(o.onSuccess,!0):(B.warn("setMessageSentStatus ->code:".concat(n,",messageId:").concat(e)),W(o.onError,n))}))}),"setMessageSentStatus",o)},e.prototype.setMessageReceivedStatus=function(e,n,o){var s=this;t.assert("messageId",e,t.AssertRules.NUMBER,!0),t.assert("receivedStatus",n,t.AssertRules.NUMBER,!0),B.info("setMessageReceivedStatus ->messageId:".concat(e,",receivedStatus:").concat(n)),this.assertCPPMode((function(){s._context.setMessageReceivedStatus(e,n).then((function(n){n===t.ErrorCode.SUCCESS?H(o.onSuccess,!0):(B.warn("setMessageReceivedStatus ->code:".concat(n,",messageId:").concat(e)),W(o.onError,n))}))}),"setMessageReceivedStatus",o)},e.prototype.setMessageContent=function(e,n,o){var s=this;t.assert("messageId",e,t.AssertRules.NUMBER,!0),t.assert("objectName",o,t.AssertRules.ONLY_STRING,!0),B.info("setMessageContent ->messageId:".concat(e,",objectName:").concat(o)),this.assertCPPMode((function(){s._context.setMessageContent(e,n,o)}),"setMessageContent")},e.prototype.setMessageSearchField=function(e,n,o){var s=this;t.assert("messageId",e,t.AssertRules.NUMBER,!0),t.assert("searchFiles",o,t.AssertRules.STRING,!0),B.info("setMessageSearchField ->messageId:".concat(e,",searchFiles:").concat(o)),this.assertCPPMode((function(){s._context.setMessageSearchField(e,n,o)}),"setMessageSearchField")},e.prototype.searchConversationByContent=function(e,n,o,s){var a=this;t.assert("keyword",e,t.AssertRules.STRING,!0),t.assert("callback",n,t.AssertRules.CALLBACK),t.assert("conversationTypes",o,t.AssertRules.ARRAY),t.assert("customMessageType",s,t.AssertRules.ARRAY),this.assertCPPMode((function(){a._defaultChannelClient.searchConversationByContent(e,n,o,s)}),"searchConversationByContent",n)},e.prototype.searchMessageByContent=function(e,n,o,s,a,r,c){var i=this;t.assert("conversationType",e,t.AssertRules.NUMBER,!0),t.assert("targetId",n,t.AssertRules.STRING,!0),t.assert("keyword",o,t.AssertRules.STRING,!0),t.assert("timestamp",s,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,n,o,s,a,r,c)}),"searchMessageByContent",c)},e.prototype.getUnreadMentionedMessages=function(e,n){return this._isCPPMode?(t.assert("conversationType",e,t.AssertRules.NUMBER,!0),t.assert("targetId",n,t.AssertRules.STRING,!0),this._defaultChannelClient.getUnreadMentionedMessages(e,n)):(B.error("getUnreadMentionedMessages method is not supported in a browser!"),null)},e.prototype.clearUnreadCountByTimestamp=function(e,n,o,s){var a=this;t.assert("conversationType",e,t.AssertRules.NUMBER,!0),t.assert("targetId",n,t.AssertRules.STRING,!0),t.assert("timestamp",o,t.AssertRules.NUMBER,!0),this.assertCPPMode((function(){a._defaultChannelClient.clearUnreadCountByTimestamp(e,n,o,s)}),"clearUnreadCountByTimestamp",s)},e.prototype.getFirstUnreadMessage=function(e,t,n){return this._defaultChannelClient.getFirstUnreadMessage(e,t,n)},e.prototype.getConversationNotificationStatus=function(e,n,o){var s=this;t.assert("conversationType",e,t.AssertRules.NUMBER,!0),t.assert("targetId",n,t.AssertRules.STRING,!0),this.assertCPPMode((function(){s._defaultChannelClient.getConversationNotificationStatus(e,n,o)}),"getConversationNotificationStatus",o)},e.prototype.getServerTime=function(){return this._context.getServerTime()},e.prototype.getRTCUserInfoList=function(e,n){B.info("getRTCUserInfoList ->roomId:".concat(e.id)),this._context.getRTCUserInfoList(e.id).then((function(o){var s=o.code,a=o.data;if(s!==t.ErrorCode.SUCCESS)B.warn("getRTCUserInfoList ->code:".concat(s,",roomId:").concat(e.id)),n.onError(s);else{var r=null==a?void 0:a.users;n.onSuccess(r)}})).catch((function(t){B.warn("getRTCUserInfoList ->error:".concat(t,",roomId:").concat(e.id)),n.onError(t)}))},e.prototype.getRTCUserList=function(e,n){B.info("getRTCUserList ->roomId:".concat(e.id)),this._context.getRTCUserList(e.id).then((function(o){var s=o.code,a=o.data;s!==t.ErrorCode.SUCCESS?(B.warn("getRTCUserList ->code:".concat(s,",roomId:").concat(e.id)),n.onError(s)):n.onSuccess(a)})).catch((function(t){B.warn("getRTCUserList ->error:".concat(t,",roomId:").concat(e.id)),n.onError(t)}))},e.prototype.setRTCUserInfo=function(e,n,o){B.info("setRTCUserInfo ->roomId:".concat(e.id,",info:").concat(JSON.stringify(n||{}))),this._context.setRTCUserInfo(e.id,n.key,n.value).then((function(s){s!==t.ErrorCode.SUCCESS?(B.warn("setRTCUserInfo ->code:".concat(s,",roomId:").concat(e.id,",key:").concat(n.key,",value:").concat(n.value)),o.onError(s)):o.onSuccess(!0)})).catch((function(t){B.warn("setRTCUserInfo ->code:".concat(t,",roomId:").concat(e.id,",key:").concat(n.key,",value:").concat(n.value)),o.onError(t)}))},e.prototype.removeRTCUserInfo=function(e,n,o){B.info("removeRTCUserInfo ->roomId:".concat(e.id,"keys:").concat(n.keys)),this._context.removeRTCUserInfo(e.id,n.keys).then((function(n){n!==t.ErrorCode.SUCCESS?(B.warn("removeRTCUserInfo ->code:".concat(n,",roomId:").concat(e.id)),o.onError(n)):o.onSuccess(!0)})).catch((function(t){B.warn("removeRTCUserInfo ->error:".concat(t,",roomId:").concat(e.id)),o.onError(t)}))},e.prototype.getRTCRoomInfo=function(e,n){B.info("getRTCRoomInfo ->roomId:".concat(e.id)),this._context.getRTCRoomInfo(e.id).then((function(o){var s=o.code,a=o.data;s!==t.ErrorCode.SUCCESS?(B.warn("getRTCRoomInfo ->code:".concat(s,",roomId:").concat(e.id)),n.onError(s)):n.onSuccess(a)})).catch((function(t){B.warn("getRTCRoomInfo ->error:".concat(t,",roomId:").concat(e.id)),n.onError(t)}))},e.prototype.setRTCRoomInfo=function(e,n,o){throw t.todo("setRTCRoomInfo")},e.prototype.removeRTCRoomInfo=function(e,n,o){throw t.todo("removeRTCRoomInfo")},e.prototype.joinRTCRoom=function(e,n){B.info("joinRTCRoom ->roomId:".concat(e.id));var o=e.mode||0;this._context.joinRTCRoom(e.id,o).then((function(o){var s=o.code,a=o.data;s!==t.ErrorCode.SUCCESS?(B.warn("joinRTCRoom ->code:".concat(s,",roomId:").concat(e.id)),n.onError(s)):n.onSuccess(a)})).catch((function(t){B.warn("joinRTCRoom ->error:".concat(t,",roomId:").concat(e.id)),n.onError(t)}))},e.prototype.quitRTCRoom=function(e,n){B.info("quitRTCRoom ->roomId:".concat(e.id)),this._context.quitRTCRoom(e.id).then((function(o){o!==t.ErrorCode.SUCCESS?(B.warn("quitRTCRoom ->code:".concat(o,",roomId:").concat(e.id)),n.onError(o)):n.onSuccess(!0)})).catch((function(t){B.warn("quitRTCRoom ->error:".concat(t,",roomId:").concat(e.id)),n.onError(t)}))},e.prototype.RTCPing=function(e,n){B.info("RTCPing ->roomId:".concat(e.id));var o=e.mode||0;this._context.rtcPing(e.id,o).then((function(o){o!==t.ErrorCode.SUCCESS?(B.warn("RTCPing ->code:".concat(o,",roomId:").concat(e.id)),n.onError(o)):n.onSuccess(!0)})).catch((function(t){B.warn("RTCPing ->error:".concat(t,",roomId:").concat(e.id)),n.onError(t)}))},e.prototype.setRTCData=function(e,n,o,s,a,r,c){B.info("setRTCData ->roomId:".concat(e,",key:").concat(n)),this._context.setRTCData(e,n,o,s,a,c).then((function(n){n!==t.ErrorCode.SUCCESS?(B.warn("setRTCData ->code:".concat(n,",roomId:").concat(e)),r.onError(n)):r.onSuccess(!0)})).catch((function(t){B.warn("setRTCData ->error:".concat(t,",roomId:").concat(e)),r.onError(t)}))},e.prototype.getRTCData=function(e,n,o,s,a){B.info("getRTCData ->roomId:".concat(e,",keys:").concat(n)),this._context.getRTCData(e,n,o,s).then((function(n){var o=n.code,s=n.data;o!==t.ErrorCode.SUCCESS?(B.warn("getRTCData ->code:".concat(o,",roomId:").concat(e)),a.onError(o)):a.onSuccess(s)})).catch((function(t){B.warn("setRTCUserInfo ->error:".concat(t,",roomId:").concat(e)),a.onError(t)}))},e.prototype.removeRTCData=function(e,n,o,s,a,r){B.info("removeRTCData ->roomId:".concat(e,",keys:").concat(n)),this._context.removeRTCData(e,n,o,s,r).then((function(n){n!==t.ErrorCode.SUCCESS?(B.warn("removeRTCData ->code:".concat(n,",roomId:").concat(e)),a.onError(n)):a.onSuccess(!0)})).catch((function(t){B.warn("removeRTCData ->error:".concat(t,",roomId:").concat(e)),a.onError(t)}))},e.prototype.setRTCUserData=function(e,n,o,s,a,r){this.setRTCData(e,n,o,s,t.RTCApiType.PERSON,a,r)},e.prototype.setRTCUserTotalRes=function(e,n,o,s,a){B.info("setRTCUserTotalRes ->roomId:".concat(e)),this._context.setRTCTotalRes(e,n,o,s).then((function(n){n!==t.ErrorCode.SUCCESS?(B.warn("setRTCUserTotalRes ->code:".concat(n,",roomId:").concat(e)),a.onError(n)):a.onSuccess(!0)})).catch((function(t){B.warn("setRTCUserTotalRes ->error:".concat(t,",roomId:").concat(e)),a.onError(t)}))},e.prototype.getRTCUserData=function(e,n,o,s){this.getRTCData(e,n,o,t.RTCApiType.PERSON,s)},e.prototype.removeRTCUserData=function(e,n,o,s,a){this.removeRTCData(e,n,o,t.RTCApiType.PERSON,s,a)},e.prototype.setRTCRoomData=function(e,n,o,s,a,r){this.setRTCData(e,n,o,s,t.RTCApiType.ROOM,a,r)},e.prototype.getRTCRoomData=function(e,n,o,s){this.getRTCData(e,n,o,t.RTCApiType.ROOM,s)},e.prototype.removeRTCRoomData=function(e,n,o,s,a){this.removeRTCData(e,n,o,t.RTCApiType.ROOM,s,a)},e.prototype.setRTCOutData=function(e,n,o,s,a){throw t.todo("setRTCOutData")},e.prototype.getRTCOutData=function(e,n,o){throw t.todo("getRTCOutData")},e.prototype.getRTCToken=function(e,n){B.info("getRTCToken ->roomId:".concat(e.id)),this._context.getRTCToken(e.id,e.mode,e.broadcastType).then((function(o){var s=o.code,a=o.data;s!==t.ErrorCode.SUCCESS?(B.warn("getRTCToken ->code:".concat(s,",roomId:").concat(e.id)),n.onError(s)):n.onSuccess(a)})).catch((function(t){B.warn("getRTCToken ->error:".concat(t,",roomId:").concat(e.id)),n.onError(t)}))},e.prototype.setRTCState=function(e,n,o){B.info("setRTCState ->roomId:".concat(e.id)),this._context.setRTCState(e.id,n.report).then((function(n){n!==t.ErrorCode.SUCCESS?(B.warn("setRTCState ->code:".concat(n,",roomId:").concat(e.id)),o.onError(n)):o.onSuccess(!0)})).catch((function(t){B.warn("setRTCState ->error:".concat(t,",roomId:").concat(e.id)),o.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.3");var ne,oe={init:function(e,n,o){void 0===o&&(o={}),t.assert("appkey",e,t.AssertRules.STRING,!0),B.setLogLevel(o.logLevel),B.setLogStdout(o.logStdout),B.info("RongIMLib Version: ".concat("5.5.3",", Commit: ").concat("91c274754ff48547d8f76b79194ed406200cffe4",",appkey:").concat(e));var s=null==o?void 0:o.connectionType;s?t.CONNECTION_TYPE.WEBSOCKET!==s&&t.CONNECTION_TYPE.COMET!==s&&(B.warn("RongIMLib connectionType must be ".concat(t.CONNECTION_TYPE.WEBSOCKET," or ").concat(t.CONNECTION_TYPE.COMET)),s=t.CONNECTION_TYPE.WEBSOCKET):s=t.CONNECTION_TYPE.WEBSOCKET,t.logger.info(t.LogTagId.A_INIT_O,{appkey:e,navigators:o.navi?[o.navi]:[],connectionType:s,logLevel:o.logLevel,typingExpireTime:o.typingExpireTime}),Y=t.APIContext.init(w,{appkey:e,apiVersion:"5.5.3",navigators:o.navi?[o.navi]:[],miniCMPProxy:[],connectionType:s,logLevel:o.logLevel,logStdout:o.logStdout,typingExpireTime:o.typingExpireTime,indexDBSwitch:o.indexDBSwitch,checkCA:o.checkCA}),te=Math.min(15,Math.max(o.readReceiptTimeout||1,1)),q=new z(Y,{readReceiptTimeout:te})},getInstance:function(){return q},setConnectionStatusListener:function(e){var n=t.logger.ID();Y.assignWatcher({connectionState:function(o){t.logger.info(t.LogTagId.A_CONNECT_S,{status:o},{traceId:n}),k.clear(),e.onChanged(o)}})},setOnReceiveMessageListener:function(e){Y.assignWatcher({message:function(n,o,s){try{var a=K(n),r=Y.getCurrentUserId(),c=Y.getConnectedTime();F(a,r,c,te),a=function(e,t,n,o){var s=new Date(n-1e3*o*60*60*24).getTime()-e.sentTime<0;if("ReadReceiptResponseMessage"!==e.messageType||!s)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()||k.set(n),t.logger.info(t.LogTagId.A_PULL_MSG_O,{message:n.messageUId}),e.onReceived(a,void 0,s)}catch(e){B.error("setOnReceiveMessageListener ->error:".concat(e))}}})},setConversationStatusListener:function(e){Y.assignWatcher({conversationState:function(t){try{var n=[];t.forEach((function(e){var t=e.updatedItems,o=e.conversationType,s=e.targetId,a=e.channelId,r=(t=t||{}).notificationStatus,c=t.isTop;r&&c&&n.push({notificationStatus:r.val,isTop:c.val,conversationType:o,targetId:s,channelId:a||"",updatedTime:r.time})})),n.length>0&&e.onChanged(n)}catch(e){B.error("setConversationStatusListener ->error:".concat(e))}}})},setMessageExpansionListener:function(e){Y.assignWatcher({expansion:function(t){try{t.updatedExpansion&&e.onUpdated(t.updatedExpansion),t.deletedExpansion&&e.onDeleted(t.deletedExpansion)}catch(e){B.error("setMessageExpansionListener ->error:".concat(e))}}})},setTagListener:function(e){Y.assignWatcher({tag:function(){e.onChanged()}})},setConversationTagListener:function(e){Y.assignWatcher({conversationTagChanged:function(){e.onChanged()}})},setPullOffLineFinished:function(e){Y.assignWatcher({pullFinished:function(){e.onFinished()}})},setTypingStatusListener:function(e){Y.assignWatcher({typingState:function(t){e.onChanged(t)}})},setMessageBlockedListener:function(e){Y.assignWatcher({messageBlocked:function(t){e.onReceived(t)}})},setChatRoomStatusListener:function(e){Y.assignWatcher({chatroomState:function(t){e.onChanged(t)}})},connect:function(e,n){return r(this,void 0,void 0,(function(){var o,s,a;return c(this,(function(r){switch(r.label){case 0:return o=t.logger.ID(),t.logger.info(t.LogTagId.A_CONNECT_T,{token:e,reconnectKickEnable:!1},{traceId:o}),B.info("connect ->token:".concat(e)),[4,Y.connect(e,!1,!1,o)];case 1:return s=r.sent(),(s.code===t.ErrorCode.SUCCESS?t.logger.info:t.logger.warn)(t.LogTagId.A_CONNECT_R,{code:s.code,userId:s.userId},{traceId:o}),s.code===t.ErrorCode.SUCCESS?(n.onSuccess(s.userId),a=new Date(Y.getConnectedTime()-1e3*te*60*60*24).getTime(),D.getKeys().forEach((function(e){if(/SENT$/.test(e)){var t=D.get(e).dealtime;t&&a-t>0&&D.remove(e)}else if(/RECEIVED$/.test(e)){var n=D.get(e),o=Object.keys(n).length;Object.keys(n).forEach((function(e){var t=n[e].dealtime;t&&a-t>0&&delete n[e]})),Object.keys(n).length!==o&&(0===n.length?D.remove(e):D.set(e,n))}}))):s.code===t.ErrorCode.RC_CONN_USER_OR_PASSWD_ERROR?(B.warn("connect ->code:".concat(s.code,",token:").concat(e)),n.onTokenIncorrect()):(B.warn("connect ->code:".concat(s.code,",token:").concat(e)),n.onError(s.code)),[2]}}))}))},reconnect:function(e,n){var o=t.logger.ID();t.logger.info(t.LogTagId.A_RECONNECT_T,{},{traceId:o}),Y.reconnect().then((function(n){(n.code===t.ErrorCode.SUCCESS?t.logger.info:t.logger.warn)(t.LogTagId.A_RECONNECT_R,{code:n.code,userId:n.userId},{traceId:o}),n.code===t.ErrorCode.SUCCESS?e.onSuccess(n.userId):(B.warn("reconnect ->code:".concat(n.code)),e.onError(n.code))})).catch((function(t){e.onError(t)}))},RegisterMessage:{},RegisterMessageTypeMapping:O,getMessageObjectName:function(e){var t=a(a({},P),O);return Object.keys(t).find((function(n){return t[n]===e}))||e},registerMessageType:function(e,t,n,o){this.RegisterMessage[e]=V(e,t,n.isPersited,n.isCounted),this.RegisterMessageTypeMapping[t]=e,Y.registerMessageType(t,n.isPersited,n.isCounted,o)},createLogger:function(e,n){return/^(RC)/.test(e)?(B.error("Tag error. Tags that start with RC are used internally by the SDK !"),null):["IM","RTC"].includes(n)?new t.Logger(e,n,"A"):(B.error("The parameter type must be one of IM, or RTC !"),null)},messageWatch:function(e){var t=this;$.push((function(n){var o,s;B.info("messageWatch ->message:".concat(JSON.stringify(n||{})));try{e(n),null===(s=(o=t._voipProvider).onReceived)||void 0===s||s.call(o,n)}catch(e){B.error("messageWatch ->error:".concat(e))}})),Y.assignWatcher({rtcInnerWatcher:ee})},statusWatch:function(e){Z.push((function(t){B.info("statusWatch ->status:".concat(t));try{e(t)}catch(e){B.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:{}},se=function(e,t,n){this.type=e,this.userIdList=t,this.mentionedContent=n},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"),Se=V("RCCombineMessage","RC:CombineMsg"),me=function(e,t,n,o,s,a,r,c,i,u,d,g,l,C,f,p,R,h){this.conversationType=e,this.targetId=t,this.senderUserId=n,this.content=o,this.objectName=s,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,(ne=exports.VoIPMediaType||(exports.VoIPMediaType={}))[ne.MEDIA_AUDIO=1]="MEDIA_AUDIO",ne[ne.MEDIA_VEDIO=2]="MEDIA_VEDIO",ne[ne.MEDIA_VIDEO=2]="MEDIA_VIDEO";var Ie,Te=V("AcceptMessage","RC:VCAccept"),Me=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"}(Ie||(Ie={}));var we=Ie,Be=t.ConnectResultCode;window&&(window.RongIMClient=oe),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=Te,exports.BaseMessage=j,exports.ChannelClient=Q,exports.ConnectionState=Be,exports.FileMessage=Ce,exports.GIFMessage=pe,exports.GetChatRoomType=s,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=se,exports.MentionedType=we,exports.Message=me,exports.MessageTag=ae,exports.PublicServiceMultiRichContentMessage=xe,exports.PublicServiceRichContentMessage=Le,exports.RCCombineMessage=Se,exports.ReadReceiptMessage=Re,exports.ReadReceiptRequestMessage=he,exports.ReadReceiptResponseMessage=J,exports.ReferenceMessage=_e,exports.RichContentMessage=de,exports.RingingMessage=Me,exports.RongIMClient=oe,exports.SentStatus=o,exports.SightMessage=fe,exports.SummaryMessage=ye,exports.SyncReadStatusMessage=Ne,exports.TextMessage=re,exports.TypingStatusMessage=ie,exports.VoiceMessage=ge;
|
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.5.
|
|
13
|
+
"version": "5.5.3",
|
|
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.5.
|
|
24
|
+
"@rongcloud/engine": "=5.5.3"
|
|
25
25
|
}
|
|
26
26
|
}
|