@rongcloud/imlib-next 5.5.8-beem-alpha.4 → 5.6.0-beem-alpha.1

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.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@rongcloud/engine"),t=function(){return t=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},t.apply(this,arguments)};function n(e,t,n,o){return new(n||(n=Promise))((function(r,a){function s(e){try{c(o.next(e))}catch(e){a(e)}}function i(e){try{c(o.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,i)}c((o=o.apply(e,t||[])).next())}))}function o(e,t){var n,o,r,a,s={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return a={next:i(0),throw:i(1),return:i(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function i(a){return function(i){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,o&&(r=2&a[0]?o.return:a[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,a[1])).done)return r;switch(o=0,r&&(a=[2&a[0],r.value]),a[0]){case 0:case 1:r=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,o=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!(r=s.trys,(r=r.length>0&&r[r.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!r||a[1]>r[0]&&a[1]<r[3])){s.label=a[1];break}if(6===a[0]&&s.label<r[1]){s.label=r[1],r=a;break}if(r&&s.label<r[2]){s.label=r[2],s.ops.push(a);break}r[2]&&s.ops.pop(),s.trys.pop();continue}a=t.call(e,s)}catch(e){a=[6,e],o=0}finally{n=r=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,i])}}}var r=function(){return!("undefined"==typeof uni||!function(e){for(var t=["request","getSystemInfo"],n=0,o=t.length;n<o;n++)if(!e[t[n]])return!1;return!0}(uni))},a=r();var s,i,c={tag:"browser",httpReq:function(t){var n=t.method||e.HttpMethod.GET,o=t.timeout||e.HTTP_TIMEOUT,r=t.headers,a=t.query,s=t.body,i=e.appendUrl(t.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")),c="[object XDomainRequest]"===Object.prototype.toString.call(a);if(a.open(n,i),r&&a.setRequestHeader)for(var d in r)a.setRequestHeader(d,r[d]);if(c){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 u="object"==typeof s?JSON.stringify(s):s;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})}),o),a.send(s)}))},localStorage:null===window||void 0===window?void 0:window.localStorage,sessionStorage:null===window||void 0===window?void 0:window.sessionStorage,useNavi:!0,connectPlatform:"",isFromUniapp:a,createWebSocket:function(e,t){var n=new WebSocket(e,t);return n.binaryType="arraybuffer",{onClose:function(e){n.onclose=function(t){var n=t.code,o=t.reason;e(n,o)}},onError:function(e){n.onerror=e},onMessage:function(e){n.onmessage=function(t){e(t.data)}},onOpen:function(e){n.onopen=e},send:function(e){n.send(e)},close:function(e,t){n.close()}}},getNetworkType:function(){var t=navigator.connection||navigator.mozConnection||navigator.webkitConnection,n=t.type,o=t.effectiveType,r=n||o||e.NetworkType.UNKONWN;return new Promise((function(e){e(r)}))}},d=r(),u=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return wx[e].apply(wx,t)}catch(e){null===console||void 0===console||console.error(e)}}},l={setItem:u("setStorageSync"),getItem:u("getStorageSync"),removeItem:u("removeStorageSync"),clear:u("clearStorageSync")},g={tag:"wechat",httpReq:function(t){var n=t.method||e.HttpMethod.GET,o=t.timeout||e.HTTP_TIMEOUT,r=t.headers,a=t.query,s=t.body,i=e.appendUrl(t.url,a);return new Promise((function(t){wx.request({url:i,method:n,header:r,timeout:o,data:s,success:function(e){t({data:e.data,status:e.statusCode})},fail:function(){t({status:e.ErrorCode.RC_HTTP_REQ_FAIL})}})}))},localStorage:l,sessionStorage:l,useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:d,createWebSocket:function(e,t){var n=wx.connectSocket({url:e,protocols:t});return{onClose:function(e){n.onClose((function(t){e(t.code,t.reason)}))},onError:function(e){n.onError((function(t){e(t.errMsg)}))},onMessage:function(e){n.onMessage((function(t){e(t.data)}))},onOpen:function(e){n.onOpen(e)},send:function(e){n.send({data:e})},close:function(e,t){n.close({code:e,reason:t})}}},getNetworkType:function(){return new Promise((function(t){wx.getNetworkType({success:function(e){var n=e.networkType;t(n)},fail:function(){t(e.NetworkType.UNKONWN)}})}))}},v=r(),f=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{if("setStorageSync"===e)return my[e]({key:t[0],data:JSON.parse(t[1])});if("clearStorageSync"===e)return my[e]();if("removeStorageSync"===e)return my[e]({key:t[0]});var o=my[e]({key:t[0]}).data;return o?JSON.stringify(o):o}catch(e){}}},I={setItem:f("setStorageSync"),getItem:f("getStorageSync"),removeItem:f("removeStorageSync"),clear:f("clearStorageSync")},p={tag:"alipay",httpReq:function(t){var n=t.method||e.HttpMethod.GET,o=t.timeout||e.HTTP_TIMEOUT,r=t.headers,a=t.query,s=t.body,i=e.appendUrl(t.url,a),c=t.dataType||"json";return new Promise((function(t){my.request({url:i,method:n,headers:r,timeout:o,data:s,dataType:c,success:function(e){t({data:e.data,status:e.status})},fail:function(){t({status:e.ErrorCode.RC_HTTP_REQ_FAIL})}})}))},localStorage:I,sessionStorage:I,useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:v,createWebSocket:function(e){return my.connectSocket({url:e}),{onClose:function(e){my.onSocketClose(e)},onError:function(e){my.onSocketError((function(t){e(t.errMsg)}))},onMessage:function(e){my.onSocketMessage((function(t){t.isBuffer?e(my.base64ToArrayBuffer(t.data)):e(t.data)}))},onOpen:function(e){my.onSocketOpen(e)},send:function(e){my.sendSocketMessage({data:my.arrayBufferToBase64(e),isBuffer:!0})},close:function(){my.closeSocket()}}},getNetworkType:function(){return new Promise((function(t){my.getNetworkType({success:function(e){var n=e.networkType;t(n)},fail:function(){t(e.NetworkType.UNKONWN)}})}))}},R=r(),E=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return tt[e].apply(tt,t)}catch(e){}}},T={setItem:E("setStorageSync"),getItem:E("getStorageSync"),removeItem:E("removeStorageSync"),clear:E("clearStorageSync")},h={tag:"toutiao",useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:R,localStorage:T,sessionStorage:T,httpReq:function(t){return new Promise((function(n){tt.request({url:t.url,data:t.body,header:t.headers,method:t.method,success:function(e){var t=(null==e?void 0:e.data)||{},o={data:JSON.stringify(t),status:e.statusCode};n(o)},fail:function(t){n({status:e.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})}}},getNetworkType:function(){return new Promise((function(t){tt.getNetworkType({success:function(e){var n=e.networkType;t(n)},fail:function(){t(e.NetworkType.UNKONWN)}})}))}},C=r(),m=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return swan[e].apply(swan,t)}catch(e){}}},S={setItem:m("setStorageSync"),getItem:m("getStorageSync"),removeItem:m("removeStorageSync"),clear:m("clearStorageSync")},A={tag:"baidu",useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:C,localStorage:S,sessionStorage:S,httpReq:function(t){return new Promise((function(n,o){swan.request({url:t.url,data:t.body,header:t.headers,method:t.method,success:function(e){var t=(null==e?void 0:e.data)||{},o={data:JSON.stringify(t),status:e.statusCode};n(o)},fail:function(t){n({status:e.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})}}},getNetworkType:function(){return n(this,void 0,void 0,(function(){return o(this,(function(t){return[2,new Promise((function(t){swan.getNetworkType({success:function(e){var n=e.networkType;t(n)},fail:function(){t(e.NetworkType.UNKONWN)}})}))]}))}))}},O=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return uni[e].apply(uni,t)}catch(e){null===console||void 0===console||console.error(e)}}},N={setItem:O("setStorageSync"),getItem:O("getStorageSync"),removeItem:O("removeStorageSync"),clear:O("clearStorageSync")},_={tag:"uniapp",httpReq:function(t){var n=t.method||e.HttpMethod.GET,o=t.timeout||e.HTTP_TIMEOUT,r=t.headers,a=t.query,s=t.body,i=e.appendUrl(t.url,a);return new Promise((function(t){uni.request({url:i,method:n,header:r,timeout:o,data:s,success:function(e){t({data:e.data,status:e.statusCode})},fail:function(){t({status:e.ErrorCode.RC_HTTP_REQ_FAIL})}})}))},localStorage:N,sessionStorage:N,useNavi:!0,connectPlatform:"",isFromUniapp:!0,createWebSocket:function(e,t){var n={complete:function(){},url:e,protocols:t},o=uni.connectSocket(n);return{onClose:function(e){o.onClose((function(t){e(t.code,t.reason)}))},onError:function(e){o.onError((function(t){e(t.errMsg)}))},onMessage:function(e){o.onMessage((function(t){e(t.data)}))},onOpen:function(e){o.onOpen(e)},send:function(e){o.send({data:e})},close:function(e,t){o.close({code:e,reason:t})}}},getNetworkType:function(){return new Promise((function(t){uni.getNetworkType({success:function(e){var n=e.networkType;t(n)},fail:function(){t(e.NetworkType.UNKONWN)}})}))}},y=function(e){return e&&e.request&&e.getSystemInfo},M="undefined"!=typeof uni&&y(uni)?function(){switch(process.env.VUE_APP_PLATFORM){case"app-plus":return _;case"mp-baidu":return A;case"mp-toutiao":return h;case"mp-alipay":return p;case"mp-weixin":return g;default:return c}}():"undefined"!=typeof my&&y(my)?p:"undefined"!=typeof tt&&y(tt)?h:"undefined"!=typeof swan&&y(swan)?A:"undefined"!=typeof wx&&y(wx)?g:c;function L(t){var n=t.conversationType,o=t.channelId,r=t.messageType,a=t.content,s=t.senderUserId,i=t.targetId,c=t.sentTime,d=t.receivedTime,u=t.messageUId,l=t.messageDirection,g=t.isPersited,v=t.isCounted,f=t.isOffLineMessage,I=t.canIncludeExpansion,p=t.expansion,R=t.receivedStatus,E=t.disableNotification,T=t.isMentioned,h=t.isStatusMessage,C=t.readReceiptInfo,m=t.pushConfig,S=t.messageId,A=t.isInterrupt,O=t.isModifyMessage,N=t.channelType,_=t.sentStatus;R||(R=e.ReceivedStatus.UNREAD);var y={messageType:r,channelId:o||"",content:a,senderUserId:s,targetId:i,conversationType:n,sentTime:c,receivedTime:d,messageUId:u,messageDirection:l,isPersited:g,isCounted:v,isMentioned:T,disableNotification:E,isStatusMessage:h,canIncludeExpansion:I,expansion:p,receivedStatus:R,readReceiptInfo:C,pushConfig:m,messageId:S,isInterrupt:A,isModifyMessage:O,sentStatus:_};return n!==e.ConversationType.ULTRA_GROUP&&(y.isOffLineMessage=f),n===e.ConversationType.ULTRA_GROUP&&e.isNumber(N)&&(y.channelType=N),y}function U(e){var t=e.conversationType,n=e.targetId,o=e.latestMessage,r=e.unreadMessageCount,a=e.hasMentioned,s=e.mentionedInfo,i=e.lastUnreadTime,c=e.notificationStatus,d=e.notificationLevel,u=e.isTop,l=e.channelId,g=e.unreadMentionedCount;return{conversationType:t,targetId:n,latestMessage:o&&L(o),unreadMessageCount:r,hasMentioned:a,mentionedInfo:a?{type:null==s?void 0:s.type,userIdList:null==s?void 0:s.userIdList}:void 0,lastUnreadTime:i,notificationStatus:c,notificationLevel:d,isTop:u,channelId:l,unreadMentionedCount:g}}function P(e,t){null===console||void 0===console||console.warn("Method '".concat(e,"' is deprecated, please use '").concat(t,"' instead"))}exports.Events=void 0,(s=exports.Events||(exports.Events={})).CONNECTING="CONNECTING",s.CONNECTED="CONNECTED",s.DISCONNECT="DISCONNECT",s.SUSPEND="SUSPEND",s.MESSAGES="MESSAGES",s.READ_RECEIPT_RECEIVED="READ_RECEIPT_RECEIVED",s.MESSAGE_RECEIPT_REQUEST="MESSAGE_RECEIPT_REQUEST",s.MESSAGE_RECEIPT_RESPONSE="MESSAGE_RECEIPT_RESPONSE",s.CONVERSATION="CONVERSATION",s.CHATROOM="CHATROOM",s.EXPANSION="EXPANSION",s.PULL_OFFLINE_MESSAGE_FINISHED="PULL_OFFLINE_MESSAGE_FINISHED",s.TAG="TAG",s.CONVERSATION_TAG="CONVERSATION_TAG",s.TYPING_STATUS="TYPING_STATUS",s.MESSAGE_BLOCKED="MESSAGE_BLOCKED",s.ULTRA_GROUP_ENABLE="ULTRA_GROUP_ENABLE",s.OPERATE_STATUS="OPERATE_STATUS",s.ULTRA_GROUP_MESSAGE_EXPANSION_UPDATED="ULTRA_GROUP_MESSAGE_EXPANSION_UPDATED",s.ULTRA_GROUP_MESSAGE_MODIFIED="ULTRA_GROUP_MESSAGE_MODIFIED",s.ULTRA_GROUP_MESSAGE_RECALLED="ULTRA_GROUP_MESSAGE_RECALLED",s.ULTRA_GROUP_CHANNEL_TYPE_CHANGE="ULTRA_GROUP_CHANNEL_TYPE_CHANGE",s.ULTRA_GROUP_CHANNEL_DELETE="ULTRA_GROUP_CHANNEL_DELETE",s.ULTRA_GROUP_CHANNEL_USER_KICKED="ULTRA_GROUP_CHANNEL_USER_KICKED",exports.SentStatus=void 0,(i=exports.SentStatus||(exports.SentStatus={}))[i.SENDING=10]="SENDING",i[i.FAILED=20]="FAILED",i[i.SENT=30]="SENT",i[i.RECEIVED=40]="RECEIVED",i[i.READ=50]="READ",i[i.DESTROYED=60]="DESTROYED";var x=new e.EventEmitter,w={onConnecting:function(){x.emit(exports.Events.CONNECTING)},onConnected:function(){x.emit(exports.Events.CONNECTED)},onDisconnect:function(e){x.emit(exports.Events.DISCONNECT,e)},onSuspend:function(e){x.emit(exports.Events.SUSPEND,e)},batchMessage:function(e){x.emit(exports.Events.MESSAGES,{messages:e.map((function(e){return L(e)}))})},typingState:function(e){x.emit(exports.Events.TYPING_STATUS,{status:e})},readReceiptReceived:function(e,t,n){x.emit(exports.Events.READ_RECEIPT_RECEIVED,{conversation:e,messageUId:t,sentTime:n})},messageReceiptRequest:function(e,t,n){x.emit(exports.Events.MESSAGE_RECEIPT_REQUEST,{conversation:e,messageUId:t,senderUserId:n})},messageReceiptResponse:function(e,t,n){x.emit(exports.Events.MESSAGE_RECEIPT_RESPONSE,{conversation:e,receivedUserId:t,messageUIdList:n})},conversationState:function(t){var n=t.map((function(t){var n=t.conversationType,o={conversationType:n,latestMessage:t.latestMessage?L(t.latestMessage):null,targetId:t.targetId,unreadMessageCount:t.unreadMessageCount,unreadMentionedCount:t.unreadMentionedCount,notificationStatus:t.notificationStatus,notificationLevel:t.notificationLevel,lastUnreadTime:t.lastUnreadTime,channelId:t.channelId};return n===e.ConversationType.ULTRA_GROUP?(o.versionTime=t.versionTime,{conversation:o}):(o.hasMentioned=t.hasMentioned,o.mentionedInfo=t.mentionedInfo,o.isTop=t.isTop,{conversation:o,updatedItems:t.updatedItems})}));x.emit(exports.Events.CONVERSATION,{conversationList:n})},chatroomState:function(e){x.emit(exports.Events.CHATROOM,e)},expansion:function(e){x.emit(exports.Events.EXPANSION,e)},pullFinished:function(){x.emit(exports.Events.PULL_OFFLINE_MESSAGE_FINISHED)},tag:function(){x.emit(exports.Events.TAG)},conversationTagChanged:function(){x.emit(exports.Events.CONVERSATION_TAG)},messageBlocked:function(e){x.emit(exports.Events.MESSAGE_BLOCKED,e)},ultraGroupEnable:function(e){x.emit(exports.Events.ULTRA_GROUP_ENABLE,e)},operateStatus:function(e){x.emit(exports.Events.OPERATE_STATUS,e)},ultraGroupMessageExpansionUpdated:function(e){x.emit(exports.Events.ULTRA_GROUP_MESSAGE_EXPANSION_UPDATED,e)},ultraGroupMessageModified:function(e){x.emit(exports.Events.ULTRA_GROUP_MESSAGE_MODIFIED,e)},ultraGroupMessageRecalled:function(e){x.emit(exports.Events.ULTRA_GROUP_MESSAGE_RECALLED,e)},ultraGroupChannelChangeType:function(e){x.emit(exports.Events.ULTRA_GROUP_CHANNEL_TYPE_CHANGE,e)},ultraGroupChannelUserKicked:function(e){x.emit(exports.Events.ULTRA_GROUP_CHANNEL_USER_KICKED,e)},ultraGroupChannelDelete:function(e){x.emit(exports.Events.ULTRA_GROUP_CHANNEL_DELETE,e)}};e.VersionManage.add("imlib-next","5.5.8-beem-alpha.4");var b=null,D=null,B=null;function G(){return n(this,void 0,void 0,(function(){return o(this,(function(t){switch(t.label){case 0:return b?(B.info(e.LogTagId.A_DESTROY_O),[4,e.APIContext.destroy()]):[2];case 1:return t.sent(),D=null,b=null,B=null,[2]}}))}))}function k(e){if(!b)throw new Error("Not initialized yet!");return e(b,B,D)}function H(t){return b?t(b,B,D):Promise.resolve({code:e.ErrorCode.BIZ_ERROR_CLIENT_NOT_INIT})}function V(){x.clear()}var F={TIMEOUT:{code:-1,msg:"Network timeout"},SDK_INTERNAL_ERROR:{code:-2,msg:"SDK internal error"},PARAMETER_ERROR:{code:-3,msg:"Please check the parameters, the {param} expected a value of {expect} but received {current}"},REJECTED_BY_BLACKLIST:{code:405,msg:"Blacklisted by the other party"},SEND_TOO_FAST:{code:20604,msg:"Sending messages too quickly"},NOT_IN_GROUP:{code:22406,msg:"Not in group"},ULTRA_GROUP_USER_NOT_IN_PRIVATE_CHANNEL:{code:e.ErrorCode.ULTRA_GROUP_USER_NOT_IN_PRIVATE_CHANNEL,msg:"ultra group user not in private channel"},FORBIDDEN_IN_GROUP:{code:22408,msg:"Forbbiden from speaking in the group"},NOT_IN_CHATROOM:{code:23406,msg:"Not in chatRoom"},FORBIDDEN_IN_CHATROOM:{code:23408,msg:"Forbbiden from speaking in the chatRoom"},KICKED_FROM_CHATROOM:{code:23409,msg:"Kicked out and forbbiden from joining the chatRoom"},CHATROOM_NOT_EXIST:{code:23410,msg:"ChatRoom does not exist"},CHATROOM_IS_FULL:{code:23411,msg:"ChatRoom members exceeded"},PARAMETER_INVALID_CHATROOM:{code:23412,msg:"Invalid chatRoom parameters"},ROAMING_SERVICE_UNAVAILABLE_CHATROOM:{code:23414,msg:"ChatRoom message roaming service is not open, Please go to the developer to open this service"},RECALLMESSAGE_PARAMETER_INVALID:{code:25101,msg:"Invalid recall message parameter"},ROAMING_SERVICE_UNAVAILABLE_MESSAGE:{code:25102,msg:"Single group chat roaming service is not open, Please go to the developer to open this service"},PUSHSETTING_PARAMETER_INVALID:{code:26001,msg:"Invalid push parameter"},OPERATION_BLOCKED:{code:20605,msg:"Operation is blocked"},OPERATION_NOT_SUPPORT:{code:20606,msg:"Operation is not supported"},MSG_BLOCKED_SENSITIVE_WORD:{code:21501,msg:"The sent message contains sensitive words"},REPLACED_SENSITIVE_WORD:{code:21502,msg:"Sensitive words in the message have been replaced"},NOT_CONNECTED:{code:30001,msg:"Please connect successfully first"},NAVI_REQUEST_ERROR:{code:30007,msg:"Navigation http request failed"},CMP_REQUEST_ERROR:{code:30010,msg:"CMP sniff http request failed"},CONN_APPKEY_FAKE:{code:31002,msg:"Your appkey is fake"},CONN_MINI_SERVICE_NOT_OPEN:{code:31003,msg:"Mini program service is not open, Please go to the developer to open this service"},CONN_ACK_TIMEOUT:{code:31e3,msg:"Connection ACK timeout"},CONN_TOKEN_INCORRECT:{code:31004,msg:"Your token is not valid or expired"},CONN_NOT_AUTHRORIZED:{code:31005,msg:"AppKey and Token do not match"},CONN_REDIRECTED:{code:31006,msg:"Connection redirection"},CONN_APP_BLOCKED_OR_DELETED:{code:31008,msg:"AppKey is banned or deleted"},CONN_USER_BLOCKED:{code:31009,msg:"User blocked"},CONN_DOMAIN_INCORRECT:{code:31012,msg:"Connect domain error, Please check the set security domain"},ROAMING_SERVICE_UNAVAILABLE:{code:33007,msg:"Roaming service cloud is not open, Please go to the developer to open this service"},RC_CONNECTION_EXIST:{code:34001,msg:"Connection already exists"},CHATROOM_KV_EXCEED:{code:23423,msg:"ChatRoom KV setting exceeds maximum"},CHATROOM_KV_OVERWRITE_INVALID:{code:23424,msg:"ChatRoom KV already exists"},CHATROOM_KV_STORE_NOT_OPEN:{code:23426,msg:"ChatRoom KV storage service is not open, Please go to the developer to open this service"},CHATROOM_KEY_NOT_EXIST:{code:23427,msg:"ChatRoom key does not exist"},MSG_KV_NOT_SUPPORT:{code:34008,msg:"The message cannot be extended"},SEND_MESSAGE_KV_FAIL:{code:34009,msg:"Sending RC expansion message fail"},EXPANSION_LIMIT_EXCEET:{code:34010,msg:"The message expansion size is beyond the limit"},ILLGAL_PARAMS:{code:33003,msg:"Incorrect parameters passed in while calling the interface"},UPLOAD_FILE_FAILED:{code:35020,msg:"File upload failed"},CHATROOM_KV_STORE_NOT_ALL_SUCCESS:{code:23428,msg:"Chatroom kv store not all success"},CHATROOM_KV_STORE_OUT_LIMIT:{code:23429,msg:"Chatroom kv's length is out of limit"},TAG_EXISTS:{code:33101,msg:"The tag already exists"},TAG_NOT_EXIST:{code:33100,msg:"The tag does not exist"},NOT_SUPPORT:{code:e.ErrorCode.NOT_SUPPORT,msg:"The method is not supported in a browser!"}},q={};for(var Z in F){var J=F[Z].code;q[J]=Z}F.ROAMING_SERVICE_UNAVAILABLE.code;var z=function(t){return!(!e.validate("options.conversationType",t.conversationType,e.isValidConversationType,!0)||!e.validate("options.targetId",t.targetId,e.AssertRules.STRING,!0)||!e.validate("options.channelId",t.channelId,e.AssertRules.CHANNEL_ID))},K=function(t,n,o){void 0===o&&(o="");var r="conversationType:".concat(n.conversationType,",targetId:").concat(n.targetId);return t.debug(e.LogTagId.O,"".concat(o," -> ").concat(r)),r},Y=function(t,r,a,s){return void 0===s&&(s=""),n(void 0,void 0,void 0,(function(){var n,i;return o(this,(function(o){switch(o.label){case 0:return n=K(t,r,s),[4,a()];case 1:return(i=o.sent())!==e.ErrorCode.SUCCESS?(t.warn(e.LogTagId.O,"".concat(s," fail -> ").concat(i," : ").concat(q[i]," , ").concat(n)),[2,{code:i,msg:q[i]}]):[2,{code:i}]}}))}))};var j=function(t){return!!(e.validate("options.key",t.key,e.AssertRules.STRING,!0)&&e.validate("options.value",t.value,e.AssertRules.STRING,!0)&&e.validate("options.isAutoDelete",t.isAutoDelete,e.AssertRules.BOOLEAN)&&e.validate("options.isSendNotification",t.isSendNotification,e.AssertRules.BOOLEAN)&&e.validate("options.notificationExtra",t.notificationExtra,e.AssertRules.STRING))},W=function(t){return!(!e.validate("options.key",t.key,e.AssertRules.STRING,!0)||!e.validate("options.isSendNotification",t.isSendNotification,e.AssertRules.BOOLEAN)||!e.validate("options.notificationExtra",t.notificationExtra,e.AssertRules.STRING))};var X=function(e,t,n,o){void 0===n&&(n=!0),void 0===o&&(o=!0),this.messageType=e,this.content=t,this.isPersited=n,this.isCounted=o};function Q(e,t,n){void 0===t&&(t=!0),void 0===n&&(n=!0);return function(o){return new X(e,o,t,n)}}var $,ee,te=Q("RC:ImgMsg"),ne=Q("RC:HQVCMsg"),oe=Q("RC:SightMsg"),re=Q("RC:TxtMsg"),ae=Q("RC:CombineMsg"),se=Q("RC:FileMsg"),ie=Q("RC:GIFMsg"),ce=Q("RC:VcMsg"),de=Q("RC:LBSMsg"),ue=Q("RC:ReferenceMsg"),le=Q("RC:ImgTextMsg"),ge={qiniu:function(t,n,o,r){k((function(a){var s=a.getInfoFromCache();if(1===(null==s?void 0:s.type)&&n.chunk_size&&r.size>n.chunk_size){var i=e.getUUID();i+=r.name.substr(r.name.lastIndexOf(".")),r.uniqueName=i,Te(r,n,o)}else Ee(t,n,o,r)}))},baidu:function(e,t,n,o){if(o.size>fe)throw new Error("the file size is over 5GB!");var r=t||{};t=t||ee;var a=new XMLHttpRequest,s=Ie();if(!r.uploadHost.bos&&!r.bosUploadPath)return;var i=s+ve[0][1]+r.bosUploadPath;ve.shift();var c=r.bosHeader||{},d={filename:t.uniqueValue||o.uniqueName,name:o.name,downloadUrl:i,isBosRes:!0};a.upload&&t.support_options&&(a.upload.onprogress=function(e){n.onProgress(e.loaded,e.total,!0)});a.onreadystatechange=function(){if(4===a.readyState)if(JSON.parse(a.responseText||"{}").filename=t.uniqueValue,200===a.status){n.onCompleted(d,!0)}else ve.length?ge[ve[0][0]](e,t,n,o):n.onError("upload fail")},a.open(t.method,i,!0),a.setRequestHeader("authorization",c.bosToken),a.setRequestHeader("x-bce-date",c.bosDate),a.send(o)},aliyun:function(t,n,o,r){if(r.size>fe)throw new Error("the file size is over 5GB!");var a=new FormData;a.set("file",t.get("file")),a.set("key",t.get("key")),a.set("token",t.get("token"));var s=ve[0][1];ve.shift(),t=t||$,n=(n=n||{})||ee;var i=new XMLHttpRequest,c=Ie(),d="".concat(c+n.ossBucketName,".").concat(s);i.upload&&n.support_options&&(i.upload.onprogress=function(e){o.onProgress(e.loaded,e.total)});i.onreadystatechange=function(){if(4===i.readyState){var t=JSON.parse(i.responseText||"{}");t.name=n.uniqueValue,t.filename=n.uploadFileName,t.uploadMethod=e.UploadMethod?e.UploadMethod.ALI:"",200===i.status?o.onCompleted(t):ve.length?ge[ve[0][0]](a,n,o,r):o.onError("upload fail")}},i.open(n.method,d,!0),console.log("ali:url",d);var u=n.aliHeader||{};t.set("OSSAccessKeyId",u.osskeyId),t.set("policy",u.ossPolicy),t.set("Signature",u.ossSign),t.set("success_action_status",200),t.delete("key"),t.append("key",n.uploadFileName),t.delete("file"),t.append("file",r),i.send(t)},s3:function(t,n,o,r){var a=new FormData,s=new XMLHttpRequest,i=Ie(),c=n.contentDisposition,d=ve[0][1],u="".concat(i+n.s3BucketName,".").concat(d);console.log("uploadS3:url",u),ve.shift(),s.upload&&n.support_options&&(s.upload.onprogress=function(e){o.onProgress(e.loaded,e.total)});s.onreadystatechange=function(){if(4===s.readyState){var a=JSON.parse(s.responseText||"{}");if(a.name=n.uniqueValue,a.filename=n.uploadFileName,a.uploadMethod=e.UploadMethod.AWS,200===s.status||204===s.status)o.onCompleted(a);else if(ve.length){var i=new FormData;i.set("file",t.get("file")),i.set("key",t.get("key")),i.set("token",t.get("token")),ge[ve[0][0]](i,n,o,r)}else o.onError("upload fail")}},s.open(n.method,u,!0);var l=n?n.s3Header:{},g=r&&r.type;c?a.set("Content-Disposition","".concat(c,";")):a.set("Content-Disposition","text/html"===g?"inline;":"attachment;");a.set("Content-Type",g),a.set("x-amz-credential",l.s3Credential),a.set("x-amz-algorithm",l.s3Algorithm),a.set("x-amz-date",l.s3Date),a.set("policy",l.s3Policy),a.set("x-amz-signature",l.s3Signature),a.set("key",n.uploadFileName),a.set("file",r),s.send(a)},stc:function(t,n,o,r){var a=new XMLHttpRequest,s=n.contentDisposition,i=ve[0][1],c="https://".concat(i,"/").concat(n.stcBucketName,"/").concat(n.uploadFileName);ve.shift(),a.upload&&n.support_options&&(a.upload.onprogress=function(e){o.onProgress(e.loaded,e.total)});a.onreadystatechange=function(){if(4===a.readyState){var s=JSON.parse(a.responseText||"{}");if(s.name=n.uniqueValue,s.filename=n.uploadFileName,s.uploadMethod=e.UploadMethod?e.UploadMethod.STC:"",200===a.status||204===a.status)o.onCompleted(s);else if(ve.length){var i=new FormData;i.set("file",t.get("file")),i.set("key",t.get("key")),i.set("token",t.get("token")),ge[ve[0][0]](i,n,o,r)}else o.onError("upload fail")}},a.open("PUT",c,!0);var d=n?n.stcHeader:{};a.setRequestHeader("Content-Type",r.type),s?a.setRequestHeader("Content-Disposition","".concat(s,";")):a.setRequestHeader("Content-Disposition","text/html"===r.type?"inline;":"attachment;");a.setRequestHeader("Authorization",d.stcAuthorization),a.setRequestHeader("x-amz-content-sha256",d.stcContentSha256),a.setRequestHeader("x-amz-date",d.stcDate),a.send(r)}},ve=[],fe=5368709120;function Ie(){var e="https://";return"http:"!==location.protocol&&"file:"!==location.protocol||(e="http://"),e}var pe,Re=(pe="RC-upload-",{get:function(e){e=pe+e;var t=localStorage.getItem(e);if(t)return null!==(t=JSON.parse(t||"{}"))&&t.type&&t.data?t.data:null},set:function(e,t){var n=localStorage;e=pe+e,t={data:t,type:typeof t,updateTime:Date.now()},n.setItem(e,JSON.stringify(t))},remove:function(e){e=pe+e,localStorage.removeItem(e)}});function Ee(t,n,o,r){var a="https://"+n.uploadHost.qiniu,s=(/http/.test(ve[0][1])?"":Ie())+ve[0][1]||a;n.isChunk||ve.shift();var i=new XMLHttpRequest;i.upload&&n.support_options&&(i.upload.onprogress=function(e){o.onProgress(e.loaded,e.total)}),i.onreadystatechange=function(){if(4===i.readyState){var a=JSON.parse(i.responseText||"{}");a.filename=n.uniqueValue,a.uploadMethod=e.UploadMethod?e.UploadMethod.QINIU:"",200===i.status||204===i.status?o.onCompleted(a):ve.length?ge[ve[0][0]](t,n,o,r):o.onError("upload fail")}},i.open(n.method,s,!0),o.onOpen(i),n.stream&&i.setRequestHeader("authorization","UpToken ".concat(n.multi_parmas.token)),function(e,t){for(var n in e)t(n,e[n])}(n.headers,(function(e,t){i.setRequestHeader(e,t)})),i.send(t)}function Te(t,n,o,r){var a=0,s=r||e.getUUID(),i=Re.get(s);i&&(t.uniqueName=i.sessionId,a=i.offset);var c=Math.min(n.chunk_size,t.size-a),d=t.slice(a,a+c),u=t.uniqueName;n.multi_parmas.name=u,n.filesize=t.size;var l="bytes=".concat(a,"-").concat(a+c);n.headers={Range:l,"X-File-TransactionId":u,"X-File-Total-Size":t.size},n.isChunk=!0,d.name=t.name,d=function(e,t,n){var o=new FormData;for(var r in t.unique_key&&o.append(t.unique_key,n),o.append(t.file_data_name,e,e.name),t.multi_parmas){var a=t.multi_parmas[r];o.append(r,a)}return o}(d,n,t.uniqueName),Ee(d,n,{onCompleted:function(e){a+=c;var r=t.uniqueName;Re.set(s,{offset:a,sessionId:r}),a<t.size?Te(t,n,o,s):(a=0,Re.remove(s),o.onCompleted(e))},onError:function(e){console.error(e),o.onError(e)},onProgress:function(e,t){var r=e+a;o.onProgress(r,n.filesize)},onOpen:function(e){o.onOpen(e)}},t)}function he(t,n,o,r){var a,s,i=n&&n.type||"text/plain",c=i.indexOf("image")>-1?1:4,d=o.contentDisposition,u=Math.ceil(n.size/o.stc_chunk_size),l=o&&JSON.parse(o.ossConfig?o.ossConfig:"");Array.isArray(l)||(l=[]);var g=l.find((function(e){return Object.keys(e).includes("stc")})),v="uploads";t.getFileToken(c,a,"POST",v).then((function(e){a=e.fileName,s="https://".concat(g.stc,"/").concat(o.stcBucketName,"/").concat(a),console.log("uploadStcMultipart:url",s);var t=new XMLHttpRequest;t.open("POST","".concat(s,"?").concat(v),!0),d?t.setRequestHeader("Content-Disposition","".concat(d,";")):t.setRequestHeader("Content-Disposition","text/html"===n.type?"inline;":"attachment;"),t.setRequestHeader("Authorization",e&&e.stcAuthorization),t.setRequestHeader("x-amz-content-sha256",e&&e.stcContentSha256),t.setRequestHeader("x-amz-date",e&&e.stcDate),t.setRequestHeader("Content-Type",i),t.send(),t.onreadystatechange=function(){if(4===t.readyState){var e=t.response.match(/(?:<UploadId>)(\S*?)(?:<\/UploadId>)/);console.log("uploadId",e),200===t.status||204===t.status?function(e){for(var t=[],n=1;n<=u;n++)t.push(R(e,n));p(e,t)}(Array.isArray(e)&&e[1]):r.onError("uploadStcMultipart:did not get uploadId")}}}),(function(e){r.onError("uploadStcMultipart:".concat(e))}));var f=[],I=new Map;function p(d,l){l&&Array.isArray(l)&&0!==l.length&&Promise.all(l).then((function(){var l="uploadId=".concat(d);if(I.size===u)t.getFileToken(c,a,"POST",l).then((function(t){console.log("onSuccess",t),console.log("onSuccess:uploadId",d);var a=new XMLHttpRequest;a.open("POST","".concat(s,"?").concat(l),!0),a.setRequestHeader("Authorization",t&&t.stcAuthorization),a.setRequestHeader("x-amz-content-sha256",t&&t.stcContentSha256),a.setRequestHeader("x-amz-date",t&&t.stcDate),a.setRequestHeader("Content-Type",i);var c="<CompleteMultipartUpload xmlns='http://s3.amazonaws.com/doc/2006-03-01/'>",u=Array.from(I.keys()||[]).sort((function(e,t){return e-t}));console.log("keys",u),u.forEach((function(e){c+="<Part><ETag>".concat(I.get(e),"</ETag><PartNumber>").concat(e,"</PartNumber></Part>")})),c+="</CompleteMultipartUpload>",a.send(c),console.log("xml",c),a.onreadystatechange=function(){if(4===a.readyState)if(200===a.status||204===a.status){var t={name:n.name,filename:o.uploadFileName,uploadMethod:e.UploadMethod.STC};r.onCompleted(t)}else r.onError("uploadStcMultipart:upload does not end")}}),(function(e){r.onError("uploadStcMultipart:".concat(e))}));else{for(var g=[],v=0,E=f;v<E.length;v++){var T=E[v];g.push(R(d,T))}p(d,g)}}),(function(e){console.error(e),r.onError("uploadStcMultipart: chunkFiles upload failed and those will reupload");for(var t=[],n=0,o=f;n<o.length;n++){var a=o[n];t.push(R(d,a))}p(d,t)}))}function R(e,r){return new Promise((function(d,u){var l="partNumber=".concat(r,"&uploadId=").concat(e);t.getFileToken(c,a,"PUT",l).then((function(e){console.log("signature ".concat(r," onSuccess"),e);var t=n&&n.slice((r-1)*o.stc_chunk_size,r*o.stc_chunk_size);console.log("fileChunk:size",t.size);var a=new XMLHttpRequest;a.open("PUT","".concat(s,"?").concat(l),!0),a.setRequestHeader("Authorization",e&&e.stcAuthorization),a.setRequestHeader("x-amz-content-sha256",e&&e.stcContentSha256),a.setRequestHeader("x-amz-date",e&&e.stcDate),a.setRequestHeader("Content-Type",i),a.send(t),a.onreadystatechange=function(){if(4===a.readyState)if(200===a.status||204===a.status){var e=a.getResponseHeader("etag");console.log("etag:".concat(r),e),I.set(r,e),d(e)}else f.includes(r)||f.push(r),u(r)}}),(function(e){console.log("getETags:签名验证失败"),f.includes(r)||f.push(r),u(r)}))}))}}var Ce={form:function(e,t){var n=new FormData;if(t.unique_key){var o=e.name.substr(e.name.lastIndexOf(".")),r=me()+o;n.append(t.unique_key,r),t.uniqueValue=r}return n.append(t.file_data_name,e),Se(t.multi_parmas,(function(e,t){n.append(e,t)})),n},json:function(e,t){var n={};if(t.unique_key){var o=e.name.substr(e.name.lastIndexOf(".")),r=me()+o;n[t.unique_key]=r,t.uniqueValue=r}return n[t.file_data_name]=e,Se(t.multi_parmas,(function(e,t){n[e]=t})),JSON.stringify(n)},data:function(e,t){return e}};function me(){var e=(new Date).getTime();return"xxxxxx4xxxyxxxxxxx".replace(/[xy]/g,(function(t){var n=(e+16*Math.random())%16|0;return e=Math.floor(e/16),("x"===t?n:3&n|8).toString(16)}))}function Se(e,t){for(var n in e)t(n,e[n])}var Ae,Oe=0,Ne=function(){function e(e){this.options=function(e){var t={domain:"",method:"POST",file_data_name:"file",unique_key:"key",base64_size:4194304,chunk_size:4194304,bos_chunk_size:4294967296,stc_chunk_size:10485760,headers:{},multi_parmas:{},query:{},support_options:!0,data:Ce.form,genUId:me};if(!e||!e.domain)throw new Error("domain is null");for(var n in e)t[n]=e[n];return t}(e)}return e.prototype.setOptions=function(e){var t=this;Se(e,(function(e,n){t.options[e]=n}))},e.prototype.upload=function(e,t,n,o){if(n){var r=this;!function(e,t,n,o,r){$=n,ee=o,ve=[];var a,s=e.getInfoFromCache();if(1===(null==s?void 0:s.type)&&t.uploadDomain)ve=[["qiniu",t.uploadDomain]];else if(o.ossConfig){var i,c,d=JSON.parse(o.ossConfig),u="",l=[];d.forEach((function(e){var t=Number(e.p)-1;for(var n in e)"aliyun"===n&&(u=e[n]),"s3"===n&&(i=e[n]),"stc"===n&&(c=e[n]),"p"!==n&&(l[t]=[n,e[n]])})),l.forEach((function(e){e&&ve.push(e)})),d.length!==ve.length&&(ve=[["qiniu",o.domain],["baidu",o.uploadHost.bos],["aliyun",u],["s3",i],["stc",c]])}else ve=[["qiniu",o.domain],["baidu",o.uploadHost.bos]];if(o.ossConfig){var g=o&&JSON.parse(o.ossConfig);Array.isArray(g)||(g=[]),a=g.find((function(e){return Object.keys(e).includes("stc")}))}if(a&&1===parseInt(a.p,10)&&n.size>=4194304)he(e,n,o,r);else{var v=o.data(n,o);ge[ve[0][0]](v,o,r,n)}}(e,t,n,this.options,{onProgress:function(e,t,n){(Ae=e,n)?Ae=Oe+e/t*(t-Oe):Oe=Ae;o.onProgress(Ae,t)},onCompleted:function(e){o.onCompleted(e)},onError:function(e){o.onError(e)},onOpen:function(e){r.xhr=e}})}else o.onError("upload file is null.")},e.prototype.cancel=function(){var e;null===(e=this.xhr)||void 0===e||e.abort()},e}();var _e,ye,Me={init:function(e){return new Ne(e)},dataType:Ce,resize:function(e,t,n){e.type;var o=document.createElement("canvas"),r=new FileReader;r.readAsDataURL(e),r.onload=function(e){var r=e.target.result,a=new Image;a.src=r;var s=a.width,i=a.height,c=function(e,t){var n=1,o=e.width,r=t.maxWidth||0;r>0&&o>r&&(n=r/o);var a=e.height,s=t.maxHeight||0;if(s>0&&a>s){var i=s/a;n=Math.min(n,i)}var c=t.maxSize||0,d=Math.ceil(e.size/1e3);if(d>c){var u=c/d;n=Math.min(n,u)}return n}({width:s,height:i,size:e.total},t),d=r;c<1&&(d=function(e,t,n){return o.width=t,o.height=n,o.getContext("2d").drawImage(e,0,0,t,n),o.toDataURL("image/jpg")}(a,s*c,i*c)),n(d)}},Upload:Ne},Le=function(e,t,n){var o=document.createElement("canvas"),r=o.getContext("2d"),a=new Image,s="string"==typeof e;a.onload=function(s){var i=function(e,t,n){var o,r,a,s=e<t,i=0,c=0;return(s?t/e:e/t)>n.scale?(s?(r=100,c=((a=t/(o=e/100))-n.maxHeight)/2):(a=100,i=((r=e/(o=t/100))-n.maxWidth)/2),{w:r,h:a,x:-i,y:-c}):(s?(o=t/n.maxHeight,a=n.maxHeight,r=e/o):(o=e/n.maxWidth,r=n.maxWidth,a=t/o),{w:r,h:a,x:-i,y:-c})}(a.width,a.height,t);o.width=i.w>t.maxWidth?t.maxWidth:i.w,o.height=i.h>t.maxHeight?t.maxHeight:i.h,r.drawImage(a,i.x,i.y,i.w,i.h);var c=o.toDataURL("string"==typeof e?"image/jpg":e.type,t.quality);c=c.replace(/data:image\/[^;]+;base64,/,""),n(c)},a.src=s?"data:image/jpg;base64,".concat(e):function(e){var t=window.URL||window.webkitURL;return t?t.createObjectURL(e):""}(e)},Ue=function(e,t){var n=e.file,o=e.compress;Le(n,o,t)},Pe=function(e,t){if(e.getToken)e.getToken((function(n,o){o=o||{},e.multi_parmas=e.multi_parmas||{},e.multi_parmas.token=n,e.uploadHost=e.uploadHost||{},e.uploadHost.bos=o.bos,e.ossConfig=o.ossConfig,e.bosHeader=e.bosHeader||{},e.bosHeader.bosDate=o.bosDate,e.bosHeader.bosToken=o.bosToken,e.bosUploadPath=o.path,e.aliHeader={},e.aliHeader.osskeyId=o.osskeyId,e.aliHeader.ossPolicy=o.ossPolicy,e.aliHeader.ossSign=o.ossSign,e.ossBucketName=o.ossBucketName,e.uploadFileName=o.fileName,e.s3Header={},e.s3Header.s3Credential=o.s3Credential,e.s3Header.s3Algorithm=o.s3Algorithm,e.s3Header.s3Date=o.s3Date,e.s3Header.s3Policy=o.s3Policy,e.s3Header.s3Signature=o.s3Signature,e.s3BucketName=o.s3BucketName,e.stcHeader={},e.stcHeader.stcAuthorization=o.stcAuthorization,e.stcHeader.stcContentSha256=o.stcContentSha256,e.stcHeader.stcDate=o.stcDate,e.stcBucketName=o.stcBucketName,e.headers=e.headers||{},e.base64&&(e.headers["Content-type"]="application/octet-stream",e.headers.Authorization="UpToken ".concat(n));var r=Me.init(e);t(r)}));else{e.headers=e.headers||{},e.base64&&(e.headers["Content-type"]="application/octet-stream");var n=Me.init(e);t(n)}},xe=function(e,t,n,o,r){o.upload(e,t,n.file,{onError:function(e){r.onError(e)},onProgress:function(e,t){r.onProgress(e,t)},onCompleted:function(e){e.filename=e.filename||e.hash;var t=n.compressThumbnail||Ue;n.compress?t(n,(function(t){e.thumbnail=t,r.onCompleted(e)})):r.onCompleted(e)}})},we=function(){function e(e){this.instance=e}return e.prototype.upload=function(e,t,n,o){xe(e,t,{file:n},this.instance,o)},e.prototype.cancel=function(){this.instance.cancel()},e}(),be=function(){function e(e,t){this.instance=e,this.cfg=t}return e.prototype.upload=function(e,t,n,o){var r={file:n,compress:this.cfg};xe(e,t,r,this.instance,o)},e.prototype.cancel=function(){this.instance.cancel()},e}(),De=function(e,t){Pe(e,(function(e){var n=new we(e);t(n)}))},Be=function(e,t){Pe(e,(function(n){var o,r,a,s,i={maxHeight:(null===(o=e.thumbnailConfig)||void 0===o?void 0:o.maxHeight)||160,maxWidth:(null===(r=e.thumbnailConfig)||void 0===r?void 0:r.maxWidth)||160,quality:(null===(a=e.thumbnailConfig)||void 0===a?void 0:a.quality)||.5,scale:(null===(s=e.thumbnailConfig)||void 0===s?void 0:s.scale)||2.4},c=new be(n,i);t(c)}))};Me.dataType;function Ge(r,a,s,i,c,d,u){var l,g=this;void 0===c&&(c=e.FileType.FILE),l=c===e.FileType.IMAGE?e.FileType.IMAGE:e.FileType.FILE;var v=r.getInfoFromCache();if(!ye&&(ye="upload.qiniup.com",v&&v.ossConfig))try{var f=JSON.parse(v.ossConfig).find((function(e){return void 0!==e.qiniu}));f&&(ye=f.qiniu)}catch(e){}var I=t({domain:ye,getToken:function(e){r.getFileToken(l).then((function(t){e(t.token,t)})).catch((function(e){d.onFail(e)}))}},u);(l===e.FileType.IMAGE?Be:De)(I,(function(a){a.upload(r,s,i,{onProgress:function(e,t){var n,o=Math.floor(e/t*100);null===(n=d.onProgress)||void 0===n||n.call(d,o)},onCompleted:function(r){return n(g,void 0,void 0,(function(){return o(this,(function(n){return 1===(null==v?void 0:v.type)?function(n,o,r,a,s,i){var c={type:a.type,name:s.rc_url.file_name,downloadUrl:n.uploadDomain+s.rc_url.path};if(o===e.FileType.AUDIO)return void ke(a).then((function(e){i.onSuccess(t(t({},c),e))}));o===e.FileType.IMAGE&&(c.thumbnail=s.thumbnail);i.onSuccess(c)}(s,c,0,i,r,d):function(n,o,r,a,s){Ve(o,a.filename,a.name,a,a.uploadMethod).then((function(i){if(0===i.code){var c=i.data;c.type=r.type,c.name=a.name||a.filename,n!==e.FileType.AUDIO?(o===e.FileType.IMAGE&&(c.thumbnail=a.thumbnail),s.onSuccess(c)):ke(r).then((function(e){s.onSuccess(t(t({},c),e))}))}else s.onFail(i)})).catch((function(e){s.onFail(e)}))}(c,l,i,r,d),[2]}))}))},onError:function(e){d.onFail(e)}})}))}function ke(e){return new Promise((function(t){if("function"!=typeof e.arrayBuffer){var n=new FileReader;n.onload=function(){n.result?He(n.result).then((function(e){t(e)}),(function(){t({})})):t({})},n.onerror=function(){t({duration:0})},n.readAsArrayBuffer(e)}else e.arrayBuffer().then(He).then((function(e){t(e)}))}))}function He(e){return _e=_e||new AudioContext,new Promise((function(t,n){_e.decodeAudioData(e,(function(e){t({duration:e.duration,length:e.length})}),n)}))}function Ve(t,n,o,r,a){return e.validate("fileType",t,e.isValidFileType,!0)&&e.validate("filename",n,e.AssertRules.STRING)&&e.validate("saveName",o,e.AssertRules.STRING)&&e.validate("serverType",a,e.AssertRules.NUMBER)?H((function(s){return new Promise((function(i){s.getFileUrl(t,n,o,r,a).then((function(t){i({code:e.ErrorCode.SUCCESS,data:t})})).catch((function(e){i({code:e})}))}))})):Promise.resolve({code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER})}function Fe(r,a,s){return n(this,void 0,void 0,(function(){var i=this;return o(this,(function(c){return[2,H((function(c,d){return n(i,void 0,void 0,(function(){var n,i,u,l,g,v,f,I,p,R,E,T,h;return o(this,(function(o){switch(o.label){case 0:return s=s||{},a instanceof X==!1?(d.warn(e.LogTagId.O,"send message fail -> message parameter is not an instance of BaseMessage"),[2,F.ILLGAL_PARAMS]):e.validate("conversation",r,e.AssertRules.OBJECT,!0)?(n=r.conversationType,i=r.targetId,u=r.channelId,e.validate("conversation.targetId",i,e.AssertRules.STRING,!0)&&e.validate("conversation.conversationType",n,e.AssertRules.NUMBER)&&e.validate("conversation.channelId",u,e.AssertRules.CHANNEL_ID)&&e.validate("options.isStatusMessage",null==s?void 0:s.isStatusMessage,e.AssertRules.BOOLEAN)&&e.validate("options.disableNotification",null==s?void 0:s.disableNotification,e.AssertRules.BOOLEAN)&&e.validate("options.pushContent",null==s?void 0:s.pushContent,e.AssertRules.STRING)&&e.validate("options.pushData",null==s?void 0:s.pushData,e.AssertRules.STRING)&&e.validate("options.isMentioned",null==s?void 0:s.isMentioned,e.AssertRules.BOOLEAN)&&e.validate("options.mentionedType",null==s?void 0:s.mentionedType,e.AssertRules.NUMBER)&&e.validate("options.mentionedUserIdList",null==s?void 0:s.mentionedUserIdList,e.AssertRules.ARRAY)&&e.validate("options.directionalUserIdList",null==s?void 0:s.directionalUserIdList,e.AssertRules.ARRAY)&&e.validate("options.isVoipPush",null==s?void 0:s.isVoipPush,e.AssertRules.BOOLEAN)&&e.validate("options.canIncludeExpansion",null==s?void 0:s.canIncludeExpansion,e.AssertRules.BOOLEAN)&&e.validate("options.expansion",null==s?void 0:s.expansion,e.AssertRules.OBJECT)&&e.validate("options.pushConfig",null==s?void 0:s.pushConfig,e.AssertRules.OBJECT)&&e.validate("options.messageId",null==s?void 0:s.messageId,e.AssertRules.NUMBER)?(l="conversationType:".concat(n,",targetId:").concat(i),d.debug(e.LogTagId.O,"send message ->".concat(l)),g=function(e,n,o){var r=e.isStatusMessage,a=e.disableNotification,s=e.pushContent,i=e.pushData,c=e.isMentioned,d=e.mentionedType,u=e.mentionedUserIdList,l=e.directionalUserIdList,g=e.isVoipPush,v=e.canIncludeExpansion,f=e.expansion,I=e.isFilerWhiteBlacklist,p=e.pushConfig,R=e.messageId,E=o.channelId;return t({isStatusMessage:r,disableNotification:a,pushContent:s,pushData:i,isMentioned:c,mentionedType:d,mentionedUserIdList:u,directionalUserIdList:l,isVoipPush:g,canIncludeExpansion:v,expansion:f,isFilerWhiteBlacklist:I,pushConfig:p,channelId:E||"",messageId:R},n)}(s,a,r),v={isMentioned:!!s.isMentioned,content:a.content,messageType:a.messageType,isPersited:a.isPersited||!1,isCounted:a.isCounted||!1,disableNotification:!!(null==s?void 0:s.disableNotification),canIncludeExpansion:!!(null==s?void 0:s.canIncludeExpansion),expansion:(null==s?void 0:s.expansion)||null,conversationType:r.conversationType,targetId:r.targetId,channelId:r.channelId,senderUserId:c.getCurrentUserId(),messageUId:"",messageDirection:e.MessageDirection.SEND,receivedTime:0,isStatusMessage:s.isStatusMessage||!1,receivedStatus:e.ReceivedStatus.UNREAD,isOffLineMessage:!1,pushConfig:null==s?void 0:s.pushConfig},n!==e.ConversationType.ULTRA_GROUP&&(v.isOffLineMessage=!1),f=d.createTraceId(),I=function(t){v.messageId=t;try{(null==s?void 0:s.onSendBefore)&&s.onSendBefore(L(v))}catch(t){d.error(e.LogTagId.O,'Callback method "onSendBefore" execution error.\n'.concat(null==t?void 0:t.stack),f)}},d.info(e.LogTagId.A_SEND_MSG_T,JSON.stringify({messageType:a.messageType,conversationType:n,targetId:i,channelId:u}),f),[4,c.sendMessage(n,i,g,I,f)]):[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]):[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}];case 1:return p=o.sent(),R=p.code,E=p.data,T=R===e.ErrorCode.SUCCESS?"info":"warn",d[T](e.LogTagId.A_SEND_MSG_R,JSON.stringify({code:R,messageUId:E?E.messageUId:"",messageId:E?E.messageId:""}),f),R===e.ErrorCode.SUCCESS?(h=L(E),[2,{code:R,data:h}]):(d.warn(e.LogTagId.O,"send message fail ->".concat(R,":").concat(q[R],",").concat(l)),v.sentTime=(null==E?void 0:E.sentTime)||0,[2,{code:R,msg:q[R],data:L(v)}])}}))}))}))]}))}))}function qe(t,n){return function(o,r,a,s){if(!e.validate("sendOptions.contentDisposition",null==s?void 0:s.contentDisposition,(function(e){return["inline","attachment"].includes(e)})))return Promise.resolve({code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER});var i={contentDisposition:null==s?void 0:s.contentDisposition};if(s&&"thumbnailConfig"in s){var c=null==s?void 0:s.thumbnailConfig;if(!(e.validate("sendOptions.maxHeight",null==c?void 0:c.maxHeight,e.AssertRules.NUMBER)&&e.validate("sendOptions.maxWidth",null==c?void 0:c.maxWidth,e.AssertRules.NUMBER)&&e.validate("sendOptions.quality",null==c?void 0:c.quality,e.AssertRules.NUMBER)&&e.validate("sendOptions.scale",null==c?void 0:c.scale,e.AssertRules.NUMBER)))return Promise.resolve({code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER});i.thumbnailConfig=c}return H((function(c,d,u){return new Promise((function(l){var g=d.createTraceId();d.info(e.LogTagId.L_MEDIA_UPLOAD_T,JSON.stringify({filesize:r.file.size,type:t}),g),Ge(c,0,u,r.file,t,{onProgress:null==a?void 0:a.onProgress,onSuccess:function(t){var i,c=(null===(i=null==a?void 0:a.onComplete)||void 0===i?void 0:i.call(a,{url:t.downloadUrl}))||n(t,r);t&&t.downloadUrl&&d.info(e.LogTagId.L_MEDIA_UPLOAD_R,JSON.stringify({downurl:t.downloadUrl,code:e.ErrorCode.SUCCESS}),g),Fe(o,c,s).then(l)},onFail:function(t){d.warn(e.LogTagId.L_MEDIA_UPLOAD_R,JSON.stringify({code:e.ErrorCode.UPLOAD_FILE_FAILED}),g),l({code:e.ErrorCode.UPLOAD_FILE_FAILED,msg:t||e.ErrorCode[e.ErrorCode.UPLOAD_FILE_FAILED]})}},i)}))}))}}var Ze=qe(e.FileType.FILE,(function(e,t){return new se({name:e.name,size:t.file.size,type:t.file.type,fileUrl:e.downloadUrl,user:t.user,extra:t.extra})})),Je=qe(e.FileType.IMAGE,(function(e,t){return new te({content:e.thumbnail,imageUri:e.downloadUrl,user:t.user,extra:t.extra})})),ze=qe(e.FileType.AUDIO,(function(e,t){return new ne({remoteUrl:e.downloadUrl,duration:e.duration,type:e.type,user:t.user,extra:t.extra})})),Ke=qe(e.FileType.SIGHT,(function(e,t){return new oe({sightUrl:e.downloadUrl,content:t.thumbnail,duration:t.duration,size:t.file.size||e.size,name:t.name||e.name,user:t.user,extra:t.extra})}));qe(e.FileType.COMBINE_HTML,(function(e,t){return new ae({remoteUrl:e.downloadUrl,nameList:t.nameList,summaryList:t.summaryList,conversationType:t.conversationType,user:t.user,extra:t.extra})}));var Ye=Object.freeze({__proto__:null,getAllConversationList:function(t){return n(this,void 0,void 0,(function(){var r=this;return o(this,(function(a){return e.usingCppEngine()?e.validate("channelId",t,e.AssertRules.ONLY_STRING)?[2,H((function(a,s){return n(r,void 0,void 0,(function(){var n,r,i,c;return o(this,(function(o){switch(o.label){case 0:return s.info(e.LogTagId.O,"getAllConversationList -> channelId: ".concat(t)),e.isUndefined(t)?[4,a.getConversationListWithAllChannel()]:[3,2];case 1:return n=o.sent(),[3,4];case 2:return[4,a.getConversationList(void 0,void 0,void 0,void 0,t)];case 3:n=o.sent(),o.label=4;case 4:return r=n.code,i=n.data,r===e.ErrorCode.SUCCESS&&i?(c=i.map((function(e){return U(e)})),[2,{code:r,data:c}]):(s.warn(e.LogTagId.O,"getAllConversationList fail -> code: ".concat(r," channelId: ").concat(t)),[2,{code:r,msg:q[r]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:q[e.ErrorCode.NOT_SUPPORT]}]}))}))},getConversationList:function(t,r,a){return n(this,void 0,void 0,(function(){var s=this;return o(this,(function(i){return e.usingCppEngine()?e.validate("startTime",t,e.AssertRules.NUMBER,!0)&&e.validate("count",r,e.AssertRules.NUMBER,!0)&&e.validate("channelId",a,e.AssertRules.ONLY_STRING)?[2,H((function(i,c){return n(s,void 0,void 0,(function(){var n,s,d,u,l,g;return o(this,(function(o){switch(o.label){case 0:return n="startTime: ".concat(t,", count: ").concat(r,", channelId: ").concat(a),c.info(e.LogTagId.O,"getConversationList -> ".concat(n)),e.isUndefined(a)?[4,i.getConversationListWithAllChannelByPage(t,r)]:[3,2];case 1:return s=o.sent(),[3,4];case 2:return d=[1,2,3,5,6,7,8],[4,i.getConversationsByPage(d,t,r,a)];case 3:s=o.sent(),o.label=4;case 4:return u=s.code,l=s.data,u===e.ErrorCode.SUCCESS&&l?(g=l.map((function(e){return U(e)})),[2,{code:u,data:g}]):(c.warn(e.LogTagId.O,"getConversationList fail -> code: ".concat(u," ").concat(n)),[2,{code:u,msg:q[u]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:q[e.ErrorCode.NOT_SUPPORT]}]}))}))},searchConversationByContent:function t(r,a,s){return n(this,void 0,void 0,(function(){var i=this;return o(this,(function(c){return e.usingCppEngine()?e.validate("keyword",r,e.AssertRules.STRING,!0)&&e.validate("messageTypes",a,e.AssertRules.ARRAY,!0)&&e.validate("channelId",s,e.AssertRules.ONLY_STRING)&&!a.every((function(t){return!e.validate("messageType",t,e.AssertRules.STRING,!0)}))?[2,H((function(c,d){return n(i,void 0,void 0,(function(){var n,i,u,l,g;return o(this,(function(o){switch(o.label){case 0:return n="keyword: ".concat(r,", messageTypes: ").concat(JSON.stringify(a),", channelId: ").concat(s),d.info(e.LogTagId.O,"searchConversationByContent -> ".concat(t)),e.isUndefined(s)?[4,c.searchConversationByContentWithAllChannel(r,a)]:[3,2];case 1:return i=o.sent(),[3,4];case 2:return[4,c.searchConversationByContent(r,a,s)];case 3:i=o.sent(),o.label=4;case 4:return u=i.code,l=i.data,u===e.ErrorCode.SUCCESS&&l?(g=l.map((function(e){return U(e)})),[2,{code:u,data:g}]):(d.warn(e.LogTagId.O,"searchConversationByContent fail -> code: ".concat(u," ").concat(n)),[2,{code:u,msg:q[u]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:q[e.ErrorCode.NOT_SUPPORT]}]}))}))},searchMessages:function(t,r,a,s){return n(this,void 0,void 0,(function(){var i=this;return o(this,(function(c){return e.usingCppEngine()?e.validate("conversation",t,e.AssertRules.CONVERSATION,!0)&&e.validate("keyword",r,e.AssertRules.STRING,!0)&&e.validate("startTime",a,e.AssertRules.NUMBER,!0)&&e.validate("count",s,e.AssertRules.NUMBER,!0)?[2,H((function(c,d){return n(i,void 0,void 0,(function(){var n,i,u,l,g,v,f,I,p,R;return o(this,(function(o){switch(o.label){case 0:return n="conversation: ".concat(JSON.stringify(t),", keyword: ").concat(r,", timestamp: ").concat(a,", count: ").concat(s),d.info(e.LogTagId.O,"searchMessages -> ".concat(n)),i=t.targetId,u=t.conversationType,l=t.channelId,e.isUndefined(l)?[4,c.searchMessageByContentWithAllChannel(u,i,r,a,s)]:[3,2];case 1:return g=o.sent(),[3,4];case 2:return 0,[4,c.searchMessageByContent(u,i,r,a,s,0,l)];case 3:g=o.sent(),o.label=4;case 4:return v=g.code,f=g.data,v===e.ErrorCode.SUCCESS&&f?(I=f.messages,p=f.count,R=I.map((function(e){return L(e)})),[2,{code:v,data:{messages:R,count:p}}]):(d.warn(e.LogTagId.O,"searchMessages fail -> code: ".concat(v," ").concat(n)),[2,{code:v,msg:q[v]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:q[e.ErrorCode.NOT_SUPPORT]}]}))}))},searchMessageInTimeRange:function(t,r){return n(this,void 0,void 0,(function(){var a=this;return o(this,(function(s){return e.usingCppEngine()?e.validate("conversation",t,e.AssertRules.CONVERSATION,!0)&&e.validate("option",r,e.AssertRules.OBJECT,!0)&&e.validate("option.keyword",r.keyword,e.AssertRules.STRING,!0)&&e.validate("option.startTime",r.startTime,e.AssertRules.NUMBER,!0)&&e.validate("option.endTime",r.endTime,e.AssertRules.NUMBER,!0)&&e.validate("option.offset",r.offset,e.AssertRules.NUMBER)&&e.validate("option.limit",r.limit,e.AssertRules.NUMBER)?[2,H((function(s,i){return n(a,void 0,void 0,(function(){var n,a,c,d,u,l,g,v,f,I,p;return o(this,(function(o){switch(o.label){case 0:return n="conversation: ".concat(JSON.stringify(t),", option: ").concat(JSON.stringify(r)),i.info(e.LogTagId.O,"searchMessageInTimeRange -> ".concat(n)),a=t.conversationType,c=t.targetId,d=r.keyword,u=r.startTime,l=r.endTime,g=r.offset,v=r.limit,g=g||0,v=v||5,[4,s.searchMessageByContentInTimeRangeWithAllChannel(a,c,d,u,l,g,v)];case 1:return f=o.sent(),I=f.code,p=f.data,I===e.ErrorCode.SUCCESS&&p?[2,{code:I,data:{messages:p.messages.map((function(e){return L(e)}))}}]:(i.warn(e.LogTagId.O,"searchMessageInTimeRange fail -> code: ".concat(I,", ").concat(n)),[2,{code:I}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:q[e.ErrorCode.NOT_SUPPORT]}]}))}))},getHistoryMessagesByMessageTypes:function(t,r){return n(this,void 0,void 0,(function(){var a=this;return o(this,(function(s){return e.usingCppEngine()?e.validate("conversation",t,e.AssertRules.CONVERSATION,!0)&&e.validate("option",r,e.AssertRules.OBJECT,!0)&&e.validate("option.count",r.count,e.AssertRules.NUMBER)&&e.validate("option.timestamp",r.timestamp,e.AssertRules.NUMBER)&&e.validate("option.order",r.order,(function(e){return[0,1].includes(e)}))&&e.validate("option.messageTypes",r.messageTypes,e.AssertRules.ARRAY,!0)&&!r.messageTypes.every((function(t){return!e.validate("option.messageType",t,e.AssertRules.STRING,!0)}))?[2,H((function(s,i){return n(a,void 0,void 0,(function(){var n,a,c,d,u,l,g,v,f,I,p,R,E,T,h;return o(this,(function(o){switch(o.label){case 0:return n=r.count,a=r.timestamp,c=r.order,d=r.messageTypes,u="conversation: ".concat(JSON.stringify(t),", option: ").concat(JSON.stringify(r)),i.info(e.LogTagId.O,"getHistoryMessagesByMessageTypes -> ".concat(u)),l=t.conversationType,g=t.targetId,v=t.channelId,n||(n=20),a||(a=0),c||(c=0),v||(v=""),[4,s.getHistoryMessagesByObjectNames(l,g,a,n,d,c,v)];case 1:return f=o.sent(),I=f.code,p=f.data,I===e.ErrorCode.SUCCESS?(E=(R=p).list,T=R.hasMore,h=E.map((function(e){return L(e)})),[2,{code:I,data:{messages:h,hasMore:T}}]):(i.warn(e.LogTagId.O,"getHistoryMessagesByMessageTypes fail -> code: ".concat(I," ").concat(u)),[2,{code:I,msg:q[I]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:q[e.ErrorCode.NOT_SUPPORT]}]}))}))},setMessageStatusToRead:function(t,r){return n(this,void 0,void 0,(function(){var a=this;return o(this,(function(s){return e.usingCppEngine()?e.validate("conversation",t,e.AssertRules.CONVERSATION,!0)&&e.validate("timestamp",r,e.AssertRules.NUMBER,!0)?[2,H((function(s,i){return n(a,void 0,void 0,(function(){var n,a,c,d;return o(this,(function(o){switch(o.label){case 0:return n="conversation: ".concat(JSON.stringify(t),", timestamp: ").concat(r),i.info(e.LogTagId.O,"updateSentMsgReceiptStatus -> ".concat(n)),a=t.conversationType,c=t.targetId,d=t.channelId,[4,s.setMessageStatusToRead(a,c,r,d)];case 1:return[2,o.sent()]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:q[e.ErrorCode.NOT_SUPPORT]}]}))}))},setMessageReceivedStatus:function(t,r){return n(this,void 0,void 0,(function(){var a=this;return o(this,(function(s){return e.usingCppEngine()?e.validate("messageId",t,e.AssertRules.NUMBER,!0)&&e.validate("receivedStatus",r,(function(t){return!e.isUndefined(e.ReceivedStatus[t])}),!0)?[2,H((function(s,i){return n(a,void 0,void 0,(function(){return o(this,(function(n){switch(n.label){case 0:return i.info(e.LogTagId.O,"setMessageReceivedStatus -> messageId: ".concat(t,", receivedStatus: ").concat(r)),[4,s.setMessageReceivedStatus(t,r)];case 1:return[2,{code:n.sent()}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:q[e.ErrorCode.NOT_SUPPORT]}]}))}))},setMessageSentStatus:function(t,r){return n(this,void 0,void 0,(function(){var a=this;return o(this,(function(s){return e.usingCppEngine()?e.validate("messageId",t,e.AssertRules.NUMBER,!0)&&e.validate("sentStatus",r,(function(t){return!e.isUndefined(exports.SentStatus[t])}),!0)?[2,H((function(s,i){return n(a,void 0,void 0,(function(){return o(this,(function(n){switch(n.label){case 0:return i.info(e.LogTagId.O,"setMessageSentStatus ->messageId: ".concat(t,", sentStatus: ").concat(r)),[4,s.setMessageSentStatus(t,r)];case 1:return[2,{code:n.sent()}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:q[e.ErrorCode.NOT_SUPPORT]}]}))}))},setMessageContent:function(t,r,a){return void 0===a&&(a=""),n(this,void 0,void 0,(function(){var s=this;return o(this,(function(i){return e.usingCppEngine()?e.validate("messageId",t,e.AssertRules.NUMBER,!0)&&e.validate("content",r,e.AssertRules.OBJECT,!0)&&e.validate("messageType",a,e.AssertRules.ONLY_STRING,!0)?[2,H((function(i,c){return n(s,void 0,void 0,(function(){return o(this,(function(n){switch(n.label){case 0:return c.info(e.LogTagId.O,"setMessageSentStatus ->messageId: ".concat(t,", messageType: ").concat(a)),[4,i.setMessageContent(t,r,a)];case 1:return[2,{code:n.sent()}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:q[e.ErrorCode.NOT_SUPPORT]}]}))}))},deleteMessages:function(t){return n(this,void 0,void 0,(function(){var r=this;return o(this,(function(a){return e.usingCppEngine()?!e.validate("messageIds",t,e.AssertRules.ARRAY,!0)||t.every((function(t){return!e.validate("messageId",t,e.AssertRules.NUMBER,!0)}))?[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,H((function(a,s){return n(r,void 0,void 0,(function(){return o(this,(function(n){switch(n.label){case 0:return s.info(e.LogTagId.O,"deleteMessages ->messageIds: ".concat(JSON.stringify(t))),[4,a.deleteMessages(t)];case 1:return[2,{code:n.sent()}]}}))}))}))]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:q[e.ErrorCode.NOT_SUPPORT]}]}))}))},clearMessages:function(t){return n(this,void 0,void 0,(function(){var r=this;return o(this,(function(a){return e.usingCppEngine()?[2,H((function(a,s){return n(r,void 0,void 0,(function(){var n,r,i,c;return o(this,(function(o){switch(o.label){case 0:return n=t.conversationType,r=t.targetId,i=t.channelId,s.info(e.LogTagId.O,"clearMessages ->targetId:".concat(r,",conversationType:").concat(n)),[4,a.clearMessages(n,r,i)];case 1:return(c=o.sent())===e.ErrorCode.SUCCESS?[2,{code:c}]:(s.warn(e.LogTagId.O,"clearMessages ->code:".concat(c,",targetId:").concat(r)),[2,{code:c,msg:q[c]}])}}))}))}))]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:q[e.ErrorCode.NOT_SUPPORT]}]}))}))},deleteMessagesByTimestamp:function(t,r,a){return n(this,void 0,void 0,(function(){var s,i,c,d=this;return o(this,(function(u){return e.usingCppEngine()?(s=t.conversationType,i=t.targetId,c=t.channelId,e.validate("conversationType",s,e.AssertRules.NUMBER,!0)&&e.validate("targetId",i,e.AssertRules.STRING,!0)&&e.validate("timestamp",r,e.AssertRules.NUMBER,!0)&&e.validate("cleanSpace",a,e.AssertRules.BOOLEAN)?[2,H((function(t,u){return n(d,void 0,void 0,(function(){var n;return o(this,(function(o){switch(o.label){case 0:return[4,t.deleteMessagesByTimestamp(s,i,r,a,c)];case 1:return(n=o.sent())===e.ErrorCode.SUCCESS?[2,{code:n}]:(u.warn(e.LogTagId.O,"deleteMessagesByTimestamp ->code:".concat(n,",targetId:").concat(i)),[2,{code:n,msg:q[n]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]):[2,{code:e.ErrorCode.NOT_SUPPORT,msg:q[e.ErrorCode.NOT_SUPPORT]}]}))}))},insertMessage:function(t,r,a){return void 0===a&&(a={}),n(this,void 0,void 0,(function(){var s=this;return o(this,(function(i){return e.usingCppEngine()?[2,H((function(i,c){return n(s,void 0,void 0,(function(){var n,s,d,u,l,g,v,f,I,p,R,E,T,h,C,m;return o(this,(function(o){switch(o.label){case 0:return n=r.senderUserId,s=r.messageType,d=r.content,u=r.messageDirection,l=r.messageUId,g=r.canIncludeExpansion,v=r.expansion,f=r.disableNotification,I=r.sentTime,p=r.sentStatus,c.info(e.LogTagId.O,"insertMessage ->targetId:".concat(t.targetId,",conversationType:").concat(t.conversationType)),R=a.isUnread,E=a.searchContent,T={senderUserId:n,messageType:s,content:d,messageDirection:u,sentTime:I,sentStatus:p,searchContent:E,isUnread:R,messageUId:l,disableNotification:f,canIncludeExpansion:g,expansionMsg:JSON.stringify(v),channelId:t.channelId||""},[4,i.insertMessage(t.conversationType,t.targetId,T)];case 1:return h=o.sent(),C=h.code,m=h.data,C===e.ErrorCode.SUCCESS?[2,{code:C,data:L(m)}]:(c.warn(e.LogTagId.O,"insertMessage ->code:".concat(C,",targetId:").concat(t.targetId)),[2,{code:C,msg:q[C]}])}}))}))}))]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:q[e.ErrorCode.NOT_SUPPORT]}]}))}))},clearLocalData:function(){return n(this,void 0,void 0,(function(){var t=this;return o(this,(function(r){return e.usingCppEngine()?[2,H((function(r,a){return n(t,void 0,void 0,(function(){var t,n,s;return o(this,(function(o){switch(o.label){case 0:return a.info(e.LogTagId.O,"clearLocalData ->"),[4,r.clearData()];case 1:return t=o.sent(),n=t.code,s=t.data,[2,{code:n,data:s}]}}))}))}))]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:q[e.ErrorCode.NOT_SUPPORT]}]}))}))}}),je=function(e,t,n){this.type=e,this.userIdList=t,this.mentionedContent=n};Object.defineProperty(exports,"ChatroomEntryType",{enumerable:!0,get:function(){return e.ChatroomEntryType}}),Object.defineProperty(exports,"ChatroomUserChangeType",{enumerable:!0,get:function(){return e.ChatroomUserChangeType}}),Object.defineProperty(exports,"ConnectionStatus",{enumerable:!0,get:function(){return e.ConnectionStatus}}),Object.defineProperty(exports,"ConversationType",{enumerable:!0,get:function(){return e.ConversationType}}),Object.defineProperty(exports,"ErrorCode",{enumerable:!0,get:function(){return e.ErrorCode}}),Object.defineProperty(exports,"FileType",{enumerable:!0,get:function(){return e.FileType}}),Object.defineProperty(exports,"LogL",{enumerable:!0,get:function(){return e.LogL}}),Object.defineProperty(exports,"LogLevel",{enumerable:!0,get:function(){return e.LogLevel}}),Object.defineProperty(exports,"MentionedType",{enumerable:!0,get:function(){return e.MentionedType}}),Object.defineProperty(exports,"MessageBlockSourceType",{enumerable:!0,get:function(){return e.MessageBlockSourceType}}),Object.defineProperty(exports,"MessageBlockType",{enumerable:!0,get:function(){return e.MessageBlockType}}),Object.defineProperty(exports,"MessageDirection",{enumerable:!0,get:function(){return e.MessageDirection}}),Object.defineProperty(exports,"NotificationLevel",{enumerable:!0,get:function(){return e.NotificationLevel}}),Object.defineProperty(exports,"NotificationStatus",{enumerable:!0,get:function(){return e.NotificationStatus}}),Object.defineProperty(exports,"ReceivedStatus",{enumerable:!0,get:function(){return e.ReceivedStatus}}),Object.defineProperty(exports,"UltraGroupChannelType",{enumerable:!0,get:function(){return e.UltraGroupChannelType}}),Object.defineProperty(exports,"UploadMethod",{enumerable:!0,get:function(){return e.UploadMethod}}),exports.BaseMessage=X,exports.CombineMessage=ae,exports.ConnectType={COMET:"comet",WEBSOCKET:"websocket"},exports.FileMessage=se,exports.GIFMessage=ie,exports.HQVoiceMessage=ne,exports.ImageMessage=te,exports.LocationMessage=de,exports.MentionedInfoBody=je,exports.MessageType={TEXT:"RC:TxtMsg",VOICE:"RC:VcMsg",HQ_VOICE:"RC:HQVCMsg",IMAGE:"RC:ImgMsg",GIF:"RC:GIFMsg",RICH_CONTENT:"RC:ImgTextMsg",LOCATION:"RC:LBSMsg",FILE:"RC:FileMsg",SIGHT:"RC:SightMsg",COMBINE:"RC:CombineMsg",CHRM_KV_NOTIFY:"RC:chrmKVNotiMsg",LOG_COMMAND:"RC:LogCmdMsg",EXPANSION_NOTIFY:"RC:MsgExMsg",REFERENCE:"RC:ReferenceMsg",RECALL_MESSAGE_TYPE:"RC:RcCmd"},exports.ReferenceMessage=ue,exports.RichContentMessage=le,exports.SightMessage=oe,exports.TextMessage=re,exports.VoiceMessage=ce,exports.__addSDKVersion=function(t,n){e.VersionManage.add(t,n)},exports.addConversationsToTag=function(t,r){return n(this,void 0,void 0,(function(){var a=this;return o(this,(function(s){return e.validate("tagId",t,e.AssertRules.STRING,!0)&&e.validate("conversations",r,e.AssertRules.ARRAY,!0)&&!r.every((function(t){return!e.validate("conversation.conversationType",t.conversationType,e.AssertRules.NUMBER,!0)||!e.validate("conversation.targetId",t.targetId,e.AssertRules.STRING,!0)||!e.validate("conversation.channelId",t.channelId,e.AssertRules.CHANNEL_ID)}))?[2,H((function(s,i){return n(a,void 0,void 0,(function(){var n;return o(this,(function(o){switch(o.label){case 0:return i.info(e.LogTagId.O,"addTagForConversations ->tagId:".concat(t)),[4,s.addTagForConversations(t,r)];case 1:return(n=o.sent().code)===e.ErrorCode.SUCCESS?[2,{code:n}]:(i.warn(e.LogTagId.O,"addTagForConversations ->code:".concat(n,",tagId:").concat(t)),[2,{code:n,msg:q[n]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.addEventListener=function(e,t,n){x.on(e,t,n)},exports.addTag=function(t){return n(this,void 0,void 0,(function(){var r=this;return o(this,(function(a){return e.validate("tag.tagId",t.tagId,e.AssertRules.STRING,!0)&&e.validate("tag.tagId",t.tagId,(function(e){return e.length<=10}))&&e.validate("tag.tagName",t.tagName,(function(e){return e.length<=15}))&&e.validate("tag.tagName",t.tagName,e.AssertRules.STRING,!0)?[2,H((function(a,s){return n(r,void 0,void 0,(function(){var n;return o(this,(function(o){switch(o.label){case 0:return s.info(e.LogTagId.O,"createTag ->tagId:".concat(t.tagId,",tagName:").concat(t.tagName)),[4,a.createTag(t)];case 1:return(n=o.sent().code)===e.ErrorCode.SUCCESS?[2,{code:n}]:(s.warn(e.LogTagId.O,"createTag ->code:".concat(n,",tagId:").concat(t.tagId)),[2,{code:n,msg:q[n]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.addToBlacklist=function(t){return n(this,void 0,void 0,(function(){var r=this;return o(this,(function(a){return e.validate("userId",t,e.AssertRules.STRING,!0)?[2,H((function(a,s){return n(r,void 0,void 0,(function(){return o(this,(function(n){switch(n.label){case 0:return s.info(e.LogTagId.O,"addToBlacklist -> userId: ".concat(t)),[4,a.addToBlacklist(t)];case 1:return[2,{code:n.sent()}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.bindRTCRoomForChatroom=function(e){return n(this,void 0,void 0,(function(){var t=this;return o(this,(function(r){return[2,H((function(r){return n(t,void 0,void 0,(function(){var t;return o(this,(function(n){switch(n.label){case 0:return[4,r.bindRTCRoomForChatroom(e)];case 1:return[2,{code:t=n.sent(),msg:q[t]}]}}))}))}))]}))}))},exports.clearAllMessagesUnreadStatus=function(){return n(this,void 0,void 0,(function(){var e=this;return o(this,(function(t){return[2,H((function(t,r){return n(e,void 0,void 0,(function(){return o(this,(function(e){switch(e.label){case 0:return[4,t.clearAllUnreadCount()];case 1:return[2,{code:e.sent()}]}}))}))}))]}))}))},exports.clearEventListeners=V,exports.clearHistoryMessages=function(t,r){return n(this,void 0,void 0,(function(){var a=this;return o(this,(function(s){return e.validate("options.timestamp",r,e.AssertRules.NUMBER,!0)&&e.validate("conversation.channelId",null==t?void 0:t.channelId,e.AssertRules.CHANNEL_ID)?[2,H((function(s,i){return n(a,void 0,void 0,(function(){var n,a;return o(this,(function(o){switch(o.label){case 0:return n="conversationType:".concat(t.conversationType,",targetId:").concat(t.targetId),i.debug(e.LogTagId.O,"clear message ->".concat(n)),[4,s.deleteRemoteMessageByTimestamp(t.conversationType,t.targetId,r,t.channelId)];case 1:return(a=o.sent())!==e.ErrorCode.SUCCESS?(i.warn(e.LogTagId.O,"clear message ->".concat(a,":").concat(q[a],",").concat(n)),[2,{code:a,msg:q[a]}]):[2,{code:e.ErrorCode.SUCCESS}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.clearMessages=function(t){return n(this,void 0,void 0,(function(){var r=this;return o(this,(function(a){return P("RongIMLib.clearMessages","RongIMLib.ElectronExtension.clearMessages"),e.usingCppEngine()?[2,H((function(a,s){return n(r,void 0,void 0,(function(){var n,r,i,c;return o(this,(function(o){switch(o.label){case 0:return n=t.conversationType,r=t.targetId,i=t.channelId,s.info(e.LogTagId.O,"clearMessages ->targetId:".concat(r,",conversationType:").concat(n)),[4,a.clearMessages(n,r,i)];case 1:return(c=o.sent())===e.ErrorCode.SUCCESS?[2,{code:c}]:(s.warn(e.LogTagId.O,"clearMessages ->code:".concat(c,",targetId:").concat(r)),[2,{code:c,msg:q[c]}])}}))}))}))]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:q[e.ErrorCode.NOT_SUPPORT]}]}))}))},exports.clearMessagesUnreadStatus=function(t){return n(this,void 0,void 0,(function(){var r=this;return o(this,(function(a){return e.validate("options.conversationType",t.conversationType,e.isValidConversationType,!0)&&e.validate("options.targetId",t.targetId,e.AssertRules.STRING,!0)&&e.validate("options.channelId",t.channelId,e.AssertRules.CHANNEL_ID)?[2,H((function(a,s){return n(r,void 0,void 0,(function(){var n,r;return o(this,(function(o){switch(o.label){case 0:return[4,a.clearUnreadCount(t.conversationType,t.targetId,t.channelId)];case 1:return n=o.sent(),r="conversationType:".concat(t.conversationType,",targetId:").concat(t.targetId),s.debug(e.LogTagId.O,"clear unreadMsgNum ->".concat(r)),n!==e.ErrorCode.SUCCESS?(s.warn(e.LogTagId.O,"clear unreadMsgNum fail ->".concat(n,":").concat(q[n],",").concat(r)),[2,{code:n,msg:q[n]}]):[2,{code:n}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.clearTextMessageDraft=function(t){return n(this,void 0,void 0,(function(){var r=this;return o(this,(function(a){return e.validate("options.conversationType",t.conversationType,e.isValidConversationType,!0)&&e.validate("options.targetId",t.targetId,e.AssertRules.STRING,!0)&&e.validate("options.channelId",t.channelId,e.AssertRules.CHANNEL_ID)?[2,H((function(a,s){return n(r,void 0,void 0,(function(){var n,r;return o(this,(function(o){switch(o.label){case 0:return n="conversationType:".concat(t.conversationType,",targetId:").concat(t.targetId),s.debug(e.LogTagId.O,"delete draft ->".concat(n)),[4,a.clearConversationMessageDraft(t.conversationType,t.targetId,t.channelId)];case 1:return(r=o.sent())===e.ErrorCode.SUCCESS?[2,{code:r}]:(s.warn(e.LogTagId.O,"delete draft fail ->".concat(r,":").concat(q[r],",").concat(n)),[2,{code:r,msg:q[r]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.clearUnreadCountByTimestamp=function(t,r){return n(this,void 0,void 0,(function(){var a=this;return o(this,(function(s){return e.usingCppEngine()?[2,H((function(s,i){return n(a,void 0,void 0,(function(){var n,a,c,d;return o(this,(function(o){switch(o.label){case 0:return n=t.conversationType,a=t.targetId,c=t.channelId,i.info(e.LogTagId.O,"clearUnreadCountByTimestamp ->targetId:".concat(a,",conversationType:").concat(n)),[4,s.clearUnreadCountByTimestamp(n,a,r,c)];case 1:return(d=o.sent())===e.ErrorCode.SUCCESS?[2,{code:d}]:(i.warn(e.LogTagId.O,"clearUnreadCountByTimestamp ->code:".concat(d,",targetId:").concat(a)),[2,{code:d,msg:q[d]}])}}))}))}))]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:q[e.ErrorCode.NOT_SUPPORT]}]}))}))},exports.connect=function(t,r){return n(this,void 0,void 0,(function(){var a=this;return o(this,(function(s){return[2,H((function(s,i){return n(a,void 0,void 0,(function(){var n,a,c;return o(this,(function(o){switch(o.label){case 0:return e.validate("token",t,e.AssertRules.STRING,!0)&&e.validate("reconnectKickEnable",r,e.AssertRules.BOOLEAN)?(n=i.createTraceId(),i.info(e.LogTagId.A_CONNECT_T,JSON.stringify({token:t,reconnectKickEnable:r}),n),[4,s.connect(t,!1,r,n)]):[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}];case 1:return a=o.sent(),c=a.code===e.ErrorCode.SUCCESS?"info":"warn",i[c](e.LogTagId.A_CONNECT_R,JSON.stringify({code:a.code,userId:a.userId}),n),a.code===e.ErrorCode.SUCCESS?[2,{code:a.code,data:{userId:a.userId}}]:[2,{code:a.code,msg:q[a.code]}]}}))}))}))]}))}))},exports.deleteLocalMessagesByTimestamp=function(t,r,a){return n(this,void 0,void 0,(function(){var s,i,c,d=this;return o(this,(function(u){return P("RongIMLib.deleteLocalMessagesByTimestamp","RongIMLib.ElectronExtension.deleteMessagesByTimestamp"),e.usingCppEngine()?(s=t.conversationType,i=t.targetId,c=t.channelId,e.validate("conversationType",s,e.AssertRules.NUMBER,!0)&&e.validate("targetId",i,e.AssertRules.STRING,!0)&&e.validate("timestamp",r,e.AssertRules.NUMBER,!0)&&e.validate("cleanSpace",a,e.AssertRules.BOOLEAN)?[2,H((function(u,l){return n(d,void 0,void 0,(function(){var n;return o(this,(function(o){switch(o.label){case 0:return[4,u.deleteMessagesByTimestamp(s,i,r,a,c)];case 1:return n=o.sent(),l.debug(e.LogTagId.A_DELETE_MESSAGES_S,JSON.stringify({code:n,conversationType:s,targetId:i,channelId:c,timestamp:r})),n===e.ErrorCode.SUCCESS?[2,{code:n}]:(l.warn(e.LogTagId.O,"deleteLocalMessagesByTimestamp ->code:".concat(n,",targetId:").concat(t.targetId)),[2,{code:n,msg:q[n]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]):[2,{code:e.ErrorCode.NOT_SUPPORT,msg:q[e.ErrorCode.NOT_SUPPORT]}]}))}))},exports.deleteMessages=function(t,r){return n(this,void 0,void 0,(function(){var a=this;return o(this,(function(s){return e.validate("options",r,(function(t){return e.isArray(t)&&t.length}),!0)&&e.validate("conversation.channelId",null==t?void 0:t.channelId,e.AssertRules.CHANNEL_ID)&&!r.every((function(t){return!e.validate("options.messageUId",t.messageUId,e.AssertRules.STRING,!0)||!e.validate("options.sentTime",t.sentTime,e.AssertRules.NUMBER,!0)||!e.validate("options.messageDirection",t.messageDirection,(function(e){return 1===e||2===e}),!0)}))?[2,H((function(s,i){return n(a,void 0,void 0,(function(){var n,a;return o(this,(function(o){switch(o.label){case 0:return n="conversationType:".concat(t.conversationType,",targetId:").concat(t.targetId),i.debug(e.LogTagId.O,"delete messages ->".concat(n)),[4,s.deleteRemoteMessage(t.conversationType,t.targetId,r,t.channelId)];case 1:return(a=o.sent())!==e.ErrorCode.SUCCESS?(i.warn(e.LogTagId.O,"delete message fail ->".concat(a,":").concat(q[a],",").concat(n)),[2,{code:a,msg:q[a]}]):[2,{code:e.ErrorCode.SUCCESS}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.destroy=function(){return n(this,void 0,void 0,(function(){return o(this,(function(e){return b?(V(),[2,G()]):[2]}))}))},exports.disconnect=function(){return e.logger.info(e.LogTagId.A_DISCONNECT_O,{}),k((function(e){return e.disconnect()}))},exports.electronExtension=Ye,exports.forceRemoveChatRoomEntry=function(t,r){return n(this,void 0,void 0,(function(){var a=this;return o(this,(function(s){return e.validate("targetId",t,e.AssertRules.STRING,!0)&&W(r)?[2,H((function(s,i){return n(a,void 0,void 0,(function(){var n,a;return o(this,(function(o){switch(o.label){case 0:return n="id:".concat(t),i.info(e.LogTagId.O,"force remove chatroom entry ->".concat(n)),[4,s.forceRemoveChatroomEntry(t,r)];case 1:return(a=o.sent())!==e.ErrorCode.SUCCESS?(i.warn(e.LogTagId.O,"force remove chatroom entry fail ->code+:".concat(q[a],",").concat(n)),[2,{code:a,msg:q[a]}]):[2,{code:a}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.forceSetChatRoomEntry=function(t,r){return n(this,void 0,void 0,(function(){var a=this;return o(this,(function(s){return e.validate("targetId",t,e.AssertRules.STRING,!0)&&j(r)?[2,H((function(s,i){return n(a,void 0,void 0,(function(){var n,a;return o(this,(function(o){switch(o.label){case 0:return n="id:".concat(t),i.debug(e.LogTagId.O,"force set chatroom entry ->".concat(n)),[4,s.forceSetChatroomEntry(t,r)];case 1:return(a=o.sent())!==e.ErrorCode.SUCCESS?(i.warn(e.LogTagId.O,"force set chatroom entry fail ->code+:".concat(q[a],",").concat(n)),[2,{code:a,msg:q[a]}]):[2,{code:a}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getAllChatRoomEntries=function(t){return n(this,void 0,void 0,(function(){var r=this;return o(this,(function(a){return[2,H((function(a,s){return n(r,void 0,void 0,(function(){var n,r,i,c;return o(this,(function(o){switch(o.label){case 0:return n="id:".concat(t),s.debug(e.LogTagId.O,"get all chatroom entries->".concat(n)),[4,a.getAllChatroomEntries(t)];case 1:return r=o.sent(),i=r.code,c=r.data,i===e.ErrorCode.SUCCESS&&c?[2,{code:i,data:c}]:(s.warn(e.LogTagId.O,"get all chatroom entries fail ->code+:".concat(q[i],",").concat(n)),[2,{code:i,msg:q[i]}])}}))}))}))]}))}))},exports.getAllConversationState=function(){return n(this,void 0,void 0,(function(){return o(this,(function(e){return[2,H((function(e){return e.getAllConversationState()}))]}))}))},exports.getAllUltraGroupUnreadCount=function(){return n(this,void 0,void 0,(function(){var t=this;return o(this,(function(r){return[2,H((function(r,a){return n(t,void 0,void 0,(function(){var t,n,s,i;return o(this,(function(o){switch(o.label){case 0:return t="getAllUltraGroupUnreadCount",[4,r.getAllUltraGroupUnreadCount()];case 1:return n=o.sent(),s=n.code,i=n.data,a.debug(e.LogTagId.O,t),s===e.ErrorCode.SUCCESS?[2,{code:s,data:i}]:(a.warn(e.LogTagId.O,"".concat(t," fail ->").concat(s,": ").concat(q[s])),[2,{code:s,msg:q[s]}])}}))}))}))]}))}))},exports.getAllUltraGroupUnreadMentionedCount=function(){return n(this,void 0,void 0,(function(){var t=this;return o(this,(function(r){return[2,H((function(r,a){return n(t,void 0,void 0,(function(){var t,n,s,i;return o(this,(function(o){switch(o.label){case 0:return t="getAllUltraGroupUnreadMentionedCount",!0,[4,r.getAllUltraGroupUnreadCount(true)];case 1:return n=o.sent(),s=n.code,i=n.data,a.debug(e.LogTagId.O,t),s===e.ErrorCode.SUCCESS?[2,{code:s,data:i}]:(a.warn(e.LogTagId.O,"".concat(t," fail ->").concat(s,": ").concat(q[s])),[2,{code:s,msg:q[s]}])}}))}))}))]}))}))},exports.getAllUnreadMentionedCount=function(){return n(this,void 0,void 0,(function(){return o(this,(function(t){return[2,H((function(t,n){return n.debug(e.LogTagId.O,"getAllUnreadMentionedCount"),t.getAllUnreadMentionedCount()}))]}))}))},exports.getBlacklist=function(){return n(this,void 0,void 0,(function(){var t=this;return o(this,(function(r){return[2,H((function(r,a){return n(t,void 0,void 0,(function(){var t,n,s;return o(this,(function(o){switch(o.label){case 0:return a.info(e.LogTagId.O,"getBlacklist -> "),[4,r.getBlacklist()];case 1:return t=o.sent(),n=t.code,s=t.data,n===e.ErrorCode.SUCCESS&&s?[2,{code:n,data:s}]:(a.warn(e.LogTagId.O,"getBlacklist fail -> code: ".concat(n)),[2,{code:n}])}}))}))}))]}))}))},exports.getBlacklistStatus=function(t){return n(this,void 0,void 0,(function(){var r=this;return o(this,(function(a){return e.validate("userId",t,e.AssertRules.STRING,!0)?[2,H((function(a,s){return n(r,void 0,void 0,(function(){var n,r,i;return o(this,(function(o){switch(o.label){case 0:return s.info(e.LogTagId.O,"getBlacklistStatus -> userId: ".concat(t)),[4,a.getBlacklistStatus(t)];case 1:return n=o.sent(),r=n.code,i=n.data,r===e.ErrorCode.SUCCESS?[2,{code:r,data:0===i}]:(s.warn(e.LogTagId.O,"getBlacklistStatus fail -> code: ".concat(r,", userId: ").concat(t)),[2,{code:r}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getBlockUltraGroupList=function(){return n(this,void 0,void 0,(function(){var t=this;return o(this,(function(r){return[2,H((function(r,a){return n(t,void 0,void 0,(function(){var t,n,s;return o(this,(function(o){switch(o.label){case 0:return[4,r.getBlockUltraGroupList()];case 1:return t=o.sent(),n=t.code,s=t.data,n===e.ErrorCode.SUCCESS?[2,{code:e.ErrorCode.SUCCESS,data:s}]:(a.warn(e.LogTagId.O,"get block ultragroup ->".concat(n,":").concat(q[n])),[2,{code:n,msg:q[n]}])}}))}))}))]}))}))},exports.getBlockedConversationList=function(){return n(this,void 0,void 0,(function(){return o(this,(function(e){return[2,H((function(e){return e.getBlockConversationList()}))]}))}))},exports.getChatRoomEntry=function(t,r){return n(this,void 0,void 0,(function(){var a=this;return o(this,(function(s){return e.validate("key",r,(function(t){return e.isString(t)&&/[\w+=-]+/.test(t)&&t.length<=128}),!0)?[2,H((function(s,i){return n(a,void 0,void 0,(function(){var n,a,c,d;return o(this,(function(o){switch(o.label){case 0:return n="id:".concat(t),i.debug(e.LogTagId.O,"get chatroom entry->".concat(n)),[4,s.getChatroomEntry(t,r)];case 1:return a=o.sent(),c=a.code,d=a.data,c===e.ErrorCode.SUCCESS&&d?[2,{code:c,data:d}]:(i.warn(e.LogTagId.O,"get chatroom entry fail ->code+:".concat(q[c],",").concat(n)),[2,{code:c,msg:q[c]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getChatRoomInfo=function(t,r){return n(this,void 0,void 0,(function(){var a=this;return o(this,(function(s){return e.validate("options.count",r.count,e.AssertRules.NUMBER)&&e.validate("options.order",r.order,(function(e){return[0,1,2].includes(e)}))?[2,H((function(s,i){return n(a,void 0,void 0,(function(){var n,a,c,d;return o(this,(function(o){switch(o.label){case 0:return n="id:".concat(t),i.debug(e.LogTagId.O,"get chatroom info ->".concat(n)),[4,s.getChatroomInfo(t,r.count,r.order)];case 1:return a=o.sent(),c=a.code,d=a.data,c===e.ErrorCode.SUCCESS&&d?[2,{code:c,data:d}]:(i.warn(e.LogTagId.O,"get chatroom info fail ->code+:".concat(q[c],",").concat(n)),[2,{code:c,msg:q[c]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getChatroomHistoryMessages=function(t,r){return n(this,void 0,void 0,(function(){var a=this;return o(this,(function(s){return e.validate("options.timestamp",r.timestamp,e.AssertRules.NUMBER)&&e.validate("options.count",r.count,e.AssertRules.NUMBER)&&e.validate("options.order",r.order,(function(e){return 0===e||1===e}))?[2,H((function(s,i){return n(a,void 0,void 0,(function(){var n,a,c,d,u;return o(this,(function(o){switch(o.label){case 0:return n="id:".concat(t),i.debug(e.LogTagId.O,"get chatroom history message->".concat(n)),[4,s.getChatRoomHistoryMessages(t,r.count,r.order,r.timestamp)];case 1:return a=o.sent(),c=a.code,d=a.data,c===e.ErrorCode.SUCCESS&&d?(u=d.list.map((function(e){return L(e)})),[2,{code:c,data:{list:u,hasMore:!!d.hasMore}}]):(i.warn(e.LogTagId.O,"get chatroom history message fail ->code+:".concat(q[c],",").concat(n)),[2,{code:c,msg:q[c]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getConnectionStatus=function(){return k((function(e){return e.getConnectionStatus()}))},exports.getConversation=function(t){return n(this,void 0,void 0,(function(){var r=this;return o(this,(function(a){return e.validate("options.conversationType",t.conversationType,e.isValidConversationType,!0)&&e.validate("options.targetId",t.targetId,e.AssertRules.STRING,!0)&&e.validate("options.channelId",t.channelId,e.AssertRules.CHANNEL_ID)?[2,H((function(a,s){return n(r,void 0,void 0,(function(){var n,r,i;return o(this,(function(o){switch(o.label){case 0:return[4,a.getConversation(t.conversationType,t.targetId,t.channelId||"")];case 1:return n=o.sent(),r=n.code,i=n.data,r!==e.ErrorCode.SUCCESS?(s.warn(e.LogTagId.O,"getConversation ->code:".concat(r,", targetId:").concat(t.targetId)),[2,{code:r,msg:q[r]}]):[2,{code:r,data:i?U(i):null}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getConversationList=function(t,r){return n(this,void 0,void 0,(function(){var a=this;return o(this,(function(s){return[2,H((function(s,i){return n(a,void 0,void 0,(function(){var n,a,c;return o(this,(function(o){switch(o.label){case 0:return[4,s.getConversationList(null==t?void 0:t.count,void 0,null==t?void 0:t.startTime,null==t?void 0:t.order,r)];case 1:return n=o.sent(),a=n.code,c=n.data,a===e.ErrorCode.SUCCESS&&c?[2,{code:0,data:c.map((function(e){return U(e)}))}]:(i.warn(e.LogTagId.O,"get conversation list fail ->".concat(a,":").concat(q[a])),[2,{code:a,msg:q[a]}])}}))}))}))]}))}))},exports.getConversationNotificationLevel=function(t){return n(this,void 0,void 0,(function(){var r=this;return o(this,(function(a){return z(t)?[2,H((function(a,s){return n(r,void 0,void 0,(function(){var n,r,i,c;return o(this,(function(o){switch(o.label){case 0:return n=K(s,t,"getConversationNotificationLevel"),[4,a.getConversationNotificationLevel(t.conversationType,t.targetId,t.channelId)];case 1:return r=o.sent(),i=r.code,c=r.data,i===e.ErrorCode.SUCCESS?[2,{code:i,data:c}]:(s.warn(e.LogTagId.O,"getConversationNotificationLevel fail -> ".concat(i," : ").concat(q[i]," , ").concat(n)),[2,{code:i,msg:q[i]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getConversationNotificationStatus=function(t){return n(this,void 0,void 0,(function(){var r=this;return o(this,(function(a){return e.validate("options.conversationType",t.conversationType,e.isValidConversationType,!0)&&e.validate("options.targetId",t.targetId,e.AssertRules.STRING,!0)&&e.validate("options.channelId",t.channelId,e.AssertRules.CHANNEL_ID)?[2,H((function(a,s){return n(r,void 0,void 0,(function(){var n,r,i;return o(this,(function(o){switch(o.label){case 0:return s.info(e.LogTagId.O,"getConversationNotificationStatus ->targetId:".concat(t.targetId,",conversationType:").concat(t.conversationType)),[4,a.getConversationNotificationStatus(t.conversationType,t.targetId,t.channelId)];case 1:return n=o.sent(),r=n.code,i=n.data,r===e.ErrorCode.SUCCESS?[2,{code:r,data:i}]:(s.warn(e.LogTagId.O,"getConversationNotificationStatus ->code:".concat(r,",targetId:").concat(t.targetId)),[2,{code:r,msg:q[r]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getConversationsFromTagByPage=function(t,r,a){return n(this,void 0,void 0,(function(){var s=this;return o(this,(function(i){return e.validate("tagId",t,e.AssertRules.STRING,!0)&&e.validate("count",r,e.AssertRules.NUMBER,!0)&&e.validate("startTime",a,e.AssertRules.NUMBER,!0)?[2,H((function(i,c){return n(s,void 0,void 0,(function(){var n,s,d;return o(this,(function(o){switch(o.label){case 0:return c.info(e.LogTagId.O,"getConversationListByTag ->tagId:".concat(t)),[4,i.getConversationListByTag(t,a,r)];case 1:return n=o.sent(),s=n.code,d=n.data,s===e.ErrorCode.SUCCESS?[2,{code:s,data:d}]:(c.warn(e.LogTagId.O,"getConversationListByTag ->code:".concat(s,",tagId:").concat(t)),[2,{code:s,msg:q[s]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getCurrentUserId=function(){return k((function(e){return e.getCurrentUserId()}))},exports.getDeviceId=function(){return k((function(e){return e.getDeviceId()}))},exports.getFileToken=function(t,n,o,r){return H((function(a){return new Promise((function(s){a.getFileToken(t,n,o,r).then((function(t){s({code:e.ErrorCode.SUCCESS,data:t})})).catch((function(e){s({code:e,msg:q[e]})}))}))}))},exports.getFileUrl=Ve,exports.getFirstUnreadMessage=function(t){return n(this,void 0,void 0,(function(){var r=this;return o(this,(function(a){return e.usingCppEngine()?e.validate("conversation.conversationType",t.conversationType,e.AssertRules.NUMBER,!0)&&e.validate("conversation.targetId",t.targetId,e.AssertRules.STRING,!0)&&e.validate("conversation.channelId",null==t?void 0:t.channelId,e.AssertRules.CHANNEL_ID)?[2,H((function(a,s){return n(r,void 0,void 0,(function(){var n,r,i;return o(this,(function(o){switch(o.label){case 0:return[4,a.getFirstUnreadMessage(t.conversationType,t.targetId,t.channelId)];case 1:return n=o.sent(),r=n.code,i=n.data,r===e.ErrorCode.SUCCESS?[2,{code:r,data:i}]:(s.warn(e.LogTagId.O,"insertMessage ->code:".concat(r,",targetId:").concat(t.targetId)),[2,{code:r,msg:q[r]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:q[e.ErrorCode.NOT_SUPPORT]}]}))}))},exports.getHistoryMessages=function(t,r){return n(this,void 0,void 0,(function(){var a=this;return o(this,(function(s){return e.validate("options.timestamp",null==r?void 0:r.timestamp,e.AssertRules.NUMBER)&&e.validate("options.count",null==r?void 0:r.count,e.AssertRules.NUMBER)&&e.validate("options.order",null==r?void 0:r.order,(function(e){return 0===e||1===e}))&&e.validate("conversation.channelId",null==t?void 0:t.channelId,e.AssertRules.CHANNEL_ID)?[2,H((function(s,i){return n(a,void 0,void 0,(function(){var n,a,c,d,u;return o(this,(function(o){switch(o.label){case 0:return n=i.createTraceId(),i.info(e.LogTagId.A_GET_HISTORY_MSG_T,JSON.stringify({targetId:t.targetId,conversationType:t.conversationType,channelId:t.channelId,timestamp:null==r?void 0:r.timestamp,count:null==r?void 0:r.count}),n),[4,s.getHistoryMessage(t.conversationType,t.targetId,null==r?void 0:r.timestamp,null==r?void 0:r.count,null==r?void 0:r.order,null==t?void 0:t.channelId,"",n)];case 1:return a=o.sent(),c=a.code,d=a.data,c===e.ErrorCode.SUCCESS&&d?(u=d.list.map((function(e){return L(e)})),i.info(e.LogTagId.A_GET_HISTORY_MSG_R,JSON.stringify({code:c,messageLength:u.length}),n),[2,{code:c,data:{list:u,hasMore:d.hasMore}}]):(i.warn(e.LogTagId.A_GET_HISTORY_MSG_R,JSON.stringify({code:c,messageUIds:""}),n),[2,{code:c,msg:q[c]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getMessage=function(t){return n(this,void 0,void 0,(function(){var r=this;return o(this,(function(a){return e.usingCppEngine()?[2,H((function(a,s){return n(r,void 0,void 0,(function(){var n,r,i;return o(this,(function(o){switch(o.label){case 0:return[4,a.getMessage(t)];case 1:return n=o.sent(),r=n.code,i=n.data,r===e.ErrorCode.SUCCESS?[2,{code:r,data:L(i)}]:(s.warn(e.LogTagId.O,"getMessage ->code:".concat(r,",messageId:").concat(t)),[2,{code:r,msg:q[r]}])}}))}))}))]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:q[e.ErrorCode.NOT_SUPPORT]}]}))}))},exports.getMessageReader=function(t,r,a){return n(this,void 0,void 0,(function(){var s=this;return o(this,(function(i){return e.validate("messageUId",r,e.AssertRules.STRING,!0)?[2,H((function(i,c){return n(s,void 0,void 0,(function(){var n,s,d,u;return o(this,(function(o){switch(o.label){case 0:return n="messageUId:".concat(r,",targetId:").concat(t),c.debug(e.LogTagId.O,"get message reader ->".concat(n)),[4,i.getMessageReader(t,r,a)];case 1:return s=o.sent(),d=s.code,u=s.data,d===e.ErrorCode.SUCCESS?[2,{code:d,data:u}]:(c.warn(e.LogTagId.O,"get message reader fail ->".concat(d,":").concat(q[d],",").concat(n)),[2,{code:d,msg:q[d]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getRemoteHistoryMessages=function(t,r){return n(this,void 0,void 0,(function(){var a=this;return o(this,(function(s){return e.validate("options.timestamp",null==r?void 0:r.timestamp,e.AssertRules.NUMBER)&&e.validate("options.count",null==r?void 0:r.count,e.AssertRules.NUMBER)&&e.validate("options.order",null==r?void 0:r.order,(function(e){return 0===e||1===e}))&&e.validate("conversation.channelId",null==t?void 0:t.channelId,e.AssertRules.CHANNEL_ID)?[2,H((function(s,i){return n(a,void 0,void 0,(function(){var n,a,c,d,u;return o(this,(function(o){switch(o.label){case 0:return n="conversationType:".concat(t.conversationType,",targetId:").concat(t.targetId),i.debug(e.LogTagId.O,"get history message ->".concat(n)),[4,s.getRemoteHistoryMessages(t.conversationType,t.targetId,(null==r?void 0:r.timestamp)||0,(null==r?void 0:r.count)||20,(null==r?void 0:r.order)||0,t.channelId||"")];case 1:return a=o.sent(),c=a.code,d=a.data,c===e.ErrorCode.SUCCESS&&d?(u=d.list.map((function(e){return L(e)})),[2,{code:c,data:{list:u,hasMore:d.hasMore}}]):(i.warn(e.LogTagId.O,"get history message fail ->".concat(c,":").concat(q[c],",").concat(n)),[2,{code:c,msg:q[c]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getServerTime=function(){return k((function(e){return e.getServerTime()}))},exports.getTags=function(){return n(this,void 0,void 0,(function(){var t=this;return o(this,(function(r){return[2,H((function(r,a){return n(t,void 0,void 0,(function(){var t,n,s;return o(this,(function(o){switch(o.label){case 0:return[4,r.getTagList()];case 1:return t=o.sent(),n=t.code,s=t.data,n===e.ErrorCode.SUCCESS?[2,{code:e.ErrorCode.SUCCESS,data:s}]:(a.warn(e.LogTagId.O,"getTagList ->code:".concat(n)),[2,{code:n,msg:q[n]}])}}))}))}))]}))}))},exports.getTagsFromConversation=function(t){return n(this,void 0,void 0,(function(){var r=this;return o(this,(function(a){return e.validate("conversationType",t.conversationType,e.AssertRules.NUMBER)&&e.validate("targetId",t.targetId,e.AssertRules.STRING)&&e.validate("channelId",t.channelId,e.AssertRules.CHANNEL_ID)?[2,H((function(a,s){return n(r,void 0,void 0,(function(){var n,r,i;return o(this,(function(o){switch(o.label){case 0:return s.info(e.LogTagId.O,"getTagsForConversation ->targetId:".concat(t.targetId,",conversationType:").concat(t.conversationType)),[4,a.getTagsForConversation(t)];case 1:return n=o.sent(),r=n.code,i=n.data,r===e.ErrorCode.SUCCESS?[2,{code:r,data:i}]:[2,{code:r,msg:q[r]}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getTextMessageDraft=function(t){return n(this,void 0,void 0,(function(){var r=this;return o(this,(function(a){return e.validate("options.conversationType",t.conversationType,e.isValidConversationType,!0)&&e.validate("options.targetId",t.targetId,e.AssertRules.STRING,!0)&&e.validate("options.channelId",t.channelId,e.AssertRules.CHANNEL_ID)?[2,H((function(a,s){return n(r,void 0,void 0,(function(){var n,r,i,c;return o(this,(function(o){switch(o.label){case 0:return[4,a.getConversationMessageDraft(t.conversationType,t.targetId,t.channelId)];case 1:return n=o.sent(),r=n.code,i=n.data,c="conversationType:".concat(t.conversationType,",targetId:").concat(t.targetId),s.debug(e.LogTagId.O,"get draft ->".concat(c)),r===e.ErrorCode.SUCCESS?[2,{code:r,data:i||""}]:(s.warn(e.LogTagId.O,"get draft fail ->".concat(r,":").concat(q[r],",").concat(c)),[2,{code:r,msg:q[r]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getTopConversationList=function(){return n(this,void 0,void 0,(function(){return o(this,(function(e){return[2,H((function(e){return e.getTopConversationList()}))]}))}))},exports.getTotalUnreadCount=function(t,r,a){return n(this,void 0,void 0,(function(){var s=this;return o(this,(function(i){return t.debug(e.LogTagId.O,"get total unread count -> ConversationType:".concat(JSON.stringify(a)," includeMuted:").concat(r)),e.validate("includeMuted",r,e.AssertRules.BOOLEAN,!1)&&e.validate("conversationTypes",a,e.AssertRules.ARRAY,!1)&&!(null==a?void 0:a.every((function(t){return!e.validate("conversationType",t,e.isValidConversationType)})))?[2,H((function(t,i){return n(s,void 0,void 0,(function(){var n,s,c;return o(this,(function(o){switch(o.label){case 0:return[4,t.getTotalUnreadCount("",a,r)];case 1:return n=o.sent(),s=n.code,c=n.data,s===e.ErrorCode.SUCCESS?[2,{code:s,data:c}]:(i.warn(e.LogTagId.O,"getTotalUnreadCount fail ->".concat(s,":").concat(q[s])),[2,{code:s,msg:q[s]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getTotalUnreadCountByLevels=function(t,r){return n(this,void 0,void 0,(function(){var a=this;return o(this,(function(s){return!e.validate("conversationTypes",t,e.AssertRules.ARRAY,!0)||!e.validate("levels",r,e.AssertRules.ARRAY,!0)||t.every((function(t){return!e.validate("conversationType",t,e.isValidConversationType)}))||r.every((function(t){return!e.validate("level",t,e.isValidNotificationLevel)}))?[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,H((function(s,i){return n(a,void 0,void 0,(function(){var n,a,c;return o(this,(function(o){switch(o.label){case 0:return[4,s.getTotalUnreadCountByLevels(t,r)];case 1:return n=o.sent(),a=n.code,c=n.data,a===e.ErrorCode.SUCCESS?[2,{code:a,data:c}]:(i.warn(e.LogTagId.O,"getTotalUnreadCountByLevels fail ->".concat(a,":").concat(q[a])),[2,{code:a,msg:q[a]}])}}))}))}))]}))}))},exports.getTotalUnreadMentionedCountByLevels=function(t,r){return n(this,void 0,void 0,(function(){var a=this;return o(this,(function(s){return!e.validate("conversationTypes",t,e.AssertRules.ARRAY,!0)||!e.validate("levels",r,e.AssertRules.ARRAY,!0)||t.every((function(t){return!e.validate("conversationType",t,e.isValidConversationType)}))||r.every((function(t){return!e.validate("level",t,e.isValidNotificationLevel)}))?[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,H((function(s,i){return n(a,void 0,void 0,(function(){var n,a,c;return o(this,(function(o){switch(o.label){case 0:return[4,s.getTotalUnreadCountByLevels(t,r,!0)];case 1:return n=o.sent(),a=n.code,c=n.data,a===e.ErrorCode.SUCCESS?[2,{code:a,data:c}]:(i.warn(e.LogTagId.O,"getTotalUnreadMentionedCountByLevels fail ->".concat(a,":").concat(q[a])),[2,{code:a,msg:q[a]}])}}))}))}))]}))}))},exports.getUltraGroupDefaultNotificationLevel=function(t){return n(this,void 0,void 0,(function(){var r=this;return o(this,(function(a){return e.validate("options.targetId",t.targetId,e.AssertRules.STRING,!0)&&e.validate("options.channelId",t.channelId,e.AssertRules.CHANNEL_ID)?[2,H((function(a,s){return n(r,void 0,void 0,(function(){var n,r,i,c,d;return o(this,(function(o){switch(o.label){case 0:return n="getUltraGroupDefaultNotificationLevel",r="targetId: ".concat(t.targetId,", channelId: ").concat(t.channelId),s.debug(e.LogTagId.O,"".concat(n," -> ").concat(r)),[4,a.getUltraGroupDefaultNotificationLevel(t.targetId,t.channelId)];case 1:return i=o.sent(),c=i.code,d=i.data,c===e.ErrorCode.SUCCESS?[2,{code:c,data:d}]:(s.warn(e.LogTagId.O,"".concat(n," fail -> ").concat(c," : ").concat(q[c]," , ").concat(r)),[2,{code:c,msg:q[c]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getUltraGroupFirstUnreadMessageTimestamp=function(t){return n(this,void 0,void 0,(function(){var r=this;return o(this,(function(a){return e.validate("conversation.targetId",t.targetId,e.AssertRules.STRING,!0)&&e.validate("conversation.channelId",t.channelId,e.AssertRules.ONLY_STRING,!0)?[2,H((function(a){return n(r,void 0,void 0,(function(){var n,r,s,i,c,d;return o(this,(function(o){switch(o.label){case 0:return n=t.targetId,r=t.channelId,s={targetId:n,channelId:r},[4,a.getUltraGroupFirstUnreadMessageTimestamp(s)];case 1:return i=o.sent(),c=i.code,d=i.data,c===e.ErrorCode.SUCCESS?[2,{code:c,data:d}]:[2,{code:c,msg:q[c]}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getUltraGroupList=function(t){return void 0===t&&(t={}),n(this,void 0,void 0,(function(){var r=this;return o(this,(function(a){return e.validate("options.targetId",t.targetId,e.AssertRules.STRING,!1)&&e.validate("options.channelType",t.channelType,(function(t){return void 0!==e.UltraGroupChannelType[t]}),!1)?[2,H((function(a,s){return n(r,void 0,void 0,(function(){var n,r,i;return o(this,(function(o){switch(o.label){case 0:return[4,a.getUltraGroupList(t)];case 1:return n=o.sent(),r=n.code,i=n.data,r===e.ErrorCode.SUCCESS?[2,{code:e.ErrorCode.SUCCESS,data:i}]:(s.warn(e.LogTagId.O,"get ultragroup ->".concat(r,":").concat(q[r])),[2,{code:r,msg:q[r]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getUltraGroupMessageListByMessageUId=function(t,r){return n(this,void 0,void 0,(function(){var a=this;return o(this,(function(s){return e.validate("options.targetId",t.targetId,e.AssertRules.STRING,!0)&&e.validate("options.channelId",t.channelId,e.AssertRules.CHANNEL_ID)&&e.validate("options.conversationType",t.conversationType,e.isValidConversationType,!0)&&e.validate("msgs",r,e.AssertRules.ARRAY,!0)?[2,H((function(s,i){return n(a,void 0,void 0,(function(){var n,a,c,d,u,l,g,v;return o(this,(function(o){switch(o.label){case 0:return n=t.targetId,a=t.conversationType,c=t.channelId,d=[],r.forEach((function(e){var t=e.sendTime,n=e.messageUId;d.push({sendTime:t,messageUId:n,channelId:c})})),u={targetId:n,conversationType:a,messages:d},[4,s.getUltraGroupMessageListByMessageUId(u)];case 1:return l=o.sent(),g=l.code,v=l.data,g===e.ErrorCode.SUCCESS?[2,{code:e.ErrorCode.SUCCESS,data:v}]:(i.warn(e.LogTagId.O,"get UltraGroup MessageList by messageUId ->".concat(g,":").concat(q[g])),[2,{code:g,msg:q[g]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getUltraGroupUnreadCountByTargetId=function(t,r){return n(this,void 0,void 0,(function(){var a=this;return o(this,(function(s){return e.validate("targetId",t,e.AssertRules.STRING,!0)&&e.validate("notificationLevels",r,e.AssertRules.ARRAY)&&!(null==r?void 0:r.every((function(t){return!e.validate("notificationLevel",t,e.isValidNotificationLevel)})))?[2,H((function(s,i){return n(a,void 0,void 0,(function(){var n,a,c,d,u;return o(this,(function(o){switch(o.label){case 0:return n="getUltraGroupUnreadCountByTargetId",[4,s.getUltraGroupUnreadCountByTargetId(t,r)];case 1:return a=o.sent(),c=a.code,d=a.data,u="targetId: ".concat(t,", levels: ").concat(JSON.stringify(r)),i.debug(e.LogTagId.O,"".concat(n," -> ").concat(u)),c===e.ErrorCode.SUCCESS?[2,{code:c,data:d}]:(i.warn(e.LogTagId.O,"".concat(n," fail -> ").concat(c,": ").concat(q[c],", ").concat(u)),[2,{code:c,msg:q[c]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getUltraGroupUnreadMentionedCountByTargetId=function(t,r){return n(this,void 0,void 0,(function(){var a=this;return o(this,(function(s){return e.validate("targetId",t,e.AssertRules.STRING,!0)&&e.validate("notificationLevels",r,e.AssertRules.ARRAY)&&!(null==r?void 0:r.every((function(t){return!e.validate("notificationLevel",t,e.isValidNotificationLevel)})))?[2,H((function(s,i){return n(a,void 0,void 0,(function(){var n,a,c;return o(this,(function(o){switch(o.label){case 0:return i.debug(e.LogTagId.O,"get UltraGroup unreadMentionedCount by targetId: ".concat(t,", notificationLevels: ").concat(JSON.stringify(r))),[4,s.getUltraGroupUnreadMentionedCountByTargetId(t,r)];case 1:return n=o.sent(),a=n.code,c=n.data,a===e.ErrorCode.SUCCESS?[2,{code:e.ErrorCode.SUCCESS,data:c}]:(i.warn(e.LogTagId.O,"get UltraGroup unreadMentionedCount by targetId error ->".concat(a,":").concat(q[a])),[2,{code:a,msg:q[a]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getUltraGroupUnreadMentionedMessages=function(t){return n(this,void 0,void 0,(function(){var r=this;return o(this,(function(a){return t.channelId=t.channelId||"",e.validate("options.targetId",t.targetId,e.AssertRules.STRING,!0)&&e.validate("options.channelId",t.channelId,e.AssertRules.ONLY_STRING,!0)&&e.validate("options.sentTime",t.sentTime,e.AssertRules.NUMBER,!0)&&e.validate("options.count",t.count,(function(t){return e.isNumber(t)&&t>0&&t<=50}),!0)?[2,H((function(a,s){return n(r,void 0,void 0,(function(){var n,r,i,c,d,u,l,g;return o(this,(function(o){switch(o.label){case 0:return n=t.targetId,r=t.channelId,i=t.sentTime,c=t.count,d={targetId:n,channelId:r,sentTime:i,count:c},[4,a.getUltraGroupUnreadMentionedMessages(d)];case 1:return u=o.sent(),l=u.code,g=u.data,l===e.ErrorCode.SUCCESS?[2,{code:l,data:g}]:(s.warn(e.LogTagId.O,"getUltraGroupUnreadMentionedMessages fail ->".concat(l,": ").concat(q[l])),[2,{code:l,msg:q[l]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getUnreadCount=function(t){return n(this,void 0,void 0,(function(){var r=this;return o(this,(function(a){return e.validate("options.conversationType",t.conversationType,e.isValidConversationType,!0)&&e.validate("options.targetId",t.targetId,e.AssertRules.STRING,!0)&&e.validate("options.channelId",t.channelId,e.AssertRules.CHANNEL_ID)?[2,H((function(a,s){return n(r,void 0,void 0,(function(){var n,r,i,c;return o(this,(function(o){switch(o.label){case 0:return[4,a.getUnreadCount(t.conversationType,t.targetId,t.channelId)];case 1:return n=o.sent(),r=n.code,i=n.data,c="conversationType:".concat(t.conversationType,",targetId:").concat(t.targetId),s.debug(e.LogTagId.O,"get unreadCount ->".concat(c)),r===e.ErrorCode.SUCCESS?[2,{code:r,data:i}]:(s.warn(e.LogTagId.O,"get unreadCount fail ->".concat(r,":").concat(q[r],",").concat(c)),[2,{code:r,msg:q[r]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getUnreadCountByTag=function(t,r){return n(this,void 0,void 0,(function(){var a=this;return o(this,(function(s){return e.validate("tagId",t,e.AssertRules.STRING,!0)&&e.validate("containMuted",r,e.AssertRules.BOOLEAN,!0)?[2,H((function(s,i){return n(a,void 0,void 0,(function(){var n,a,c;return o(this,(function(o){switch(o.label){case 0:return i.info(e.LogTagId.O,"getUnreadCountByTag ->tagId:".concat(t)),[4,s.getUnreadCountByTag(t,r)];case 1:return n=o.sent(),a=n.code,c=n.data,a===e.ErrorCode.SUCCESS?[2,{code:a,data:c}]:(i.warn(e.LogTagId.O,"getUnreadCountByTag ->code:".concat(a,",tagId:").concat(t)),[2,{code:a,msg:q[a]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getUnreadMentionedCount=function(t){return n(this,void 0,void 0,(function(){return o(this,(function(n){return e.validate("options.targetId",t.targetId,e.AssertRules.STRING,!0)&&e.validate("options.channelId",t.channelId,e.AssertRules.CHANNEL_ID)?[2,H((function(n,o){return o.debug(e.LogTagId.O,"getUnreadMentionedCount".concat(t.targetId,",channelId:").concat(t.channelId)),n.getUnreadMentionedCount(t)}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getUnreadMentionedMessages=function(t){if(!e.usingCppEngine())return{code:e.ErrorCode.NOT_SUPPORT,msg:q[e.ErrorCode.NOT_SUPPORT]};var n,o=t.conversationType,r=t.targetId;return e.validate("conversationType",o,e.AssertRules.NUMBER,!0)&&e.validate("targetId",r,e.AssertRules.STRING,!0)?(n=function(t){var n=t.getUnreadMentionedMessages(o,r),a=[];return n&&n.length&&n.forEach((function(e){return a.push(L(e))})),{code:e.ErrorCode.SUCCESS,data:a}},b?n(b,B,D):{code:e.ErrorCode.BIZ_ERROR_CLIENT_NOT_INIT}):{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}},exports.init=function(t){!function(t){var n=t.appkey,o=t.navigators;b?B.warn(e.LogTagId.A_INIT_REPEAT_O):(e.assert("options.navigators",t.navigators,(function(t){return e.isArray(t)&&(0===t.length||t.every(e.isHttpUrl))})),D=t,b=e.APIContext.init(M,{appkey:t.appkey,apiVersion:"5.5.8-beem-alpha.4",navigators:t.navigators||[],miniCMPProxy:t.customCMP||[],logOutputLevel:t.logOutputLevel,__reportLogLevel:t.__reportLogLevel,checkCA:t.checkCA,httpInMainProcess:!!t.httpInMainProcess}),(B=b.createLogger("RC-IM","IM")).setOutputLevel(t.logOutputLevel),B.info(e.LogTagId.A_INIT_O,JSON.stringify({appkey:n,navigators:o,version:"5.5.8-beem-alpha.4",commit:"630821aa823b034763e8d6f71e44221a90fe6f2c"})),b.assignWatcher(w))}(t)},exports.insertMessage=function(t,r,a){return void 0===a&&(a={}),n(this,void 0,void 0,(function(){var s=this;return o(this,(function(i){return P("RongIMLib.insertMessage","RongIMLib.ElectronExtension.insertMessage"),e.usingCppEngine()?[2,H((function(i,c){return n(s,void 0,void 0,(function(){var n,s,d,u,l,g,v,f,I,p,R,E,T,h,C,m;return o(this,(function(o){switch(o.label){case 0:return n=r.senderUserId,s=r.messageType,d=r.content,u=r.messageDirection,l=r.messageUId,g=r.canIncludeExpansion,v=r.expansion,f=r.disableNotification,I=r.sentTime,p=r.sentStatus,c.info(e.LogTagId.O,"insertMessage ->targetId:".concat(t.targetId,",conversationType:").concat(t.conversationType)),R=a.isUnread,E=a.searchContent,T={senderUserId:n,messageType:s,content:d,messageDirection:u,sentTime:I,sentStatus:p,searchContent:E,isUnread:R,messageUId:l,disableNotification:f,canIncludeExpansion:g,expansionMsg:JSON.stringify(v),channelId:t.channelId||""},[4,i.insertMessage(t.conversationType,t.targetId,T)];case 1:return h=o.sent(),C=h.code,m=h.data,C===e.ErrorCode.SUCCESS?[2,{code:C,data:L(m)}]:(c.warn(e.LogTagId.O,"insertMessage ->code:".concat(C,",targetId:").concat(t.targetId)),[2,{code:C,msg:q[C]}])}}))}))}))]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:q[e.ErrorCode.NOT_SUPPORT]}]}))}))},exports.installPlugin=function(e,t){return k((function(n){return n.install(e,t)}))},exports.joinChatRoom=function(t,r){return n(this,void 0,void 0,(function(){var a=this;return o(this,(function(s){return e.validate("options.count",r.count,e.AssertRules.NUMBER,!0)?[2,H((function(s,i){return n(a,void 0,void 0,(function(){var n,a,c;return o(this,(function(o){switch(o.label){case 0:return n=i.createTraceId(),i.info(e.LogTagId.A_JOIN_CHATROOM_T,JSON.stringify({chatroomId:t,count:r.count,joinExist:!1}),n),[4,s.joinChatroom(t,r.count,n)];case 1:return a=o.sent(),c=a===e.ErrorCode.SUCCESS?"info":"warn",i[c](e.LogTagId.A_JOIN_CHATROOM_R,JSON.stringify({code:a,timestamp:(new Date).getTime()}),n),a!==e.ErrorCode.SUCCESS?[2,{code:a,msg:q[a]}]:[2,{code:a}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.joinExistChatRoom=function(t,r){return n(this,void 0,void 0,(function(){var a=this;return o(this,(function(s){return e.validate("options.count",r.count,e.AssertRules.NUMBER,!0)?[2,H((function(s,i){return n(a,void 0,void 0,(function(){var n,a,c;return o(this,(function(o){switch(o.label){case 0:return n=i.createTraceId(),i.info(e.LogTagId.A_JOIN_CHATROOM_T,JSON.stringify({chatroomId:t,count:r.count,joinExist:!0}),n),[4,s.joinExistChatroom(t,r.count,n)];case 1:return a=o.sent(),c=a===e.ErrorCode.SUCCESS?"info":"warn",i[c](e.LogTagId.A_JOIN_CHATROOM_R,JSON.stringify({code:a,timestamp:(new Date).getTime()}),n),a!==e.ErrorCode.SUCCESS?[2,{code:a,msg:q[a]}]:[2,{code:a}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.modifyMessage=function(t,r){return n(this,void 0,void 0,(function(){var a=this;return o(this,(function(s){return e.validate("content",t,e.AssertRules.OBJECT,!0)&&e.validate("message",r,e.AssertRules.OBJECT,!0)?[2,H((function(s,i){return n(a,void 0,void 0,(function(){var n,a,c,d,u,l,g,v,f,I;return o(this,(function(o){switch(o.label){case 0:return n=r.conversationType,a=r.targetId,c=r.messageUId,d=r.senderUserId,u=r.sentTime,l=r.canIncludeExpansion,g=r.channelId,v="conversationType:".concat(n,",targetId:").concat(a,",channelId:").concat(g,",messageUId:").concat(c),i.debug(e.LogTagId.O,"update ultragroup message expansion ->".concat(v)),f={targetId:a,channelId:g,conversationType:n,fromUserId:d,sendTime:u,canIncludeExpansion:l,messageUId:c,content:t},[4,s.modifyMessage(f)];case 1:return(I=o.sent().code)===e.ErrorCode.SUCCESS?[2,{code:e.ErrorCode.SUCCESS}]:(i.warn(e.LogTagId.O,"modify ultraGroup message ->".concat(I,":").concat(q[I])),[2,{code:I,msg:q[I]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.onceEventListener=function(e,t,n){x.once(e,t,n)},exports.quitChatRoom=function(t){return n(this,void 0,void 0,(function(){var r=this;return o(this,(function(a){return[2,H((function(a,s){return n(r,void 0,void 0,(function(){var n,r,i;return o(this,(function(o){switch(o.label){case 0:return n=s.createTraceId(),s.info(e.LogTagId.A_QUIT_CHATROOM_T,JSON.stringify({chatroomId:t}),n),[4,a.quitChatroom(t)];case 1:return r=o.sent(),i=r===e.ErrorCode.SUCCESS?"info":"warn",s[i](e.LogTagId.A_QUIT_CHATROOM_R,JSON.stringify({code:r}),n),r!==e.ErrorCode.SUCCESS?[2,{code:r,msg:q[r]}]:[2,{code:r}]}}))}))}))]}))}))},exports.recallMessage=function(t,r){return n(this,void 0,void 0,(function(){var a=this;return o(this,(function(s){return e.validate("options.messageUId",r.messageUId,e.AssertRules.STRING,!0)&&e.validate("options.sentTime",r.sentTime,e.AssertRules.NUMBER,!0)&&e.validate("options.disableNotification",null==r?void 0:r.disableNotification,e.AssertRules.BOOLEAN)&&e.validate("options.pushConfig",null==r?void 0:r.pushConfig,e.AssertRules.OBJECT)&&e.validate("conversation.channelId",null==t?void 0:t.channelId,e.AssertRules.CHANNEL_ID)?[2,H((function(s,i){return n(a,void 0,void 0,(function(){var n,a,c,d,u;return o(this,(function(o){switch(o.label){case 0:return n={user:r.user,channelId:t.channelId||"",disableNotification:null==r?void 0:r.disableNotification,pushConfig:null==r?void 0:r.pushConfig,extra:r.extra,isDelete:r.isDelete},a="conversationType:".concat(t.conversationType,",targetId:").concat(t.targetId,",messageUId:").concat(r.messageUId),i.debug(e.LogTagId.O,"recall message ->".concat(a)),[4,s.recallMessage(t.conversationType,t.targetId,r.messageUId,r.sentTime,n)];case 1:return c=o.sent(),d=c.code,u=c.data,d===e.ErrorCode.SUCCESS&&u?[2,{code:d,data:L(u)}]:d===e.ErrorCode.SUCCESS?[2,{code:d}]:(i.warn(e.LogTagId.O,"recall message fail ->".concat(d,":").concat(q[d],",").concat(a)),[2,{code:d,msg:q[d]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.registerMessageType=function(t,n,o,r,a){return k((function(s,i){return e.assert("messageType",t,e.AssertRules.STRING,!0),e.assert("isPersited",n,e.AssertRules.BOOLEAN,!0),e.assert("isCounted",o,e.AssertRules.BOOLEAN,!0),e.assert("isStatusMessage",a,e.AssertRules.BOOLEAN,!1),i.info(e.LogTagId.A_REGTYP_O,JSON.stringify({messageType:t,isCounted:o,isStatusMessage:a,isPersited:n})),s.registerMessageType(t,n,o,r,a),Q(t,n,o)}))},exports.removeAllExpansionForUltraGroupMessage=function(t){return n(this,void 0,void 0,(function(){var r=this;return o(this,(function(a){return e.validate("message",t,e.AssertRules.OBJECT,!0)?[2,H((function(a,s){return n(r,void 0,void 0,(function(){var n,r,i,c,d,u,l,g,v;return o(this,(function(o){switch(o.label){case 0:return n=t.conversationType,r=t.targetId,i=t.messageUId,c=t.sentTime,d=t.canIncludeExpansion,u=t.channelId,l="conversationType:".concat(n,",targetId:").concat(r,",channelId:").concat(u,",messageUId:").concat(i),s.debug(e.LogTagId.O,"remove all expansion for ultraGroup message ->".concat(l)),g={targetId:r,channelId:u,conversationType:n,sendTime:c,canIncludeExpansion:d,messageUId:i,removeAll:!0},[4,a.expandUltraMessage(g)];case 1:return(v=o.sent().code)===e.ErrorCode.SUCCESS?[2,{code:e.ErrorCode.SUCCESS}]:(s.warn(e.LogTagId.O,"remove all expansion for ultraGroup message ->".concat(v,":").concat(q[v])),[2,{code:v,msg:q[v]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.removeChatRoomEntries=function(r,a){return n(this,void 0,void 0,(function(){var s=this;return o(this,(function(i){return e.validate("targetId",r,e.AssertRules.STRING,!0)&&function(t){return!(t.entries.every((function(t){return!e.validate("key",t,e.AssertRules.STRING,!0)}))||!e.validate("options.notificationExtra",t.notificationExtra,e.AssertRules.STRING))}(a)?[2,H((function(i,c){return n(s,void 0,void 0,(function(){var n,s,d,u,l;return o(this,(function(o){switch(o.label){case 0:return n="id:".concat(r),c.info(e.LogTagId.O,"remove chatroom entry->".concat(n)),(s=t({},a)).entries=a.entries.map((function(e){return{key:e}})),[4,i.removeChatroomEntries(r,s)];case 1:return d=o.sent(),u=d.code,l=d.data,u!==e.ErrorCode.SUCCESS?(c.warn(e.LogTagId.O,"remove chatroom entry fail ->code+:".concat(q[u],",").concat(n)),[2,{code:u,msg:q[u],data:l}]):[2,{code:u}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.removeChatRoomEntry=function(t,r){return n(this,void 0,void 0,(function(){var a=this;return o(this,(function(s){return e.validate("targetId",t,e.AssertRules.STRING,!0)&&W(r)?[2,H((function(s,i){return n(a,void 0,void 0,(function(){var n,a;return o(this,(function(o){switch(o.label){case 0:return n="id:".concat(t),i.debug(e.LogTagId.O,"remove chatroom entry->".concat(n)),[4,s.removeChatroomEntry(t,r)];case 1:return(a=o.sent())!==e.ErrorCode.SUCCESS?(i.warn(e.LogTagId.O,"remove chatroom entry fail ->code+:".concat(q[a],",").concat(n)),[2,{code:a,msg:q[a]}]):[2,{code:a}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.removeConversation=function(t){return n(this,void 0,void 0,(function(){var r=this;return o(this,(function(a){return e.validate("options.conversationType",t.conversationType,e.isValidConversationType,!0)&&e.validate("options.targetId",t.targetId,e.AssertRules.STRING,!0)&&e.validate("options.channelId",t.channelId,e.AssertRules.CHANNEL_ID)?[2,H((function(a,s){return n(r,void 0,void 0,(function(){var n,r;return o(this,(function(o){switch(o.label){case 0:return[4,a.removeConversation(t.conversationType,t.targetId,t.channelId)];case 1:return n=o.sent(),r="conversationType:".concat(t.conversationType,",targetId:").concat(t.targetId),s.debug(e.LogTagId.O,"destroy conversation ->".concat(r)),n!==e.ErrorCode.SUCCESS?(s.warn(e.LogTagId.O,"destroy conversation fail ->".concat(n,":").concat(q[n],",").concat(r)),[2,{code:n,msg:q[n]}]):[2,{code:n}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.removeConversationsFromTag=function(t,r){return n(this,void 0,void 0,(function(){var a=this;return o(this,(function(s){return e.validate("tagId",t,e.AssertRules.STRING,!0)&&e.validate("conversations",r,e.AssertRules.ARRAY,!0)&&!r.every((function(t){return!e.validate("conversation.conversationType",t.conversationType,e.AssertRules.NUMBER,!0)||!e.validate("conversation.targetId",t.targetId,e.AssertRules.STRING,!0)||!e.validate("conversation.channelId",t.channelId,e.AssertRules.CHANNEL_ID)}))?[2,H((function(s,i){return n(a,void 0,void 0,(function(){var n;return o(this,(function(o){switch(o.label){case 0:return i.info(e.LogTagId.O,"removeTagForConversations ->tagId:".concat(t)),[4,s.removeTagForConversations(t,r)];case 1:return(n=o.sent().code)===e.ErrorCode.SUCCESS?[2,{code:n}]:(i.warn(e.LogTagId.O,"removeTagForConversations ->code:".concat(n,",tagId:").concat(t)),[2,{code:n,msg:q[n]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.removeEventListener=function(e,t,n){x.off(e,t,n)},exports.removeEventListeners=function(e){x.removeAll(e)},exports.removeExpansionForUltraGroupMessage=function(t,r){return n(this,void 0,void 0,(function(){var a=this;return o(this,(function(s){return e.validate("expansion",t,e.AssertRules.ARRAY,!0)&&e.validate("message",r,e.AssertRules.OBJECT,!0)?[2,H((function(s,i){return n(a,void 0,void 0,(function(){var n,a,c,d,u,l,g,v,f;return o(this,(function(o){switch(o.label){case 0:return n=r.conversationType,a=r.targetId,c=r.messageUId,d=r.sentTime,u=r.canIncludeExpansion,l=r.channelId,g="conversationType:".concat(n,",targetId:").concat(a,",channelId:").concat(l,",messageUId:").concat(c),i.debug(e.LogTagId.O,"remove expansion for ultragroup message ->".concat(g)),v={targetId:a,channelId:l,conversationType:n,sendTime:d,canIncludeExpansion:u,messageUId:c,keys:t},[4,s.expandUltraMessage(v)];case 1:return(f=o.sent().code)===e.ErrorCode.SUCCESS?[2,{code:e.ErrorCode.SUCCESS}]:(i.warn(e.LogTagId.O,"remove expansion for ultraGroup message ->".concat(f,":").concat(q[f])),[2,{code:f,msg:q[f]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.removeFromBlacklist=function(t){return n(this,void 0,void 0,(function(){var r=this;return o(this,(function(a){return e.validate("userId",t,e.AssertRules.STRING,!0)?[2,H((function(e,a){return n(r,void 0,void 0,(function(){return o(this,(function(n){switch(n.label){case 0:return a.info("removeFromBlacklist -> userId: ".concat(t)),[4,e.removeFromBlacklist(t)];case 1:return[2,{code:n.sent()}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.removeMessageExpansionForKey=function(t,r){return n(this,void 0,void 0,(function(){var a=this;return o(this,(function(s){return e.validate("keys",t,e.AssertRules.ARRAY,!0)&&e.validate("message",r,e.AssertRules.OBJECT,!0)?[2,H((function(s,i){return n(a,void 0,void 0,(function(){var n,a,c,d,u,l,g;return o(this,(function(o){switch(o.label){case 0:return n=r.conversationType,a=r.targetId,c=r.messageUId,d=r.canIncludeExpansion,u=r.channelId,l="conversationType:".concat(n,",targetId:").concat(a,",messageUId:").concat(c),i.debug(e.LogTagId.O,"remove message expansion ->".concat(l)),[4,s.sendExpansionMessage({conversationType:n,targetId:a,messageUId:c,canIncludeExpansion:d,keys:t,channelId:u})];case 1:return(g=o.sent().code)!==e.ErrorCode.SUCCESS?(i.warn(e.LogTagId.O,"remove message expansion fail ->".concat(g,":").concat(q[g],",").concat(l)),[2,{code:g,msg:q[g]}]):[2,{code:g}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.removeTag=function(t){return n(this,void 0,void 0,(function(){var r=this;return o(this,(function(a){return e.validate("tagId",t,e.AssertRules.STRING,!0)?[2,H((function(a,s){return n(r,void 0,void 0,(function(){var n;return o(this,(function(o){switch(o.label){case 0:return s.info(e.LogTagId.O,"removeTag ->tagId:".concat(t)),[4,a.removeTag(t)];case 1:return(n=o.sent().code)===e.ErrorCode.SUCCESS?[2,{code:n}]:(s.warn(e.LogTagId.O,"removeTag ->code:".concat(n,",tagId:").concat(t)),[2,{code:n,msg:q[n]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.removeTagFromConversations=function(t,r){return n(this,void 0,void 0,(function(){var a=this;return o(this,(function(s){return e.validate("tagId",t,e.AssertRules.STRING,!0)&&e.validate("conversations",r,e.AssertRules.ARRAY,!0)&&!r.every((function(t){return!e.validate("conversation.conversationType",t.conversationType,e.AssertRules.NUMBER,!0)||!e.validate("conversation.targetId",t.targetId,e.AssertRules.STRING,!0)||!e.validate("conversation.channelId",t.channelId,e.AssertRules.CHANNEL_ID)}))?[2,H((function(s,i){return n(a,void 0,void 0,(function(){var n;return o(this,(function(o){switch(o.label){case 0:return i.info(e.LogTagId.O,"removeTagForConversations ->tagId:".concat(t)),[4,s.removeTagForConversations(t,r)];case 1:return(n=o.sent().code)===e.ErrorCode.SUCCESS?[2,{code:n}]:(i.warn(e.LogTagId.O,"removeTagForConversations ->code:".concat(n,",tagId:").concat(t)),[2,{code:n,msg:q[n]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.removeTagsFromConversation=function(t,r){return n(this,void 0,void 0,(function(){var a=this;return o(this,(function(s){return e.validate("conversation.conversationType",t.conversationType,e.AssertRules.NUMBER,!0)&&e.validate("conversation.targetId",t.targetId,e.AssertRules.STRING,!0)&&e.validate("conversation.channelId",t.channelId,e.AssertRules.CHANNEL_ID)&&e.validate("tagIds",r,e.AssertRules.ARRAY,!0)&&!r.every((function(t){return!e.validate("tagId",t,e.AssertRules.STRING,!0)}))?[2,H((function(s,i){return n(a,void 0,void 0,(function(){var n;return o(this,(function(o){switch(o.label){case 0:return i.info(e.LogTagId.O,"removeTagsForConversation ->tagIds:".concat(r,",targetId:").concat(t.targetId,",conversationType:").concat(t.conversationType)),[4,s.removeTagsForConversation(t,r)];case 1:return(n=o.sent().code)===e.ErrorCode.SUCCESS?[2,{code:n}]:(i.warn(e.LogTagId.O,"removeTagsForConversation ->code:".concat(n,",tagIds:").concat(r)),[2,{code:n,msg:q[n]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.saveTextMessageDraft=function(t,r){return n(this,void 0,void 0,(function(){var a=this;return o(this,(function(s){return e.validate("options.conversationType",t.conversationType,e.isValidConversationType,!0)&&e.validate("options.targetId",t.targetId,e.AssertRules.STRING,!0)&&e.validate("options.channelId",t.channelId,e.AssertRules.CHANNEL_ID)&&e.validate("draft",r,e.AssertRules.STRING,!0)?[2,H((function(s,i){return n(a,void 0,void 0,(function(){var n,a;return o(this,(function(o){switch(o.label){case 0:return n="conversationType:".concat(t.conversationType,",targetId:").concat(t.targetId),i.debug(e.LogTagId.O,"set draft ->".concat(n)),[4,s.saveConversationMessageDraft(t.conversationType,t.targetId,r,t.channelId)];case 1:return(a=o.sent())===e.ErrorCode.SUCCESS?[2,{code:a}]:(i.warn(e.LogTagId.O,"set draft fail ->".concat(a,":").concat(q[a],",").concat(n)),[2,{code:a,msg:q[a]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.searchConversationByContent=function(t,r,a,s){return n(this,void 0,void 0,(function(){var i=this;return o(this,(function(c){return P("RongIMLib.searchConversationByContent","RongIMLib.ElectronExtension.searchConversationByContent"),e.usingCppEngine()?[2,H((function(c,d){return n(i,void 0,void 0,(function(){var n,i,u;return o(this,(function(o){switch(o.label){case 0:return d.info(e.LogTagId.O,"searchConversationByContent ->keyword:".concat(t)),[4,c.searchConversationByContent(t,a,s,r)];case 1:return n=o.sent(),i=n.code,u=n.data,i===e.ErrorCode.SUCCESS?[2,{code:i,data:u}]:(d.warn(e.LogTagId.O,"searchConversationByContent ->code:".concat(i,",keyword:").concat(t)),[2,{code:i,msg:q[i]}])}}))}))}))]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:q[e.ErrorCode.NOT_SUPPORT]}]}))}))},exports.searchMessages=function(t,r,a,s){return n(this,void 0,void 0,(function(){var i=this;return o(this,(function(c){return P("RongIMLib.searchMessages","RongIMLib.ElectronExtension.searchMessages"),e.usingCppEngine()?e.validate("conversationType",t.conversationType,e.AssertRules.NUMBER,!0)&&e.validate("targetId",t.targetId,e.AssertRules.STRING,!0)&&e.validate("keyword",r,e.AssertRules.STRING,!0)&&e.validate("timestamp",a,e.AssertRules.NUMBER)&&e.validate("count",s,e.AssertRules.NUMBER)?[2,H((function(c,d){return n(i,void 0,void 0,(function(){var n,i,u,l;return o(this,(function(o){switch(o.label){case 0:return 1,[4,c.searchMessageByContent(t.conversationType,t.targetId,r,a,s,1,t.channelId)];case 1:return n=o.sent(),i=n.code,u=n.data,i===e.ErrorCode.SUCCESS?(l=[],(null==u?void 0:u.messages)&&u.messages.length&&u.messages.forEach((function(e){return l.push(L(e))})),[2,{code:i,data:{messages:l,count:null==u?void 0:u.count}}]):(d.warn(e.LogTagId.O,"searchMessages ->code:".concat(i,",targetId:").concat(t.targetId)),[2,{code:i,msg:q[i]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:q[e.ErrorCode.NOT_SUPPORT]}]}))}))},exports.sendFileMessage=Ze,exports.sendHQVoiceMessage=ze,exports.sendImageMessage=Je,exports.sendMessage=Fe,exports.sendReadReceiptMessage=function(t,r,a,s){return n(this,void 0,void 0,(function(){var i=this;return o(this,(function(c){return[2,H((function(c){return n(i,void 0,void 0,(function(){var n,i,c,d,u;return o(this,(function(o){switch(o.label){case 0:return n={targetId:t,conversationType:e.ConversationType.PRIVATE,channelId:s},i=new X("RC:ReadNtf",{messageUId:r,lastMessageSendTime:a,type:1}),[4,Fe(n,i)];case 1:return c=o.sent(),d=c.code,u=c.msg,0===d?[2,{code:d}]:[2,{code:d,msg:u}]}}))}))}))]}))}))},exports.sendReadReceiptRequest=function(t,r,a){return n(this,void 0,void 0,(function(){var s=this;return o(this,(function(i){return e.validate("messageUId",r,e.AssertRules.STRING,!0)&&e.validate("channelId",a,e.AssertRules.CHANNEL_ID)?[2,H((function(i,c){return n(s,void 0,void 0,(function(){var n,s,i,d,u;return o(this,(function(o){switch(o.label){case 0:return n="messageUId:".concat(r,",targetId:").concat(t),c.debug(e.LogTagId.O,"send read receipt message ->".concat(n)),s=new X("RC:RRReqMsg",{messageUId:r}),[4,Fe({targetId:t,conversationType:e.ConversationType.GROUP,channelId:a},s)];case 1:return i=o.sent(),d=i.code,u=i.msg,0===d?[2,{code:d}]:[2,{code:d,msg:u}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.sendReadReceiptResponse=function(e,t,r){return n(this,void 0,void 0,(function(){return o(this,(function(e){throw new Error("This method is deprecated, please use method sendReadReceiptResponseV2.")}))}))},exports.sendReadReceiptResponseV2=function(t,r,a){return n(this,void 0,void 0,(function(){var s=this;return o(this,(function(i){return e.validate("targetId",t,e.AssertRules.STRING,!0)&&e.validate("messageList",r,e.AssertRules.OBJECT,!0)&&e.validate("channelId",a,e.AssertRules.CHANNEL_ID)&&!Object.keys(r).every((function(t){return!e.validate(t,r[t],e.AssertRules.ARRAY)}))?[2,H((function(i,c){return n(s,void 0,void 0,(function(){var n,s,d,u,l,g,v;return o(this,(function(o){switch(o.label){case 0:return n={targetId:t,conversationType:e.ConversationType.GROUP,channelId:a},d=i.getInfoFromCache(),0!==(u=(null==d?void 0:d.grpRRVer)||0)?[3,2]:(l=new X("RC:RRRspMsg",{receiptMessageDic:r}),[4,Fe(n,l)]);case 1:return s=o.sent(),[3,4];case 2:return 1!==u?[3,4]:(g=[],Object.keys(r).forEach((function(e){r[e].forEach((function(e){-1===g.indexOf(e)&&g.push(e)}))})),g.length?[4,i.sendReadReceiptMessage(t,g,a)]:(c.warn(e.LogTagId.O,"Error in parameter messageList."),[2,{code:e.ErrorCode.PARAMETER_ERROR}]));case 3:s=o.sent(),o.label=4;case 4:return(v=s.code)===e.ErrorCode.SUCCESS?[2,{code:v}]:(c.warn(e.LogTagId.O,"send read receipt message fail ->".concat(v,":").concat(q[v])),[2,{code:v,msg:q[v]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.sendSightMessage=Ke,exports.sendSyncReadStatusMessage=function(t,r){return n(this,void 0,void 0,(function(){var n,a,s,i;return o(this,(function(o){switch(o.label){case 0:return e.validate("conversation.type",t.conversationType,e.AssertRules.NUMBER,!0)&&e.validate("conversation.targetId",t.targetId,e.AssertRules.STRING,!0)&&e.validate("lastMessageSendTime",r,e.AssertRules.NUMBER,!0)&&e.validate("conversation.channelId",null==t?void 0:t.channelId,e.AssertRules.CHANNEL_ID)?(n=new X("RC:SRSMsg",{lastMessageSendTime:r}),[4,Fe(t,n)]):[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}];case 1:return a=o.sent(),s=a.code,i=a.msg,0===s?[2,{code:s}]:[2,{code:s,msg:i}]}}))}))},exports.sendTextMessage=function(e,t,n){return Fe(e,new re(t),n)},exports.sendTypingStatusMessage=function(t,r){return n(this,void 0,void 0,(function(){var a=this;return o(this,(function(s){return e.validate("typingContentType",r,e.AssertRules.STRING,!0)?[2,H((function(s,i){return n(a,void 0,void 0,(function(){var n,a,c,d,u,l;return o(this,(function(o){switch(o.label){case 0:return n={messageType:"RC:TypSts",content:{typingContentType:r},isStatusMessage:!0,channelId:t.channelId},a=i.createTraceId(),i.info(e.LogTagId.A_SEND_MSG_T,JSON.stringify({messageType:n.messageType,conversationType:t.conversationType,targetId:t.targetId,channelId:t.channelId}),a),[4,s.sendMessage(t.conversationType,t.targetId,n,void 0,a)];case 1:return c=o.sent(),d=c.code,u=c.data,l=d===e.ErrorCode.SUCCESS?"info":"warn",i[l](e.LogTagId.A_SEND_MSG_R,JSON.stringify({code:d,messageUId:u?u.messageUId:"",messageId:u?u.messageId:""}),a),d===e.ErrorCode.SUCCESS?[2,{code:d,data:L(u)}]:[2,{code:d,msg:q[d]}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.sendUltraGroupTypingStatus=function(t){return n(this,void 0,void 0,(function(){var r=this;return o(this,(function(a){return e.validate("options.targetId",t.targetId,e.AssertRules.STRING,!0)&&e.validate("options.channelId",t.channelId,e.AssertRules.CHANNEL_ID)&&e.validate("options.conversationType",t.conversationType,e.isValidConversationType,!0)?[2,H((function(a,s){return n(r,void 0,void 0,(function(){var n;return o(this,(function(o){switch(o.label){case 0:return[4,a.sendUltraGroupTypingStatus(t)];case 1:return(n=o.sent().code)===e.ErrorCode.SUCCESS?[2,{code:e.ErrorCode.SUCCESS}]:(s.warn(e.LogTagId.O,"send ultraGroup OperateStatus ->".concat(n,":").concat(q[n])),[2,{code:n,msg:q[n]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.setChatRoomEntries=function(t,r){return n(this,void 0,void 0,(function(){var a=this;return o(this,(function(s){return e.validate("targetId",t,e.AssertRules.STRING,!0)&&function(t){return!(t.entries.every((function(t){return!e.validate("entry.key",t.key,e.AssertRules.STRING,!0)||!e.validate("entry.value",t.value,e.AssertRules.STRING,!0)}))||!e.validate("options.isAutoDelete",t.isAutoDelete,e.AssertRules.BOOLEAN)||!e.validate("options.notificationExtra",t.notificationExtra,e.AssertRules.STRING)||!e.validate("options.isForce",t.isForce,e.AssertRules.BOOLEAN))}(r)?r.entries.length>10?[2,F.CHATROOM_KV_STORE_OUT_LIMIT]:[2,H((function(s,i){return n(a,void 0,void 0,(function(){var n,a,c,d;return o(this,(function(o){switch(o.label){case 0:return n="id:".concat(t),i.debug(e.LogTagId.O,"set chatroom entry->".concat(n)),[4,s.setChatroomEntries(t,r)];case 1:return a=o.sent(),c=a.code,d=a.data,c!==e.ErrorCode.SUCCESS?(i.warn(e.LogTagId.O,"set chatroom entry fail ->code+:".concat(q[c],",").concat(n)),[2,{code:c,msg:q[c],data:d}]):[2,{code:c}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.setChatRoomEntry=function(t,r){return n(this,void 0,void 0,(function(){var a=this;return o(this,(function(s){return e.validate("targetId",t,e.AssertRules.STRING,!0)&&j(r)?[2,H((function(s,i){return n(a,void 0,void 0,(function(){var n,a;return o(this,(function(o){switch(o.label){case 0:return n="id:".concat(t),i.debug(e.LogTagId.O,"set chatroom entry->".concat(n)),[4,s.setChatroomEntry(t,r)];case 1:return(a=o.sent())!==e.ErrorCode.SUCCESS?(i.warn(e.LogTagId.O,"set chatroom entry fail ->code+:".concat(q[a],",").concat(n)),[2,{code:a,msg:q[a]}]):[2,{code:a}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.setConversationNotificationLevel=function(t,r){return n(this,void 0,void 0,(function(){return o(this,(function(n){return e.validate("notificationLevel",r,(function(t){return void 0!==e.NotificationLevel[t]}),!0)&&z(t)?[2,H((function(e,n){return Y(n,t,(function(){return e.setConversationNotificationLevel(t.conversationType,t.targetId,r,t.channelId)}),"setConversationNotificationLevel")}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.setConversationNotificationStatus=function(t,r){return n(this,void 0,void 0,(function(){return o(this,(function(n){return e.validate("notificationStatus",r,(function(e){return 1===e||2===e}),!0)&&z(t)?[2,H((function(e,n){return Y(n,t,(function(){return e.setConversationStatus(t.conversationType,t.targetId,void 0,r,t.channelId)}),"setConversationNotificationStatus")}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.setConversationToTop=function(t,r){return void 0===r&&(r=!0),n(this,void 0,void 0,(function(){var a=this;return o(this,(function(s){return e.validate("options.type",t.conversationType,e.isValidConversationType,!0)&&e.validate("options.targetId",t.targetId,e.AssertRules.STRING,!0)&&e.validate("options.channelId",t.channelId,e.AssertRules.CHANNEL_ID)?[2,H((function(s,i){return n(a,void 0,void 0,(function(){var n,a;return o(this,(function(o){switch(o.label){case 0:return n="conversationType:".concat(t.conversationType,",targetId:").concat(t.targetId),i.debug(e.LogTagId.O,"set conversation status ->".concat(n)),[4,s.setConversationStatus(t.conversationType,t.targetId,r,void 0,t.channelId)];case 1:return(a=o.sent())!==e.ErrorCode.SUCCESS?(i.warn(e.LogTagId.O,"set conversation status fail ->".concat(a,":").concat(q[a],",").concat(n)),[2,{code:a,msg:q[a]}]):[2,{code:a}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.setConversationToTopInTag=function(t,r,a){return n(this,void 0,void 0,(function(){var s=this;return o(this,(function(i){return e.validate("tagId",t,e.AssertRules.STRING,!0)&&e.validate("conversation.targetId",r.targetId,e.AssertRules.STRING,!0)&&e.validate("conversation.conversationType",r.conversationType,e.AssertRules.NUMBER,!0)&&e.validate("conversation.channelId",r.channelId,e.AssertRules.CHANNEL_ID)&&e.validate("status.isTop",a,e.AssertRules.BOOLEAN,!0)?[2,H((function(i,c){return n(s,void 0,void 0,(function(){var n;return o(this,(function(o){switch(o.label){case 0:return c.info(e.LogTagId.O,"setConversationStatusInTag ->tagId:".concat(t,",targetId:").concat(r.targetId,",conversationType").concat(r.conversationType)),[4,i.setConversationStatusInTag(t,r,{isTop:a})];case 1:return(n=o.sent().code)===e.ErrorCode.SUCCESS?[2,{code:n}]:(c.warn(e.LogTagId.O,"setConversationStatusInTag ->code:".concat(n,",tagId:").concat(t)),[2,{code:n,msg:q[n]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.setMessageReceivedStatus=function(t,r){return n(this,void 0,void 0,(function(){var a=this;return o(this,(function(s){return P("RongIMLib.setMessageReceivedStatus","RongIMLib.ElectronExtension.setMessageReceivedStatus"),e.usingCppEngine()?e.validate("messageId",t,e.AssertRules.NUMBER,!0)&&e.validate("receivedStatus",r,e.AssertRules.NUMBER,!0)?[2,H((function(s,i){return n(a,void 0,void 0,(function(){var n;return o(this,(function(o){switch(o.label){case 0:return i.info(e.LogTagId.O,"setMessageReceivedStatus ->messageId:".concat(t,",receivedStatus:").concat(r)),[4,s.setMessageReceivedStatus(t,r)];case 1:return(n=o.sent())===e.ErrorCode.SUCCESS?[2,{code:n}]:(i.warn(e.LogTagId.O,"setMessageReceivedStatus ->code:".concat(n,",messageId:").concat(t)),[2,{code:n,msg:q[n]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:q[e.ErrorCode.NOT_SUPPORT]}]}))}))},exports.setUltraGroupDefaultNotificationLevel=function(t,r){return n(this,void 0,void 0,(function(){var a=this;return o(this,(function(s){return t.channelId=t.channelId||"",e.validate("options.targetId",t.targetId,e.AssertRules.STRING,!0)&&e.validate("options.channelId",t.channelId,e.AssertRules.ONLY_STRING,!0)&&e.validate("notificationLevel",r,(function(t){return void 0!==e.NotificationLevel[t]}),!0)?[2,H((function(s,i){return n(a,void 0,void 0,(function(){var n,a,c;return o(this,(function(o){switch(o.label){case 0:return n="setUltraGroupDefaultNotificationLevel",a="targetId: ".concat(t.targetId,", channelId: ").concat(t.channelId),i.debug(e.LogTagId.O,"".concat(n," -> ").concat(a)),[4,s.setUltraGroupDefaultNotificationLevel(t.targetId,r,t.channelId)];case 1:return(c=o.sent().code)===e.ErrorCode.SUCCESS?[2,{code:c}]:(i.warn(e.LogTagId.O,"".concat(n," fail -> ").concat(c," : ").concat(q[c]," , ").concat(a)),[2,{code:c,msg:q[c]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.updateExpansionForUltraGroupMessage=function(t,r){return n(this,void 0,void 0,(function(){var a=this;return o(this,(function(s){return e.validate("expansion",t,e.AssertRules.OBJECT,!0)&&e.validate("message",r,e.AssertRules.OBJECT,!0)?[2,H((function(s,i){return n(a,void 0,void 0,(function(){var n,a,c,d,u,l,g,v,f;return o(this,(function(o){switch(o.label){case 0:return n=r.conversationType,a=r.targetId,c=r.messageUId,d=r.sentTime,u=r.canIncludeExpansion,l=r.channelId,g="conversationType:".concat(n,",targetId:").concat(a,",channelId:").concat(l,",messageUId:").concat(c),i.debug(e.LogTagId.O,"update expansion for ultragroup message ->".concat(g)),v={targetId:a,channelId:l,conversationType:n,sendTime:d,canIncludeExpansion:u,messageUId:c,expansion:t},[4,s.expandUltraMessage(v)];case 1:return(f=o.sent().code)===e.ErrorCode.SUCCESS?[2,{code:e.ErrorCode.SUCCESS}]:(i.warn(e.LogTagId.O,"update expansion for ultragroup message ->".concat(f,":").concat(q[f])),[2,{code:f,msg:q[f]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.updateMessageExpansion=function(t,r){return n(this,void 0,void 0,(function(){var a=this;return o(this,(function(s){return e.validate("expansion",t,e.AssertRules.OBJECT,!0)&&e.validate("message",r,e.AssertRules.OBJECT,!0)?[2,H((function(s,i){return n(a,void 0,void 0,(function(){var n,a,c,d,u,l,g,v;return o(this,(function(o){switch(o.label){case 0:return n=r.conversationType,a=r.targetId,c=r.messageUId,d=r.canIncludeExpansion,u=r.expansion,l=r.channelId,g="conversationType:".concat(n,",targetId:").concat(a,",messageUId:").concat(c),i.debug(e.LogTagId.O,"update message expansion ->".concat(g)),[4,s.sendExpansionMessage({conversationType:n,targetId:a,messageUId:c,expansion:t,canIncludeExpansion:d,originExpansion:u,channelId:l})];case 1:return(v=o.sent().code)!==e.ErrorCode.SUCCESS?(i.warn(e.LogTagId.O,"update message expansion fail ->".concat(v,":").concat(q[v],",").concat(g)),[2,{code:v,msg:q[v]}]):[2,{code:v}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.updateTag=function(t){return n(this,void 0,void 0,(function(){var r=this;return o(this,(function(a){return e.validate("tag.tagId",t.tagId,e.AssertRules.STRING,!0)&&e.validate("tag.tagName",t.tagName,e.AssertRules.STRING,!0)&&e.validate("tag.tagName",t.tagName,(function(e){return e.length<=15}))?[2,H((function(a,s){return n(r,void 0,void 0,(function(){var n;return o(this,(function(o){switch(o.label){case 0:return s.info(e.LogTagId.O,"updateTag ->tagId:".concat(t.tagId,",tagName:").concat(t.tagName)),[4,a.updateTag(t)];case 1:return(n=o.sent().code)===e.ErrorCode.SUCCESS?[2,{code:n}]:(s.warn(e.LogTagId.O,"updateTag ->code:".concat(n,",tagId:").concat(t.tagId)),[2,{code:n,msg:q[n]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@rongcloud/engine"),t=function(){return t=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},t.apply(this,arguments)};function n(e,t,n,o){return new(n||(n=Promise))((function(r,a){function s(e){try{c(o.next(e))}catch(e){a(e)}}function i(e){try{c(o.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,i)}c((o=o.apply(e,t||[])).next())}))}function o(e,t){var n,o,r,a,s={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return a={next:i(0),throw:i(1),return:i(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function i(a){return function(i){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,o&&(r=2&a[0]?o.return:a[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,a[1])).done)return r;switch(o=0,r&&(a=[2&a[0],r.value]),a[0]){case 0:case 1:r=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,o=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!(r=s.trys,(r=r.length>0&&r[r.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!r||a[1]>r[0]&&a[1]<r[3])){s.label=a[1];break}if(6===a[0]&&s.label<r[1]){s.label=r[1],r=a;break}if(r&&s.label<r[2]){s.label=r[2],s.ops.push(a);break}r[2]&&s.ops.pop(),s.trys.pop();continue}a=t.call(e,s)}catch(e){a=[6,e],o=0}finally{n=r=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,i])}}}var r=function(){return!("undefined"==typeof uni||!function(e){for(var t=["request","getSystemInfo"],n=0,o=t.length;n<o;n++)if(!e[t[n]])return!1;return!0}(uni))},a=r();var s,i,c={tag:"browser",httpReq:function(t){var n=t.method||e.HttpMethod.GET,o=t.timeout||e.HTTP_TIMEOUT,r=t.headers,a=t.query,s=t.body,i=e.appendUrl(t.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")),c="[object XDomainRequest]"===Object.prototype.toString.call(a);if(a.open(n,i),r&&a.setRequestHeader)for(var d in r)a.setRequestHeader(d,r[d]);if(c){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 u="object"==typeof s?JSON.stringify(s):s;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})}),o),a.send(s)}))},localStorage:null===window||void 0===window?void 0:window.localStorage,sessionStorage:null===window||void 0===window?void 0:window.sessionStorage,useNavi:!0,connectPlatform:"",isFromUniapp:a,createWebSocket:function(e,t){var n=new WebSocket(e,t);return n.binaryType="arraybuffer",{onClose:function(e){n.onclose=function(t){var n=t.code,o=t.reason;e(n,o)}},onError:function(e){n.onerror=e},onMessage:function(e){n.onmessage=function(t){e(t.data)}},onOpen:function(e){n.onopen=e},send:function(e){n.send(e)},close:function(e,t){n.close()}}},getNetworkType:function(){var t=navigator.connection||navigator.mozConnection||navigator.webkitConnection,n=t.type,o=t.effectiveType,r=n||o||e.NetworkType.UNKONWN;return new Promise((function(e){e(r)}))}},d=r(),u=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return wx[e].apply(wx,t)}catch(e){null===console||void 0===console||console.error(e)}}},l={setItem:u("setStorageSync"),getItem:u("getStorageSync"),removeItem:u("removeStorageSync"),clear:u("clearStorageSync")},g={tag:"wechat",httpReq:function(t){var n=t.method||e.HttpMethod.GET,o=t.timeout||e.HTTP_TIMEOUT,r=t.headers,a=t.query,s=t.body,i=e.appendUrl(t.url,a);return new Promise((function(t){wx.request({url:i,method:n,header:r,timeout:o,data:s,success:function(e){t({data:e.data,status:e.statusCode})},fail:function(){t({status:e.ErrorCode.RC_HTTP_REQ_FAIL})}})}))},localStorage:l,sessionStorage:l,useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:d,createWebSocket:function(e,t){var n=wx.connectSocket({url:e,protocols:t});return{onClose:function(e){n.onClose((function(t){e(t.code,t.reason)}))},onError:function(e){n.onError((function(t){e(t.errMsg)}))},onMessage:function(e){n.onMessage((function(t){e(t.data)}))},onOpen:function(e){n.onOpen(e)},send:function(e){n.send({data:e})},close:function(e,t){n.close({code:e,reason:t})}}},getNetworkType:function(){return new Promise((function(t){wx.getNetworkType({success:function(e){var n=e.networkType;t(n)},fail:function(){t(e.NetworkType.UNKONWN)}})}))}},v=r(),f=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{if("setStorageSync"===e)return my[e]({key:t[0],data:JSON.parse(t[1])});if("clearStorageSync"===e)return my[e]();if("removeStorageSync"===e)return my[e]({key:t[0]});var o=my[e]({key:t[0]}).data;return o?JSON.stringify(o):o}catch(e){}}},I={setItem:f("setStorageSync"),getItem:f("getStorageSync"),removeItem:f("removeStorageSync"),clear:f("clearStorageSync")},p={tag:"alipay",httpReq:function(t){var n=t.method||e.HttpMethod.GET,o=t.timeout||e.HTTP_TIMEOUT,r=t.headers,a=t.query,s=t.body,i=e.appendUrl(t.url,a),c=t.dataType||"json";return new Promise((function(t){my.request({url:i,method:n,headers:r,timeout:o,data:s,dataType:c,success:function(e){t({data:e.data,status:e.status})},fail:function(){t({status:e.ErrorCode.RC_HTTP_REQ_FAIL})}})}))},localStorage:I,sessionStorage:I,useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:v,createWebSocket:function(e){return my.connectSocket({url:e}),{onClose:function(e){my.onSocketClose(e)},onError:function(e){my.onSocketError((function(t){e(t.errMsg)}))},onMessage:function(e){my.onSocketMessage((function(t){t.isBuffer?e(my.base64ToArrayBuffer(t.data)):e(t.data)}))},onOpen:function(e){my.onSocketOpen(e)},send:function(e){my.sendSocketMessage({data:my.arrayBufferToBase64(e),isBuffer:!0})},close:function(){my.closeSocket()}}},getNetworkType:function(){return new Promise((function(t){my.getNetworkType({success:function(e){var n=e.networkType;t(n)},fail:function(){t(e.NetworkType.UNKONWN)}})}))}},R=r(),E=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return tt[e].apply(tt,t)}catch(e){}}},T={setItem:E("setStorageSync"),getItem:E("getStorageSync"),removeItem:E("removeStorageSync"),clear:E("clearStorageSync")},h={tag:"toutiao",useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:R,localStorage:T,sessionStorage:T,httpReq:function(t){return new Promise((function(n){tt.request({url:t.url,data:t.body,header:t.headers,method:t.method,success:function(e){var t=(null==e?void 0:e.data)||{},o={data:JSON.stringify(t),status:e.statusCode};n(o)},fail:function(t){n({status:e.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})}}},getNetworkType:function(){return new Promise((function(t){tt.getNetworkType({success:function(e){var n=e.networkType;t(n)},fail:function(){t(e.NetworkType.UNKONWN)}})}))}},C=r(),m=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return swan[e].apply(swan,t)}catch(e){}}},S={setItem:m("setStorageSync"),getItem:m("getStorageSync"),removeItem:m("removeStorageSync"),clear:m("clearStorageSync")},A={tag:"baidu",useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:C,localStorage:S,sessionStorage:S,httpReq:function(t){return new Promise((function(n,o){swan.request({url:t.url,data:t.body,header:t.headers,method:t.method,success:function(e){var t=(null==e?void 0:e.data)||{},o={data:JSON.stringify(t),status:e.statusCode};n(o)},fail:function(t){n({status:e.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})}}},getNetworkType:function(){return n(this,void 0,void 0,(function(){return o(this,(function(t){return[2,new Promise((function(t){swan.getNetworkType({success:function(e){var n=e.networkType;t(n)},fail:function(){t(e.NetworkType.UNKONWN)}})}))]}))}))}},O=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return uni[e].apply(uni,t)}catch(e){null===console||void 0===console||console.error(e)}}},N={setItem:O("setStorageSync"),getItem:O("getStorageSync"),removeItem:O("removeStorageSync"),clear:O("clearStorageSync")},_={tag:"uniapp",httpReq:function(t){var n=t.method||e.HttpMethod.GET,o=t.timeout||e.HTTP_TIMEOUT,r=t.headers,a=t.query,s=t.body,i=e.appendUrl(t.url,a);return new Promise((function(t){uni.request({url:i,method:n,header:r,timeout:o,data:s,success:function(e){t({data:e.data,status:e.statusCode})},fail:function(){t({status:e.ErrorCode.RC_HTTP_REQ_FAIL})}})}))},localStorage:N,sessionStorage:N,useNavi:!0,connectPlatform:"",isFromUniapp:!0,createWebSocket:function(e,t){var n={complete:function(){},url:e,protocols:t},o=uni.connectSocket(n);return{onClose:function(e){o.onClose((function(t){e(t.code,t.reason)}))},onError:function(e){o.onError((function(t){e(t.errMsg)}))},onMessage:function(e){o.onMessage((function(t){e(t.data)}))},onOpen:function(e){o.onOpen(e)},send:function(e){o.send({data:e})},close:function(e,t){o.close({code:e,reason:t})}}},getNetworkType:function(){return new Promise((function(t){uni.getNetworkType({success:function(e){var n=e.networkType;t(n)},fail:function(){t(e.NetworkType.UNKONWN)}})}))}},y=function(e){return e&&e.request&&e.getSystemInfo},M="undefined"!=typeof uni&&y(uni)?function(){switch(process.env.VUE_APP_PLATFORM){case"app-plus":return _;case"mp-baidu":return A;case"mp-toutiao":return h;case"mp-alipay":return p;case"mp-weixin":return g;default:return c}}():"undefined"!=typeof my&&y(my)?p:"undefined"!=typeof tt&&y(tt)?h:"undefined"!=typeof swan&&y(swan)?A:"undefined"!=typeof wx&&y(wx)?g:c;function L(t){var n=t.conversationType,o=t.channelId,r=t.messageType,a=t.content,s=t.senderUserId,i=t.targetId,c=t.sentTime,d=t.receivedTime,u=t.messageUId,l=t.messageDirection,g=t.isPersited,v=t.isCounted,f=t.isOffLineMessage,I=t.canIncludeExpansion,p=t.expansion,R=t.receivedStatus,E=t.disableNotification,T=t.isMentioned,h=t.isStatusMessage,C=t.readReceiptInfo,m=t.pushConfig,S=t.messageId,A=t.isInterrupt,O=t.isModifyMessage,N=t.channelType,_=t.sentStatus;R||(R=e.ReceivedStatus.UNREAD);var y={messageType:r,channelId:o||"",content:a,senderUserId:s,targetId:i,conversationType:n,sentTime:c,receivedTime:d,messageUId:u,messageDirection:l,isPersited:g,isCounted:v,isMentioned:T,disableNotification:E,isStatusMessage:h,canIncludeExpansion:I,expansion:p,receivedStatus:R,readReceiptInfo:C,pushConfig:m,messageId:S,isInterrupt:A,isModifyMessage:O,sentStatus:_};return n!==e.ConversationType.ULTRA_GROUP&&(y.isOffLineMessage=f),n===e.ConversationType.ULTRA_GROUP&&e.isNumber(N)&&(y.channelType=N),y}function U(e){var t=e.conversationType,n=e.targetId,o=e.latestMessage,r=e.unreadMessageCount,a=e.hasMentioned,s=e.mentionedInfo,i=e.lastUnreadTime,c=e.notificationStatus,d=e.notificationLevel,u=e.isTop,l=e.channelId,g=e.unreadMentionedCount;return{conversationType:t,targetId:n,latestMessage:o&&L(o),unreadMessageCount:r,hasMentioned:a,mentionedInfo:a?{type:null==s?void 0:s.type,userIdList:null==s?void 0:s.userIdList}:void 0,lastUnreadTime:i,notificationStatus:c,notificationLevel:d,isTop:u,channelId:l,unreadMentionedCount:g}}function P(e,t){null===console||void 0===console||console.warn("Method '".concat(e,"' is deprecated, please use '").concat(t,"' instead"))}exports.Events=void 0,(s=exports.Events||(exports.Events={})).CONNECTING="CONNECTING",s.CONNECTED="CONNECTED",s.DISCONNECT="DISCONNECT",s.SUSPEND="SUSPEND",s.MESSAGES="MESSAGES",s.READ_RECEIPT_RECEIVED="READ_RECEIPT_RECEIVED",s.MESSAGE_RECEIPT_REQUEST="MESSAGE_RECEIPT_REQUEST",s.MESSAGE_RECEIPT_RESPONSE="MESSAGE_RECEIPT_RESPONSE",s.CONVERSATION="CONVERSATION",s.CHATROOM="CHATROOM",s.EXPANSION="EXPANSION",s.PULL_OFFLINE_MESSAGE_FINISHED="PULL_OFFLINE_MESSAGE_FINISHED",s.TAG="TAG",s.CONVERSATION_TAG="CONVERSATION_TAG",s.TYPING_STATUS="TYPING_STATUS",s.MESSAGE_BLOCKED="MESSAGE_BLOCKED",s.ULTRA_GROUP_ENABLE="ULTRA_GROUP_ENABLE",s.OPERATE_STATUS="OPERATE_STATUS",s.ULTRA_GROUP_MESSAGE_EXPANSION_UPDATED="ULTRA_GROUP_MESSAGE_EXPANSION_UPDATED",s.ULTRA_GROUP_MESSAGE_MODIFIED="ULTRA_GROUP_MESSAGE_MODIFIED",s.ULTRA_GROUP_MESSAGE_RECALLED="ULTRA_GROUP_MESSAGE_RECALLED",s.ULTRA_GROUP_CHANNEL_TYPE_CHANGE="ULTRA_GROUP_CHANNEL_TYPE_CHANGE",s.ULTRA_GROUP_CHANNEL_DELETE="ULTRA_GROUP_CHANNEL_DELETE",s.ULTRA_GROUP_CHANNEL_USER_KICKED="ULTRA_GROUP_CHANNEL_USER_KICKED",exports.SentStatus=void 0,(i=exports.SentStatus||(exports.SentStatus={}))[i.SENDING=10]="SENDING",i[i.FAILED=20]="FAILED",i[i.SENT=30]="SENT",i[i.RECEIVED=40]="RECEIVED",i[i.READ=50]="READ",i[i.DESTROYED=60]="DESTROYED";var x=new e.EventEmitter,w={onConnecting:function(){x.emit(exports.Events.CONNECTING)},onConnected:function(){x.emit(exports.Events.CONNECTED)},onDisconnect:function(e){x.emit(exports.Events.DISCONNECT,e)},onSuspend:function(e){x.emit(exports.Events.SUSPEND,e)},batchMessage:function(e){x.emit(exports.Events.MESSAGES,{messages:e.map((function(e){return L(e)}))})},typingState:function(e){x.emit(exports.Events.TYPING_STATUS,{status:e})},readReceiptReceived:function(e,t,n){x.emit(exports.Events.READ_RECEIPT_RECEIVED,{conversation:e,messageUId:t,sentTime:n})},messageReceiptRequest:function(e,t,n){x.emit(exports.Events.MESSAGE_RECEIPT_REQUEST,{conversation:e,messageUId:t,senderUserId:n})},messageReceiptResponse:function(e,t,n){x.emit(exports.Events.MESSAGE_RECEIPT_RESPONSE,{conversation:e,receivedUserId:t,messageUIdList:n})},conversationState:function(t){var n=t.map((function(t){var n=t.conversationType,o={conversationType:n,latestMessage:t.latestMessage?L(t.latestMessage):null,targetId:t.targetId,unreadMessageCount:t.unreadMessageCount,unreadMentionedCount:t.unreadMentionedCount,notificationStatus:t.notificationStatus,notificationLevel:t.notificationLevel,lastUnreadTime:t.lastUnreadTime,channelId:t.channelId};return n===e.ConversationType.ULTRA_GROUP?(o.versionTime=t.versionTime,{conversation:o}):(o.hasMentioned=t.hasMentioned,o.mentionedInfo=t.mentionedInfo,o.isTop=t.isTop,{conversation:o,updatedItems:t.updatedItems})}));x.emit(exports.Events.CONVERSATION,{conversationList:n})},chatroomState:function(e){x.emit(exports.Events.CHATROOM,e)},expansion:function(e){x.emit(exports.Events.EXPANSION,e)},pullFinished:function(){x.emit(exports.Events.PULL_OFFLINE_MESSAGE_FINISHED)},tag:function(){x.emit(exports.Events.TAG)},conversationTagChanged:function(){x.emit(exports.Events.CONVERSATION_TAG)},messageBlocked:function(e){x.emit(exports.Events.MESSAGE_BLOCKED,e)},ultraGroupEnable:function(e){x.emit(exports.Events.ULTRA_GROUP_ENABLE,e)},operateStatus:function(e){x.emit(exports.Events.OPERATE_STATUS,e)},ultraGroupMessageExpansionUpdated:function(e){x.emit(exports.Events.ULTRA_GROUP_MESSAGE_EXPANSION_UPDATED,e)},ultraGroupMessageModified:function(e){x.emit(exports.Events.ULTRA_GROUP_MESSAGE_MODIFIED,e)},ultraGroupMessageRecalled:function(e){x.emit(exports.Events.ULTRA_GROUP_MESSAGE_RECALLED,e)},ultraGroupChannelChangeType:function(e){x.emit(exports.Events.ULTRA_GROUP_CHANNEL_TYPE_CHANGE,e)},ultraGroupChannelUserKicked:function(e){x.emit(exports.Events.ULTRA_GROUP_CHANNEL_USER_KICKED,e)},ultraGroupChannelDelete:function(e){x.emit(exports.Events.ULTRA_GROUP_CHANNEL_DELETE,e)}};e.VersionManage.add("imlib-next","5.6.0-beem-alpha.1");var b=null,D=null,B=null;function G(){return n(this,void 0,void 0,(function(){return o(this,(function(t){switch(t.label){case 0:return b?(B.info(e.LogTagId.A_DESTROY_O),[4,e.APIContext.destroy()]):[2];case 1:return t.sent(),D=null,b=null,B=null,[2]}}))}))}function k(e){if(!b)throw new Error("Not initialized yet!");return e(b,B,D)}function H(t){return b?t(b,B,D):Promise.resolve({code:e.ErrorCode.BIZ_ERROR_CLIENT_NOT_INIT})}function V(){x.clear()}var F={TIMEOUT:{code:-1,msg:"Network timeout"},SDK_INTERNAL_ERROR:{code:-2,msg:"SDK internal error"},PARAMETER_ERROR:{code:-3,msg:"Please check the parameters, the {param} expected a value of {expect} but received {current}"},REJECTED_BY_BLACKLIST:{code:405,msg:"Blacklisted by the other party"},SEND_TOO_FAST:{code:20604,msg:"Sending messages too quickly"},NOT_IN_GROUP:{code:22406,msg:"Not in group"},ULTRA_GROUP_USER_NOT_IN_PRIVATE_CHANNEL:{code:e.ErrorCode.ULTRA_GROUP_USER_NOT_IN_PRIVATE_CHANNEL,msg:"ultra group user not in private channel"},FORBIDDEN_IN_GROUP:{code:22408,msg:"Forbbiden from speaking in the group"},NOT_IN_CHATROOM:{code:23406,msg:"Not in chatRoom"},FORBIDDEN_IN_CHATROOM:{code:23408,msg:"Forbbiden from speaking in the chatRoom"},KICKED_FROM_CHATROOM:{code:23409,msg:"Kicked out and forbbiden from joining the chatRoom"},CHATROOM_NOT_EXIST:{code:23410,msg:"ChatRoom does not exist"},CHATROOM_IS_FULL:{code:23411,msg:"ChatRoom members exceeded"},PARAMETER_INVALID_CHATROOM:{code:23412,msg:"Invalid chatRoom parameters"},ROAMING_SERVICE_UNAVAILABLE_CHATROOM:{code:23414,msg:"ChatRoom message roaming service is not open, Please go to the developer to open this service"},RECALLMESSAGE_PARAMETER_INVALID:{code:25101,msg:"Invalid recall message parameter"},ROAMING_SERVICE_UNAVAILABLE_MESSAGE:{code:25102,msg:"Single group chat roaming service is not open, Please go to the developer to open this service"},PUSHSETTING_PARAMETER_INVALID:{code:26001,msg:"Invalid push parameter"},OPERATION_BLOCKED:{code:20605,msg:"Operation is blocked"},OPERATION_NOT_SUPPORT:{code:20606,msg:"Operation is not supported"},MSG_BLOCKED_SENSITIVE_WORD:{code:21501,msg:"The sent message contains sensitive words"},REPLACED_SENSITIVE_WORD:{code:21502,msg:"Sensitive words in the message have been replaced"},NOT_CONNECTED:{code:30001,msg:"Please connect successfully first"},NAVI_REQUEST_ERROR:{code:30007,msg:"Navigation http request failed"},CMP_REQUEST_ERROR:{code:30010,msg:"CMP sniff http request failed"},CONN_APPKEY_FAKE:{code:31002,msg:"Your appkey is fake"},CONN_MINI_SERVICE_NOT_OPEN:{code:31003,msg:"Mini program service is not open, Please go to the developer to open this service"},CONN_ACK_TIMEOUT:{code:31e3,msg:"Connection ACK timeout"},CONN_TOKEN_INCORRECT:{code:31004,msg:"Your token is not valid or expired"},CONN_NOT_AUTHRORIZED:{code:31005,msg:"AppKey and Token do not match"},CONN_REDIRECTED:{code:31006,msg:"Connection redirection"},CONN_APP_BLOCKED_OR_DELETED:{code:31008,msg:"AppKey is banned or deleted"},CONN_USER_BLOCKED:{code:31009,msg:"User blocked"},CONN_DOMAIN_INCORRECT:{code:31012,msg:"Connect domain error, Please check the set security domain"},ROAMING_SERVICE_UNAVAILABLE:{code:33007,msg:"Roaming service cloud is not open, Please go to the developer to open this service"},RC_CONNECTION_EXIST:{code:34001,msg:"Connection already exists"},CHATROOM_KV_EXCEED:{code:23423,msg:"ChatRoom KV setting exceeds maximum"},CHATROOM_KV_OVERWRITE_INVALID:{code:23424,msg:"ChatRoom KV already exists"},CHATROOM_KV_STORE_NOT_OPEN:{code:23426,msg:"ChatRoom KV storage service is not open, Please go to the developer to open this service"},CHATROOM_KEY_NOT_EXIST:{code:23427,msg:"ChatRoom key does not exist"},MSG_KV_NOT_SUPPORT:{code:34008,msg:"The message cannot be extended"},SEND_MESSAGE_KV_FAIL:{code:34009,msg:"Sending RC expansion message fail"},EXPANSION_LIMIT_EXCEET:{code:34010,msg:"The message expansion size is beyond the limit"},ILLGAL_PARAMS:{code:33003,msg:"Incorrect parameters passed in while calling the interface"},UPLOAD_FILE_FAILED:{code:35020,msg:"File upload failed"},CHATROOM_KV_STORE_NOT_ALL_SUCCESS:{code:23428,msg:"Chatroom kv store not all success"},CHATROOM_KV_STORE_OUT_LIMIT:{code:23429,msg:"Chatroom kv's length is out of limit"},TAG_EXISTS:{code:33101,msg:"The tag already exists"},TAG_NOT_EXIST:{code:33100,msg:"The tag does not exist"},NOT_SUPPORT:{code:e.ErrorCode.NOT_SUPPORT,msg:"The method is not supported in a browser!"}},q={};for(var Z in F){var J=F[Z].code;q[J]=Z}F.ROAMING_SERVICE_UNAVAILABLE.code;var z=function(t){return!(!e.validate("options.conversationType",t.conversationType,e.isValidConversationType,!0)||!e.validate("options.targetId",t.targetId,e.AssertRules.STRING,!0)||!e.validate("options.channelId",t.channelId,e.AssertRules.CHANNEL_ID))},K=function(t,n,o){void 0===o&&(o="");var r="conversationType:".concat(n.conversationType,",targetId:").concat(n.targetId);return t.debug(e.LogTagId.O,"".concat(o," -> ").concat(r)),r},Y=function(t,r,a,s){return void 0===s&&(s=""),n(void 0,void 0,void 0,(function(){var n,i;return o(this,(function(o){switch(o.label){case 0:return n=K(t,r,s),[4,a()];case 1:return(i=o.sent())!==e.ErrorCode.SUCCESS?(t.warn(e.LogTagId.O,"".concat(s," fail -> ").concat(i," : ").concat(q[i]," , ").concat(n)),[2,{code:i,msg:q[i]}]):[2,{code:i}]}}))}))};var j=function(t){return!!(e.validate("options.key",t.key,e.AssertRules.STRING,!0)&&e.validate("options.value",t.value,e.AssertRules.STRING,!0)&&e.validate("options.isAutoDelete",t.isAutoDelete,e.AssertRules.BOOLEAN)&&e.validate("options.isSendNotification",t.isSendNotification,e.AssertRules.BOOLEAN)&&e.validate("options.notificationExtra",t.notificationExtra,e.AssertRules.STRING))},W=function(t){return!(!e.validate("options.key",t.key,e.AssertRules.STRING,!0)||!e.validate("options.isSendNotification",t.isSendNotification,e.AssertRules.BOOLEAN)||!e.validate("options.notificationExtra",t.notificationExtra,e.AssertRules.STRING))};var X=function(e,t,n,o){void 0===n&&(n=!0),void 0===o&&(o=!0),this.messageType=e,this.content=t,this.isPersited=n,this.isCounted=o};function Q(e,t,n){void 0===t&&(t=!0),void 0===n&&(n=!0);return function(o){return new X(e,o,t,n)}}var $,ee,te=Q("RC:ImgMsg"),ne=Q("RC:HQVCMsg"),oe=Q("RC:SightMsg"),re=Q("RC:TxtMsg"),ae=Q("RC:CombineMsg"),se=Q("RC:FileMsg"),ie=Q("RC:GIFMsg"),ce=Q("RC:VcMsg"),de=Q("RC:LBSMsg"),ue=Q("RC:ReferenceMsg"),le=Q("RC:ImgTextMsg"),ge={qiniu:function(t,n,o,r){k((function(a){var s=a.getInfoFromCache();if(1===(null==s?void 0:s.type)&&n.chunk_size&&r.size>n.chunk_size){var i=e.getUUID();i+=r.name.substr(r.name.lastIndexOf(".")),r.uniqueName=i,Te(r,n,o)}else Ee(t,n,o,r)}))},baidu:function(e,t,n,o){if(o.size>fe)throw new Error("the file size is over 5GB!");var r=t||{};t=t||ee;var a=new XMLHttpRequest,s=Ie();if(!r.uploadHost.bos&&!r.bosUploadPath)return;var i=s+ve[0][1]+r.bosUploadPath;ve.shift();var c=r.bosHeader||{},d={filename:t.uniqueValue||o.uniqueName,name:o.name,downloadUrl:i,isBosRes:!0};a.upload&&t.support_options&&(a.upload.onprogress=function(e){n.onProgress(e.loaded,e.total,!0)});a.onreadystatechange=function(){if(4===a.readyState)if(JSON.parse(a.responseText||"{}").filename=t.uniqueValue,200===a.status){n.onCompleted(d,!0)}else ve.length?ge[ve[0][0]](e,t,n,o):n.onError("upload fail")},a.open(t.method,i,!0),a.setRequestHeader("authorization",c.bosToken),a.setRequestHeader("x-bce-date",c.bosDate),a.send(o)},aliyun:function(t,n,o,r){if(r.size>fe)throw new Error("the file size is over 5GB!");var a=new FormData;a.set("file",t.get("file")),a.set("key",t.get("key")),a.set("token",t.get("token"));var s=ve[0][1];ve.shift(),t=t||$,n=(n=n||{})||ee;var i=new XMLHttpRequest,c=Ie(),d="".concat(c+n.ossBucketName,".").concat(s);i.upload&&n.support_options&&(i.upload.onprogress=function(e){o.onProgress(e.loaded,e.total)});i.onreadystatechange=function(){if(4===i.readyState){var t=JSON.parse(i.responseText||"{}");t.name=n.uniqueValue,t.filename=n.uploadFileName,t.uploadMethod=e.UploadMethod?e.UploadMethod.ALI:"",200===i.status?o.onCompleted(t):ve.length?ge[ve[0][0]](a,n,o,r):o.onError("upload fail")}},i.open(n.method,d,!0),console.log("ali:url",d);var u=n.aliHeader||{};t.set("OSSAccessKeyId",u.osskeyId),t.set("policy",u.ossPolicy),t.set("Signature",u.ossSign),t.set("success_action_status",200),t.delete("key"),t.append("key",n.uploadFileName),t.delete("file"),t.append("file",r),i.send(t)},s3:function(t,n,o,r){var a=new FormData,s=new XMLHttpRequest,i=Ie(),c=n.contentDisposition,d=ve[0][1],u="".concat(i+n.s3BucketName,".").concat(d);console.log("uploadS3:url",u),ve.shift(),s.upload&&n.support_options&&(s.upload.onprogress=function(e){o.onProgress(e.loaded,e.total)});s.onreadystatechange=function(){if(4===s.readyState){var a=JSON.parse(s.responseText||"{}");if(a.name=n.uniqueValue,a.filename=n.uploadFileName,a.uploadMethod=e.UploadMethod.AWS,200===s.status||204===s.status)o.onCompleted(a);else if(ve.length){var i=new FormData;i.set("file",t.get("file")),i.set("key",t.get("key")),i.set("token",t.get("token")),ge[ve[0][0]](i,n,o,r)}else o.onError("upload fail")}},s.open(n.method,u,!0);var l=n?n.s3Header:{},g=r&&r.type;c?a.set("Content-Disposition","".concat(c,";")):a.set("Content-Disposition","text/html"===g?"inline;":"attachment;");a.set("Content-Type",g),a.set("x-amz-credential",l.s3Credential),a.set("x-amz-algorithm",l.s3Algorithm),a.set("x-amz-date",l.s3Date),a.set("policy",l.s3Policy),a.set("x-amz-signature",l.s3Signature),a.set("key",n.uploadFileName),a.set("file",r),s.send(a)},stc:function(t,n,o,r){var a=new XMLHttpRequest,s=n.contentDisposition,i=ve[0][1],c="https://".concat(i,"/").concat(n.stcBucketName,"/").concat(n.uploadFileName);ve.shift(),a.upload&&n.support_options&&(a.upload.onprogress=function(e){o.onProgress(e.loaded,e.total)});a.onreadystatechange=function(){if(4===a.readyState){var s=JSON.parse(a.responseText||"{}");if(s.name=n.uniqueValue,s.filename=n.uploadFileName,s.uploadMethod=e.UploadMethod?e.UploadMethod.STC:"",200===a.status||204===a.status)o.onCompleted(s);else if(ve.length){var i=new FormData;i.set("file",t.get("file")),i.set("key",t.get("key")),i.set("token",t.get("token")),ge[ve[0][0]](i,n,o,r)}else o.onError("upload fail")}},a.open("PUT",c,!0);var d=n?n.stcHeader:{};a.setRequestHeader("Content-Type",r.type),s?a.setRequestHeader("Content-Disposition","".concat(s,";")):a.setRequestHeader("Content-Disposition","text/html"===r.type?"inline;":"attachment;");a.setRequestHeader("Authorization",d.stcAuthorization),a.setRequestHeader("x-amz-content-sha256",d.stcContentSha256),a.setRequestHeader("x-amz-date",d.stcDate),a.send(r)}},ve=[],fe=5368709120;function Ie(){var e="https://";return"http:"!==location.protocol&&"file:"!==location.protocol||(e="http://"),e}var pe,Re=(pe="RC-upload-",{get:function(e){e=pe+e;var t=localStorage.getItem(e);if(t)return null!==(t=JSON.parse(t||"{}"))&&t.type&&t.data?t.data:null},set:function(e,t){var n=localStorage;e=pe+e,t={data:t,type:typeof t,updateTime:Date.now()},n.setItem(e,JSON.stringify(t))},remove:function(e){e=pe+e,localStorage.removeItem(e)}});function Ee(t,n,o,r){var a="https://"+n.uploadHost.qiniu,s=(/http/.test(ve[0][1])?"":Ie())+ve[0][1]||a;n.isChunk||ve.shift();var i=new XMLHttpRequest;i.upload&&n.support_options&&(i.upload.onprogress=function(e){o.onProgress(e.loaded,e.total)}),i.onreadystatechange=function(){if(4===i.readyState){var a=JSON.parse(i.responseText||"{}");a.filename=n.uniqueValue,a.uploadMethod=e.UploadMethod?e.UploadMethod.QINIU:"",200===i.status||204===i.status?o.onCompleted(a):ve.length?ge[ve[0][0]](t,n,o,r):o.onError("upload fail")}},i.open(n.method,s,!0),o.onOpen(i),n.stream&&i.setRequestHeader("authorization","UpToken ".concat(n.multi_parmas.token)),function(e,t){for(var n in e)t(n,e[n])}(n.headers,(function(e,t){i.setRequestHeader(e,t)})),i.send(t)}function Te(t,n,o,r){var a=0,s=r||e.getUUID(),i=Re.get(s);i&&(t.uniqueName=i.sessionId,a=i.offset);var c=Math.min(n.chunk_size,t.size-a),d=t.slice(a,a+c),u=t.uniqueName;n.multi_parmas.name=u,n.filesize=t.size;var l="bytes=".concat(a,"-").concat(a+c);n.headers={Range:l,"X-File-TransactionId":u,"X-File-Total-Size":t.size},n.isChunk=!0,d.name=t.name,d=function(e,t,n){var o=new FormData;for(var r in t.unique_key&&o.append(t.unique_key,n),o.append(t.file_data_name,e,e.name),t.multi_parmas){var a=t.multi_parmas[r];o.append(r,a)}return o}(d,n,t.uniqueName),Ee(d,n,{onCompleted:function(e){a+=c;var r=t.uniqueName;Re.set(s,{offset:a,sessionId:r}),a<t.size?Te(t,n,o,s):(a=0,Re.remove(s),o.onCompleted(e))},onError:function(e){console.error(e),o.onError(e)},onProgress:function(e,t){var r=e+a;o.onProgress(r,n.filesize)},onOpen:function(e){o.onOpen(e)}},t)}function he(t,n,o,r){var a,s,i=n&&n.type||"text/plain",c=i.indexOf("image")>-1?1:4,d=o.contentDisposition,u=Math.ceil(n.size/o.stc_chunk_size),l=o&&JSON.parse(o.ossConfig?o.ossConfig:"");Array.isArray(l)||(l=[]);var g=l.find((function(e){return Object.keys(e).includes("stc")})),v="uploads";t.getFileToken(c,a,"POST",v).then((function(e){a=e.fileName,s="https://".concat(g.stc,"/").concat(o.stcBucketName,"/").concat(a),console.log("uploadStcMultipart:url",s);var t=new XMLHttpRequest;t.open("POST","".concat(s,"?").concat(v),!0),d?t.setRequestHeader("Content-Disposition","".concat(d,";")):t.setRequestHeader("Content-Disposition","text/html"===n.type?"inline;":"attachment;"),t.setRequestHeader("Authorization",e&&e.stcAuthorization),t.setRequestHeader("x-amz-content-sha256",e&&e.stcContentSha256),t.setRequestHeader("x-amz-date",e&&e.stcDate),t.setRequestHeader("Content-Type",i),t.send(),t.onreadystatechange=function(){if(4===t.readyState){var e=t.response.match(/(?:<UploadId>)(\S*?)(?:<\/UploadId>)/);console.log("uploadId",e),200===t.status||204===t.status?function(e){for(var t=[],n=1;n<=u;n++)t.push(R(e,n));p(e,t)}(Array.isArray(e)&&e[1]):r.onError("uploadStcMultipart:did not get uploadId")}}}),(function(e){r.onError("uploadStcMultipart:".concat(e))}));var f=[],I=new Map;function p(d,l){l&&Array.isArray(l)&&0!==l.length&&Promise.all(l).then((function(){var l="uploadId=".concat(d);if(I.size===u)t.getFileToken(c,a,"POST",l).then((function(t){console.log("onSuccess",t),console.log("onSuccess:uploadId",d);var a=new XMLHttpRequest;a.open("POST","".concat(s,"?").concat(l),!0),a.setRequestHeader("Authorization",t&&t.stcAuthorization),a.setRequestHeader("x-amz-content-sha256",t&&t.stcContentSha256),a.setRequestHeader("x-amz-date",t&&t.stcDate),a.setRequestHeader("Content-Type",i);var c="<CompleteMultipartUpload xmlns='http://s3.amazonaws.com/doc/2006-03-01/'>",u=Array.from(I.keys()||[]).sort((function(e,t){return e-t}));console.log("keys",u),u.forEach((function(e){c+="<Part><ETag>".concat(I.get(e),"</ETag><PartNumber>").concat(e,"</PartNumber></Part>")})),c+="</CompleteMultipartUpload>",a.send(c),console.log("xml",c),a.onreadystatechange=function(){if(4===a.readyState)if(200===a.status||204===a.status){var t={name:n.name,filename:o.uploadFileName,uploadMethod:e.UploadMethod.STC};r.onCompleted(t)}else r.onError("uploadStcMultipart:upload does not end")}}),(function(e){r.onError("uploadStcMultipart:".concat(e))}));else{for(var g=[],v=0,E=f;v<E.length;v++){var T=E[v];g.push(R(d,T))}p(d,g)}}),(function(e){console.error(e),r.onError("uploadStcMultipart: chunkFiles upload failed and those will reupload");for(var t=[],n=0,o=f;n<o.length;n++){var a=o[n];t.push(R(d,a))}p(d,t)}))}function R(e,r){return new Promise((function(d,u){var l="partNumber=".concat(r,"&uploadId=").concat(e);t.getFileToken(c,a,"PUT",l).then((function(e){console.log("signature ".concat(r," onSuccess"),e);var t=n&&n.slice((r-1)*o.stc_chunk_size,r*o.stc_chunk_size);console.log("fileChunk:size",t.size);var a=new XMLHttpRequest;a.open("PUT","".concat(s,"?").concat(l),!0),a.setRequestHeader("Authorization",e&&e.stcAuthorization),a.setRequestHeader("x-amz-content-sha256",e&&e.stcContentSha256),a.setRequestHeader("x-amz-date",e&&e.stcDate),a.setRequestHeader("Content-Type",i),a.send(t),a.onreadystatechange=function(){if(4===a.readyState)if(200===a.status||204===a.status){var e=a.getResponseHeader("etag");console.log("etag:".concat(r),e),I.set(r,e),d(e)}else f.includes(r)||f.push(r),u(r)}}),(function(e){console.log("getETags:签名验证失败"),f.includes(r)||f.push(r),u(r)}))}))}}var Ce={form:function(e,t){var n=new FormData;if(t.unique_key){var o=e.name.substr(e.name.lastIndexOf(".")),r=me()+o;n.append(t.unique_key,r),t.uniqueValue=r}return n.append(t.file_data_name,e),Se(t.multi_parmas,(function(e,t){n.append(e,t)})),n},json:function(e,t){var n={};if(t.unique_key){var o=e.name.substr(e.name.lastIndexOf(".")),r=me()+o;n[t.unique_key]=r,t.uniqueValue=r}return n[t.file_data_name]=e,Se(t.multi_parmas,(function(e,t){n[e]=t})),JSON.stringify(n)},data:function(e,t){return e}};function me(){var e=(new Date).getTime();return"xxxxxx4xxxyxxxxxxx".replace(/[xy]/g,(function(t){var n=(e+16*Math.random())%16|0;return e=Math.floor(e/16),("x"===t?n:3&n|8).toString(16)}))}function Se(e,t){for(var n in e)t(n,e[n])}var Ae,Oe=0,Ne=function(){function e(e){this.options=function(e){var t={domain:"",method:"POST",file_data_name:"file",unique_key:"key",base64_size:4194304,chunk_size:4194304,bos_chunk_size:4294967296,stc_chunk_size:10485760,headers:{},multi_parmas:{},query:{},support_options:!0,data:Ce.form,genUId:me};if(!e||!e.domain)throw new Error("domain is null");for(var n in e)t[n]=e[n];return t}(e)}return e.prototype.setOptions=function(e){var t=this;Se(e,(function(e,n){t.options[e]=n}))},e.prototype.upload=function(e,t,n,o){if(n){var r=this;!function(e,t,n,o,r){$=n,ee=o,ve=[];var a,s=e.getInfoFromCache();if(1===(null==s?void 0:s.type)&&t.uploadDomain)ve=[["qiniu",t.uploadDomain]];else if(o.ossConfig){var i,c,d=JSON.parse(o.ossConfig),u="",l=[];d.forEach((function(e){var t=Number(e.p)-1;for(var n in e)"aliyun"===n&&(u=e[n]),"s3"===n&&(i=e[n]),"stc"===n&&(c=e[n]),"p"!==n&&(l[t]=[n,e[n]])})),l.forEach((function(e){e&&ve.push(e)})),d.length!==ve.length&&(ve=[["qiniu",o.domain],["baidu",o.uploadHost.bos],["aliyun",u],["s3",i],["stc",c]])}else ve=[["qiniu",o.domain],["baidu",o.uploadHost.bos]];if(o.ossConfig){var g=o&&JSON.parse(o.ossConfig);Array.isArray(g)||(g=[]),a=g.find((function(e){return Object.keys(e).includes("stc")}))}if(a&&1===parseInt(a.p,10)&&n.size>=4194304)he(e,n,o,r);else{var v=o.data(n,o);ge[ve[0][0]](v,o,r,n)}}(e,t,n,this.options,{onProgress:function(e,t,n){(Ae=e,n)?Ae=Oe+e/t*(t-Oe):Oe=Ae;o.onProgress(Ae,t)},onCompleted:function(e){o.onCompleted(e)},onError:function(e){o.onError(e)},onOpen:function(e){r.xhr=e}})}else o.onError("upload file is null.")},e.prototype.cancel=function(){var e;null===(e=this.xhr)||void 0===e||e.abort()},e}();var _e,ye,Me={init:function(e){return new Ne(e)},dataType:Ce,resize:function(e,t,n){e.type;var o=document.createElement("canvas"),r=new FileReader;r.readAsDataURL(e),r.onload=function(e){var r=e.target.result,a=new Image;a.src=r;var s=a.width,i=a.height,c=function(e,t){var n=1,o=e.width,r=t.maxWidth||0;r>0&&o>r&&(n=r/o);var a=e.height,s=t.maxHeight||0;if(s>0&&a>s){var i=s/a;n=Math.min(n,i)}var c=t.maxSize||0,d=Math.ceil(e.size/1e3);if(d>c){var u=c/d;n=Math.min(n,u)}return n}({width:s,height:i,size:e.total},t),d=r;c<1&&(d=function(e,t,n){return o.width=t,o.height=n,o.getContext("2d").drawImage(e,0,0,t,n),o.toDataURL("image/jpg")}(a,s*c,i*c)),n(d)}},Upload:Ne},Le=function(e,t,n){var o=document.createElement("canvas"),r=o.getContext("2d"),a=new Image,s="string"==typeof e;a.onload=function(s){var i=function(e,t,n){var o,r,a,s=e<t,i=0,c=0;return(s?t/e:e/t)>n.scale?(s?(r=100,c=((a=t/(o=e/100))-n.maxHeight)/2):(a=100,i=((r=e/(o=t/100))-n.maxWidth)/2),{w:r,h:a,x:-i,y:-c}):(s?(o=t/n.maxHeight,a=n.maxHeight,r=e/o):(o=e/n.maxWidth,r=n.maxWidth,a=t/o),{w:r,h:a,x:-i,y:-c})}(a.width,a.height,t);o.width=i.w>t.maxWidth?t.maxWidth:i.w,o.height=i.h>t.maxHeight?t.maxHeight:i.h,r.drawImage(a,i.x,i.y,i.w,i.h);var c=o.toDataURL("string"==typeof e?"image/jpg":e.type,t.quality);c=c.replace(/data:image\/[^;]+;base64,/,""),n(c)},a.src=s?"data:image/jpg;base64,".concat(e):function(e){var t=window.URL||window.webkitURL;return t?t.createObjectURL(e):""}(e)},Ue=function(e,t){var n=e.file,o=e.compress;Le(n,o,t)},Pe=function(e,t){if(e.getToken)e.getToken((function(n,o){o=o||{},e.multi_parmas=e.multi_parmas||{},e.multi_parmas.token=n,e.uploadHost=e.uploadHost||{},e.uploadHost.bos=o.bos,e.ossConfig=o.ossConfig,e.bosHeader=e.bosHeader||{},e.bosHeader.bosDate=o.bosDate,e.bosHeader.bosToken=o.bosToken,e.bosUploadPath=o.path,e.aliHeader={},e.aliHeader.osskeyId=o.osskeyId,e.aliHeader.ossPolicy=o.ossPolicy,e.aliHeader.ossSign=o.ossSign,e.ossBucketName=o.ossBucketName,e.uploadFileName=o.fileName,e.s3Header={},e.s3Header.s3Credential=o.s3Credential,e.s3Header.s3Algorithm=o.s3Algorithm,e.s3Header.s3Date=o.s3Date,e.s3Header.s3Policy=o.s3Policy,e.s3Header.s3Signature=o.s3Signature,e.s3BucketName=o.s3BucketName,e.stcHeader={},e.stcHeader.stcAuthorization=o.stcAuthorization,e.stcHeader.stcContentSha256=o.stcContentSha256,e.stcHeader.stcDate=o.stcDate,e.stcBucketName=o.stcBucketName,e.headers=e.headers||{},e.base64&&(e.headers["Content-type"]="application/octet-stream",e.headers.Authorization="UpToken ".concat(n));var r=Me.init(e);t(r)}));else{e.headers=e.headers||{},e.base64&&(e.headers["Content-type"]="application/octet-stream");var n=Me.init(e);t(n)}},xe=function(e,t,n,o,r){o.upload(e,t,n.file,{onError:function(e){r.onError(e)},onProgress:function(e,t){r.onProgress(e,t)},onCompleted:function(e){e.filename=e.filename||e.hash;var t=n.compressThumbnail||Ue;n.compress?t(n,(function(t){e.thumbnail=t,r.onCompleted(e)})):r.onCompleted(e)}})},we=function(){function e(e){this.instance=e}return e.prototype.upload=function(e,t,n,o){xe(e,t,{file:n},this.instance,o)},e.prototype.cancel=function(){this.instance.cancel()},e}(),be=function(){function e(e,t){this.instance=e,this.cfg=t}return e.prototype.upload=function(e,t,n,o){var r={file:n,compress:this.cfg};xe(e,t,r,this.instance,o)},e.prototype.cancel=function(){this.instance.cancel()},e}(),De=function(e,t){Pe(e,(function(e){var n=new we(e);t(n)}))},Be=function(e,t){Pe(e,(function(n){var o,r,a,s,i={maxHeight:(null===(o=e.thumbnailConfig)||void 0===o?void 0:o.maxHeight)||160,maxWidth:(null===(r=e.thumbnailConfig)||void 0===r?void 0:r.maxWidth)||160,quality:(null===(a=e.thumbnailConfig)||void 0===a?void 0:a.quality)||.5,scale:(null===(s=e.thumbnailConfig)||void 0===s?void 0:s.scale)||2.4},c=new be(n,i);t(c)}))};Me.dataType;function Ge(r,a,s,i,c,d,u){var l,g=this;void 0===c&&(c=e.FileType.FILE),l=c===e.FileType.IMAGE?e.FileType.IMAGE:e.FileType.FILE;var v=r.getInfoFromCache();if(!ye&&(ye="upload.qiniup.com",v&&v.ossConfig))try{var f=JSON.parse(v.ossConfig).find((function(e){return void 0!==e.qiniu}));f&&(ye=f.qiniu)}catch(e){}var I=t({domain:ye,getToken:function(e){r.getFileToken(l).then((function(t){e(t.token,t)})).catch((function(e){d.onFail(e)}))}},u);(l===e.FileType.IMAGE?Be:De)(I,(function(a){a.upload(r,s,i,{onProgress:function(e,t){var n,o=Math.floor(e/t*100);null===(n=d.onProgress)||void 0===n||n.call(d,o)},onCompleted:function(r){return n(g,void 0,void 0,(function(){return o(this,(function(n){return 1===(null==v?void 0:v.type)?function(n,o,r,a,s,i){var c={type:a.type,name:s.rc_url.file_name,downloadUrl:n.uploadDomain+s.rc_url.path};if(o===e.FileType.AUDIO)return void ke(a).then((function(e){i.onSuccess(t(t({},c),e))}));o===e.FileType.IMAGE&&(c.thumbnail=s.thumbnail);i.onSuccess(c)}(s,c,0,i,r,d):function(n,o,r,a,s){Ve(o,a.filename,a.name,a,a.uploadMethod).then((function(i){if(0===i.code){var c=i.data;c.type=r.type,c.name=a.name||a.filename,n!==e.FileType.AUDIO?(o===e.FileType.IMAGE&&(c.thumbnail=a.thumbnail),s.onSuccess(c)):ke(r).then((function(e){s.onSuccess(t(t({},c),e))}))}else s.onFail(i)})).catch((function(e){s.onFail(e)}))}(c,l,i,r,d),[2]}))}))},onError:function(e){d.onFail(e)}})}))}function ke(e){return new Promise((function(t){if("function"!=typeof e.arrayBuffer){var n=new FileReader;n.onload=function(){n.result?He(n.result).then((function(e){t(e)}),(function(){t({})})):t({})},n.onerror=function(){t({duration:0})},n.readAsArrayBuffer(e)}else e.arrayBuffer().then(He).then((function(e){t(e)}))}))}function He(e){return _e=_e||new AudioContext,new Promise((function(t,n){_e.decodeAudioData(e,(function(e){t({duration:e.duration,length:e.length})}),n)}))}function Ve(t,n,o,r,a){return e.validate("fileType",t,e.isValidFileType,!0)&&e.validate("filename",n,e.AssertRules.STRING)&&e.validate("saveName",o,e.AssertRules.STRING)&&e.validate("serverType",a,e.AssertRules.NUMBER)?H((function(s){return new Promise((function(i){s.getFileUrl(t,n,o,r,a).then((function(t){i({code:e.ErrorCode.SUCCESS,data:t})})).catch((function(e){i({code:e})}))}))})):Promise.resolve({code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER})}function Fe(r,a,s){return n(this,void 0,void 0,(function(){var i=this;return o(this,(function(c){return[2,H((function(c,d){return n(i,void 0,void 0,(function(){var n,i,u,l,g,v,f,I,p,R,E,T,h;return o(this,(function(o){switch(o.label){case 0:return s=s||{},a instanceof X==!1?(d.warn(e.LogTagId.O,"send message fail -> message parameter is not an instance of BaseMessage"),[2,F.ILLGAL_PARAMS]):e.validate("conversation",r,e.AssertRules.OBJECT,!0)?(n=r.conversationType,i=r.targetId,u=r.channelId,e.validate("conversation.targetId",i,e.AssertRules.STRING,!0)&&e.validate("conversation.conversationType",n,e.AssertRules.NUMBER)&&e.validate("conversation.channelId",u,e.AssertRules.CHANNEL_ID)&&e.validate("options.isStatusMessage",null==s?void 0:s.isStatusMessage,e.AssertRules.BOOLEAN)&&e.validate("options.disableNotification",null==s?void 0:s.disableNotification,e.AssertRules.BOOLEAN)&&e.validate("options.pushContent",null==s?void 0:s.pushContent,e.AssertRules.STRING)&&e.validate("options.pushData",null==s?void 0:s.pushData,e.AssertRules.STRING)&&e.validate("options.isMentioned",null==s?void 0:s.isMentioned,e.AssertRules.BOOLEAN)&&e.validate("options.mentionedType",null==s?void 0:s.mentionedType,e.AssertRules.NUMBER)&&e.validate("options.mentionedUserIdList",null==s?void 0:s.mentionedUserIdList,e.AssertRules.ARRAY)&&e.validate("options.directionalUserIdList",null==s?void 0:s.directionalUserIdList,e.AssertRules.ARRAY)&&e.validate("options.isVoipPush",null==s?void 0:s.isVoipPush,e.AssertRules.BOOLEAN)&&e.validate("options.canIncludeExpansion",null==s?void 0:s.canIncludeExpansion,e.AssertRules.BOOLEAN)&&e.validate("options.expansion",null==s?void 0:s.expansion,e.AssertRules.OBJECT)&&e.validate("options.pushConfig",null==s?void 0:s.pushConfig,e.AssertRules.OBJECT)&&e.validate("options.messageId",null==s?void 0:s.messageId,e.AssertRules.NUMBER)?(l="conversationType:".concat(n,",targetId:").concat(i),d.debug(e.LogTagId.O,"send message ->".concat(l)),g=function(e,n,o){var r=e.isStatusMessage,a=e.disableNotification,s=e.pushContent,i=e.pushData,c=e.isMentioned,d=e.mentionedType,u=e.mentionedUserIdList,l=e.directionalUserIdList,g=e.isVoipPush,v=e.canIncludeExpansion,f=e.expansion,I=e.isFilerWhiteBlacklist,p=e.pushConfig,R=e.messageId,E=o.channelId;return t({isStatusMessage:r,disableNotification:a,pushContent:s,pushData:i,isMentioned:c,mentionedType:d,mentionedUserIdList:u,directionalUserIdList:l,isVoipPush:g,canIncludeExpansion:v,expansion:f,isFilerWhiteBlacklist:I,pushConfig:p,channelId:E||"",messageId:R},n)}(s,a,r),v={isMentioned:!!s.isMentioned,content:a.content,messageType:a.messageType,isPersited:a.isPersited||!1,isCounted:a.isCounted||!1,disableNotification:!!(null==s?void 0:s.disableNotification),canIncludeExpansion:!!(null==s?void 0:s.canIncludeExpansion),expansion:(null==s?void 0:s.expansion)||null,conversationType:r.conversationType,targetId:r.targetId,channelId:r.channelId,senderUserId:c.getCurrentUserId(),messageUId:"",messageDirection:e.MessageDirection.SEND,receivedTime:0,isStatusMessage:s.isStatusMessage||!1,receivedStatus:e.ReceivedStatus.UNREAD,isOffLineMessage:!1,pushConfig:null==s?void 0:s.pushConfig},n!==e.ConversationType.ULTRA_GROUP&&(v.isOffLineMessage=!1),f=d.createTraceId(),I=function(t){v.messageId=t;try{(null==s?void 0:s.onSendBefore)&&s.onSendBefore(L(v))}catch(t){d.error(e.LogTagId.O,'Callback method "onSendBefore" execution error.\n'.concat(null==t?void 0:t.stack),f)}},d.info(e.LogTagId.A_SEND_MSG_T,JSON.stringify({messageType:a.messageType,conversationType:n,targetId:i,channelId:u}),f),[4,c.sendMessage(n,i,g,I,f)]):[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]):[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}];case 1:return p=o.sent(),R=p.code,E=p.data,T=R===e.ErrorCode.SUCCESS?"info":"warn",d[T](e.LogTagId.A_SEND_MSG_R,JSON.stringify({code:R,messageUId:E?E.messageUId:"",messageId:E?E.messageId:""}),f),R===e.ErrorCode.SUCCESS?(h=L(E),[2,{code:R,data:h}]):(d.warn(e.LogTagId.O,"send message fail ->".concat(R,":").concat(q[R],",").concat(l)),v.sentTime=(null==E?void 0:E.sentTime)||0,[2,{code:R,msg:q[R],data:L(v)}])}}))}))}))]}))}))}function qe(t,n){return function(o,r,a,s){if(!e.validate("sendOptions.contentDisposition",null==s?void 0:s.contentDisposition,(function(e){return["inline","attachment"].includes(e)})))return Promise.resolve({code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER});var i={contentDisposition:null==s?void 0:s.contentDisposition};if(s&&"thumbnailConfig"in s){var c=null==s?void 0:s.thumbnailConfig;if(!(e.validate("sendOptions.maxHeight",null==c?void 0:c.maxHeight,e.AssertRules.NUMBER)&&e.validate("sendOptions.maxWidth",null==c?void 0:c.maxWidth,e.AssertRules.NUMBER)&&e.validate("sendOptions.quality",null==c?void 0:c.quality,e.AssertRules.NUMBER)&&e.validate("sendOptions.scale",null==c?void 0:c.scale,e.AssertRules.NUMBER)))return Promise.resolve({code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER});i.thumbnailConfig=c}return H((function(c,d,u){return new Promise((function(l){var g=d.createTraceId();d.info(e.LogTagId.L_MEDIA_UPLOAD_T,JSON.stringify({filesize:r.file.size,type:t}),g),Ge(c,0,u,r.file,t,{onProgress:null==a?void 0:a.onProgress,onSuccess:function(t){var i,c=(null===(i=null==a?void 0:a.onComplete)||void 0===i?void 0:i.call(a,{url:t.downloadUrl}))||n(t,r);t&&t.downloadUrl&&d.info(e.LogTagId.L_MEDIA_UPLOAD_R,JSON.stringify({downurl:t.downloadUrl,code:e.ErrorCode.SUCCESS}),g),Fe(o,c,s).then(l)},onFail:function(t){d.warn(e.LogTagId.L_MEDIA_UPLOAD_R,JSON.stringify({code:e.ErrorCode.UPLOAD_FILE_FAILED}),g),l({code:e.ErrorCode.UPLOAD_FILE_FAILED,msg:t||e.ErrorCode[e.ErrorCode.UPLOAD_FILE_FAILED]})}},i)}))}))}}var Ze=qe(e.FileType.FILE,(function(e,t){return new se({name:e.name,size:t.file.size,type:t.file.type,fileUrl:e.downloadUrl,user:t.user,extra:t.extra})})),Je=qe(e.FileType.IMAGE,(function(e,t){return new te({content:e.thumbnail,imageUri:e.downloadUrl,user:t.user,extra:t.extra})})),ze=qe(e.FileType.AUDIO,(function(e,t){return new ne({remoteUrl:e.downloadUrl,duration:e.duration,type:e.type,user:t.user,extra:t.extra})})),Ke=qe(e.FileType.SIGHT,(function(e,t){return new oe({sightUrl:e.downloadUrl,content:t.thumbnail,duration:t.duration,size:t.file.size||e.size,name:t.name||e.name,user:t.user,extra:t.extra})}));qe(e.FileType.COMBINE_HTML,(function(e,t){return new ae({remoteUrl:e.downloadUrl,nameList:t.nameList,summaryList:t.summaryList,conversationType:t.conversationType,user:t.user,extra:t.extra})}));var Ye=Object.freeze({__proto__:null,getAllConversationList:function(t){return n(this,void 0,void 0,(function(){var r=this;return o(this,(function(a){return e.usingCppEngine()?e.validate("channelId",t,e.AssertRules.ONLY_STRING)?[2,H((function(a,s){return n(r,void 0,void 0,(function(){var n,r,i,c;return o(this,(function(o){switch(o.label){case 0:return s.info(e.LogTagId.O,"getAllConversationList -> channelId: ".concat(t)),e.isUndefined(t)?[4,a.getConversationListWithAllChannel()]:[3,2];case 1:return n=o.sent(),[3,4];case 2:return[4,a.getConversationList(void 0,void 0,void 0,void 0,t)];case 3:n=o.sent(),o.label=4;case 4:return r=n.code,i=n.data,r===e.ErrorCode.SUCCESS&&i?(c=i.map((function(e){return U(e)})),[2,{code:r,data:c}]):(s.warn(e.LogTagId.O,"getAllConversationList fail -> code: ".concat(r," channelId: ").concat(t)),[2,{code:r,msg:q[r]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:q[e.ErrorCode.NOT_SUPPORT]}]}))}))},getConversationList:function(t,r,a){return n(this,void 0,void 0,(function(){var s=this;return o(this,(function(i){return e.usingCppEngine()?e.validate("startTime",t,e.AssertRules.NUMBER,!0)&&e.validate("count",r,e.AssertRules.NUMBER,!0)&&e.validate("channelId",a,e.AssertRules.ONLY_STRING)?[2,H((function(i,c){return n(s,void 0,void 0,(function(){var n,s,d,u,l,g;return o(this,(function(o){switch(o.label){case 0:return n="startTime: ".concat(t,", count: ").concat(r,", channelId: ").concat(a),c.info(e.LogTagId.O,"getConversationList -> ".concat(n)),e.isUndefined(a)?[4,i.getConversationListWithAllChannelByPage(t,r)]:[3,2];case 1:return s=o.sent(),[3,4];case 2:return d=[1,2,3,5,6,7,8],[4,i.getConversationsByPage(d,t,r,a)];case 3:s=o.sent(),o.label=4;case 4:return u=s.code,l=s.data,u===e.ErrorCode.SUCCESS&&l?(g=l.map((function(e){return U(e)})),[2,{code:u,data:g}]):(c.warn(e.LogTagId.O,"getConversationList fail -> code: ".concat(u," ").concat(n)),[2,{code:u,msg:q[u]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:q[e.ErrorCode.NOT_SUPPORT]}]}))}))},searchConversationByContent:function t(r,a,s){return n(this,void 0,void 0,(function(){var i=this;return o(this,(function(c){return e.usingCppEngine()?e.validate("keyword",r,e.AssertRules.STRING,!0)&&e.validate("messageTypes",a,e.AssertRules.ARRAY,!0)&&e.validate("channelId",s,e.AssertRules.ONLY_STRING)&&!a.every((function(t){return!e.validate("messageType",t,e.AssertRules.STRING,!0)}))?[2,H((function(c,d){return n(i,void 0,void 0,(function(){var n,i,u,l,g;return o(this,(function(o){switch(o.label){case 0:return n="keyword: ".concat(r,", messageTypes: ").concat(JSON.stringify(a),", channelId: ").concat(s),d.info(e.LogTagId.O,"searchConversationByContent -> ".concat(t)),e.isUndefined(s)?[4,c.searchConversationByContentWithAllChannel(r,a)]:[3,2];case 1:return i=o.sent(),[3,4];case 2:return[4,c.searchConversationByContent(r,a,s)];case 3:i=o.sent(),o.label=4;case 4:return u=i.code,l=i.data,u===e.ErrorCode.SUCCESS&&l?(g=l.map((function(e){return U(e)})),[2,{code:u,data:g}]):(d.warn(e.LogTagId.O,"searchConversationByContent fail -> code: ".concat(u," ").concat(n)),[2,{code:u,msg:q[u]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:q[e.ErrorCode.NOT_SUPPORT]}]}))}))},searchMessages:function(t,r,a,s){return n(this,void 0,void 0,(function(){var i=this;return o(this,(function(c){return e.usingCppEngine()?e.validate("conversation",t,e.AssertRules.CONVERSATION,!0)&&e.validate("keyword",r,e.AssertRules.STRING,!0)&&e.validate("startTime",a,e.AssertRules.NUMBER,!0)&&e.validate("count",s,e.AssertRules.NUMBER,!0)?[2,H((function(c,d){return n(i,void 0,void 0,(function(){var n,i,u,l,g,v,f,I,p,R;return o(this,(function(o){switch(o.label){case 0:return n="conversation: ".concat(JSON.stringify(t),", keyword: ").concat(r,", timestamp: ").concat(a,", count: ").concat(s),d.info(e.LogTagId.O,"searchMessages -> ".concat(n)),i=t.targetId,u=t.conversationType,l=t.channelId,e.isUndefined(l)?[4,c.searchMessageByContentWithAllChannel(u,i,r,a,s)]:[3,2];case 1:return g=o.sent(),[3,4];case 2:return 0,[4,c.searchMessageByContent(u,i,r,a,s,0,l)];case 3:g=o.sent(),o.label=4;case 4:return v=g.code,f=g.data,v===e.ErrorCode.SUCCESS&&f?(I=f.messages,p=f.count,R=I.map((function(e){return L(e)})),[2,{code:v,data:{messages:R,count:p}}]):(d.warn(e.LogTagId.O,"searchMessages fail -> code: ".concat(v," ").concat(n)),[2,{code:v,msg:q[v]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:q[e.ErrorCode.NOT_SUPPORT]}]}))}))},searchMessageInTimeRange:function(t,r){return n(this,void 0,void 0,(function(){var a=this;return o(this,(function(s){return e.usingCppEngine()?e.validate("conversation",t,e.AssertRules.CONVERSATION,!0)&&e.validate("option",r,e.AssertRules.OBJECT,!0)&&e.validate("option.keyword",r.keyword,e.AssertRules.STRING,!0)&&e.validate("option.startTime",r.startTime,e.AssertRules.NUMBER,!0)&&e.validate("option.endTime",r.endTime,e.AssertRules.NUMBER,!0)&&e.validate("option.offset",r.offset,e.AssertRules.NUMBER)&&e.validate("option.limit",r.limit,e.AssertRules.NUMBER)?[2,H((function(s,i){return n(a,void 0,void 0,(function(){var n,a,c,d,u,l,g,v,f,I,p;return o(this,(function(o){switch(o.label){case 0:return n="conversation: ".concat(JSON.stringify(t),", option: ").concat(JSON.stringify(r)),i.info(e.LogTagId.O,"searchMessageInTimeRange -> ".concat(n)),a=t.conversationType,c=t.targetId,d=r.keyword,u=r.startTime,l=r.endTime,g=r.offset,v=r.limit,g=g||0,v=v||5,[4,s.searchMessageByContentInTimeRangeWithAllChannel(a,c,d,u,l,g,v)];case 1:return f=o.sent(),I=f.code,p=f.data,I===e.ErrorCode.SUCCESS&&p?[2,{code:I,data:{messages:p.messages.map((function(e){return L(e)}))}}]:(i.warn(e.LogTagId.O,"searchMessageInTimeRange fail -> code: ".concat(I,", ").concat(n)),[2,{code:I}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:q[e.ErrorCode.NOT_SUPPORT]}]}))}))},getHistoryMessagesByMessageTypes:function(t,r){return n(this,void 0,void 0,(function(){var a=this;return o(this,(function(s){return e.usingCppEngine()?e.validate("conversation",t,e.AssertRules.CONVERSATION,!0)&&e.validate("option",r,e.AssertRules.OBJECT,!0)&&e.validate("option.count",r.count,e.AssertRules.NUMBER)&&e.validate("option.timestamp",r.timestamp,e.AssertRules.NUMBER)&&e.validate("option.order",r.order,(function(e){return[0,1].includes(e)}))&&e.validate("option.messageTypes",r.messageTypes,e.AssertRules.ARRAY,!0)&&!r.messageTypes.every((function(t){return!e.validate("option.messageType",t,e.AssertRules.STRING,!0)}))?[2,H((function(s,i){return n(a,void 0,void 0,(function(){var n,a,c,d,u,l,g,v,f,I,p,R,E,T,h;return o(this,(function(o){switch(o.label){case 0:return n=r.count,a=r.timestamp,c=r.order,d=r.messageTypes,u="conversation: ".concat(JSON.stringify(t),", option: ").concat(JSON.stringify(r)),i.info(e.LogTagId.O,"getHistoryMessagesByMessageTypes -> ".concat(u)),l=t.conversationType,g=t.targetId,v=t.channelId,n||(n=20),a||(a=0),c||(c=0),v||(v=""),[4,s.getHistoryMessagesByObjectNames(l,g,a,n,d,c,v)];case 1:return f=o.sent(),I=f.code,p=f.data,I===e.ErrorCode.SUCCESS?(E=(R=p).list,T=R.hasMore,h=E.map((function(e){return L(e)})),[2,{code:I,data:{messages:h,hasMore:T}}]):(i.warn(e.LogTagId.O,"getHistoryMessagesByMessageTypes fail -> code: ".concat(I," ").concat(u)),[2,{code:I,msg:q[I]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:q[e.ErrorCode.NOT_SUPPORT]}]}))}))},setMessageStatusToRead:function(t,r){return n(this,void 0,void 0,(function(){var a=this;return o(this,(function(s){return e.usingCppEngine()?e.validate("conversation",t,e.AssertRules.CONVERSATION,!0)&&e.validate("timestamp",r,e.AssertRules.NUMBER,!0)?[2,H((function(s,i){return n(a,void 0,void 0,(function(){var n,a,c,d;return o(this,(function(o){switch(o.label){case 0:return n="conversation: ".concat(JSON.stringify(t),", timestamp: ").concat(r),i.info(e.LogTagId.O,"updateSentMsgReceiptStatus -> ".concat(n)),a=t.conversationType,c=t.targetId,d=t.channelId,[4,s.setMessageStatusToRead(a,c,r,d)];case 1:return[2,o.sent()]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:q[e.ErrorCode.NOT_SUPPORT]}]}))}))},setMessageReceivedStatus:function(t,r){return n(this,void 0,void 0,(function(){var a=this;return o(this,(function(s){return e.usingCppEngine()?e.validate("messageId",t,e.AssertRules.NUMBER,!0)&&e.validate("receivedStatus",r,(function(t){return!e.isUndefined(e.ReceivedStatus[t])}),!0)?[2,H((function(s,i){return n(a,void 0,void 0,(function(){return o(this,(function(n){switch(n.label){case 0:return i.info(e.LogTagId.O,"setMessageReceivedStatus -> messageId: ".concat(t,", receivedStatus: ").concat(r)),[4,s.setMessageReceivedStatus(t,r)];case 1:return[2,{code:n.sent()}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:q[e.ErrorCode.NOT_SUPPORT]}]}))}))},setMessageSentStatus:function(t,r){return n(this,void 0,void 0,(function(){var a=this;return o(this,(function(s){return e.usingCppEngine()?e.validate("messageId",t,e.AssertRules.NUMBER,!0)&&e.validate("sentStatus",r,(function(t){return!e.isUndefined(exports.SentStatus[t])}),!0)?[2,H((function(s,i){return n(a,void 0,void 0,(function(){return o(this,(function(n){switch(n.label){case 0:return i.info(e.LogTagId.O,"setMessageSentStatus ->messageId: ".concat(t,", sentStatus: ").concat(r)),[4,s.setMessageSentStatus(t,r)];case 1:return[2,{code:n.sent()}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:q[e.ErrorCode.NOT_SUPPORT]}]}))}))},setMessageContent:function(t,r,a){return void 0===a&&(a=""),n(this,void 0,void 0,(function(){var s=this;return o(this,(function(i){return e.usingCppEngine()?e.validate("messageId",t,e.AssertRules.NUMBER,!0)&&e.validate("content",r,e.AssertRules.OBJECT,!0)&&e.validate("messageType",a,e.AssertRules.ONLY_STRING,!0)?[2,H((function(i,c){return n(s,void 0,void 0,(function(){return o(this,(function(n){switch(n.label){case 0:return c.info(e.LogTagId.O,"setMessageSentStatus ->messageId: ".concat(t,", messageType: ").concat(a)),[4,i.setMessageContent(t,r,a)];case 1:return[2,{code:n.sent()}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:q[e.ErrorCode.NOT_SUPPORT]}]}))}))},deleteMessages:function(t){return n(this,void 0,void 0,(function(){var r=this;return o(this,(function(a){return e.usingCppEngine()?!e.validate("messageIds",t,e.AssertRules.ARRAY,!0)||t.every((function(t){return!e.validate("messageId",t,e.AssertRules.NUMBER,!0)}))?[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,H((function(a,s){return n(r,void 0,void 0,(function(){return o(this,(function(n){switch(n.label){case 0:return s.info(e.LogTagId.O,"deleteMessages ->messageIds: ".concat(JSON.stringify(t))),[4,a.deleteMessages(t)];case 1:return[2,{code:n.sent()}]}}))}))}))]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:q[e.ErrorCode.NOT_SUPPORT]}]}))}))},clearMessages:function(t){return n(this,void 0,void 0,(function(){var r=this;return o(this,(function(a){return e.usingCppEngine()?[2,H((function(a,s){return n(r,void 0,void 0,(function(){var n,r,i,c;return o(this,(function(o){switch(o.label){case 0:return n=t.conversationType,r=t.targetId,i=t.channelId,s.info(e.LogTagId.O,"clearMessages ->targetId:".concat(r,",conversationType:").concat(n)),[4,a.clearMessages(n,r,i)];case 1:return(c=o.sent())===e.ErrorCode.SUCCESS?[2,{code:c}]:(s.warn(e.LogTagId.O,"clearMessages ->code:".concat(c,",targetId:").concat(r)),[2,{code:c,msg:q[c]}])}}))}))}))]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:q[e.ErrorCode.NOT_SUPPORT]}]}))}))},deleteMessagesByTimestamp:function(t,r,a){return n(this,void 0,void 0,(function(){var s,i,c,d=this;return o(this,(function(u){return e.usingCppEngine()?(s=t.conversationType,i=t.targetId,c=t.channelId,e.validate("conversationType",s,e.AssertRules.NUMBER,!0)&&e.validate("targetId",i,e.AssertRules.STRING,!0)&&e.validate("timestamp",r,e.AssertRules.NUMBER,!0)&&e.validate("cleanSpace",a,e.AssertRules.BOOLEAN)?[2,H((function(t,u){return n(d,void 0,void 0,(function(){var n;return o(this,(function(o){switch(o.label){case 0:return[4,t.deleteMessagesByTimestamp(s,i,r,a,c)];case 1:return(n=o.sent())===e.ErrorCode.SUCCESS?[2,{code:n}]:(u.warn(e.LogTagId.O,"deleteMessagesByTimestamp ->code:".concat(n,",targetId:").concat(i)),[2,{code:n,msg:q[n]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]):[2,{code:e.ErrorCode.NOT_SUPPORT,msg:q[e.ErrorCode.NOT_SUPPORT]}]}))}))},insertMessage:function(t,r,a){return void 0===a&&(a={}),n(this,void 0,void 0,(function(){var s=this;return o(this,(function(i){return e.usingCppEngine()?[2,H((function(i,c){return n(s,void 0,void 0,(function(){var n,s,d,u,l,g,v,f,I,p,R,E,T,h,C,m;return o(this,(function(o){switch(o.label){case 0:return n=r.senderUserId,s=r.messageType,d=r.content,u=r.messageDirection,l=r.messageUId,g=r.canIncludeExpansion,v=r.expansion,f=r.disableNotification,I=r.sentTime,p=r.sentStatus,c.info(e.LogTagId.O,"insertMessage ->targetId:".concat(t.targetId,",conversationType:").concat(t.conversationType)),R=a.isUnread,E=a.searchContent,T={senderUserId:n,messageType:s,content:d,messageDirection:u,sentTime:I,sentStatus:p,searchContent:E,isUnread:R,messageUId:l,disableNotification:f,canIncludeExpansion:g,expansionMsg:JSON.stringify(v),channelId:t.channelId||""},[4,i.insertMessage(t.conversationType,t.targetId,T)];case 1:return h=o.sent(),C=h.code,m=h.data,C===e.ErrorCode.SUCCESS?[2,{code:C,data:L(m)}]:(c.warn(e.LogTagId.O,"insertMessage ->code:".concat(C,",targetId:").concat(t.targetId)),[2,{code:C,msg:q[C]}])}}))}))}))]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:q[e.ErrorCode.NOT_SUPPORT]}]}))}))},clearLocalData:function(){return n(this,void 0,void 0,(function(){var t=this;return o(this,(function(r){return e.usingCppEngine()?[2,H((function(r,a){return n(t,void 0,void 0,(function(){var t,n,s;return o(this,(function(o){switch(o.label){case 0:return a.info(e.LogTagId.O,"clearLocalData ->"),[4,r.clearData()];case 1:return t=o.sent(),n=t.code,s=t.data,[2,{code:n,data:s}]}}))}))}))]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:q[e.ErrorCode.NOT_SUPPORT]}]}))}))}}),je=function(e,t,n){this.type=e,this.userIdList=t,this.mentionedContent=n};Object.defineProperty(exports,"ChatroomEntryType",{enumerable:!0,get:function(){return e.ChatroomEntryType}}),Object.defineProperty(exports,"ChatroomUserChangeType",{enumerable:!0,get:function(){return e.ChatroomUserChangeType}}),Object.defineProperty(exports,"ConnectionStatus",{enumerable:!0,get:function(){return e.ConnectionStatus}}),Object.defineProperty(exports,"ConversationType",{enumerable:!0,get:function(){return e.ConversationType}}),Object.defineProperty(exports,"ErrorCode",{enumerable:!0,get:function(){return e.ErrorCode}}),Object.defineProperty(exports,"FileType",{enumerable:!0,get:function(){return e.FileType}}),Object.defineProperty(exports,"LogL",{enumerable:!0,get:function(){return e.LogL}}),Object.defineProperty(exports,"LogLevel",{enumerable:!0,get:function(){return e.LogLevel}}),Object.defineProperty(exports,"MentionedType",{enumerable:!0,get:function(){return e.MentionedType}}),Object.defineProperty(exports,"MessageBlockSourceType",{enumerable:!0,get:function(){return e.MessageBlockSourceType}}),Object.defineProperty(exports,"MessageBlockType",{enumerable:!0,get:function(){return e.MessageBlockType}}),Object.defineProperty(exports,"MessageDirection",{enumerable:!0,get:function(){return e.MessageDirection}}),Object.defineProperty(exports,"NotificationLevel",{enumerable:!0,get:function(){return e.NotificationLevel}}),Object.defineProperty(exports,"NotificationStatus",{enumerable:!0,get:function(){return e.NotificationStatus}}),Object.defineProperty(exports,"ReceivedStatus",{enumerable:!0,get:function(){return e.ReceivedStatus}}),Object.defineProperty(exports,"UltraGroupChannelType",{enumerable:!0,get:function(){return e.UltraGroupChannelType}}),Object.defineProperty(exports,"UploadMethod",{enumerable:!0,get:function(){return e.UploadMethod}}),exports.BaseMessage=X,exports.CombineMessage=ae,exports.ConnectType={COMET:"comet",WEBSOCKET:"websocket"},exports.FileMessage=se,exports.GIFMessage=ie,exports.HQVoiceMessage=ne,exports.ImageMessage=te,exports.LocationMessage=de,exports.MentionedInfoBody=je,exports.MessageType={TEXT:"RC:TxtMsg",VOICE:"RC:VcMsg",HQ_VOICE:"RC:HQVCMsg",IMAGE:"RC:ImgMsg",GIF:"RC:GIFMsg",RICH_CONTENT:"RC:ImgTextMsg",LOCATION:"RC:LBSMsg",FILE:"RC:FileMsg",SIGHT:"RC:SightMsg",COMBINE:"RC:CombineMsg",CHRM_KV_NOTIFY:"RC:chrmKVNotiMsg",LOG_COMMAND:"RC:LogCmdMsg",EXPANSION_NOTIFY:"RC:MsgExMsg",REFERENCE:"RC:ReferenceMsg",RECALL_MESSAGE_TYPE:"RC:RcCmd"},exports.ReferenceMessage=ue,exports.RichContentMessage=le,exports.SightMessage=oe,exports.TextMessage=re,exports.VoiceMessage=ce,exports.__addSDKVersion=function(t,n){e.VersionManage.add(t,n)},exports.addConversationsToTag=function(t,r){return n(this,void 0,void 0,(function(){var a=this;return o(this,(function(s){return e.validate("tagId",t,e.AssertRules.STRING,!0)&&e.validate("conversations",r,e.AssertRules.ARRAY,!0)&&!r.every((function(t){return!e.validate("conversation.conversationType",t.conversationType,e.AssertRules.NUMBER,!0)||!e.validate("conversation.targetId",t.targetId,e.AssertRules.STRING,!0)||!e.validate("conversation.channelId",t.channelId,e.AssertRules.CHANNEL_ID)}))?[2,H((function(s,i){return n(a,void 0,void 0,(function(){var n;return o(this,(function(o){switch(o.label){case 0:return i.info(e.LogTagId.O,"addTagForConversations ->tagId:".concat(t)),[4,s.addTagForConversations(t,r)];case 1:return(n=o.sent().code)===e.ErrorCode.SUCCESS?[2,{code:n}]:(i.warn(e.LogTagId.O,"addTagForConversations ->code:".concat(n,",tagId:").concat(t)),[2,{code:n,msg:q[n]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.addEventListener=function(e,t,n){x.on(e,t,n)},exports.addTag=function(t){return n(this,void 0,void 0,(function(){var r=this;return o(this,(function(a){return e.validate("tag.tagId",t.tagId,e.AssertRules.STRING,!0)&&e.validate("tag.tagId",t.tagId,(function(e){return e.length<=10}))&&e.validate("tag.tagName",t.tagName,(function(e){return e.length<=15}))&&e.validate("tag.tagName",t.tagName,e.AssertRules.STRING,!0)?[2,H((function(a,s){return n(r,void 0,void 0,(function(){var n;return o(this,(function(o){switch(o.label){case 0:return s.info(e.LogTagId.O,"createTag ->tagId:".concat(t.tagId,",tagName:").concat(t.tagName)),[4,a.createTag(t)];case 1:return(n=o.sent().code)===e.ErrorCode.SUCCESS?[2,{code:n}]:(s.warn(e.LogTagId.O,"createTag ->code:".concat(n,",tagId:").concat(t.tagId)),[2,{code:n,msg:q[n]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.addToBlacklist=function(t){return n(this,void 0,void 0,(function(){var r=this;return o(this,(function(a){return e.validate("userId",t,e.AssertRules.STRING,!0)?[2,H((function(a,s){return n(r,void 0,void 0,(function(){return o(this,(function(n){switch(n.label){case 0:return s.info(e.LogTagId.O,"addToBlacklist -> userId: ".concat(t)),[4,a.addToBlacklist(t)];case 1:return[2,{code:n.sent()}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.bindRTCRoomForChatroom=function(e){return n(this,void 0,void 0,(function(){var t=this;return o(this,(function(r){return[2,H((function(r){return n(t,void 0,void 0,(function(){var t;return o(this,(function(n){switch(n.label){case 0:return[4,r.bindRTCRoomForChatroom(e)];case 1:return[2,{code:t=n.sent(),msg:q[t]}]}}))}))}))]}))}))},exports.clearAllMessagesUnreadStatus=function(){return n(this,void 0,void 0,(function(){var e=this;return o(this,(function(t){return[2,H((function(t,r){return n(e,void 0,void 0,(function(){return o(this,(function(e){switch(e.label){case 0:return[4,t.clearAllUnreadCount()];case 1:return[2,{code:e.sent()}]}}))}))}))]}))}))},exports.clearEventListeners=V,exports.clearHistoryMessages=function(t,r){return n(this,void 0,void 0,(function(){var a=this;return o(this,(function(s){return e.validate("options.timestamp",r,e.AssertRules.NUMBER,!0)&&e.validate("conversation.channelId",null==t?void 0:t.channelId,e.AssertRules.CHANNEL_ID)?[2,H((function(s,i){return n(a,void 0,void 0,(function(){var n,a;return o(this,(function(o){switch(o.label){case 0:return n="conversationType:".concat(t.conversationType,",targetId:").concat(t.targetId),i.debug(e.LogTagId.O,"clear message ->".concat(n)),[4,s.deleteRemoteMessageByTimestamp(t.conversationType,t.targetId,r,t.channelId)];case 1:return(a=o.sent())!==e.ErrorCode.SUCCESS?(i.warn(e.LogTagId.O,"clear message ->".concat(a,":").concat(q[a],",").concat(n)),[2,{code:a,msg:q[a]}]):[2,{code:e.ErrorCode.SUCCESS}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.clearMessages=function(t){return n(this,void 0,void 0,(function(){var r=this;return o(this,(function(a){return P("RongIMLib.clearMessages","RongIMLib.ElectronExtension.clearMessages"),e.usingCppEngine()?[2,H((function(a,s){return n(r,void 0,void 0,(function(){var n,r,i,c;return o(this,(function(o){switch(o.label){case 0:return n=t.conversationType,r=t.targetId,i=t.channelId,s.info(e.LogTagId.O,"clearMessages ->targetId:".concat(r,",conversationType:").concat(n)),[4,a.clearMessages(n,r,i)];case 1:return(c=o.sent())===e.ErrorCode.SUCCESS?[2,{code:c}]:(s.warn(e.LogTagId.O,"clearMessages ->code:".concat(c,",targetId:").concat(r)),[2,{code:c,msg:q[c]}])}}))}))}))]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:q[e.ErrorCode.NOT_SUPPORT]}]}))}))},exports.clearMessagesUnreadStatus=function(t){return n(this,void 0,void 0,(function(){var r=this;return o(this,(function(a){return e.validate("options.conversationType",t.conversationType,e.isValidConversationType,!0)&&e.validate("options.targetId",t.targetId,e.AssertRules.STRING,!0)&&e.validate("options.channelId",t.channelId,e.AssertRules.CHANNEL_ID)?[2,H((function(a,s){return n(r,void 0,void 0,(function(){var n,r;return o(this,(function(o){switch(o.label){case 0:return[4,a.clearUnreadCount(t.conversationType,t.targetId,t.channelId)];case 1:return n=o.sent(),r="conversationType:".concat(t.conversationType,",targetId:").concat(t.targetId),s.debug(e.LogTagId.O,"clear unreadMsgNum ->".concat(r)),n!==e.ErrorCode.SUCCESS?(s.warn(e.LogTagId.O,"clear unreadMsgNum fail ->".concat(n,":").concat(q[n],",").concat(r)),[2,{code:n,msg:q[n]}]):[2,{code:n}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.clearTextMessageDraft=function(t){return n(this,void 0,void 0,(function(){var r=this;return o(this,(function(a){return e.validate("options.conversationType",t.conversationType,e.isValidConversationType,!0)&&e.validate("options.targetId",t.targetId,e.AssertRules.STRING,!0)&&e.validate("options.channelId",t.channelId,e.AssertRules.CHANNEL_ID)?[2,H((function(a,s){return n(r,void 0,void 0,(function(){var n,r;return o(this,(function(o){switch(o.label){case 0:return n="conversationType:".concat(t.conversationType,",targetId:").concat(t.targetId),s.debug(e.LogTagId.O,"delete draft ->".concat(n)),[4,a.clearConversationMessageDraft(t.conversationType,t.targetId,t.channelId)];case 1:return(r=o.sent())===e.ErrorCode.SUCCESS?[2,{code:r}]:(s.warn(e.LogTagId.O,"delete draft fail ->".concat(r,":").concat(q[r],",").concat(n)),[2,{code:r,msg:q[r]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.clearUnreadCountByTimestamp=function(t,r){return n(this,void 0,void 0,(function(){var a=this;return o(this,(function(s){return e.usingCppEngine()?[2,H((function(s,i){return n(a,void 0,void 0,(function(){var n,a,c,d;return o(this,(function(o){switch(o.label){case 0:return n=t.conversationType,a=t.targetId,c=t.channelId,i.info(e.LogTagId.O,"clearUnreadCountByTimestamp ->targetId:".concat(a,",conversationType:").concat(n)),[4,s.clearUnreadCountByTimestamp(n,a,r,c)];case 1:return(d=o.sent())===e.ErrorCode.SUCCESS?[2,{code:d}]:(i.warn(e.LogTagId.O,"clearUnreadCountByTimestamp ->code:".concat(d,",targetId:").concat(a)),[2,{code:d,msg:q[d]}])}}))}))}))]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:q[e.ErrorCode.NOT_SUPPORT]}]}))}))},exports.connect=function(t,r){return n(this,void 0,void 0,(function(){var a=this;return o(this,(function(s){return[2,H((function(s,i){return n(a,void 0,void 0,(function(){var n,a,c;return o(this,(function(o){switch(o.label){case 0:return e.validate("token",t,e.AssertRules.STRING,!0)&&e.validate("reconnectKickEnable",r,e.AssertRules.BOOLEAN)?(n=i.createTraceId(),i.info(e.LogTagId.A_CONNECT_T,JSON.stringify({token:t,reconnectKickEnable:r}),n),[4,s.connect(t,!1,r,n)]):[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}];case 1:return a=o.sent(),c=a.code===e.ErrorCode.SUCCESS?"info":"warn",i[c](e.LogTagId.A_CONNECT_R,JSON.stringify({code:a.code,userId:a.userId}),n),a.code===e.ErrorCode.SUCCESS?[2,{code:a.code,data:{userId:a.userId}}]:[2,{code:a.code,msg:q[a.code]}]}}))}))}))]}))}))},exports.deleteLocalMessagesByTimestamp=function(t,r,a){return n(this,void 0,void 0,(function(){var s,i,c,d=this;return o(this,(function(u){return P("RongIMLib.deleteLocalMessagesByTimestamp","RongIMLib.ElectronExtension.deleteMessagesByTimestamp"),e.usingCppEngine()?(s=t.conversationType,i=t.targetId,c=t.channelId,e.validate("conversationType",s,e.AssertRules.NUMBER,!0)&&e.validate("targetId",i,e.AssertRules.STRING,!0)&&e.validate("timestamp",r,e.AssertRules.NUMBER,!0)&&e.validate("cleanSpace",a,e.AssertRules.BOOLEAN)?[2,H((function(u,l){return n(d,void 0,void 0,(function(){var n;return o(this,(function(o){switch(o.label){case 0:return[4,u.deleteMessagesByTimestamp(s,i,r,a,c)];case 1:return n=o.sent(),l.debug(e.LogTagId.A_DELETE_MESSAGES_S,JSON.stringify({code:n,conversationType:s,targetId:i,channelId:c,timestamp:r})),n===e.ErrorCode.SUCCESS?[2,{code:n}]:(l.warn(e.LogTagId.O,"deleteLocalMessagesByTimestamp ->code:".concat(n,",targetId:").concat(t.targetId)),[2,{code:n,msg:q[n]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]):[2,{code:e.ErrorCode.NOT_SUPPORT,msg:q[e.ErrorCode.NOT_SUPPORT]}]}))}))},exports.deleteMessages=function(t,r){return n(this,void 0,void 0,(function(){var a=this;return o(this,(function(s){return e.validate("options",r,(function(t){return e.isArray(t)&&t.length}),!0)&&e.validate("conversation.channelId",null==t?void 0:t.channelId,e.AssertRules.CHANNEL_ID)&&!r.every((function(t){return!e.validate("options.messageUId",t.messageUId,e.AssertRules.STRING,!0)||!e.validate("options.sentTime",t.sentTime,e.AssertRules.NUMBER,!0)||!e.validate("options.messageDirection",t.messageDirection,(function(e){return 1===e||2===e}),!0)}))?[2,H((function(s,i){return n(a,void 0,void 0,(function(){var n,a;return o(this,(function(o){switch(o.label){case 0:return n="conversationType:".concat(t.conversationType,",targetId:").concat(t.targetId),i.debug(e.LogTagId.O,"delete messages ->".concat(n)),[4,s.deleteRemoteMessage(t.conversationType,t.targetId,r,t.channelId)];case 1:return(a=o.sent())!==e.ErrorCode.SUCCESS?(i.warn(e.LogTagId.O,"delete message fail ->".concat(a,":").concat(q[a],",").concat(n)),[2,{code:a,msg:q[a]}]):[2,{code:e.ErrorCode.SUCCESS}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.destroy=function(){return n(this,void 0,void 0,(function(){return o(this,(function(e){return b?(V(),[2,G()]):[2]}))}))},exports.disconnect=function(){return e.logger.info(e.LogTagId.A_DISCONNECT_O,{}),k((function(e){return e.disconnect()}))},exports.electronExtension=Ye,exports.forceRemoveChatRoomEntry=function(t,r){return n(this,void 0,void 0,(function(){var a=this;return o(this,(function(s){return e.validate("targetId",t,e.AssertRules.STRING,!0)&&W(r)?[2,H((function(s,i){return n(a,void 0,void 0,(function(){var n,a;return o(this,(function(o){switch(o.label){case 0:return n="id:".concat(t),i.info(e.LogTagId.O,"force remove chatroom entry ->".concat(n)),[4,s.forceRemoveChatroomEntry(t,r)];case 1:return(a=o.sent())!==e.ErrorCode.SUCCESS?(i.warn(e.LogTagId.O,"force remove chatroom entry fail ->code+:".concat(q[a],",").concat(n)),[2,{code:a,msg:q[a]}]):[2,{code:a}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.forceSetChatRoomEntry=function(t,r){return n(this,void 0,void 0,(function(){var a=this;return o(this,(function(s){return e.validate("targetId",t,e.AssertRules.STRING,!0)&&j(r)?[2,H((function(s,i){return n(a,void 0,void 0,(function(){var n,a;return o(this,(function(o){switch(o.label){case 0:return n="id:".concat(t),i.debug(e.LogTagId.O,"force set chatroom entry ->".concat(n)),[4,s.forceSetChatroomEntry(t,r)];case 1:return(a=o.sent())!==e.ErrorCode.SUCCESS?(i.warn(e.LogTagId.O,"force set chatroom entry fail ->code+:".concat(q[a],",").concat(n)),[2,{code:a,msg:q[a]}]):[2,{code:a}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getAllChatRoomEntries=function(t){return n(this,void 0,void 0,(function(){var r=this;return o(this,(function(a){return[2,H((function(a,s){return n(r,void 0,void 0,(function(){var n,r,i,c;return o(this,(function(o){switch(o.label){case 0:return n="id:".concat(t),s.debug(e.LogTagId.O,"get all chatroom entries->".concat(n)),[4,a.getAllChatroomEntries(t)];case 1:return r=o.sent(),i=r.code,c=r.data,i===e.ErrorCode.SUCCESS&&c?[2,{code:i,data:c}]:(s.warn(e.LogTagId.O,"get all chatroom entries fail ->code+:".concat(q[i],",").concat(n)),[2,{code:i,msg:q[i]}])}}))}))}))]}))}))},exports.getAllConversationState=function(){return n(this,void 0,void 0,(function(){return o(this,(function(e){return[2,H((function(e){return e.getAllConversationState()}))]}))}))},exports.getAllUltraGroupUnreadCount=function(){return n(this,void 0,void 0,(function(){var t=this;return o(this,(function(r){return[2,H((function(r,a){return n(t,void 0,void 0,(function(){var t,n,s,i;return o(this,(function(o){switch(o.label){case 0:return t="getAllUltraGroupUnreadCount",[4,r.getAllUltraGroupUnreadCount()];case 1:return n=o.sent(),s=n.code,i=n.data,a.debug(e.LogTagId.O,t),s===e.ErrorCode.SUCCESS?[2,{code:s,data:i}]:(a.warn(e.LogTagId.O,"".concat(t," fail ->").concat(s,": ").concat(q[s])),[2,{code:s,msg:q[s]}])}}))}))}))]}))}))},exports.getAllUltraGroupUnreadMentionedCount=function(){return n(this,void 0,void 0,(function(){var t=this;return o(this,(function(r){return[2,H((function(r,a){return n(t,void 0,void 0,(function(){var t,n,s,i;return o(this,(function(o){switch(o.label){case 0:return t="getAllUltraGroupUnreadMentionedCount",!0,[4,r.getAllUltraGroupUnreadCount(true)];case 1:return n=o.sent(),s=n.code,i=n.data,a.debug(e.LogTagId.O,t),s===e.ErrorCode.SUCCESS?[2,{code:s,data:i}]:(a.warn(e.LogTagId.O,"".concat(t," fail ->").concat(s,": ").concat(q[s])),[2,{code:s,msg:q[s]}])}}))}))}))]}))}))},exports.getAllUnreadMentionedCount=function(){return n(this,void 0,void 0,(function(){return o(this,(function(t){return[2,H((function(t,n){return n.debug(e.LogTagId.O,"getAllUnreadMentionedCount"),t.getAllUnreadMentionedCount()}))]}))}))},exports.getBlacklist=function(){return n(this,void 0,void 0,(function(){var t=this;return o(this,(function(r){return[2,H((function(r,a){return n(t,void 0,void 0,(function(){var t,n,s;return o(this,(function(o){switch(o.label){case 0:return a.info(e.LogTagId.O,"getBlacklist -> "),[4,r.getBlacklist()];case 1:return t=o.sent(),n=t.code,s=t.data,n===e.ErrorCode.SUCCESS&&s?[2,{code:n,data:s}]:(a.warn(e.LogTagId.O,"getBlacklist fail -> code: ".concat(n)),[2,{code:n}])}}))}))}))]}))}))},exports.getBlacklistStatus=function(t){return n(this,void 0,void 0,(function(){var r=this;return o(this,(function(a){return e.validate("userId",t,e.AssertRules.STRING,!0)?[2,H((function(a,s){return n(r,void 0,void 0,(function(){var n,r,i;return o(this,(function(o){switch(o.label){case 0:return s.info(e.LogTagId.O,"getBlacklistStatus -> userId: ".concat(t)),[4,a.getBlacklistStatus(t)];case 1:return n=o.sent(),r=n.code,i=n.data,r===e.ErrorCode.SUCCESS?[2,{code:r,data:0===i}]:(s.warn(e.LogTagId.O,"getBlacklistStatus fail -> code: ".concat(r,", userId: ").concat(t)),[2,{code:r}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getBlockUltraGroupList=function(){return n(this,void 0,void 0,(function(){var t=this;return o(this,(function(r){return[2,H((function(r,a){return n(t,void 0,void 0,(function(){var t,n,s;return o(this,(function(o){switch(o.label){case 0:return[4,r.getBlockUltraGroupList()];case 1:return t=o.sent(),n=t.code,s=t.data,n===e.ErrorCode.SUCCESS?[2,{code:e.ErrorCode.SUCCESS,data:s}]:(a.warn(e.LogTagId.O,"get block ultragroup ->".concat(n,":").concat(q[n])),[2,{code:n,msg:q[n]}])}}))}))}))]}))}))},exports.getBlockedConversationList=function(){return n(this,void 0,void 0,(function(){return o(this,(function(e){return[2,H((function(e){return e.getBlockConversationList()}))]}))}))},exports.getChatRoomEntry=function(t,r){return n(this,void 0,void 0,(function(){var a=this;return o(this,(function(s){return e.validate("key",r,(function(t){return e.isString(t)&&/[\w+=-]+/.test(t)&&t.length<=128}),!0)?[2,H((function(s,i){return n(a,void 0,void 0,(function(){var n,a,c,d;return o(this,(function(o){switch(o.label){case 0:return n="id:".concat(t),i.debug(e.LogTagId.O,"get chatroom entry->".concat(n)),[4,s.getChatroomEntry(t,r)];case 1:return a=o.sent(),c=a.code,d=a.data,c===e.ErrorCode.SUCCESS&&d?[2,{code:c,data:d}]:(i.warn(e.LogTagId.O,"get chatroom entry fail ->code+:".concat(q[c],",").concat(n)),[2,{code:c,msg:q[c]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getChatRoomInfo=function(t,r){return n(this,void 0,void 0,(function(){var a=this;return o(this,(function(s){return e.validate("options.count",r.count,e.AssertRules.NUMBER)&&e.validate("options.order",r.order,(function(e){return[0,1,2].includes(e)}))?[2,H((function(s,i){return n(a,void 0,void 0,(function(){var n,a,c,d;return o(this,(function(o){switch(o.label){case 0:return n="id:".concat(t),i.debug(e.LogTagId.O,"get chatroom info ->".concat(n)),[4,s.getChatroomInfo(t,r.count,r.order)];case 1:return a=o.sent(),c=a.code,d=a.data,c===e.ErrorCode.SUCCESS&&d?[2,{code:c,data:d}]:(i.warn(e.LogTagId.O,"get chatroom info fail ->code+:".concat(q[c],",").concat(n)),[2,{code:c,msg:q[c]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getChatroomHistoryMessages=function(t,r){return n(this,void 0,void 0,(function(){var a=this;return o(this,(function(s){return e.validate("options.timestamp",r.timestamp,e.AssertRules.NUMBER)&&e.validate("options.count",r.count,e.AssertRules.NUMBER)&&e.validate("options.order",r.order,(function(e){return 0===e||1===e}))?[2,H((function(s,i){return n(a,void 0,void 0,(function(){var n,a,c,d,u;return o(this,(function(o){switch(o.label){case 0:return n="id:".concat(t),i.debug(e.LogTagId.O,"get chatroom history message->".concat(n)),[4,s.getChatRoomHistoryMessages(t,r.count,r.order,r.timestamp)];case 1:return a=o.sent(),c=a.code,d=a.data,c===e.ErrorCode.SUCCESS&&d?(u=d.list.map((function(e){return L(e)})),[2,{code:c,data:{list:u,hasMore:!!d.hasMore}}]):(i.warn(e.LogTagId.O,"get chatroom history message fail ->code+:".concat(q[c],",").concat(n)),[2,{code:c,msg:q[c]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getConnectionStatus=function(){return k((function(e){return e.getConnectionStatus()}))},exports.getConversation=function(t){return n(this,void 0,void 0,(function(){var r=this;return o(this,(function(a){return e.validate("options.conversationType",t.conversationType,e.isValidConversationType,!0)&&e.validate("options.targetId",t.targetId,e.AssertRules.STRING,!0)&&e.validate("options.channelId",t.channelId,e.AssertRules.CHANNEL_ID)?[2,H((function(a,s){return n(r,void 0,void 0,(function(){var n,r,i;return o(this,(function(o){switch(o.label){case 0:return[4,a.getConversation(t.conversationType,t.targetId,t.channelId||"")];case 1:return n=o.sent(),r=n.code,i=n.data,r!==e.ErrorCode.SUCCESS?(s.warn(e.LogTagId.O,"getConversation ->code:".concat(r,", targetId:").concat(t.targetId)),[2,{code:r,msg:q[r]}]):[2,{code:r,data:i?U(i):null}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getConversationList=function(t,r){return n(this,void 0,void 0,(function(){var a=this;return o(this,(function(s){return[2,H((function(s,i){return n(a,void 0,void 0,(function(){var n,a,c;return o(this,(function(o){switch(o.label){case 0:return[4,s.getConversationList(null==t?void 0:t.count,void 0,null==t?void 0:t.startTime,null==t?void 0:t.order,r)];case 1:return n=o.sent(),a=n.code,c=n.data,a===e.ErrorCode.SUCCESS&&c?[2,{code:0,data:c.map((function(e){return U(e)}))}]:(i.warn(e.LogTagId.O,"get conversation list fail ->".concat(a,":").concat(q[a])),[2,{code:a,msg:q[a]}])}}))}))}))]}))}))},exports.getConversationNotificationLevel=function(t){return n(this,void 0,void 0,(function(){var r=this;return o(this,(function(a){return z(t)?[2,H((function(a,s){return n(r,void 0,void 0,(function(){var n,r,i,c;return o(this,(function(o){switch(o.label){case 0:return n=K(s,t,"getConversationNotificationLevel"),[4,a.getConversationNotificationLevel(t.conversationType,t.targetId,t.channelId)];case 1:return r=o.sent(),i=r.code,c=r.data,i===e.ErrorCode.SUCCESS?[2,{code:i,data:c}]:(s.warn(e.LogTagId.O,"getConversationNotificationLevel fail -> ".concat(i," : ").concat(q[i]," , ").concat(n)),[2,{code:i,msg:q[i]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getConversationNotificationStatus=function(t){return n(this,void 0,void 0,(function(){var r=this;return o(this,(function(a){return e.validate("options.conversationType",t.conversationType,e.isValidConversationType,!0)&&e.validate("options.targetId",t.targetId,e.AssertRules.STRING,!0)&&e.validate("options.channelId",t.channelId,e.AssertRules.CHANNEL_ID)?[2,H((function(a,s){return n(r,void 0,void 0,(function(){var n,r,i;return o(this,(function(o){switch(o.label){case 0:return s.info(e.LogTagId.O,"getConversationNotificationStatus ->targetId:".concat(t.targetId,",conversationType:").concat(t.conversationType)),[4,a.getConversationNotificationStatus(t.conversationType,t.targetId,t.channelId)];case 1:return n=o.sent(),r=n.code,i=n.data,r===e.ErrorCode.SUCCESS?[2,{code:r,data:i}]:(s.warn(e.LogTagId.O,"getConversationNotificationStatus ->code:".concat(r,",targetId:").concat(t.targetId)),[2,{code:r,msg:q[r]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getConversationsFromTagByPage=function(t,r,a){return n(this,void 0,void 0,(function(){var s=this;return o(this,(function(i){return e.validate("tagId",t,e.AssertRules.STRING,!0)&&e.validate("count",r,e.AssertRules.NUMBER,!0)&&e.validate("startTime",a,e.AssertRules.NUMBER,!0)?[2,H((function(i,c){return n(s,void 0,void 0,(function(){var n,s,d;return o(this,(function(o){switch(o.label){case 0:return c.info(e.LogTagId.O,"getConversationListByTag ->tagId:".concat(t)),[4,i.getConversationListByTag(t,a,r)];case 1:return n=o.sent(),s=n.code,d=n.data,s===e.ErrorCode.SUCCESS?[2,{code:s,data:d}]:(c.warn(e.LogTagId.O,"getConversationListByTag ->code:".concat(s,",tagId:").concat(t)),[2,{code:s,msg:q[s]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getCurrentUserId=function(){return k((function(e){return e.getCurrentUserId()}))},exports.getDeviceId=function(){return k((function(e){return e.getDeviceId()}))},exports.getFileToken=function(t,n,o,r){return H((function(a){return new Promise((function(s){a.getFileToken(t,n,o,r).then((function(t){s({code:e.ErrorCode.SUCCESS,data:t})})).catch((function(e){s({code:e,msg:q[e]})}))}))}))},exports.getFileUrl=Ve,exports.getFirstUnreadMessage=function(t){return n(this,void 0,void 0,(function(){var r=this;return o(this,(function(a){return e.usingCppEngine()?e.validate("conversation.conversationType",t.conversationType,e.AssertRules.NUMBER,!0)&&e.validate("conversation.targetId",t.targetId,e.AssertRules.STRING,!0)&&e.validate("conversation.channelId",null==t?void 0:t.channelId,e.AssertRules.CHANNEL_ID)?[2,H((function(a,s){return n(r,void 0,void 0,(function(){var n,r,i;return o(this,(function(o){switch(o.label){case 0:return[4,a.getFirstUnreadMessage(t.conversationType,t.targetId,t.channelId)];case 1:return n=o.sent(),r=n.code,i=n.data,r===e.ErrorCode.SUCCESS?[2,{code:r,data:i}]:(s.warn(e.LogTagId.O,"insertMessage ->code:".concat(r,",targetId:").concat(t.targetId)),[2,{code:r,msg:q[r]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:q[e.ErrorCode.NOT_SUPPORT]}]}))}))},exports.getHistoryMessages=function(t,r){return n(this,void 0,void 0,(function(){var a=this;return o(this,(function(s){return e.validate("options.timestamp",null==r?void 0:r.timestamp,e.AssertRules.NUMBER)&&e.validate("options.count",null==r?void 0:r.count,e.AssertRules.NUMBER)&&e.validate("options.order",null==r?void 0:r.order,(function(e){return 0===e||1===e}))&&e.validate("conversation.channelId",null==t?void 0:t.channelId,e.AssertRules.CHANNEL_ID)?[2,H((function(s,i){return n(a,void 0,void 0,(function(){var n,a,c,d,u;return o(this,(function(o){switch(o.label){case 0:return n=i.createTraceId(),i.info(e.LogTagId.A_GET_HISTORY_MSG_T,JSON.stringify({targetId:t.targetId,conversationType:t.conversationType,channelId:t.channelId,timestamp:null==r?void 0:r.timestamp,count:null==r?void 0:r.count}),n),[4,s.getHistoryMessage(t.conversationType,t.targetId,null==r?void 0:r.timestamp,null==r?void 0:r.count,null==r?void 0:r.order,null==t?void 0:t.channelId,"",n)];case 1:return a=o.sent(),c=a.code,d=a.data,c===e.ErrorCode.SUCCESS&&d?(u=d.list.map((function(e){return L(e)})),i.info(e.LogTagId.A_GET_HISTORY_MSG_R,JSON.stringify({code:c,messageLength:u.length}),n),[2,{code:c,data:{list:u,hasMore:d.hasMore}}]):(i.warn(e.LogTagId.A_GET_HISTORY_MSG_R,JSON.stringify({code:c,messageUIds:""}),n),[2,{code:c,msg:q[c]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getMessage=function(t){return n(this,void 0,void 0,(function(){var r=this;return o(this,(function(a){return e.usingCppEngine()?[2,H((function(a,s){return n(r,void 0,void 0,(function(){var n,r,i;return o(this,(function(o){switch(o.label){case 0:return[4,a.getMessage(t)];case 1:return n=o.sent(),r=n.code,i=n.data,r===e.ErrorCode.SUCCESS?[2,{code:r,data:L(i)}]:(s.warn(e.LogTagId.O,"getMessage ->code:".concat(r,",messageId:").concat(t)),[2,{code:r,msg:q[r]}])}}))}))}))]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:q[e.ErrorCode.NOT_SUPPORT]}]}))}))},exports.getMessageReader=function(t,r,a){return n(this,void 0,void 0,(function(){var s=this;return o(this,(function(i){return e.validate("messageUId",r,e.AssertRules.STRING,!0)?[2,H((function(i,c){return n(s,void 0,void 0,(function(){var n,s,d,u;return o(this,(function(o){switch(o.label){case 0:return n="messageUId:".concat(r,",targetId:").concat(t),c.debug(e.LogTagId.O,"get message reader ->".concat(n)),[4,i.getMessageReader(t,r,a)];case 1:return s=o.sent(),d=s.code,u=s.data,d===e.ErrorCode.SUCCESS?[2,{code:d,data:u}]:(c.warn(e.LogTagId.O,"get message reader fail ->".concat(d,":").concat(q[d],",").concat(n)),[2,{code:d,msg:q[d]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getRemoteHistoryMessages=function(t,r){return n(this,void 0,void 0,(function(){var a=this;return o(this,(function(s){return e.validate("options.timestamp",null==r?void 0:r.timestamp,e.AssertRules.NUMBER)&&e.validate("options.count",null==r?void 0:r.count,e.AssertRules.NUMBER)&&e.validate("options.order",null==r?void 0:r.order,(function(e){return 0===e||1===e}))&&e.validate("conversation.channelId",null==t?void 0:t.channelId,e.AssertRules.CHANNEL_ID)?[2,H((function(s,i){return n(a,void 0,void 0,(function(){var n,a,c,d,u;return o(this,(function(o){switch(o.label){case 0:return n="conversationType:".concat(t.conversationType,",targetId:").concat(t.targetId),i.debug(e.LogTagId.O,"get history message ->".concat(n)),[4,s.getRemoteHistoryMessages(t.conversationType,t.targetId,(null==r?void 0:r.timestamp)||0,(null==r?void 0:r.count)||20,(null==r?void 0:r.order)||0,t.channelId||"")];case 1:return a=o.sent(),c=a.code,d=a.data,c===e.ErrorCode.SUCCESS&&d?(u=d.list.map((function(e){return L(e)})),[2,{code:c,data:{list:u,hasMore:d.hasMore}}]):(i.warn(e.LogTagId.O,"get history message fail ->".concat(c,":").concat(q[c],",").concat(n)),[2,{code:c,msg:q[c]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getServerTime=function(){return k((function(e){return e.getServerTime()}))},exports.getTags=function(){return n(this,void 0,void 0,(function(){var t=this;return o(this,(function(r){return[2,H((function(r,a){return n(t,void 0,void 0,(function(){var t,n,s;return o(this,(function(o){switch(o.label){case 0:return[4,r.getTagList()];case 1:return t=o.sent(),n=t.code,s=t.data,n===e.ErrorCode.SUCCESS?[2,{code:e.ErrorCode.SUCCESS,data:s}]:(a.warn(e.LogTagId.O,"getTagList ->code:".concat(n)),[2,{code:n,msg:q[n]}])}}))}))}))]}))}))},exports.getTagsFromConversation=function(t){return n(this,void 0,void 0,(function(){var r=this;return o(this,(function(a){return e.validate("conversationType",t.conversationType,e.AssertRules.NUMBER)&&e.validate("targetId",t.targetId,e.AssertRules.STRING)&&e.validate("channelId",t.channelId,e.AssertRules.CHANNEL_ID)?[2,H((function(a,s){return n(r,void 0,void 0,(function(){var n,r,i;return o(this,(function(o){switch(o.label){case 0:return s.info(e.LogTagId.O,"getTagsForConversation ->targetId:".concat(t.targetId,",conversationType:").concat(t.conversationType)),[4,a.getTagsForConversation(t)];case 1:return n=o.sent(),r=n.code,i=n.data,r===e.ErrorCode.SUCCESS?[2,{code:r,data:i}]:[2,{code:r,msg:q[r]}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getTextMessageDraft=function(t){return n(this,void 0,void 0,(function(){var r=this;return o(this,(function(a){return e.validate("options.conversationType",t.conversationType,e.isValidConversationType,!0)&&e.validate("options.targetId",t.targetId,e.AssertRules.STRING,!0)&&e.validate("options.channelId",t.channelId,e.AssertRules.CHANNEL_ID)?[2,H((function(a,s){return n(r,void 0,void 0,(function(){var n,r,i,c;return o(this,(function(o){switch(o.label){case 0:return[4,a.getConversationMessageDraft(t.conversationType,t.targetId,t.channelId)];case 1:return n=o.sent(),r=n.code,i=n.data,c="conversationType:".concat(t.conversationType,",targetId:").concat(t.targetId),s.debug(e.LogTagId.O,"get draft ->".concat(c)),r===e.ErrorCode.SUCCESS?[2,{code:r,data:i||""}]:(s.warn(e.LogTagId.O,"get draft fail ->".concat(r,":").concat(q[r],",").concat(c)),[2,{code:r,msg:q[r]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getTopConversationList=function(){return n(this,void 0,void 0,(function(){return o(this,(function(e){return[2,H((function(e){return e.getTopConversationList()}))]}))}))},exports.getTotalUnreadCount=function(t,r,a){return n(this,void 0,void 0,(function(){var s=this;return o(this,(function(i){return t.debug(e.LogTagId.O,"get total unread count -> ConversationType:".concat(JSON.stringify(a)," includeMuted:").concat(r)),e.validate("includeMuted",r,e.AssertRules.BOOLEAN,!1)&&e.validate("conversationTypes",a,e.AssertRules.ARRAY,!1)&&!(null==a?void 0:a.every((function(t){return!e.validate("conversationType",t,e.isValidConversationType)})))?[2,H((function(t,i){return n(s,void 0,void 0,(function(){var n,s,c;return o(this,(function(o){switch(o.label){case 0:return[4,t.getTotalUnreadCount("",a,r)];case 1:return n=o.sent(),s=n.code,c=n.data,s===e.ErrorCode.SUCCESS?[2,{code:s,data:c}]:(i.warn(e.LogTagId.O,"getTotalUnreadCount fail ->".concat(s,":").concat(q[s])),[2,{code:s,msg:q[s]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getTotalUnreadCountByLevels=function(t,r){return n(this,void 0,void 0,(function(){var a=this;return o(this,(function(s){return!e.validate("conversationTypes",t,e.AssertRules.ARRAY,!0)||!e.validate("levels",r,e.AssertRules.ARRAY,!0)||t.every((function(t){return!e.validate("conversationType",t,e.isValidConversationType)}))||r.every((function(t){return!e.validate("level",t,e.isValidNotificationLevel)}))?[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,H((function(s,i){return n(a,void 0,void 0,(function(){var n,a,c;return o(this,(function(o){switch(o.label){case 0:return[4,s.getTotalUnreadCountByLevels(t,r)];case 1:return n=o.sent(),a=n.code,c=n.data,a===e.ErrorCode.SUCCESS?[2,{code:a,data:c}]:(i.warn(e.LogTagId.O,"getTotalUnreadCountByLevels fail ->".concat(a,":").concat(q[a])),[2,{code:a,msg:q[a]}])}}))}))}))]}))}))},exports.getTotalUnreadMentionedCountByLevels=function(t,r){return n(this,void 0,void 0,(function(){var a=this;return o(this,(function(s){return!e.validate("conversationTypes",t,e.AssertRules.ARRAY,!0)||!e.validate("levels",r,e.AssertRules.ARRAY,!0)||t.every((function(t){return!e.validate("conversationType",t,e.isValidConversationType)}))||r.every((function(t){return!e.validate("level",t,e.isValidNotificationLevel)}))?[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,H((function(s,i){return n(a,void 0,void 0,(function(){var n,a,c;return o(this,(function(o){switch(o.label){case 0:return[4,s.getTotalUnreadCountByLevels(t,r,!0)];case 1:return n=o.sent(),a=n.code,c=n.data,a===e.ErrorCode.SUCCESS?[2,{code:a,data:c}]:(i.warn(e.LogTagId.O,"getTotalUnreadMentionedCountByLevels fail ->".concat(a,":").concat(q[a])),[2,{code:a,msg:q[a]}])}}))}))}))]}))}))},exports.getUltraGroupDefaultNotificationLevel=function(t){return n(this,void 0,void 0,(function(){var r=this;return o(this,(function(a){return e.validate("options.targetId",t.targetId,e.AssertRules.STRING,!0)&&e.validate("options.channelId",t.channelId,e.AssertRules.CHANNEL_ID)?[2,H((function(a,s){return n(r,void 0,void 0,(function(){var n,r,i,c,d;return o(this,(function(o){switch(o.label){case 0:return n="getUltraGroupDefaultNotificationLevel",r="targetId: ".concat(t.targetId,", channelId: ").concat(t.channelId),s.debug(e.LogTagId.O,"".concat(n," -> ").concat(r)),[4,a.getUltraGroupDefaultNotificationLevel(t.targetId,t.channelId)];case 1:return i=o.sent(),c=i.code,d=i.data,c===e.ErrorCode.SUCCESS?[2,{code:c,data:d}]:(s.warn(e.LogTagId.O,"".concat(n," fail -> ").concat(c," : ").concat(q[c]," , ").concat(r)),[2,{code:c,msg:q[c]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getUltraGroupFirstUnreadMessageTimestamp=function(t){return n(this,void 0,void 0,(function(){var r=this;return o(this,(function(a){return e.validate("conversation.targetId",t.targetId,e.AssertRules.STRING,!0)&&e.validate("conversation.channelId",t.channelId,e.AssertRules.ONLY_STRING,!0)?[2,H((function(a){return n(r,void 0,void 0,(function(){var n,r,s,i,c,d;return o(this,(function(o){switch(o.label){case 0:return n=t.targetId,r=t.channelId,s={targetId:n,channelId:r},[4,a.getUltraGroupFirstUnreadMessageTimestamp(s)];case 1:return i=o.sent(),c=i.code,d=i.data,c===e.ErrorCode.SUCCESS?[2,{code:c,data:d}]:[2,{code:c,msg:q[c]}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getUltraGroupList=function(t){return void 0===t&&(t={}),n(this,void 0,void 0,(function(){var r=this;return o(this,(function(a){return e.validate("options.targetId",t.targetId,e.AssertRules.STRING,!1)&&e.validate("options.channelType",t.channelType,(function(t){return void 0!==e.UltraGroupChannelType[t]}),!1)?[2,H((function(a,s){return n(r,void 0,void 0,(function(){var n,r,i;return o(this,(function(o){switch(o.label){case 0:return[4,a.getUltraGroupList(t)];case 1:return n=o.sent(),r=n.code,i=n.data,r===e.ErrorCode.SUCCESS?[2,{code:e.ErrorCode.SUCCESS,data:i}]:(s.warn(e.LogTagId.O,"get ultragroup ->".concat(r,":").concat(q[r])),[2,{code:r,msg:q[r]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getUltraGroupMessageListByMessageUId=function(t,r){return n(this,void 0,void 0,(function(){var a=this;return o(this,(function(s){return e.validate("options.targetId",t.targetId,e.AssertRules.STRING,!0)&&e.validate("options.channelId",t.channelId,e.AssertRules.CHANNEL_ID)&&e.validate("options.conversationType",t.conversationType,e.isValidConversationType,!0)&&e.validate("msgs",r,e.AssertRules.ARRAY,!0)?[2,H((function(s,i){return n(a,void 0,void 0,(function(){var n,a,c,d,u,l,g,v;return o(this,(function(o){switch(o.label){case 0:return n=t.targetId,a=t.conversationType,c=t.channelId,d=[],r.forEach((function(e){var t=e.sendTime,n=e.messageUId;d.push({sendTime:t,messageUId:n,channelId:c})})),u={targetId:n,conversationType:a,messages:d},[4,s.getUltraGroupMessageListByMessageUId(u)];case 1:return l=o.sent(),g=l.code,v=l.data,g===e.ErrorCode.SUCCESS?[2,{code:e.ErrorCode.SUCCESS,data:v}]:(i.warn(e.LogTagId.O,"get UltraGroup MessageList by messageUId ->".concat(g,":").concat(q[g])),[2,{code:g,msg:q[g]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getUltraGroupUnreadCountByTargetId=function(t,r){return n(this,void 0,void 0,(function(){var a=this;return o(this,(function(s){return e.validate("targetId",t,e.AssertRules.STRING,!0)&&e.validate("notificationLevels",r,e.AssertRules.ARRAY)&&!(null==r?void 0:r.every((function(t){return!e.validate("notificationLevel",t,e.isValidNotificationLevel)})))?[2,H((function(s,i){return n(a,void 0,void 0,(function(){var n,a,c,d,u;return o(this,(function(o){switch(o.label){case 0:return n="getUltraGroupUnreadCountByTargetId",[4,s.getUltraGroupUnreadCountByTargetId(t,r)];case 1:return a=o.sent(),c=a.code,d=a.data,u="targetId: ".concat(t,", levels: ").concat(JSON.stringify(r)),i.debug(e.LogTagId.O,"".concat(n," -> ").concat(u)),c===e.ErrorCode.SUCCESS?[2,{code:c,data:d}]:(i.warn(e.LogTagId.O,"".concat(n," fail -> ").concat(c,": ").concat(q[c],", ").concat(u)),[2,{code:c,msg:q[c]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getUltraGroupUnreadMentionedCountByTargetId=function(t,r){return n(this,void 0,void 0,(function(){var a=this;return o(this,(function(s){return e.validate("targetId",t,e.AssertRules.STRING,!0)&&e.validate("notificationLevels",r,e.AssertRules.ARRAY)&&!(null==r?void 0:r.every((function(t){return!e.validate("notificationLevel",t,e.isValidNotificationLevel)})))?[2,H((function(s,i){return n(a,void 0,void 0,(function(){var n,a,c;return o(this,(function(o){switch(o.label){case 0:return i.debug(e.LogTagId.O,"get UltraGroup unreadMentionedCount by targetId: ".concat(t,", notificationLevels: ").concat(JSON.stringify(r))),[4,s.getUltraGroupUnreadMentionedCountByTargetId(t,r)];case 1:return n=o.sent(),a=n.code,c=n.data,a===e.ErrorCode.SUCCESS?[2,{code:e.ErrorCode.SUCCESS,data:c}]:(i.warn(e.LogTagId.O,"get UltraGroup unreadMentionedCount by targetId error ->".concat(a,":").concat(q[a])),[2,{code:a,msg:q[a]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getUltraGroupUnreadMentionedMessages=function(t){return n(this,void 0,void 0,(function(){var r=this;return o(this,(function(a){return t.channelId=t.channelId||"",e.validate("options.targetId",t.targetId,e.AssertRules.STRING,!0)&&e.validate("options.channelId",t.channelId,e.AssertRules.ONLY_STRING,!0)&&e.validate("options.sentTime",t.sentTime,e.AssertRules.NUMBER,!0)&&e.validate("options.count",t.count,(function(t){return e.isNumber(t)&&t>0&&t<=50}),!0)?[2,H((function(a,s){return n(r,void 0,void 0,(function(){var n,r,i,c,d,u,l,g;return o(this,(function(o){switch(o.label){case 0:return n=t.targetId,r=t.channelId,i=t.sentTime,c=t.count,d={targetId:n,channelId:r,sentTime:i,count:c},[4,a.getUltraGroupUnreadMentionedMessages(d)];case 1:return u=o.sent(),l=u.code,g=u.data,l===e.ErrorCode.SUCCESS?[2,{code:l,data:g}]:(s.warn(e.LogTagId.O,"getUltraGroupUnreadMentionedMessages fail ->".concat(l,": ").concat(q[l])),[2,{code:l,msg:q[l]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getUnreadCount=function(t){return n(this,void 0,void 0,(function(){var r=this;return o(this,(function(a){return e.validate("options.conversationType",t.conversationType,e.isValidConversationType,!0)&&e.validate("options.targetId",t.targetId,e.AssertRules.STRING,!0)&&e.validate("options.channelId",t.channelId,e.AssertRules.CHANNEL_ID)?[2,H((function(a,s){return n(r,void 0,void 0,(function(){var n,r,i,c;return o(this,(function(o){switch(o.label){case 0:return[4,a.getUnreadCount(t.conversationType,t.targetId,t.channelId)];case 1:return n=o.sent(),r=n.code,i=n.data,c="conversationType:".concat(t.conversationType,",targetId:").concat(t.targetId),s.debug(e.LogTagId.O,"get unreadCount ->".concat(c)),r===e.ErrorCode.SUCCESS?[2,{code:r,data:i}]:(s.warn(e.LogTagId.O,"get unreadCount fail ->".concat(r,":").concat(q[r],",").concat(c)),[2,{code:r,msg:q[r]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getUnreadCountByTag=function(t,r){return n(this,void 0,void 0,(function(){var a=this;return o(this,(function(s){return e.validate("tagId",t,e.AssertRules.STRING,!0)&&e.validate("containMuted",r,e.AssertRules.BOOLEAN,!0)?[2,H((function(s,i){return n(a,void 0,void 0,(function(){var n,a,c;return o(this,(function(o){switch(o.label){case 0:return i.info(e.LogTagId.O,"getUnreadCountByTag ->tagId:".concat(t)),[4,s.getUnreadCountByTag(t,r)];case 1:return n=o.sent(),a=n.code,c=n.data,a===e.ErrorCode.SUCCESS?[2,{code:a,data:c}]:(i.warn(e.LogTagId.O,"getUnreadCountByTag ->code:".concat(a,",tagId:").concat(t)),[2,{code:a,msg:q[a]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getUnreadMentionedCount=function(t){return n(this,void 0,void 0,(function(){return o(this,(function(n){return e.validate("options.targetId",t.targetId,e.AssertRules.STRING,!0)&&e.validate("options.channelId",t.channelId,e.AssertRules.CHANNEL_ID)?[2,H((function(n,o){return o.debug(e.LogTagId.O,"getUnreadMentionedCount".concat(t.targetId,",channelId:").concat(t.channelId)),n.getUnreadMentionedCount(t)}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getUnreadMentionedMessages=function(t){if(!e.usingCppEngine())return{code:e.ErrorCode.NOT_SUPPORT,msg:q[e.ErrorCode.NOT_SUPPORT]};var n,o=t.conversationType,r=t.targetId;return e.validate("conversationType",o,e.AssertRules.NUMBER,!0)&&e.validate("targetId",r,e.AssertRules.STRING,!0)?(n=function(t){var n=t.getUnreadMentionedMessages(o,r),a=[];return n&&n.length&&n.forEach((function(e){return a.push(L(e))})),{code:e.ErrorCode.SUCCESS,data:a}},b?n(b,B,D):{code:e.ErrorCode.BIZ_ERROR_CLIENT_NOT_INIT}):{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}},exports.init=function(t){!function(t){var n=t.appkey,o=t.navigators;b?B.warn(e.LogTagId.A_INIT_REPEAT_O):(e.assert("options.navigators",t.navigators,(function(t){return e.isArray(t)&&(0===t.length||t.every(e.isHttpUrl))})),D=t,b=e.APIContext.init(M,{appkey:t.appkey,apiVersion:"5.6.0-beem-alpha.1",navigators:t.navigators||[],miniCMPProxy:t.customCMP||[],logOutputLevel:t.logOutputLevel,__reportLogLevel:t.__reportLogLevel,checkCA:t.checkCA,httpInMainProcess:!!t.httpInMainProcess}),(B=b.createLogger("RC-IM","IM")).setOutputLevel(t.logOutputLevel),B.info(e.LogTagId.A_INIT_O,JSON.stringify({appkey:n,navigators:o,version:"5.6.0-beem-alpha.1",commit:"02dca671efb646422cac3f575bcc320e8d2dfd58"})),b.assignWatcher(w))}(t)},exports.insertMessage=function(t,r,a){return void 0===a&&(a={}),n(this,void 0,void 0,(function(){var s=this;return o(this,(function(i){return P("RongIMLib.insertMessage","RongIMLib.ElectronExtension.insertMessage"),e.usingCppEngine()?[2,H((function(i,c){return n(s,void 0,void 0,(function(){var n,s,d,u,l,g,v,f,I,p,R,E,T,h,C,m;return o(this,(function(o){switch(o.label){case 0:return n=r.senderUserId,s=r.messageType,d=r.content,u=r.messageDirection,l=r.messageUId,g=r.canIncludeExpansion,v=r.expansion,f=r.disableNotification,I=r.sentTime,p=r.sentStatus,c.info(e.LogTagId.O,"insertMessage ->targetId:".concat(t.targetId,",conversationType:").concat(t.conversationType)),R=a.isUnread,E=a.searchContent,T={senderUserId:n,messageType:s,content:d,messageDirection:u,sentTime:I,sentStatus:p,searchContent:E,isUnread:R,messageUId:l,disableNotification:f,canIncludeExpansion:g,expansionMsg:JSON.stringify(v),channelId:t.channelId||""},[4,i.insertMessage(t.conversationType,t.targetId,T)];case 1:return h=o.sent(),C=h.code,m=h.data,C===e.ErrorCode.SUCCESS?[2,{code:C,data:L(m)}]:(c.warn(e.LogTagId.O,"insertMessage ->code:".concat(C,",targetId:").concat(t.targetId)),[2,{code:C,msg:q[C]}])}}))}))}))]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:q[e.ErrorCode.NOT_SUPPORT]}]}))}))},exports.installPlugin=function(e,t){return k((function(n){return n.install(e,t)}))},exports.joinChatRoom=function(t,r){return n(this,void 0,void 0,(function(){var a=this;return o(this,(function(s){return e.validate("options.count",r.count,e.AssertRules.NUMBER,!0)?[2,H((function(s,i){return n(a,void 0,void 0,(function(){var n,a,c;return o(this,(function(o){switch(o.label){case 0:return n=i.createTraceId(),i.info(e.LogTagId.A_JOIN_CHATROOM_T,JSON.stringify({chatroomId:t,count:r.count,joinExist:!1}),n),[4,s.joinChatroom(t,r.count,n)];case 1:return a=o.sent(),c=a===e.ErrorCode.SUCCESS?"info":"warn",i[c](e.LogTagId.A_JOIN_CHATROOM_R,JSON.stringify({code:a,timestamp:(new Date).getTime()}),n),a!==e.ErrorCode.SUCCESS?[2,{code:a,msg:q[a]}]:[2,{code:a}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.joinExistChatRoom=function(t,r){return n(this,void 0,void 0,(function(){var a=this;return o(this,(function(s){return e.validate("options.count",r.count,e.AssertRules.NUMBER,!0)?[2,H((function(s,i){return n(a,void 0,void 0,(function(){var n,a,c;return o(this,(function(o){switch(o.label){case 0:return n=i.createTraceId(),i.info(e.LogTagId.A_JOIN_CHATROOM_T,JSON.stringify({chatroomId:t,count:r.count,joinExist:!0}),n),[4,s.joinExistChatroom(t,r.count,n)];case 1:return a=o.sent(),c=a===e.ErrorCode.SUCCESS?"info":"warn",i[c](e.LogTagId.A_JOIN_CHATROOM_R,JSON.stringify({code:a,timestamp:(new Date).getTime()}),n),a!==e.ErrorCode.SUCCESS?[2,{code:a,msg:q[a]}]:[2,{code:a}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.modifyMessage=function(t,r){return n(this,void 0,void 0,(function(){var a=this;return o(this,(function(s){return e.validate("content",t,e.AssertRules.OBJECT,!0)&&e.validate("message",r,e.AssertRules.OBJECT,!0)?[2,H((function(s,i){return n(a,void 0,void 0,(function(){var n,a,c,d,u,l,g,v,f,I;return o(this,(function(o){switch(o.label){case 0:return n=r.conversationType,a=r.targetId,c=r.messageUId,d=r.senderUserId,u=r.sentTime,l=r.canIncludeExpansion,g=r.channelId,v="conversationType:".concat(n,",targetId:").concat(a,",channelId:").concat(g,",messageUId:").concat(c),i.debug(e.LogTagId.O,"update ultragroup message expansion ->".concat(v)),f={targetId:a,channelId:g,conversationType:n,fromUserId:d,sendTime:u,canIncludeExpansion:l,messageUId:c,content:t},[4,s.modifyMessage(f)];case 1:return(I=o.sent().code)===e.ErrorCode.SUCCESS?[2,{code:e.ErrorCode.SUCCESS}]:(i.warn(e.LogTagId.O,"modify ultraGroup message ->".concat(I,":").concat(q[I])),[2,{code:I,msg:q[I]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.onceEventListener=function(e,t,n){x.once(e,t,n)},exports.quitChatRoom=function(t){return n(this,void 0,void 0,(function(){var r=this;return o(this,(function(a){return[2,H((function(a,s){return n(r,void 0,void 0,(function(){var n,r,i;return o(this,(function(o){switch(o.label){case 0:return n=s.createTraceId(),s.info(e.LogTagId.A_QUIT_CHATROOM_T,JSON.stringify({chatroomId:t}),n),[4,a.quitChatroom(t)];case 1:return r=o.sent(),i=r===e.ErrorCode.SUCCESS?"info":"warn",s[i](e.LogTagId.A_QUIT_CHATROOM_R,JSON.stringify({code:r}),n),r!==e.ErrorCode.SUCCESS?[2,{code:r,msg:q[r]}]:[2,{code:r}]}}))}))}))]}))}))},exports.recallMessage=function(t,r){return n(this,void 0,void 0,(function(){var a=this;return o(this,(function(s){return e.validate("options.messageUId",r.messageUId,e.AssertRules.STRING,!0)&&e.validate("options.sentTime",r.sentTime,e.AssertRules.NUMBER,!0)&&e.validate("options.disableNotification",null==r?void 0:r.disableNotification,e.AssertRules.BOOLEAN)&&e.validate("options.pushConfig",null==r?void 0:r.pushConfig,e.AssertRules.OBJECT)&&e.validate("conversation.channelId",null==t?void 0:t.channelId,e.AssertRules.CHANNEL_ID)?[2,H((function(s,i){return n(a,void 0,void 0,(function(){var n,a,c,d,u;return o(this,(function(o){switch(o.label){case 0:return n={user:r.user,channelId:t.channelId||"",disableNotification:null==r?void 0:r.disableNotification,pushConfig:null==r?void 0:r.pushConfig,extra:r.extra,isDelete:r.isDelete},a="conversationType:".concat(t.conversationType,",targetId:").concat(t.targetId,",messageUId:").concat(r.messageUId),i.debug(e.LogTagId.O,"recall message ->".concat(a)),[4,s.recallMessage(t.conversationType,t.targetId,r.messageUId,r.sentTime,n)];case 1:return c=o.sent(),d=c.code,u=c.data,d===e.ErrorCode.SUCCESS&&u?[2,{code:d,data:L(u)}]:d===e.ErrorCode.SUCCESS?[2,{code:d}]:(i.warn(e.LogTagId.O,"recall message fail ->".concat(d,":").concat(q[d],",").concat(a)),[2,{code:d,msg:q[d]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.registerMessageType=function(t,n,o,r,a){return k((function(s,i){return e.assert("messageType",t,e.AssertRules.STRING,!0),e.assert("isPersited",n,e.AssertRules.BOOLEAN,!0),e.assert("isCounted",o,e.AssertRules.BOOLEAN,!0),e.assert("isStatusMessage",a,e.AssertRules.BOOLEAN,!1),i.info(e.LogTagId.A_REGTYP_O,JSON.stringify({messageType:t,isCounted:o,isStatusMessage:a,isPersited:n})),s.registerMessageType(t,n,o,r,a),Q(t,n,o)}))},exports.removeAllExpansionForUltraGroupMessage=function(t){return n(this,void 0,void 0,(function(){var r=this;return o(this,(function(a){return e.validate("message",t,e.AssertRules.OBJECT,!0)?[2,H((function(a,s){return n(r,void 0,void 0,(function(){var n,r,i,c,d,u,l,g,v;return o(this,(function(o){switch(o.label){case 0:return n=t.conversationType,r=t.targetId,i=t.messageUId,c=t.sentTime,d=t.canIncludeExpansion,u=t.channelId,l="conversationType:".concat(n,",targetId:").concat(r,",channelId:").concat(u,",messageUId:").concat(i),s.debug(e.LogTagId.O,"remove all expansion for ultraGroup message ->".concat(l)),g={targetId:r,channelId:u,conversationType:n,sendTime:c,canIncludeExpansion:d,messageUId:i,removeAll:!0},[4,a.expandUltraMessage(g)];case 1:return(v=o.sent().code)===e.ErrorCode.SUCCESS?[2,{code:e.ErrorCode.SUCCESS}]:(s.warn(e.LogTagId.O,"remove all expansion for ultraGroup message ->".concat(v,":").concat(q[v])),[2,{code:v,msg:q[v]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.removeChatRoomEntries=function(r,a){return n(this,void 0,void 0,(function(){var s=this;return o(this,(function(i){return e.validate("targetId",r,e.AssertRules.STRING,!0)&&function(t){return!(t.entries.every((function(t){return!e.validate("key",t,e.AssertRules.STRING,!0)}))||!e.validate("options.notificationExtra",t.notificationExtra,e.AssertRules.STRING))}(a)?[2,H((function(i,c){return n(s,void 0,void 0,(function(){var n,s,d,u,l;return o(this,(function(o){switch(o.label){case 0:return n="id:".concat(r),c.info(e.LogTagId.O,"remove chatroom entry->".concat(n)),(s=t({},a)).entries=a.entries.map((function(e){return{key:e}})),[4,i.removeChatroomEntries(r,s)];case 1:return d=o.sent(),u=d.code,l=d.data,u!==e.ErrorCode.SUCCESS?(c.warn(e.LogTagId.O,"remove chatroom entry fail ->code+:".concat(q[u],",").concat(n)),[2,{code:u,msg:q[u],data:l}]):[2,{code:u}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.removeChatRoomEntry=function(t,r){return n(this,void 0,void 0,(function(){var a=this;return o(this,(function(s){return e.validate("targetId",t,e.AssertRules.STRING,!0)&&W(r)?[2,H((function(s,i){return n(a,void 0,void 0,(function(){var n,a;return o(this,(function(o){switch(o.label){case 0:return n="id:".concat(t),i.debug(e.LogTagId.O,"remove chatroom entry->".concat(n)),[4,s.removeChatroomEntry(t,r)];case 1:return(a=o.sent())!==e.ErrorCode.SUCCESS?(i.warn(e.LogTagId.O,"remove chatroom entry fail ->code+:".concat(q[a],",").concat(n)),[2,{code:a,msg:q[a]}]):[2,{code:a}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.removeConversation=function(t){return n(this,void 0,void 0,(function(){var r=this;return o(this,(function(a){return e.validate("options.conversationType",t.conversationType,e.isValidConversationType,!0)&&e.validate("options.targetId",t.targetId,e.AssertRules.STRING,!0)&&e.validate("options.channelId",t.channelId,e.AssertRules.CHANNEL_ID)?[2,H((function(a,s){return n(r,void 0,void 0,(function(){var n,r;return o(this,(function(o){switch(o.label){case 0:return[4,a.removeConversation(t.conversationType,t.targetId,t.channelId)];case 1:return n=o.sent(),r="conversationType:".concat(t.conversationType,",targetId:").concat(t.targetId),s.debug(e.LogTagId.O,"destroy conversation ->".concat(r)),n!==e.ErrorCode.SUCCESS?(s.warn(e.LogTagId.O,"destroy conversation fail ->".concat(n,":").concat(q[n],",").concat(r)),[2,{code:n,msg:q[n]}]):[2,{code:n}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.removeConversationsFromTag=function(t,r){return n(this,void 0,void 0,(function(){var a=this;return o(this,(function(s){return e.validate("tagId",t,e.AssertRules.STRING,!0)&&e.validate("conversations",r,e.AssertRules.ARRAY,!0)&&!r.every((function(t){return!e.validate("conversation.conversationType",t.conversationType,e.AssertRules.NUMBER,!0)||!e.validate("conversation.targetId",t.targetId,e.AssertRules.STRING,!0)||!e.validate("conversation.channelId",t.channelId,e.AssertRules.CHANNEL_ID)}))?[2,H((function(s,i){return n(a,void 0,void 0,(function(){var n;return o(this,(function(o){switch(o.label){case 0:return i.info(e.LogTagId.O,"removeTagForConversations ->tagId:".concat(t)),[4,s.removeTagForConversations(t,r)];case 1:return(n=o.sent().code)===e.ErrorCode.SUCCESS?[2,{code:n}]:(i.warn(e.LogTagId.O,"removeTagForConversations ->code:".concat(n,",tagId:").concat(t)),[2,{code:n,msg:q[n]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.removeEventListener=function(e,t,n){x.off(e,t,n)},exports.removeEventListeners=function(e){x.removeAll(e)},exports.removeExpansionForUltraGroupMessage=function(t,r){return n(this,void 0,void 0,(function(){var a=this;return o(this,(function(s){return e.validate("expansion",t,e.AssertRules.ARRAY,!0)&&e.validate("message",r,e.AssertRules.OBJECT,!0)?[2,H((function(s,i){return n(a,void 0,void 0,(function(){var n,a,c,d,u,l,g,v,f;return o(this,(function(o){switch(o.label){case 0:return n=r.conversationType,a=r.targetId,c=r.messageUId,d=r.sentTime,u=r.canIncludeExpansion,l=r.channelId,g="conversationType:".concat(n,",targetId:").concat(a,",channelId:").concat(l,",messageUId:").concat(c),i.debug(e.LogTagId.O,"remove expansion for ultragroup message ->".concat(g)),v={targetId:a,channelId:l,conversationType:n,sendTime:d,canIncludeExpansion:u,messageUId:c,keys:t},[4,s.expandUltraMessage(v)];case 1:return(f=o.sent().code)===e.ErrorCode.SUCCESS?[2,{code:e.ErrorCode.SUCCESS}]:(i.warn(e.LogTagId.O,"remove expansion for ultraGroup message ->".concat(f,":").concat(q[f])),[2,{code:f,msg:q[f]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.removeFromBlacklist=function(t){return n(this,void 0,void 0,(function(){var r=this;return o(this,(function(a){return e.validate("userId",t,e.AssertRules.STRING,!0)?[2,H((function(e,a){return n(r,void 0,void 0,(function(){return o(this,(function(n){switch(n.label){case 0:return a.info("removeFromBlacklist -> userId: ".concat(t)),[4,e.removeFromBlacklist(t)];case 1:return[2,{code:n.sent()}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.removeMessageExpansionForKey=function(t,r){return n(this,void 0,void 0,(function(){var a=this;return o(this,(function(s){return e.validate("keys",t,e.AssertRules.ARRAY,!0)&&e.validate("message",r,e.AssertRules.OBJECT,!0)?[2,H((function(s,i){return n(a,void 0,void 0,(function(){var n,a,c,d,u,l,g;return o(this,(function(o){switch(o.label){case 0:return n=r.conversationType,a=r.targetId,c=r.messageUId,d=r.canIncludeExpansion,u=r.channelId,l="conversationType:".concat(n,",targetId:").concat(a,",messageUId:").concat(c),i.debug(e.LogTagId.O,"remove message expansion ->".concat(l)),[4,s.sendExpansionMessage({conversationType:n,targetId:a,messageUId:c,canIncludeExpansion:d,keys:t,channelId:u})];case 1:return(g=o.sent().code)!==e.ErrorCode.SUCCESS?(i.warn(e.LogTagId.O,"remove message expansion fail ->".concat(g,":").concat(q[g],",").concat(l)),[2,{code:g,msg:q[g]}]):[2,{code:g}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.removeTag=function(t){return n(this,void 0,void 0,(function(){var r=this;return o(this,(function(a){return e.validate("tagId",t,e.AssertRules.STRING,!0)?[2,H((function(a,s){return n(r,void 0,void 0,(function(){var n;return o(this,(function(o){switch(o.label){case 0:return s.info(e.LogTagId.O,"removeTag ->tagId:".concat(t)),[4,a.removeTag(t)];case 1:return(n=o.sent().code)===e.ErrorCode.SUCCESS?[2,{code:n}]:(s.warn(e.LogTagId.O,"removeTag ->code:".concat(n,",tagId:").concat(t)),[2,{code:n,msg:q[n]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.removeTagFromConversations=function(t,r){return n(this,void 0,void 0,(function(){var a=this;return o(this,(function(s){return e.validate("tagId",t,e.AssertRules.STRING,!0)&&e.validate("conversations",r,e.AssertRules.ARRAY,!0)&&!r.every((function(t){return!e.validate("conversation.conversationType",t.conversationType,e.AssertRules.NUMBER,!0)||!e.validate("conversation.targetId",t.targetId,e.AssertRules.STRING,!0)||!e.validate("conversation.channelId",t.channelId,e.AssertRules.CHANNEL_ID)}))?[2,H((function(s,i){return n(a,void 0,void 0,(function(){var n;return o(this,(function(o){switch(o.label){case 0:return i.info(e.LogTagId.O,"removeTagForConversations ->tagId:".concat(t)),[4,s.removeTagForConversations(t,r)];case 1:return(n=o.sent().code)===e.ErrorCode.SUCCESS?[2,{code:n}]:(i.warn(e.LogTagId.O,"removeTagForConversations ->code:".concat(n,",tagId:").concat(t)),[2,{code:n,msg:q[n]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.removeTagsFromConversation=function(t,r){return n(this,void 0,void 0,(function(){var a=this;return o(this,(function(s){return e.validate("conversation.conversationType",t.conversationType,e.AssertRules.NUMBER,!0)&&e.validate("conversation.targetId",t.targetId,e.AssertRules.STRING,!0)&&e.validate("conversation.channelId",t.channelId,e.AssertRules.CHANNEL_ID)&&e.validate("tagIds",r,e.AssertRules.ARRAY,!0)&&!r.every((function(t){return!e.validate("tagId",t,e.AssertRules.STRING,!0)}))?[2,H((function(s,i){return n(a,void 0,void 0,(function(){var n;return o(this,(function(o){switch(o.label){case 0:return i.info(e.LogTagId.O,"removeTagsForConversation ->tagIds:".concat(r,",targetId:").concat(t.targetId,",conversationType:").concat(t.conversationType)),[4,s.removeTagsForConversation(t,r)];case 1:return(n=o.sent().code)===e.ErrorCode.SUCCESS?[2,{code:n}]:(i.warn(e.LogTagId.O,"removeTagsForConversation ->code:".concat(n,",tagIds:").concat(r)),[2,{code:n,msg:q[n]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.saveTextMessageDraft=function(t,r){return n(this,void 0,void 0,(function(){var a=this;return o(this,(function(s){return e.validate("options.conversationType",t.conversationType,e.isValidConversationType,!0)&&e.validate("options.targetId",t.targetId,e.AssertRules.STRING,!0)&&e.validate("options.channelId",t.channelId,e.AssertRules.CHANNEL_ID)&&e.validate("draft",r,e.AssertRules.STRING,!0)?[2,H((function(s,i){return n(a,void 0,void 0,(function(){var n,a;return o(this,(function(o){switch(o.label){case 0:return n="conversationType:".concat(t.conversationType,",targetId:").concat(t.targetId),i.debug(e.LogTagId.O,"set draft ->".concat(n)),[4,s.saveConversationMessageDraft(t.conversationType,t.targetId,r,t.channelId)];case 1:return(a=o.sent())===e.ErrorCode.SUCCESS?[2,{code:a}]:(i.warn(e.LogTagId.O,"set draft fail ->".concat(a,":").concat(q[a],",").concat(n)),[2,{code:a,msg:q[a]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.searchConversationByContent=function(t,r,a,s){return n(this,void 0,void 0,(function(){var i=this;return o(this,(function(c){return P("RongIMLib.searchConversationByContent","RongIMLib.ElectronExtension.searchConversationByContent"),e.usingCppEngine()?[2,H((function(c,d){return n(i,void 0,void 0,(function(){var n,i,u;return o(this,(function(o){switch(o.label){case 0:return d.info(e.LogTagId.O,"searchConversationByContent ->keyword:".concat(t)),[4,c.searchConversationByContent(t,a,s,r)];case 1:return n=o.sent(),i=n.code,u=n.data,i===e.ErrorCode.SUCCESS?[2,{code:i,data:u}]:(d.warn(e.LogTagId.O,"searchConversationByContent ->code:".concat(i,",keyword:").concat(t)),[2,{code:i,msg:q[i]}])}}))}))}))]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:q[e.ErrorCode.NOT_SUPPORT]}]}))}))},exports.searchMessages=function(t,r,a,s){return n(this,void 0,void 0,(function(){var i=this;return o(this,(function(c){return P("RongIMLib.searchMessages","RongIMLib.ElectronExtension.searchMessages"),e.usingCppEngine()?e.validate("conversationType",t.conversationType,e.AssertRules.NUMBER,!0)&&e.validate("targetId",t.targetId,e.AssertRules.STRING,!0)&&e.validate("keyword",r,e.AssertRules.STRING,!0)&&e.validate("timestamp",a,e.AssertRules.NUMBER)&&e.validate("count",s,e.AssertRules.NUMBER)?[2,H((function(c,d){return n(i,void 0,void 0,(function(){var n,i,u,l;return o(this,(function(o){switch(o.label){case 0:return 1,[4,c.searchMessageByContent(t.conversationType,t.targetId,r,a,s,1,t.channelId)];case 1:return n=o.sent(),i=n.code,u=n.data,i===e.ErrorCode.SUCCESS?(l=[],(null==u?void 0:u.messages)&&u.messages.length&&u.messages.forEach((function(e){return l.push(L(e))})),[2,{code:i,data:{messages:l,count:null==u?void 0:u.count}}]):(d.warn(e.LogTagId.O,"searchMessages ->code:".concat(i,",targetId:").concat(t.targetId)),[2,{code:i,msg:q[i]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:q[e.ErrorCode.NOT_SUPPORT]}]}))}))},exports.sendFileMessage=Ze,exports.sendHQVoiceMessage=ze,exports.sendImageMessage=Je,exports.sendMessage=Fe,exports.sendReadReceiptMessage=function(t,r,a,s){return n(this,void 0,void 0,(function(){var i=this;return o(this,(function(c){return[2,H((function(c){return n(i,void 0,void 0,(function(){var n,i,c,d,u;return o(this,(function(o){switch(o.label){case 0:return n={targetId:t,conversationType:e.ConversationType.PRIVATE,channelId:s},i=new X("RC:ReadNtf",{messageUId:r,lastMessageSendTime:a,type:1}),[4,Fe(n,i)];case 1:return c=o.sent(),d=c.code,u=c.msg,0===d?[2,{code:d}]:[2,{code:d,msg:u}]}}))}))}))]}))}))},exports.sendReadReceiptRequest=function(t,r,a){return n(this,void 0,void 0,(function(){var s=this;return o(this,(function(i){return e.validate("messageUId",r,e.AssertRules.STRING,!0)&&e.validate("channelId",a,e.AssertRules.CHANNEL_ID)?[2,H((function(i,c){return n(s,void 0,void 0,(function(){var n,s,i,d,u;return o(this,(function(o){switch(o.label){case 0:return n="messageUId:".concat(r,",targetId:").concat(t),c.debug(e.LogTagId.O,"send read receipt message ->".concat(n)),s=new X("RC:RRReqMsg",{messageUId:r}),[4,Fe({targetId:t,conversationType:e.ConversationType.GROUP,channelId:a},s)];case 1:return i=o.sent(),d=i.code,u=i.msg,0===d?[2,{code:d}]:[2,{code:d,msg:u}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.sendReadReceiptResponse=function(e,t,r){return n(this,void 0,void 0,(function(){return o(this,(function(e){throw new Error("This method is deprecated, please use method sendReadReceiptResponseV2.")}))}))},exports.sendReadReceiptResponseV2=function(t,r,a){return n(this,void 0,void 0,(function(){var s=this;return o(this,(function(i){return e.validate("targetId",t,e.AssertRules.STRING,!0)&&e.validate("messageList",r,e.AssertRules.OBJECT,!0)&&e.validate("channelId",a,e.AssertRules.CHANNEL_ID)&&!Object.keys(r).every((function(t){return!e.validate(t,r[t],e.AssertRules.ARRAY)}))?[2,H((function(i,c){return n(s,void 0,void 0,(function(){var n,s,d,u,l,g,v;return o(this,(function(o){switch(o.label){case 0:return n={targetId:t,conversationType:e.ConversationType.GROUP,channelId:a},d=i.getInfoFromCache(),0!==(u=(null==d?void 0:d.grpRRVer)||0)?[3,2]:(l=new X("RC:RRRspMsg",{receiptMessageDic:r}),[4,Fe(n,l)]);case 1:return s=o.sent(),[3,4];case 2:return 1!==u?[3,4]:(g=[],Object.keys(r).forEach((function(e){r[e].forEach((function(e){-1===g.indexOf(e)&&g.push(e)}))})),g.length?[4,i.sendReadReceiptMessage(t,g,a)]:(c.warn(e.LogTagId.O,"Error in parameter messageList."),[2,{code:e.ErrorCode.PARAMETER_ERROR}]));case 3:s=o.sent(),o.label=4;case 4:return(v=s.code)===e.ErrorCode.SUCCESS?[2,{code:v}]:(c.warn(e.LogTagId.O,"send read receipt message fail ->".concat(v,":").concat(q[v])),[2,{code:v,msg:q[v]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.sendSightMessage=Ke,exports.sendSyncReadStatusMessage=function(t,r){return n(this,void 0,void 0,(function(){var n,a,s,i;return o(this,(function(o){switch(o.label){case 0:return e.validate("conversation.type",t.conversationType,e.AssertRules.NUMBER,!0)&&e.validate("conversation.targetId",t.targetId,e.AssertRules.STRING,!0)&&e.validate("lastMessageSendTime",r,e.AssertRules.NUMBER,!0)&&e.validate("conversation.channelId",null==t?void 0:t.channelId,e.AssertRules.CHANNEL_ID)?(n=new X("RC:SRSMsg",{lastMessageSendTime:r}),[4,Fe(t,n)]):[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}];case 1:return a=o.sent(),s=a.code,i=a.msg,0===s?[2,{code:s}]:[2,{code:s,msg:i}]}}))}))},exports.sendTextMessage=function(e,t,n){return Fe(e,new re(t),n)},exports.sendTypingStatusMessage=function(t,r){return n(this,void 0,void 0,(function(){var a=this;return o(this,(function(s){return e.validate("typingContentType",r,e.AssertRules.STRING,!0)?[2,H((function(s,i){return n(a,void 0,void 0,(function(){var n,a,c,d,u,l;return o(this,(function(o){switch(o.label){case 0:return n={messageType:"RC:TypSts",content:{typingContentType:r},isStatusMessage:!0,channelId:t.channelId},a=i.createTraceId(),i.info(e.LogTagId.A_SEND_MSG_T,JSON.stringify({messageType:n.messageType,conversationType:t.conversationType,targetId:t.targetId,channelId:t.channelId}),a),[4,s.sendMessage(t.conversationType,t.targetId,n,void 0,a)];case 1:return c=o.sent(),d=c.code,u=c.data,l=d===e.ErrorCode.SUCCESS?"info":"warn",i[l](e.LogTagId.A_SEND_MSG_R,JSON.stringify({code:d,messageUId:u?u.messageUId:"",messageId:u?u.messageId:""}),a),d===e.ErrorCode.SUCCESS?[2,{code:d,data:L(u)}]:[2,{code:d,msg:q[d]}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.sendUltraGroupTypingStatus=function(t){return n(this,void 0,void 0,(function(){var r=this;return o(this,(function(a){return e.validate("options.targetId",t.targetId,e.AssertRules.STRING,!0)&&e.validate("options.channelId",t.channelId,e.AssertRules.CHANNEL_ID)&&e.validate("options.conversationType",t.conversationType,e.isValidConversationType,!0)?[2,H((function(a,s){return n(r,void 0,void 0,(function(){var n;return o(this,(function(o){switch(o.label){case 0:return[4,a.sendUltraGroupTypingStatus(t)];case 1:return(n=o.sent().code)===e.ErrorCode.SUCCESS?[2,{code:e.ErrorCode.SUCCESS}]:(s.warn(e.LogTagId.O,"send ultraGroup OperateStatus ->".concat(n,":").concat(q[n])),[2,{code:n,msg:q[n]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.setChatRoomEntries=function(t,r){return n(this,void 0,void 0,(function(){var a=this;return o(this,(function(s){return e.validate("targetId",t,e.AssertRules.STRING,!0)&&function(t){return!(t.entries.every((function(t){return!e.validate("entry.key",t.key,e.AssertRules.STRING,!0)||!e.validate("entry.value",t.value,e.AssertRules.STRING,!0)}))||!e.validate("options.isAutoDelete",t.isAutoDelete,e.AssertRules.BOOLEAN)||!e.validate("options.notificationExtra",t.notificationExtra,e.AssertRules.STRING)||!e.validate("options.isForce",t.isForce,e.AssertRules.BOOLEAN))}(r)?r.entries.length>10?[2,F.CHATROOM_KV_STORE_OUT_LIMIT]:[2,H((function(s,i){return n(a,void 0,void 0,(function(){var n,a,c,d;return o(this,(function(o){switch(o.label){case 0:return n="id:".concat(t),i.debug(e.LogTagId.O,"set chatroom entry->".concat(n)),[4,s.setChatroomEntries(t,r)];case 1:return a=o.sent(),c=a.code,d=a.data,c!==e.ErrorCode.SUCCESS?(i.warn(e.LogTagId.O,"set chatroom entry fail ->code+:".concat(q[c],",").concat(n)),[2,{code:c,msg:q[c],data:d}]):[2,{code:c}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.setChatRoomEntry=function(t,r){return n(this,void 0,void 0,(function(){var a=this;return o(this,(function(s){return e.validate("targetId",t,e.AssertRules.STRING,!0)&&j(r)?[2,H((function(s,i){return n(a,void 0,void 0,(function(){var n,a;return o(this,(function(o){switch(o.label){case 0:return n="id:".concat(t),i.debug(e.LogTagId.O,"set chatroom entry->".concat(n)),[4,s.setChatroomEntry(t,r)];case 1:return(a=o.sent())!==e.ErrorCode.SUCCESS?(i.warn(e.LogTagId.O,"set chatroom entry fail ->code+:".concat(q[a],",").concat(n)),[2,{code:a,msg:q[a]}]):[2,{code:a}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.setConversationNotificationLevel=function(t,r){return n(this,void 0,void 0,(function(){return o(this,(function(n){return e.validate("notificationLevel",r,(function(t){return void 0!==e.NotificationLevel[t]}),!0)&&z(t)?[2,H((function(e,n){return Y(n,t,(function(){return e.setConversationNotificationLevel(t.conversationType,t.targetId,r,t.channelId)}),"setConversationNotificationLevel")}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.setConversationNotificationStatus=function(t,r){return n(this,void 0,void 0,(function(){return o(this,(function(n){return e.validate("notificationStatus",r,(function(e){return 1===e||2===e}),!0)&&z(t)?[2,H((function(e,n){return Y(n,t,(function(){return e.setConversationStatus(t.conversationType,t.targetId,void 0,r,t.channelId)}),"setConversationNotificationStatus")}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.setConversationToTop=function(t,r){return void 0===r&&(r=!0),n(this,void 0,void 0,(function(){var a=this;return o(this,(function(s){return e.validate("options.type",t.conversationType,e.isValidConversationType,!0)&&e.validate("options.targetId",t.targetId,e.AssertRules.STRING,!0)&&e.validate("options.channelId",t.channelId,e.AssertRules.CHANNEL_ID)?[2,H((function(s,i){return n(a,void 0,void 0,(function(){var n,a;return o(this,(function(o){switch(o.label){case 0:return n="conversationType:".concat(t.conversationType,",targetId:").concat(t.targetId),i.debug(e.LogTagId.O,"set conversation status ->".concat(n)),[4,s.setConversationStatus(t.conversationType,t.targetId,r,void 0,t.channelId)];case 1:return(a=o.sent())!==e.ErrorCode.SUCCESS?(i.warn(e.LogTagId.O,"set conversation status fail ->".concat(a,":").concat(q[a],",").concat(n)),[2,{code:a,msg:q[a]}]):[2,{code:a}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.setConversationToTopInTag=function(t,r,a){return n(this,void 0,void 0,(function(){var s=this;return o(this,(function(i){return e.validate("tagId",t,e.AssertRules.STRING,!0)&&e.validate("conversation.targetId",r.targetId,e.AssertRules.STRING,!0)&&e.validate("conversation.conversationType",r.conversationType,e.AssertRules.NUMBER,!0)&&e.validate("conversation.channelId",r.channelId,e.AssertRules.CHANNEL_ID)&&e.validate("status.isTop",a,e.AssertRules.BOOLEAN,!0)?[2,H((function(i,c){return n(s,void 0,void 0,(function(){var n;return o(this,(function(o){switch(o.label){case 0:return c.info(e.LogTagId.O,"setConversationStatusInTag ->tagId:".concat(t,",targetId:").concat(r.targetId,",conversationType").concat(r.conversationType)),[4,i.setConversationStatusInTag(t,r,{isTop:a})];case 1:return(n=o.sent().code)===e.ErrorCode.SUCCESS?[2,{code:n}]:(c.warn(e.LogTagId.O,"setConversationStatusInTag ->code:".concat(n,",tagId:").concat(t)),[2,{code:n,msg:q[n]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.setMessageReceivedStatus=function(t,r){return n(this,void 0,void 0,(function(){var a=this;return o(this,(function(s){return P("RongIMLib.setMessageReceivedStatus","RongIMLib.ElectronExtension.setMessageReceivedStatus"),e.usingCppEngine()?e.validate("messageId",t,e.AssertRules.NUMBER,!0)&&e.validate("receivedStatus",r,e.AssertRules.NUMBER,!0)?[2,H((function(s,i){return n(a,void 0,void 0,(function(){var n;return o(this,(function(o){switch(o.label){case 0:return i.info(e.LogTagId.O,"setMessageReceivedStatus ->messageId:".concat(t,",receivedStatus:").concat(r)),[4,s.setMessageReceivedStatus(t,r)];case 1:return(n=o.sent())===e.ErrorCode.SUCCESS?[2,{code:n}]:(i.warn(e.LogTagId.O,"setMessageReceivedStatus ->code:".concat(n,",messageId:").concat(t)),[2,{code:n,msg:q[n]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:q[e.ErrorCode.NOT_SUPPORT]}]}))}))},exports.setUltraGroupDefaultNotificationLevel=function(t,r){return n(this,void 0,void 0,(function(){var a=this;return o(this,(function(s){return t.channelId=t.channelId||"",e.validate("options.targetId",t.targetId,e.AssertRules.STRING,!0)&&e.validate("options.channelId",t.channelId,e.AssertRules.ONLY_STRING,!0)&&e.validate("notificationLevel",r,(function(t){return void 0!==e.NotificationLevel[t]}),!0)?[2,H((function(s,i){return n(a,void 0,void 0,(function(){var n,a,c;return o(this,(function(o){switch(o.label){case 0:return n="setUltraGroupDefaultNotificationLevel",a="targetId: ".concat(t.targetId,", channelId: ").concat(t.channelId),i.debug(e.LogTagId.O,"".concat(n," -> ").concat(a)),[4,s.setUltraGroupDefaultNotificationLevel(t.targetId,r,t.channelId)];case 1:return(c=o.sent().code)===e.ErrorCode.SUCCESS?[2,{code:c}]:(i.warn(e.LogTagId.O,"".concat(n," fail -> ").concat(c," : ").concat(q[c]," , ").concat(a)),[2,{code:c,msg:q[c]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.updateExpansionForUltraGroupMessage=function(t,r){return n(this,void 0,void 0,(function(){var a=this;return o(this,(function(s){return e.validate("expansion",t,e.AssertRules.OBJECT,!0)&&e.validate("message",r,e.AssertRules.OBJECT,!0)?[2,H((function(s,i){return n(a,void 0,void 0,(function(){var n,a,c,d,u,l,g,v,f;return o(this,(function(o){switch(o.label){case 0:return n=r.conversationType,a=r.targetId,c=r.messageUId,d=r.sentTime,u=r.canIncludeExpansion,l=r.channelId,g="conversationType:".concat(n,",targetId:").concat(a,",channelId:").concat(l,",messageUId:").concat(c),i.debug(e.LogTagId.O,"update expansion for ultragroup message ->".concat(g)),v={targetId:a,channelId:l,conversationType:n,sendTime:d,canIncludeExpansion:u,messageUId:c,expansion:t},[4,s.expandUltraMessage(v)];case 1:return(f=o.sent().code)===e.ErrorCode.SUCCESS?[2,{code:e.ErrorCode.SUCCESS}]:(i.warn(e.LogTagId.O,"update expansion for ultragroup message ->".concat(f,":").concat(q[f])),[2,{code:f,msg:q[f]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.updateMessageExpansion=function(t,r){return n(this,void 0,void 0,(function(){var a=this;return o(this,(function(s){return e.validate("expansion",t,e.AssertRules.OBJECT,!0)&&e.validate("message",r,e.AssertRules.OBJECT,!0)?[2,H((function(s,i){return n(a,void 0,void 0,(function(){var n,a,c,d,u,l,g,v;return o(this,(function(o){switch(o.label){case 0:return n=r.conversationType,a=r.targetId,c=r.messageUId,d=r.canIncludeExpansion,u=r.expansion,l=r.channelId,g="conversationType:".concat(n,",targetId:").concat(a,",messageUId:").concat(c),i.debug(e.LogTagId.O,"update message expansion ->".concat(g)),[4,s.sendExpansionMessage({conversationType:n,targetId:a,messageUId:c,expansion:t,canIncludeExpansion:d,originExpansion:u,channelId:l})];case 1:return(v=o.sent().code)!==e.ErrorCode.SUCCESS?(i.warn(e.LogTagId.O,"update message expansion fail ->".concat(v,":").concat(q[v],",").concat(g)),[2,{code:v,msg:q[v]}]):[2,{code:v}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.updateTag=function(t){return n(this,void 0,void 0,(function(){var r=this;return o(this,(function(a){return e.validate("tag.tagId",t.tagId,e.AssertRules.STRING,!0)&&e.validate("tag.tagName",t.tagName,e.AssertRules.STRING,!0)&&e.validate("tag.tagName",t.tagName,(function(e){return e.length<=15}))?[2,H((function(a,s){return n(r,void 0,void 0,(function(){var n;return o(this,(function(o){switch(o.label){case 0:return s.info(e.LogTagId.O,"updateTag ->tagId:".concat(t.tagId,",tagName:").concat(t.tagName)),[4,a.updateTag(t)];case 1:return(n=o.sent().code)===e.ErrorCode.SUCCESS?[2,{code:n}]:(s.warn(e.LogTagId.O,"updateTag ->code:".concat(n,",tagId:").concat(t.tagId)),[2,{code:n,msg:q[n]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))};