@rongcloud/imlib-next 5.8.5 → 5.8.6-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.esm.js CHANGED
@@ -1 +1 @@
1
- import{httpRequest as e,NetworkType as t,HttpMethod as n,HTTP_TIMEOUT as o,appendUrl as r,ErrorCode as i,ReceivedStatus as a,ConversationType as s,isNumber as c,EventEmitter as u,RCConnectionStatus as d,VersionManage as l,assert as f,AssertRules as v,isArray as g,isHttpUrl as I,APIContext as h,LogTagId as R,logger as m,validate as E,isValidConversationType as S,isValidNotificationLevel as T,NotificationLevel as p,isTypeInConversationList as O,UltraGroupChannelType as N,isString as _,MAX_UPLOAD_FILE_SIZE as C,UPLOAD_FILE_CHUNK_SIZE as A,UploadMethod as U,fixUrlProtocol as y,FileType as M,getUUID as P,isValidFileType as L,usingCppEngine as w,MessageDirection as B,SentStatus as D,isUndefined as b}from"@rongcloud/engine";export{AreaCode,ChatroomEntryType,ChatroomSyncStatusReason,ChatroomUserChangeType,ChrmMemBanType,ChrmMemOperateType,ChrmSyncStatus,ConnectionStatus,ConversationType,ErrorCode,FileType,LogL,LogLevel,MentionedType,MessageBlockSourceType,MessageBlockType,MessageDirection,NotificationLevel,NotificationStatus,OperateStatus,RCConnectionStatus,ReceivedStatus,SentStatus,UltraGroupChannelChangeType,UltraGroupChannelType,UploadMethod}from"@rongcloud/engine";var G=function(e,t){return G=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},G(e,t)};function V(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}G(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var k=function(){return k=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},k.apply(this,arguments)};function x(e,t,n,o){return new(n||(n=Promise))((function(r,i){function a(e){try{c(o.next(e))}catch(e){i(e)}}function s(e){try{c(o.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((o=o.apply(e,t||[])).next())}))}function F(e,t){var n,o,r,i,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,o&&(r=2&s[0]?o.return:s[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,s[1])).done)return r;switch(o=0,r&&(s=[2&s[0],r.value]),s[0]){case 0:case 1:r=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,o=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(r=a.trys,(r=r.length>0&&r[r.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]<r[3])){a.label=s[1];break}if(6===s[0]&&a.label<r[1]){a.label=r[1],r=s;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(s);break}r[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],o=0}finally{n=r=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}}var Z=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))},H=Z();var J=null,q=function(e){return x(void 0,void 0,void 0,(function(){var t;return F(this,(function(n){switch(n.label){case 0:return[4,K.getNetworkType()];case 1:return t=n.sent(),J({status:"online"===e.type,type:t}),[2]}}))}))};var K={tag:"browser",httpReq:e,localStorage:null===window||void 0===window?void 0:window.localStorage,sessionStorage:null===window||void 0===window?void 0:window.sessionStorage,useNavi:!0,connectPlatform:"",isFromUniapp:H,createWebSocket:function(e,t){var n=new WebSocket(e,t);return n.binaryType="arraybuffer",{id:Date.now(),onClose:function(e){n.onclose=function(t){var n=t.code,o=t.reason;e(n,o)}},onError:function(e){n.onerror=e},onMessage:function(e){n.onmessage=function(t){e(t.data)}},onOpen:function(e){n.onopen=e},send:function(e){n.send(e)},close:function(e,t){n.close()}}},getNetworkType:function(){var e=navigator.connection||navigator.mozConnection||navigator.webkitConnection||{effectiveType:t.UNKONWN},n=e.type,o=e.effectiveType,r=n||o||t.UNKONWN;return Promise.resolve(r)},setNetworkStatusListener:function(e){J=e,"undefined"!=typeof window&&window&&(window.addEventListener("offline",q),window.addEventListener("online",q))},removeNetworkStatusListener:function(){"undefined"!=typeof window&&window&&(window.removeEventListener("offline",q),window.removeEventListener("online",q)),J=null}},Y=Z(),z=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)}}},j={setItem:z("setStorageSync"),getItem:z("getStorageSync"),removeItem:z("removeStorageSync"),clear:z("clearStorageSync")},W=null,Q=function(e){var t=e.isConnected,n=e.networkType;W({status:t,type:n})};var X={tag:"wechat",httpReq:function(e){var t=e.method||n.GET,a=e.timeout||o,s=e.headers,c=e.query,u=e.body,d=r(e.url,c);return new Promise((function(e){wx.request({url:d,method:t,header:s,timeout:a,data:u,success:function(t){e({data:t.data,status:t.statusCode})},fail:function(){e({status:i.RC_HTTP_REQ_FAIL})}})}))},localStorage:j,sessionStorage:j,useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:Y,createWebSocket:function(e,t){var n=wx.connectSocket({url:e,protocols:t});return{id:Date.now(),onClose:function(e){n.onClose((function(t){e(t.code,t.reason)}))},onError:function(e){n.onError((function(t){e(t.errMsg)}))},onMessage:function(e){n.onMessage((function(t){e(t.data)}))},onOpen:function(e){n.onOpen(e)},send:function(e){n.send({data:e})},close:function(e,t){n.close({code:e,reason:t})}}},getNetworkType:function(){return new Promise((function(e){wx.getNetworkType({success:function(t){var n=t.networkType;e(n)},fail:function(){e(t.UNKONWN)}})}))},setNetworkStatusListener:function(e){W=e,wx.onNetworkStatusChange(Q)},removeNetworkStatusListener:function(){wx.offNetworkStatusChange(Q),W=null}},$=Z(),ee=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){}}},te={setItem:ee("setStorageSync"),getItem:ee("getStorageSync"),removeItem:ee("removeStorageSync"),clear:ee("clearStorageSync")},ne=null,oe=function(e){var t=e.isConnected,n=e.networkType;ne({status:t,type:n})};var re={tag:"alipay",httpReq:function(e){var t=e.method||n.GET,a=e.timeout||o,s=e.headers,c=e.query,u=e.body,d=r(e.url,c),l=e.dataType||"json";return new Promise((function(e){my.request({url:d,method:t,headers:s,timeout:a,data:u,dataType:l,success:function(t){e({data:t.data,status:t.status})},fail:function(){e({status:i.RC_HTTP_REQ_FAIL})}})}))},localStorage:te,sessionStorage:te,useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:$,createWebSocket:function(e){var t=my.connectSocket({url:e,multiple:!0});return{id:Date.now(),onClose:function(e){t.onClose(e)},onError:function(e){t.onError((function(t){e(t.errMsg)}))},onMessage:function(e){t.onMessage((function(t){t.data.isBuffer?e(my.base64ToArrayBuffer(t.data.data)):e(t.data.data)}))},onOpen:function(e){t.onOpen(e)},send:function(e){t.send({data:my.arrayBufferToBase64(e),isBuffer:!0})},close:function(){t.close()}}},getNetworkType:function(){return new Promise((function(e){my.getNetworkType({success:function(t){var n=t.networkType;e(n)},fail:function(){e(t.UNKONWN)}})}))},setNetworkStatusListener:function(e){ne=e,my.onNetworkStatusChange(oe)},removeNetworkStatusListener:function(){my.offNetworkStatusChange(oe),ne=null}},ie=Z(),ae=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){}}},se={setItem:ae("setStorageSync"),getItem:ae("getStorageSync"),removeItem:ae("removeStorageSync"),clear:ae("clearStorageSync")},ce=null,ue=function(e){var t=e.isConnected,n=e.networkType;ce({status:t,type:n})};var de={tag:"toutiao",useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:ie,localStorage:se,sessionStorage:se,httpReq:function(e){return new Promise((function(t){tt.request({url:e.url,data:e.body,header:e.headers,method:e.method,success:function(e){var n=(null==e?void 0:e.data)||{},o={data:JSON.stringify(n),status:e.statusCode};t(o)},fail:function(e){t({status:i.RC_HTTP_REQ_FAIL})}})}))},createWebSocket:function(e,t){var n=tt.connectSocket({url:e,protocols:t});return{id:Date.now(),onOpen:function(e){n.onOpen(e)},onClose:function(e){n.onClose((function(t){return e(t.code,t.reason)}))},onError:function(e){n.onError((function(t){return e(t.errMsg)}))},onMessage:function(e){n.onMessage((function(t){return e(t.data)}))},send:function(e){n.send({data:e})},close:function(e,t){n.close({code:e,reason:t})}}},getNetworkType:function(){return new Promise((function(e){tt.getNetworkType({success:function(t){var n=t.networkType;e(n)},fail:function(){e(t.UNKONWN)}})}))},setNetworkStatusListener:function(e){ce=e,tt.onNetworkStatusChange(ue)},removeNetworkStatusListener:function(){tt.offNetworkStatusChange(ue),ce=null}},le=Z(),fe=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){}}},ve={setItem:fe("setStorageSync"),getItem:fe("getStorageSync"),removeItem:fe("removeStorageSync"),clear:fe("clearStorageSync")},ge=null,Ie=function(e){var t=e.isConnected,n=e.networkType;ge({status:t,type:n})};var he={tag:"baidu",useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:le,localStorage:ve,sessionStorage:ve,httpReq:function(e){return new Promise((function(t,n){swan.request({url:e.url,data:e.body,header:e.headers,method:e.method,success:function(e){var n=(null==e?void 0:e.data)||{},o={data:JSON.stringify(n),status:e.statusCode};t(o)},fail:function(e){t({status:i.RC_HTTP_REQ_FAIL})}})}))},createWebSocket:function(e,t){var n=swan.connectSocket({url:e,protocols:t});return{id:Date.now(),onOpen:function(e){n.onOpen(e)},onClose:function(e){n.onClose((function(t){return e(t.code,t.reason)}))},onError:function(e){n.onError((function(t){return e(t.errMsg)}))},onMessage:function(e){n.onMessage((function(t){return e(t.data)}))},send:function(e){n.send({data:e})},close:function(e,t){n.close({code:e,reason:t})}}},getNetworkType:function(){return x(this,void 0,void 0,(function(){return F(this,(function(e){return[2,new Promise((function(e){swan.getNetworkType({success:function(t){var n=t.networkType;e(n)},fail:function(){e(t.UNKONWN)}})}))]}))}))},setNetworkStatusListener:function(e){ge=e,swan.onNetworkStatusChange(Ie)},removeNetworkStatusListener:function(){swan.offNetworkStatusChange(Ie),ge=null}},Re=Z(),me=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return jd[e].apply(jd,t)}catch(e){null===console||void 0===console||console.error(e)}}},Ee={setItem:me("setStorageSync"),getItem:me("getStorageSync"),removeItem:me("removeStorageSync"),clear:me("clearStorageSync")},Se=null,Te=function(e){var t=e.isConnected,n=e.networkType;Se({status:t,type:n})};var pe={tag:"jingdong",httpReq:function(e){var t=e.method||n.GET,a=e.timeout||o,s=e.headers,c=e.query,u=e.body,d=r(e.url,c);return new Promise((function(e){jd.request({url:d,method:t,headers:s,timeout:a,data:u,success:function(t){e({data:t.data,status:t.statusCode})},fail:function(){e({status:i.RC_HTTP_REQ_FAIL})}})}))},localStorage:Ee,sessionStorage:Ee,useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:Re,createWebSocket:function(e,t){return jd.connectSocket({url:e,protocols:t}),{id:Date.now(),onClose:function(e){jd.onSocketClose((function(t){e(t.code,t.reason)}))},onError:function(e){jd.onSocketError((function(t){e(t.errMsg)}))},onMessage:function(e){jd.onSocketMessage((function(t){e(t.data)}))},onOpen:function(e){jd.onSocketOpen(e)},send:function(e){jd.sendSocketMessage({data:e})},close:function(e,t){jd.closeSocket({code:e,reason:t})}}},getNetworkType:function(){return new Promise((function(e){jd.getNetworkType({success:function(t){var n=t.networkType;e(n)},fail:function(){e(t.UNKONWN)}})}))},setNetworkStatusListener:function(e){Se=e,jd.onNetworkStatusChange(Te)},removeNetworkStatusListener:function(){jd.offNetworkStatusChange(Te),Se=null}},Oe=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)}}},Ne={setItem:Oe("setStorageSync"),getItem:Oe("getStorageSync"),removeItem:Oe("removeStorageSync"),clear:Oe("clearStorageSync")},_e=null,Ce=function(e){var t=e.isConnected,n=e.networkType;_e({status:t,type:n})};var Ae,Ue={tag:"uniapp",httpReq:function(e){var t=e.method||n.GET,a=e.timeout||o,s=e.headers,c=e.query,u=e.body,d=r(e.url,c);return new Promise((function(e){uni.request({url:d,method:t,header:s,timeout:a,data:u,success:function(t){e({data:t.data,status:t.statusCode})},fail:function(){e({status:i.RC_HTTP_REQ_FAIL})}})}))},localStorage:Ne,sessionStorage:Ne,useNavi:!0,connectPlatform:"",isFromUniapp:!0,createWebSocket:function(e,t){var n={complete:function(){},url:e,protocols:t},o=uni.connectSocket(n);return{id:Date.now(),onClose:function(e){o.onClose((function(t){e(t.code,t.reason)}))},onError:function(e){o.onError((function(t){e(t.errMsg)}))},onMessage:function(e){o.onMessage((function(t){e(t.data)}))},onOpen:function(e){o.onOpen(e)},send:function(e){o.send({data:e})},close:function(e,t){o.close({code:e,reason:t})}}},getNetworkType:function(){return new Promise((function(e){uni.getNetworkType({success:function(t){var n=t.networkType;e(n)},fail:function(){e(t.UNKONWN)}})}))},setNetworkStatusListener:function(e){_e=e,uni.onNetworkStatusChange(Ce)},removeNetworkStatusListener:function(){uni.offNetworkStatusChange(Ce),_e=null}},ye=function(e){return e&&e.request&&e.getSystemInfo},Me="undefined"!=typeof uni&&ye(uni)?function(){switch(process.env.VUE_APP_PLATFORM){case"app-plus":return Ue;case"mp-jd":return pe;case"mp-baidu":return he;case"mp-toutiao":return de;case"mp-alipay":return re;case"mp-weixin":return X;default:return K}}():"undefined"!=typeof jd&&ye(jd)?pe:"undefined"!=typeof my&&ye(my)?re:"undefined"!=typeof tt&&ye(tt)?de:"undefined"!=typeof swan&&ye(swan)?he:"undefined"!=typeof wx&&ye(wx)?X:K;function Pe(e){var t=e.conversationType,n=e.channelId,o=e.messageType,r=e.content,i=e.senderUserId,u=e.targetId,d=e.sentTime,l=e.receivedTime,f=e.messageUId,v=e.messageDirection,g=e.isPersited,I=e.isCounted,h=e.isOffLineMessage,R=e.canIncludeExpansion,m=e.expansion,E=e.receivedStatus,S=e.disableNotification,T=e.isMentioned,p=e.isStatusMessage,O=e.readReceiptInfo,N=e.pushConfig,_=e.messageId,C=e.isInterrupt,A=e.isModifyMessage,U=e.channelType,y=e.sentStatus;E||(E=a.UNREAD);var M={messageType:o,channelId:n||"",content:r,senderUserId:i,targetId:u,conversationType:t,sentTime:d,receivedTime:l,messageUId:f,messageDirection:v,isPersited:g,isCounted:I,isMentioned:T,disableNotification:S,isStatusMessage:p,canIncludeExpansion:R,expansion:m,receivedStatus:E,readReceiptInfo:O,pushConfig:N,messageId:_,isInterrupt:C,isModifyMessage:A,sentStatus:y};return t!==s.ULTRA_GROUP&&(M.isOffLineMessage=h),t===s.ULTRA_GROUP&&c(U)&&(M.channelType=U),M}function Le(e){var t=e.conversationType,n=e.targetId,o=e.latestMessage,r=e.unreadMessageCount,i=e.hasMentioned,a=e.mentionedInfo,c=e.lastUnreadTime,u=e.notificationStatus,d=e.notificationLevel,l=e.isTop,f=e.channelId,v=e.unreadMentionedCount,g=e.matchCount,I=e.unreadMentionedMeCount,h=e.operationTime,R={conversationType:t,targetId:n,latestMessage:o&&Pe(o),unreadMessageCount:r,hasMentioned:i,mentionedInfo:i?{type:null==a?void 0:a.type,userIdList:null==a?void 0:a.userIdList}:void 0,lastUnreadTime:c,notificationStatus:u,notificationLevel:d,isTop:l,channelId:f,unreadMentionedCount:v,matchCount:g,unreadMentionedMeCount:I,operationTime:h};return R.conversationType===s.ULTRA_GROUP&&(R.firstUnreadMessage=e.firstUnreadMessage,R.channelType=e.channelType),R}function we(e,t){null===console||void 0===console||console.warn("Method '".concat(e,"' is deprecated, please use '").concat(t,"' instead"))}!function(e){e.CONNECTING="CONNECTING",e.CONNECTED="CONNECTED",e.DISCONNECT="DISCONNECT",e.SUSPEND="SUSPEND",e.MESSAGES="MESSAGES",e.READ_RECEIPT_RECEIVED="READ_RECEIPT_RECEIVED",e.MESSAGE_RECEIPT_REQUEST="MESSAGE_RECEIPT_REQUEST",e.MESSAGE_RECEIPT_RESPONSE="MESSAGE_RECEIPT_RESPONSE",e.CONVERSATION="CONVERSATION",e.CHATROOM="CHATROOM",e.EXPANSION="EXPANSION",e.PULL_OFFLINE_MESSAGE_FINISHED="PULL_OFFLINE_MESSAGE_FINISHED",e.TAG="TAG",e.CONVERSATION_TAG="CONVERSATION_TAG",e.TYPING_STATUS="TYPING_STATUS",e.MESSAGE_BLOCKED="MESSAGE_BLOCKED",e.ULTRA_GROUP_ENABLE="ULTRA_GROUP_ENABLE",e.OPERATE_STATUS="OPERATE_STATUS",e.ULTRA_GROUP_MESSAGE_EXPANSION_UPDATED="ULTRA_GROUP_MESSAGE_EXPANSION_UPDATED",e.ULTRA_GROUP_MESSAGE_MODIFIED="ULTRA_GROUP_MESSAGE_MODIFIED",e.ULTRA_GROUP_MESSAGE_RECALLED="ULTRA_GROUP_MESSAGE_RECALLED",e.ULTRA_GROUP_CHANNEL_TYPE_CHANGE="ULTRA_GROUP_CHANNEL_TYPE_CHANGE",e.ULTRA_GROUP_CHANNEL_DELETE="ULTRA_GROUP_CHANNEL_DELETE",e.ULTRA_GROUP_CHANNEL_USER_KICKED="ULTRA_GROUP_CHANNEL_USER_KICKED",e.PRIVATE_MESSAGE_DELIVERED="PRIVATE_MESSAGE_DELIVERED",e.GROUP_MESSAGE_DELIVERED="GROUP_MESSAGE_DELIVERED",e.USER_GROUP_STATUS="USER_GROUP_STATUS"}(Ae||(Ae={}));var Be=new u,De={connection:function(e,t){switch(e){case d.CONNECTED:Be.emit(Ae.CONNECTED);break;case d.CONNECTING:Be.emit(Ae.CONNECTING);break;case d.SUSPENDED:Be.emit(Ae.SUSPEND,t);break;case d.DISCONNECTED:Be.emit(Ae.DISCONNECT,t)}},batchMessage:function(e){Be.emit(Ae.MESSAGES,{messages:e.map((function(e){return Pe(e)}))})},typingState:function(e){Be.emit(Ae.TYPING_STATUS,{status:e})},readReceiptReceived:function(e,t,n){Be.emit(Ae.READ_RECEIPT_RECEIVED,{conversation:e,messageUId:t,sentTime:n})},messageReceiptRequest:function(e,t,n){Be.emit(Ae.MESSAGE_RECEIPT_REQUEST,{conversation:e,messageUId:t,senderUserId:n})},messageReceiptResponse:function(e,t,n){Be.emit(Ae.MESSAGE_RECEIPT_RESPONSE,{conversation:e,receivedUserId:t,messageUIdList:n})},conversationState:function(e){var t=e.map((function(e){var t=e.conversationType,n={conversationType:t,latestMessage:e.latestMessage?Pe(e.latestMessage):null,targetId:e.targetId,unreadMessageCount:e.unreadMessageCount,unreadMentionedCount:e.unreadMentionedCount,notificationStatus:e.notificationStatus,notificationLevel:e.notificationLevel,lastUnreadTime:e.lastUnreadTime,channelId:e.channelId};return t===s.ULTRA_GROUP?(n.versionTime=e.versionTime,n.unreadMessageCount=be(e.unreadMessageCount||0),n.unreadMentionedCount=be(e.unreadMentionedCount||0),n.unreadMentionedMeCount=be(e.unreadMentionedMeCount||0),{conversation:n}):(n.hasMentioned=e.hasMentioned,n.mentionedInfo=e.mentionedInfo,n.isTop=e.isTop,{conversation:n,updatedItems:e.updatedItems})}));Be.emit(Ae.CONVERSATION,{conversationList:t})},chatroomState:function(e){Be.emit(Ae.CHATROOM,e)},expansion:function(e){Be.emit(Ae.EXPANSION,e)},pullFinished:function(){Be.emit(Ae.PULL_OFFLINE_MESSAGE_FINISHED)},tag:function(){Be.emit(Ae.TAG)},conversationTagChanged:function(){Be.emit(Ae.CONVERSATION_TAG)},messageBlocked:function(e){Be.emit(Ae.MESSAGE_BLOCKED,e)},messageDelivered:function(e){Be.emit(Ae.PRIVATE_MESSAGE_DELIVERED,e)},groupMessageDeliveredStatus:function(e){Be.emit(Ae.GROUP_MESSAGE_DELIVERED,e)},ultraGroupEnable:function(e){Be.emit(Ae.ULTRA_GROUP_ENABLE,e.map((function(e){return Le(e)})))},operateStatus:function(e){Be.emit(Ae.OPERATE_STATUS,e)},ultraGroupMessageExpansionUpdated:function(e){Be.emit(Ae.ULTRA_GROUP_MESSAGE_EXPANSION_UPDATED,e.map((function(e){return Pe(e)})))},ultraGroupMessageModified:function(e){Be.emit(Ae.ULTRA_GROUP_MESSAGE_MODIFIED,e.map((function(e){return Pe(e)})))},ultraGroupMessageRecalled:function(e){Be.emit(Ae.ULTRA_GROUP_MESSAGE_RECALLED,e.map((function(e){return Pe(e)})))},ultraGroupChannelChangeType:function(e){Be.emit(Ae.ULTRA_GROUP_CHANNEL_TYPE_CHANGE,e)},ultraGroupChannelUserKicked:function(e){Be.emit(Ae.ULTRA_GROUP_CHANNEL_USER_KICKED,e)},ultraGroupChannelDelete:function(e){Be.emit(Ae.ULTRA_GROUP_CHANNEL_DELETE,e)},userGroupStatus:function(e){Be.emit(Ae.USER_GROUP_STATUS,e)}};function be(e){return e>999?999:e}l.add("imlib-next","5.8.5");var Ge=null,Ve=null,ke=null;function xe(){return x(this,void 0,void 0,(function(){return F(this,(function(e){switch(e.label){case 0:return Ge?(ke.info(R.A_DESTROY_O),[4,h.destroy()]):[2];case 1:return e.sent(),Ve=null,Ge=null,ke=null,[2]}}))}))}function Fe(e){if(!Ge)throw new Error("Not initialized yet!");return e(Ge,ke,Ve)}function Ze(e){return Ge?e(Ge,ke,Ve):Promise.resolve({code:i.BIZ_ERROR_CLIENT_NOT_INIT})}function He(e,t,n){Be.on(e,t,n)}function Je(e,t,n){Be.once(e,t,n)}function qe(e,t,n){Be.off(e,t,n)}function Ke(e){Be.removeAll(e)}function Ye(){Be.clear()}function ze(e){!function(e){var t,n=e.appkey,o=e.navigators;Ge?ke.warn(R.A_INIT_REPEAT_O):(f("options.appkey",e.appkey,v.STRING,!0),f("options.navigators",e.navigators,(function(e){return g(e)&&(0===e.length||e.every(I))})),Ve=e,Ge=h.init((null===(t=e.__runtimeCreator__)||void 0===t?void 0:t.call(e))||Me,{appkey:e.appkey,navigators:e.navigators||[],miniCMPProxy:e.customCMP||[],logOutputLevel:e.logOutputLevel,__reportLogLevel:e.__reportLogLevel,httpInMainProcess:!!e.httpInMainProcess,logExpireTime:e.logExpireTime,areaCode:e.areaCode,logServerUrl:e.logServerUrl,environment:e.environment}),(ke=Ge.createLogger("RC-IM","IM")).setOutputLevel(e.logOutputLevel),ke.info(R.A_INIT_O,JSON.stringify({appkey:n,navigators:o,version:"5.8.5",commit:"6c5819c31229d7abce106e4b4832ba21ddca578d"})),Ge.assignWatcher(De),m.init(ke))}(e)}function je(){return x(this,void 0,void 0,(function(){return F(this,(function(e){return Ge?(Ye(),[2,xe()]):[2]}))}))}function We(){return Fe((function(e){return e.getConnectionStatus()}))}function Qe(){return Fe((function(e){return e.getServerTime()}))}function Xe(){return Fe((function(e){return e.getCurrentUserId()}))}function $e(e,t){l.add(e,t)}function et(){return Fe((function(e){return e.getDeviceId()}))}function nt(e,t){return Fe((function(n){return n.install(e,t)}))}var ot={TIMEOUT:{code:-1,msg:"Network timeout"},REJECTED_BY_BLACKLIST:{code:405,msg:"Blacklisted by the other party"},SEND_TOO_FAST:{code:20604,msg:"Sending messages too quickly"},NOT_IN_GROUP:{code:22406,msg:"Not in group"},ULTRA_GROUP_USER_NOT_IN_PRIVATE_CHANNEL:{code:i.ULTRA_GROUP_USER_NOT_IN_PRIVATE_CHANNEL,msg:"ultra group user not in private channel"},FORBIDDEN_IN_GROUP:{code:22408,msg:"Forbbiden from speaking in the group"},NOT_IN_CHATROOM:{code:23406,msg:"Not in chatRoom"},FORBIDDEN_IN_CHATROOM:{code:23408,msg:"Forbbiden from speaking in the chatRoom"},KICKED_FROM_CHATROOM:{code:23409,msg:"Kicked out and forbbiden from joining the chatRoom"},CHATROOM_NOT_EXIST:{code:23410,msg:"ChatRoom does not exist"},CHATROOM_IS_FULL:{code:23411,msg:"ChatRoom members exceeded"},PARAMETER_INVALID_CHATROOM:{code:23412,msg:"Invalid chatRoom parameters"},ROAMING_SERVICE_UNAVAILABLE_CHATROOM:{code:23414,msg:"ChatRoom message roaming service is not open, Please go to the developer to open this service"},RECALLMESSAGE_PARAMETER_INVALID:{code:25101,msg:"Invalid recall message parameter"},ROAMING_SERVICE_UNAVAILABLE_MESSAGE:{code:25102,msg:"Single group chat roaming service is not open, Please go to the developer to open this service"},PUSHSETTING_PARAMETER_INVALID:{code:26001,msg:"Invalid push parameter"},OPERATION_BLOCKED:{code:20605,msg:"Operation is blocked"},OPERATION_NOT_SUPPORT:{code:20606,msg:"Operation is not supported"},MSG_BLOCKED_SENSITIVE_WORD:{code:21501,msg:"The sent message contains sensitive words"},REPLACED_SENSITIVE_WORD:{code:21502,msg:"Sensitive words in the message have been replaced"},NOT_CONNECTED:{code:30001,msg:"Please connect successfully first"},NAVI_REQUEST_ERROR:{code:30007,msg:"Navigation http request failed"},CMP_REQUEST_ERROR:{code:30010,msg:"CMP sniff http request failed"},CONN_APPKEY_FAKE:{code:31002,msg:"Your appkey is fake"},CONN_MINI_SERVICE_NOT_OPEN:{code:31003,msg:"Mini program service is not open, Please go to the developer to open this service"},CONN_ACK_TIMEOUT:{code:31e3,msg:"Connection ACK timeout"},CONN_TOKEN_INCORRECT:{code:31004,msg:"Your token is not valid or expired"},CONN_NOT_AUTHRORIZED:{code:31005,msg:"AppKey and Token do not match"},CONN_REDIRECTED:{code:31006,msg:"Connection redirection"},CONN_APP_BLOCKED_OR_DELETED:{code:31008,msg:"AppKey is banned or deleted"},CONN_USER_BLOCKED:{code:31009,msg:"User blocked"},CONN_DOMAIN_INCORRECT:{code:31012,msg:"Connect domain error, Please check the set security domain"},ROAMING_SERVICE_UNAVAILABLE:{code:33007,msg:"Roaming service cloud is not open, Please go to the developer to open this service"},RC_CONNECTION_EXIST:{code:34001,msg:"Connection already exists"},CHATROOM_KV_EXCEED:{code:23423,msg:"ChatRoom KV setting exceeds maximum"},CHATROOM_KV_OVERWRITE_INVALID:{code:23424,msg:"ChatRoom KV already exists"},CHATROOM_KV_STORE_NOT_OPEN:{code:23426,msg:"ChatRoom KV storage service is not open, Please go to the developer to open this service"},CHATROOM_KEY_NOT_EXIST:{code:23427,msg:"ChatRoom key does not exist"},MSG_KV_NOT_SUPPORT:{code:34008,msg:"The message cannot be extended"},SEND_MESSAGE_KV_FAIL:{code:34009,msg:"Sending RC expansion message fail"},EXPANSION_LIMIT_EXCEET:{code:34010,msg:"The message expansion size is beyond the limit"},ILLGAL_PARAMS:{code:33003,msg:"Incorrect parameters passed in while calling the interface"},UPLOAD_FILE_FAILED:{code:35020,msg:"File upload failed"},CHATROOM_KV_STORE_NOT_ALL_SUCCESS:{code:23428,msg:"Chatroom kv store not all success"},CHATROOM_KV_STORE_OUT_LIMIT:{code:23429,msg:"Chatroom kv's length is out of limit"},TAG_EXISTS:{code:33101,msg:"The tag already exists"},TAG_NOT_EXIST:{code:33100,msg:"The tag does not exist"},NOT_SUPPORT:{code:i.NOT_SUPPORT,msg:"The method is not supported in a browser!"}},rt={};for(var it in ot){var at=ot[it].code;rt[at]=it}function st(e,t){return x(this,void 0,void 0,(function(){var n=this;return F(this,(function(o){return[2,Ze((function(o,r){return x(n,void 0,void 0,(function(){var n,a,s;return F(this,(function(c){switch(c.label){case 0:return E("token",e,v.STRING,!0)&&E("reconnectKickEnable",t,v.BOOLEAN)?(n=r.createTraceId(),r.info(R.A_CONNECT_T,JSON.stringify({token:e,reconnectKickEnable:t}),n),[4,o.connect(e,!!t,n)]):[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}];case 1:return a=c.sent(),s=a.code===i.SUCCESS?"info":"warn",r[s](R.A_CONNECT_R,JSON.stringify({code:a.code,userId:a.userId}),n),a.code===i.SUCCESS?[2,{code:a.code,data:{userId:a.userId}}]:[2,{code:a.code,msg:rt[a.code]}]}}))}))}))]}))}))}function ct(e){return m.info(R.A_DISCONNECT_O,{}),Fe((function(t){return t.disconnect(e)}))}function ut(e,t){return x(this,void 0,void 0,(function(){var n=this;return F(this,(function(o){return E("options.count",null==e?void 0:e.count,v.NUMBER)&&E("options.startTime",null==e?void 0:e.startTime,v.NUMBER)&&E("options.order",null==e?void 0:e.order,v.NUMBER)&&E("channelId",t,v.CHANNEL_ID)?[2,Ze((function(o,r){return x(n,void 0,void 0,(function(){var n,a,s;return F(this,(function(c){switch(c.label){case 0:return[4,o.getConversationList(null==e?void 0:e.count,void 0,null==e?void 0:e.startTime,null==e?void 0:e.order,t)];case 1:return n=c.sent(),a=n.code,s=n.data,a===i.SUCCESS&&s?[2,{code:0,data:s.map((function(e){return Le(e)}))}]:(r.warn(R.O,"get conversation list fail ->".concat(a,":").concat(rt[a])),[2,{code:a,msg:rt[a]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function dt(e){return x(this,void 0,void 0,(function(){var t=this;return F(this,(function(n){return E("options",e,v.CONVERSATION,!0)?[2,Ze((function(n,o){return x(t,void 0,void 0,(function(){var t,r,a;return F(this,(function(s){switch(s.label){case 0:return[4,n.getConversation(e.conversationType,e.targetId,e.channelId||"")];case 1:return t=s.sent(),r=t.code,a=t.data,r!==i.SUCCESS?(o.warn(R.O,"getConversation ->code:".concat(r,", targetId:").concat(e.targetId)),[2,{code:r,msg:rt[r]}]):[2,{code:r,data:a?Le(a):null}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function lt(e){return x(this,void 0,void 0,(function(){var t=this;return F(this,(function(n){return E("options",e,v.CONVERSATION,!0)?[2,Ze((function(n,o){return x(t,void 0,void 0,(function(){var t,r;return F(this,(function(a){switch(a.label){case 0:return[4,n.removeConversation(e.conversationType,e.targetId,e.channelId)];case 1:return t=a.sent(),r="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),o.debug(R.O,"destroy conversation ->".concat(r)),t!==i.SUCCESS?(o.warn(R.O,"destroy conversation fail ->".concat(t,":").concat(rt[t],",").concat(r)),[2,{code:t,msg:rt[t]}]):[2,{code:t}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function ft(e){return x(this,void 0,void 0,(function(){var t=this;return F(this,(function(n){return E("options",e,v.CONVERSATION,!0)?[2,Ze((function(n,o){return x(t,void 0,void 0,(function(){var t,r,a,s;return F(this,(function(c){switch(c.label){case 0:return[4,n.getConversationMessageDraft(e.conversationType,e.targetId,e.channelId)];case 1:return t=c.sent(),r=t.code,a=t.data,s="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),o.debug(R.O,"get draft ->".concat(s)),r===i.SUCCESS?[2,{code:r,data:a||""}]:(o.warn(R.O,"get draft fail ->".concat(r,":").concat(rt[r],",").concat(s)),[2,{code:r,msg:rt[r]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function vt(e,t){return x(this,void 0,void 0,(function(){var n=this;return F(this,(function(o){return E("options",e,v.CONVERSATION,!0)&&E("draft",t,v.STRING,!0)?[2,Ze((function(o,r){return x(n,void 0,void 0,(function(){var n,a;return F(this,(function(s){switch(s.label){case 0:return n="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),r.debug(R.O,"set draft ->".concat(n)),[4,o.saveConversationMessageDraft(e.conversationType,e.targetId,t,e.channelId)];case 1:return(a=s.sent())===i.SUCCESS?[2,{code:a}]:(r.warn(R.O,"set draft fail ->".concat(a,":").concat(rt[a],",").concat(n)),[2,{code:a,msg:rt[a]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function gt(e){return x(this,void 0,void 0,(function(){var t=this;return F(this,(function(n){return E("options",e,v.CONVERSATION,!0)?[2,Ze((function(n,o){return x(t,void 0,void 0,(function(){var t,r;return F(this,(function(a){switch(a.label){case 0:return t="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),o.debug(R.O,"delete draft ->".concat(t)),[4,n.clearConversationMessageDraft(e.conversationType,e.targetId,e.channelId)];case 1:return(r=a.sent())===i.SUCCESS?[2,{code:r}]:(o.warn(R.O,"delete draft fail ->".concat(r,":").concat(rt[r],",").concat(t)),[2,{code:r,msg:rt[r]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function It(e,t){return x(this,void 0,void 0,(function(){var n=this;return F(this,(function(o){return E("includeMuted",e,v.BOOLEAN,!1)&&E("conversationTypes",t,v.ARRAY,!1)&&!(null==t?void 0:t.some((function(e){return!E("conversationType",e,S)})))?[2,Ze((function(o,r){return x(n,void 0,void 0,(function(){var n,a,s;return F(this,(function(c){switch(c.label){case 0:return r.debug(R.O,"get total unread count -> ConversationType:".concat(JSON.stringify(t)," includeMuted:").concat(e)),[4,o.getTotalUnreadCount("",t,e)];case 1:return n=c.sent(),a=n.code,s=n.data,a===i.SUCCESS?[2,{code:a,data:s}]:(r.warn(R.O,"getTotalUnreadCount fail ->".concat(a,":").concat(rt[a])),[2,{code:a,msg:rt[a]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function ht(e,t){return x(this,void 0,void 0,(function(){var n=this;return F(this,(function(o){return!E("conversationTypes",e,v.ARRAY,!0)||!E("levels",t,v.ARRAY,!0)||e.some((function(e){return!E("conversationType",e,S)}))||t.some((function(e){return!E("level",e,T)}))?[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,Ze((function(o,r){return x(n,void 0,void 0,(function(){var n,a,s;return F(this,(function(c){switch(c.label){case 0:return[4,o.getTotalUnreadCountByLevels(e,t)];case 1:return n=c.sent(),a=n.code,s=n.data,a===i.SUCCESS?[2,{code:a,data:s}]:(r.warn(R.O,"getTotalUnreadCountByLevels fail ->".concat(a,":").concat(rt[a])),[2,{code:a,msg:rt[a]}])}}))}))}))]}))}))}function Rt(e,t){return x(this,void 0,void 0,(function(){var n=this;return F(this,(function(o){return!E("conversationTypes",e,v.ARRAY,!0)||!E("levels",t,v.ARRAY,!0)||e.some((function(e){return!E("conversationType",e,S)}))||t.some((function(e){return!E("level",e,T)}))?[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,Ze((function(o,r){return x(n,void 0,void 0,(function(){var n,a,s;return F(this,(function(c){switch(c.label){case 0:return[4,o.getTotalUnreadCountByLevels(e,t,!0)];case 1:return n=c.sent(),a=n.code,s=n.data,a===i.SUCCESS?[2,{code:a,data:s}]:(r.warn(R.O,"getTotalUnreadMentionedCountByLevels fail ->".concat(a,":").concat(rt[a])),[2,{code:a,msg:rt[a]}])}}))}))}))]}))}))}function mt(e){return x(this,void 0,void 0,(function(){var t=this;return F(this,(function(n){return E("options",e,v.CONVERSATION,!0)?[2,Ze((function(n,o){return x(t,void 0,void 0,(function(){var t,r,a,s;return F(this,(function(c){switch(c.label){case 0:return[4,n.getUnreadCount(e.conversationType,e.targetId,e.channelId)];case 1:return t=c.sent(),r=t.code,a=t.data,s="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),o.debug(R.O,"get unreadCount ->".concat(s)),r===i.SUCCESS?[2,{code:r,data:a}]:(o.warn(R.O,"get unreadCount fail ->".concat(r,":").concat(rt[r],",").concat(s)),[2,{code:r,msg:rt[r]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Et(e){return x(this,void 0,void 0,(function(){var t=this;return F(this,(function(n){return E("options",e,v.CONVERSATION,!0)?[2,Ze((function(n,o){return x(t,void 0,void 0,(function(){var t,r;return F(this,(function(a){switch(a.label){case 0:return[4,n.clearUnreadCount(e.conversationType,e.targetId,e.channelId)];case 1:return t=a.sent(),r="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),o.debug(R.O,"clear unreadMsgNum ->".concat(r)),t!==i.SUCCESS?(o.warn(R.O,"clear unreadMsgNum fail ->".concat(t,":").concat(rt[t],",").concat(r)),[2,{code:t,msg:rt[t]}]):[2,{code:t}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function St(){return x(this,void 0,void 0,(function(){var e=this;return F(this,(function(t){return[2,Ze((function(t,n){return x(e,void 0,void 0,(function(){return F(this,(function(e){switch(e.label){case 0:return[4,t.clearAllUnreadCount()];case 1:return[2,{code:e.sent()}]}}))}))}))]}))}))}ot.ROAMING_SERVICE_UNAVAILABLE.code;var Tt=function(e,t,n){void 0===n&&(n="");var o="conversationType:".concat(t.conversationType,",targetId:").concat(t.targetId);return e.debug(R.O,"".concat(n," -> ").concat(o)),o},pt=function(e,t,n,o){return void 0===o&&(o=""),x(void 0,void 0,void 0,(function(){var r,a;return F(this,(function(s){switch(s.label){case 0:return r=Tt(e,t,o),[4,n()];case 1:return(a=s.sent())!==i.SUCCESS?(e.warn(R.O,"".concat(o," fail -> ").concat(a," : ").concat(rt[a]," , ").concat(r)),[2,{code:a,msg:rt[a]}]):[2,{code:a}]}}))}))};function Ot(e,t){return x(this,void 0,void 0,(function(){return F(this,(function(n){return E("notificationLevel",t,(function(e){return void 0!==p[e]}),!0)&&E("options",e,v.CONVERSATION,!0)?[2,Ze((function(n,o){return pt(o,e,(function(){return n.setConversationNotificationLevel(e.conversationType,e.targetId,t,e.channelId)}),"setConversationNotificationLevel")}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Nt(e,t){return x(this,void 0,void 0,(function(){return F(this,(function(n){return E("notificationStatus",t,(function(e){return 1===e||2===e}),!0)&&E("options",e,v.CONVERSATION,!0)?[2,Ze((function(n,o){return pt(o,e,(function(){return n.setConversationStatus(e.conversationType,e.targetId,void 0,t,e.channelId)}),"setConversationNotificationStatus")}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function _t(e){return x(this,void 0,void 0,(function(){var t=this;return F(this,(function(n){return E("options",e,v.CONVERSATION,!0)?[2,Ze((function(n,o){return x(t,void 0,void 0,(function(){var t,r,a,s;return F(this,(function(c){switch(c.label){case 0:return t=Tt(o,e,"getConversationNotificationLevel"),[4,n.getConversationNotificationLevel(e.conversationType,e.targetId,e.channelId)];case 1:return r=c.sent(),a=r.code,s=r.data,a===i.SUCCESS?[2,{code:a,data:s}]:(o.warn(R.O,"getConversationNotificationLevel fail -> ".concat(a," : ").concat(rt[a]," , ").concat(t)),[2,{code:a,msg:rt[a]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Ct(e){return x(this,void 0,void 0,(function(){var t=this;return F(this,(function(n){return E("options",e,v.CONVERSATION,!0)?[2,Ze((function(n,o){return x(t,void 0,void 0,(function(){var t,r,a;return F(this,(function(s){switch(s.label){case 0:return o.info(R.O,"getConversationNotificationStatus ->targetId:".concat(e.targetId,",conversationType:").concat(e.conversationType)),[4,n.getConversationNotificationStatus(e.conversationType,e.targetId,e.channelId)];case 1:return t=s.sent(),r=t.code,a=t.data,r===i.SUCCESS?[2,{code:r,data:a}]:(o.warn(R.O,"getConversationNotificationStatus ->code:".concat(r,",targetId:").concat(e.targetId)),[2,{code:r,msg:rt[r]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function At(){return x(this,void 0,void 0,(function(){return F(this,(function(e){return[2,Ze((function(e){return e.getBlockConversationList()}))]}))}))}function Ut(e,t){return void 0===t&&(t=!0),x(this,void 0,void 0,(function(){var n=this;return F(this,(function(o){return E("options",e,v.CONVERSATION,!0)&&E("isTop",t,v.BOOLEAN)?[2,Ze((function(o,r){return x(n,void 0,void 0,(function(){var n,a;return F(this,(function(s){switch(s.label){case 0:return n="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),r.debug(R.O,"set conversation status ->".concat(n)),[4,o.setConversationStatus(e.conversationType,e.targetId,t,void 0,e.channelId)];case 1:return(a=s.sent())!==i.SUCCESS?(r.warn(R.O,"set conversation status fail ->".concat(a,":").concat(rt[a],",").concat(n)),[2,{code:a,msg:rt[a]}]):[2,{code:a}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function yt(e,t){return x(this,void 0,void 0,(function(){var n=this;return F(this,(function(o){return E("conversationTypes",e,v.ARRAY)&&!(null==e?void 0:e.some((function(e){return!E("conversationType",e,S)})))&&E("channelId",t,v.CHANNEL_ID)?[2,Ze((function(o,r){return x(n,void 0,void 0,(function(){var n,a,s;return F(this,(function(c){switch(c.label){case 0:return[4,o.getTopConversationList(e,t)];case 1:return n=c.sent(),a=n.code,s=n.data,a===i.SUCCESS&&s?[2,{code:0,data:s.map((function(e){return Le(e)}))}]:(r.warn(R.A_GET_TOP_CONVERSATION_LIST_E,"".concat(a,":").concat(rt[a])),[2,{code:a,msg:rt[a]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Mt(e){return x(this,void 0,void 0,(function(){var t=this;return F(this,(function(n){return!E("conversationTypes",e,v.ARRAY)||(null==e?void 0:e.some((function(e){return!E("conversationType",e,O)})))?[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,Ze((function(n,o){return x(t,void 0,void 0,(function(){var t,o,r;return F(this,(function(a){switch(a.label){case 0:return[4,n.getUnreadConversationList(e)];case 1:return t=a.sent(),o=t.code,r=t.data,o===i.SUCCESS&&r?[2,{code:0,data:r.map((function(e){return Le(e)}))}]:[2,{code:o,msg:rt[o]}]}}))}))}))]}))}))}function Pt(e){return x(this,void 0,void 0,(function(){return F(this,(function(t){return E("options",e,v.CONVERSATION,!0)?[2,Ze((function(t,n){return n.debug(R.O,"getUnreadMentionedCount".concat(e.targetId,",channelId:").concat(e.channelId)),t.getUnreadMentionedCount(e)}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Lt(){return x(this,void 0,void 0,(function(){return F(this,(function(e){return[2,Ze((function(e,t){return t.debug(R.O,"getAllUnreadMentionedCount"),e.getAllUnreadMentionedCount()}))]}))}))}function wt(){return x(this,void 0,void 0,(function(){return F(this,(function(e){return[2,Ze((function(e){return e.getAllConversationState()}))]}))}))}function Bt(e){return void 0===e&&(e={}),x(this,void 0,void 0,(function(){var t=this;return F(this,(function(n){return E("options.targetId",e.targetId,v.STRING,!1)&&E("options.channelType",e.channelType,(function(e){return void 0!==N[e]}),!1)?[2,Ze((function(n,o){return x(t,void 0,void 0,(function(){var t,r,a;return F(this,(function(s){switch(s.label){case 0:return[4,n.getUltraGroupList(e)];case 1:return t=s.sent(),r=t.code,a=t.data,r===i.SUCCESS?[2,{code:i.SUCCESS,data:a}]:(o.warn(R.O,"get ultragroup ->".concat(r,":").concat(rt[r])),[2,{code:r,msg:rt[r]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Dt(){return x(this,void 0,void 0,(function(){var e=this;return F(this,(function(t){return[2,Ze((function(t,n){return x(e,void 0,void 0,(function(){var e,o,r;return F(this,(function(a){switch(a.label){case 0:return[4,t.getBlockUltraGroupList()];case 1:return e=a.sent(),o=e.code,r=e.data,o===i.SUCCESS?[2,{code:i.SUCCESS,data:r}]:(n.warn(R.O,"get block ultragroup ->".concat(o,":").concat(rt[o])),[2,{code:o,msg:rt[o]}])}}))}))}))]}))}))}function bt(e){return x(this,void 0,void 0,(function(){var t=this;return F(this,(function(n){return E("options",e,v.CONVERSATION,!0)?[2,Ze((function(n,o){return x(t,void 0,void 0,(function(){var t;return F(this,(function(r){switch(r.label){case 0:return[4,n.sendUltraGroupTypingStatus(e)];case 1:return(t=r.sent().code)===i.SUCCESS?[2,{code:i.SUCCESS}]:(o.warn(R.O,"send ultraGroup OperateStatus ->".concat(t,":").concat(rt[t])),[2,{code:t,msg:rt[t]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Gt(e,t){return x(this,void 0,void 0,(function(){var n=this;return F(this,(function(o){return E("options",e,v.CONVERSATION,!0)&&E("msgs",t,v.ARRAY,!0)?[2,Ze((function(o,r){return x(n,void 0,void 0,(function(){var n,a,s,c,u,d,l,f,v,g;return F(this,(function(I){switch(I.label){case 0:return n=e.targetId,a=e.conversationType,s=e.channelId,c=[],t.forEach((function(e){var t=e.sendTime,n=e.messageUId;c.push({sendTime:t,messageUId:n,channelId:s})})),u={targetId:n,conversationType:a,messages:c},[4,o.getUltraGroupMessageListByMessageUId(u)];case 1:if(d=I.sent(),l=d.code,f=d.data,l===i.SUCCESS){for(g in v={},f)v[g]=f[g]?Pe(f[g]):void 0;return[2,{code:i.SUCCESS,data:v}]}return r.warn(R.O,"get UltraGroup MessageList by messageUId ->".concat(l,":").concat(rt[l])),[2,{code:l,msg:rt[l]}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Vt(e,t){return x(this,void 0,void 0,(function(){var n=this;return F(this,(function(o){return E("expansion",e,v.OBJECT,!0)&&E("message",t,v.OBJECT,!0)?[2,Ze((function(o,r){return x(n,void 0,void 0,(function(){var n,a,s,c,u,d,l,f,v;return F(this,(function(g){switch(g.label){case 0:return n=t.conversationType,a=t.targetId,s=t.messageUId,c=t.sentTime,u=t.canIncludeExpansion,d=t.channelId,l="conversationType:".concat(n,",targetId:").concat(a,",channelId:").concat(d,",messageUId:").concat(s),r.debug(R.O,"update expansion for ultragroup message ->".concat(l)),f={targetId:a,channelId:d,conversationType:n,sendTime:c,canIncludeExpansion:u,messageUId:s,expansion:e},[4,o.expandUltraMessage(f)];case 1:return(v=g.sent().code)===i.SUCCESS?[2,{code:i.SUCCESS}]:(r.warn(R.O,"update expansion for ultragroup message ->".concat(v,":").concat(rt[v])),[2,{code:v,msg:rt[v]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function kt(e,t){return x(this,void 0,void 0,(function(){var n=this;return F(this,(function(o){return E("expansion",e,v.ARRAY,!0)&&E("message",t,v.OBJECT,!0)?[2,Ze((function(o,r){return x(n,void 0,void 0,(function(){var n,a,s,c,u,d,l,f,v;return F(this,(function(g){switch(g.label){case 0:return n=t.conversationType,a=t.targetId,s=t.messageUId,c=t.sentTime,u=t.canIncludeExpansion,d=t.channelId,l="conversationType:".concat(n,",targetId:").concat(a,",channelId:").concat(d,",messageUId:").concat(s),r.debug(R.O,"remove expansion for ultragroup message ->".concat(l)),f={targetId:a,channelId:d,conversationType:n,sendTime:c,canIncludeExpansion:u,messageUId:s,keys:e},[4,o.expandUltraMessage(f)];case 1:return(v=g.sent().code)===i.SUCCESS?[2,{code:i.SUCCESS}]:(r.warn(R.O,"remove expansion for ultraGroup message ->".concat(v,":").concat(rt[v])),[2,{code:v,msg:rt[v]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function xt(e){return x(this,void 0,void 0,(function(){var t=this;return F(this,(function(n){return E("message",e,v.OBJECT,!0)?[2,Ze((function(n,o){return x(t,void 0,void 0,(function(){var t,r,a,s,c,u,d,l,f;return F(this,(function(v){switch(v.label){case 0:return t=e.conversationType,r=e.targetId,a=e.messageUId,s=e.sentTime,c=e.canIncludeExpansion,u=e.channelId,d="conversationType:".concat(t,",targetId:").concat(r,",channelId:").concat(u,",messageUId:").concat(a),o.debug(R.O,"remove all expansion for ultraGroup message ->".concat(d)),l={targetId:r,channelId:u,conversationType:t,sendTime:s,canIncludeExpansion:c,messageUId:a,removeAll:!0},[4,n.expandUltraMessage(l)];case 1:return(f=v.sent().code)===i.SUCCESS?[2,{code:i.SUCCESS}]:(o.warn(R.O,"remove all expansion for ultraGroup message ->".concat(f,":").concat(rt[f])),[2,{code:f,msg:rt[f]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Ft(e,t){return x(this,void 0,void 0,(function(){var n=this;return F(this,(function(o){return E("content",e,v.OBJECT,!0)&&E("message",t,v.OBJECT,!0)?[2,Ze((function(o,r){return x(n,void 0,void 0,(function(){var n,a,s,c,u,d,l,f,v,g;return F(this,(function(I){switch(I.label){case 0:return n=t.conversationType,a=t.targetId,s=t.messageUId,c=t.senderUserId,u=t.sentTime,d=t.canIncludeExpansion,l=t.channelId,f="conversationType:".concat(n,",targetId:").concat(a,",channelId:").concat(l,",messageUId:").concat(s),r.debug(R.O,"update ultragroup message expansion ->".concat(f)),v={targetId:a,channelId:l,conversationType:n,fromUserId:c,sendTime:u,canIncludeExpansion:d,messageUId:s,content:e},[4,o.modifyMessage(v)];case 1:return(g=I.sent().code)===i.SUCCESS?[2,{code:i.SUCCESS}]:(r.warn(R.O,"modify ultraGroup message ->".concat(g,":").concat(rt[g])),[2,{code:g,msg:rt[g]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Zt(e,t){return x(this,void 0,void 0,(function(){var n=this;return F(this,(function(o){return E("targetId",e,v.STRING,!0)&&E("notificationLevels",t,v.ARRAY)&&!(null==t?void 0:t.some((function(e){return!E("notificationLevel",e,T)})))?[2,Ze((function(o,r){return x(n,void 0,void 0,(function(){var n,a,s;return F(this,(function(c){switch(c.label){case 0:return r.debug(R.O,"get UltraGroup unreadMentionedCount by targetId: ".concat(e,", notificationLevels: ").concat(JSON.stringify(t))),[4,o.getUltraGroupUnreadMentionedCountByTargetId(e,t)];case 1:return n=c.sent(),a=n.code,s=n.data,a===i.SUCCESS?[2,{code:i.SUCCESS,data:s}]:(r.warn(R.O,"get UltraGroup unreadMentionedCount by targetId error ->".concat(a,":").concat(rt[a])),[2,{code:a,msg:rt[a]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Ht(e){return x(this,void 0,void 0,(function(){var t=this;return F(this,(function(n){return E("options.targetId",e.targetId,v.STRING,!0)&&E("options.channelId",e.channelId,v.CHANNEL_ID)?[2,Ze((function(n,o){return x(t,void 0,void 0,(function(){var t,r,a,s,c;return F(this,(function(u){switch(u.label){case 0:return t="getUltraGroupDefaultNotificationLevel",r="targetId: ".concat(e.targetId,", channelId: ").concat(e.channelId),o.debug(R.O,"".concat(t," -> ").concat(r)),[4,n.getUltraGroupDefaultNotificationLevel(e.targetId,e.channelId)];case 1:return a=u.sent(),s=a.code,c=a.data,s===i.SUCCESS?[2,{code:s,data:c}]:(o.warn(R.O,"".concat(t," fail -> ").concat(s," : ").concat(rt[s]," , ").concat(r)),[2,{code:s,msg:rt[s]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Jt(e,t){return x(this,void 0,void 0,(function(){var n=this;return F(this,(function(o){return e.channelId=e.channelId||"",E("options.targetId",e.targetId,v.STRING,!0)&&E("options.channelId",e.channelId,v.CHANNEL_ID,!0)&&E("notificationLevel",t,(function(e){return void 0!==p[e]}),!0)?[2,Ze((function(o,r){return x(n,void 0,void 0,(function(){var n,a,s;return F(this,(function(c){switch(c.label){case 0:return n="setUltraGroupDefaultNotificationLevel",a="targetId: ".concat(e.targetId,", channelId: ").concat(e.channelId),r.debug(R.O,"".concat(n," -> ").concat(a)),[4,o.setUltraGroupDefaultNotificationLevel(e.targetId,t,e.channelId)];case 1:return(s=c.sent().code)===i.SUCCESS?[2,{code:s}]:(r.warn(R.O,"".concat(n," fail -> ").concat(s," : ").concat(rt[s]," , ").concat(a)),[2,{code:s,msg:rt[s]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function qt(e,t){return x(this,void 0,void 0,(function(){var n=this;return F(this,(function(o){return E("targetId",e,v.STRING,!0)&&E("notificationLevels",t,v.ARRAY)&&!(null==t?void 0:t.some((function(e){return!E("notificationLevel",e,T)})))?[2,Ze((function(o,r){return x(n,void 0,void 0,(function(){var n,i,a,s,c;return F(this,(function(u){switch(u.label){case 0:return n="getUltraGroupUnreadCountByTargetId",[4,o.getUltraGroupUnreadCountByTargetId(e,t)];case 1:return i=u.sent(),a=i.code,s=i.data,c="targetId: ".concat(e,", levels: ").concat(JSON.stringify(t)),r.debug(R.O,"".concat(n," -> ").concat(c)),[2,{code:a,data:s}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Kt(){return x(this,void 0,void 0,(function(){var e=this;return F(this,(function(t){return[2,Ze((function(t,n){return x(e,void 0,void 0,(function(){var e,o,r,a;return F(this,(function(s){switch(s.label){case 0:return e="getAllUltraGroupUnreadCount",[4,t.getAllUltraGroupUnreadCount()];case 1:return o=s.sent(),r=o.code,a=o.data,n.debug(R.O,e),r===i.SUCCESS?[2,{code:r,data:a}]:(n.warn(R.O,"".concat(e," fail ->").concat(r,": ").concat(rt[r])),[2,{code:r,msg:rt[r]}])}}))}))}))]}))}))}function Yt(){return x(this,void 0,void 0,(function(){var e=this;return F(this,(function(t){return[2,Ze((function(t,n){return x(e,void 0,void 0,(function(){var e,o,r,a;return F(this,(function(s){switch(s.label){case 0:return e="getAllUltraGroupUnreadMentionedCount",!0,[4,t.getAllUltraGroupUnreadCount(true)];case 1:return o=s.sent(),r=o.code,a=o.data,n.debug(R.O,e),r===i.SUCCESS?[2,{code:r,data:a}]:(n.warn(R.O,"".concat(e," fail ->").concat(r,": ").concat(rt[r])),[2,{code:r,msg:rt[r]}])}}))}))}))]}))}))}function zt(e){return x(this,void 0,void 0,(function(){var t=this;return F(this,(function(n){return e.channelId=e.channelId||"",E("options.targetId",e.targetId,v.STRING,!0)&&E("options.channelId",e.channelId,v.CHANNEL_ID,!0)&&E("options.sentTime",e.sentTime,v.NUMBER,!0)&&E("options.count",e.count,(function(e){return c(e)&&e>0&&e<=50}),!0)?[2,Ze((function(n,o){return x(t,void 0,void 0,(function(){var t,r,a,s,c,u,d,l;return F(this,(function(f){switch(f.label){case 0:return t=e.targetId,r=e.channelId,a=e.sentTime,s=e.count,c={targetId:t,channelId:r,sentTime:a,count:s},[4,n.getUltraGroupUnreadMentionedMessages(c)];case 1:return u=f.sent(),d=u.code,l=u.data,d===i.SUCCESS?[2,{code:d,data:l}]:(o.warn(R.O,"getUltraGroupUnreadMentionedMessages fail ->".concat(d,": ").concat(rt[d])),[2,{code:d,msg:rt[d]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function jt(e){return x(this,void 0,void 0,(function(){var t=this;return F(this,(function(n){return E("conversation.targetId",e.targetId,v.STRING,!0)&&E("conversation.channelId",e.channelId,v.CHANNEL_ID,!0)?[2,Ze((function(n){return x(t,void 0,void 0,(function(){var t,o,r,a,s,c;return F(this,(function(u){switch(u.label){case 0:return t=e.targetId,o=e.channelId,r={targetId:t,channelId:o},[4,n.getUltraGroupFirstUnreadMessageTimestamp(r)];case 1:return a=u.sent(),s=a.code,c=a.data,s===i.SUCCESS?[2,{code:s,data:c}]:[2,{code:s,msg:rt[s]}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Wt(e){return x(this,void 0,void 0,(function(){var t,n=this;return F(this,(function(o){return E("targetIds",e,v.ARRAY,!0)&&E("targetIds.length",e,(function(e){return e.length>0&&e.length<20}))&&!e.some((function(e){return!E("targetId",e,v.STRING)}))?(t=e.filter((function(t,n){return e.indexOf(t)===n})),[2,Ze((function(e){return x(n,void 0,void 0,(function(){var n,o,r;return F(this,(function(a){switch(a.label){case 0:return[4,e.getUltraGroupUnreadInfoList(t)];case 1:return n=a.sent(),o=n.code,r=n.data,o===i.SUCCESS?[2,{code:o,data:r}]:[2,{code:o,msg:rt[o]}]}}))}))}))]):[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}var Qt=function(e){return!!(E("options.key",e.key,v.STRING,!0)&&E("options.value",e.value,v.STRING,!0)&&E("options.isAutoDelete",e.isAutoDelete,v.BOOLEAN)&&E("options.isSendNotification",e.isSendNotification,v.BOOLEAN)&&E("options.notificationExtra",e.notificationExtra,v.STRING))},Xt=function(e){return e.entries.every((function(e){return E("entry.key",e.key,v.STRING,!0)&&E("entry.value",e.value,v.STRING,!0)}))&&E("options.isAutoDelete",e.isAutoDelete,v.BOOLEAN)&&E("options.notificationExtra",e.notificationExtra,v.STRING)&&E("options.isForce",e.isForce,v.BOOLEAN)},$t=function(e){return E("options.key",e.key,v.STRING,!0)&&E("options.isSendNotification",e.isSendNotification,v.BOOLEAN)&&E("options.notificationExtra",e.notificationExtra,v.STRING)},en=function(e){return e.entries.every((function(e){return E("key",e,v.STRING,!0)}))&&E("options.notificationExtra",e.notificationExtra,v.STRING)};function tn(e,t){return x(this,void 0,void 0,(function(){var n=this;return F(this,(function(o){return E("targetId",e,v.STRING,!0)&&E("options.count",t.count,v.NUMBER,!0)?[2,Ze((function(o,r){return x(n,void 0,void 0,(function(){var n,a,s;return F(this,(function(c){switch(c.label){case 0:return n=r.createTraceId(),r.info(R.A_JOIN_CHATROOM_T,JSON.stringify({chatroomId:e,count:t.count,joinExist:!1}),n),[4,o.joinChatroom(e,t.count,n)];case 1:return a=c.sent(),s=a===i.SUCCESS?"info":"warn",r[s](R.A_JOIN_CHATROOM_R,JSON.stringify({code:a,timestamp:(new Date).getTime()}),n),a!==i.SUCCESS?[2,{code:a,msg:rt[a]}]:[2,{code:a}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function nn(e,t){return x(this,void 0,void 0,(function(){var n=this;return F(this,(function(o){return E("targetId",e,v.STRING,!0)&&E("options.count",t.count,v.NUMBER,!0)?[2,Ze((function(o,r){return x(n,void 0,void 0,(function(){var n,a,s,c,u;return F(this,(function(d){switch(d.label){case 0:return n=r.createTraceId(),r.info(R.A_JOIN_CHATROOM_T,JSON.stringify({chatroomId:e,count:t.count,joinExist:!0}),n),[4,o.joinExistChatroom(e,t.count,n)];case 1:return a=d.sent(),s=a.code,c=a.data,u=s===i.SUCCESS?"info":"warn",r[u](R.A_JOIN_CHATROOM_R,JSON.stringify({code:s,timestamp:(new Date).getTime()}),n),s!==i.SUCCESS?[2,{code:s,msg:rt[s]}]:[2,{code:s,data:c}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function on(e){return x(this,void 0,void 0,(function(){var t=this;return F(this,(function(n){return E("targetId",e,v.STRING,!0)?[2,Ze((function(n,o){return x(t,void 0,void 0,(function(){var t,r,a;return F(this,(function(s){switch(s.label){case 0:return t=o.createTraceId(),o.info(R.A_QUIT_CHATROOM_T,JSON.stringify({chatroomId:e}),t),[4,n.quitChatroom(e)];case 1:return r=s.sent(),a=r===i.SUCCESS?"info":"warn",o[a](R.A_QUIT_CHATROOM_R,JSON.stringify({code:r}),t),r!==i.SUCCESS?[2,{code:r,msg:rt[r]}]:[2,{code:r}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function rn(e,t){return x(this,void 0,void 0,(function(){var n=this;return F(this,(function(o){return E("targetId",e,v.STRING,!0)&&E("options.count",t.count,v.NUMBER)&&E("options.order",t.order,(function(e){return[0,1,2].includes(e)}))?[2,Ze((function(o,r){return x(n,void 0,void 0,(function(){var n,a,s,c;return F(this,(function(u){switch(u.label){case 0:return n="id:".concat(e),r.debug(R.O,"get chatroom info ->".concat(n)),[4,o.getChatroomInfo(e,t.count,t.order)];case 1:return a=u.sent(),s=a.code,c=a.data,s===i.SUCCESS&&c?[2,{code:s,data:c}]:(r.warn(R.O,"get chatroom info fail ->code+:".concat(rt[s],",").concat(n)),[2,{code:s,msg:rt[s]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function an(e,t){return x(this,void 0,void 0,(function(){var n=this;return F(this,(function(o){return E("targetId",e,v.STRING,!0)&&Qt(t)?[2,Ze((function(o,r){return x(n,void 0,void 0,(function(){var n,a;return F(this,(function(s){switch(s.label){case 0:return n="id:".concat(e),r.debug(R.O,"set chatroom entry->".concat(n)),[4,o.setChatroomEntry(e,t)];case 1:return(a=s.sent())!==i.SUCCESS?(r.warn(R.O,"set chatroom entry fail ->code+:".concat(rt[a],",").concat(n)),[2,{code:a,msg:rt[a]}]):[2,{code:a}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function sn(e,t){return x(this,void 0,void 0,(function(){var n=this;return F(this,(function(o){return E("targetId",e,v.STRING,!0)&&Xt(t)?t.entries.length>10?[2,ot.CHATROOM_KV_STORE_OUT_LIMIT]:[2,Ze((function(o,r){return x(n,void 0,void 0,(function(){var n,a,s,c;return F(this,(function(u){switch(u.label){case 0:return n="id:".concat(e),r.debug(R.O,"set chatroom entry->".concat(n)),[4,o.setChatroomEntries(e,t)];case 1:return a=u.sent(),s=a.code,c=a.data,s!==i.SUCCESS?(r.warn(R.O,"set chatroom entry fail ->code+:".concat(rt[s],",").concat(n)),[2,{code:s,msg:rt[s],data:c}]):[2,{code:s}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function cn(e,t){return x(this,void 0,void 0,(function(){var n=this;return F(this,(function(o){return E("targetId",e,v.STRING,!0)&&Qt(t)?[2,Ze((function(o,r){return x(n,void 0,void 0,(function(){var n,a;return F(this,(function(s){switch(s.label){case 0:return n="id:".concat(e),r.debug(R.O,"force set chatroom entry ->".concat(n)),[4,o.forceSetChatroomEntry(e,t)];case 1:return(a=s.sent())!==i.SUCCESS?(r.warn(R.O,"force set chatroom entry fail ->code+:".concat(rt[a],",").concat(n)),[2,{code:a,msg:rt[a]}]):[2,{code:a}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function un(e,t){return x(this,void 0,void 0,(function(){var n=this;return F(this,(function(o){return E("targetId",e,v.STRING,!0)&&$t(t)?[2,Ze((function(o,r){return x(n,void 0,void 0,(function(){var n,a;return F(this,(function(s){switch(s.label){case 0:return n="id:".concat(e),r.debug(R.O,"remove chatroom entry->".concat(n)),[4,o.removeChatroomEntry(e,t)];case 1:return(a=s.sent())!==i.SUCCESS?(r.warn(R.O,"remove chatroom entry fail ->code+:".concat(rt[a],",").concat(n)),[2,{code:a,msg:rt[a]}]):[2,{code:a}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function dn(e,t){return x(this,void 0,void 0,(function(){var n=this;return F(this,(function(o){return E("targetId",e,v.STRING,!0)&&en(t)?[2,Ze((function(o,r){return x(n,void 0,void 0,(function(){var n,a,s,c,u;return F(this,(function(d){switch(d.label){case 0:return n="id:".concat(e),r.info(R.O,"remove chatroom entry->".concat(n)),(a=k({},t)).entries=t.entries.map((function(e){return{key:e}})),[4,o.removeChatroomEntries(e,a)];case 1:return s=d.sent(),c=s.code,u=s.data,c!==i.SUCCESS?(r.warn(R.O,"remove chatroom entry fail ->code+:".concat(rt[c],",").concat(n)),[2,{code:c,msg:rt[c],data:u}]):[2,{code:c}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function ln(e,t){return x(this,void 0,void 0,(function(){var n=this;return F(this,(function(o){return E("targetId",e,v.STRING,!0)&&$t(t)?[2,Ze((function(o,r){return x(n,void 0,void 0,(function(){var n,a;return F(this,(function(s){switch(s.label){case 0:return n="id:".concat(e),r.info(R.O,"force remove chatroom entry ->".concat(n)),[4,o.forceRemoveChatroomEntry(e,t)];case 1:return(a=s.sent())!==i.SUCCESS?(r.warn(R.O,"force remove chatroom entry fail ->code+:".concat(rt[a],",").concat(n)),[2,{code:a,msg:rt[a]}]):[2,{code:a}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function fn(e,t){return x(this,void 0,void 0,(function(){var n=this;return F(this,(function(o){return E("targetId",e,v.STRING,!0)&&E("key",t,(function(e){return _(e)&&/[\w+=-]+/.test(e)&&e.length<=128}),!0)?[2,Ze((function(o,r){return x(n,void 0,void 0,(function(){var n,a,s,c;return F(this,(function(u){switch(u.label){case 0:return n="id:".concat(e),r.debug(R.O,"get chatroom entry->".concat(n)),[4,o.getChatroomEntry(e,t)];case 1:return a=u.sent(),s=a.code,c=a.data,s===i.SUCCESS&&c?[2,{code:s,data:c}]:(r.warn(R.O,"get chatroom entry fail ->code+:".concat(rt[s],",").concat(n)),[2,{code:s,msg:rt[s]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function vn(e){return x(this,void 0,void 0,(function(){var t=this;return F(this,(function(n){return E("targetId",e,v.STRING,!0)?[2,Ze((function(n,o){return x(t,void 0,void 0,(function(){var t,r,a,s;return F(this,(function(c){switch(c.label){case 0:return t="id:".concat(e),o.debug(R.O,"get all chatroom entries->".concat(t)),[4,n.getAllChatroomEntries(e)];case 1:return r=c.sent(),a=r.code,s=r.data,a===i.SUCCESS&&s?[2,{code:a,data:s}]:(o.warn(R.O,"get all chatroom entries fail ->code+:".concat(rt[a],",").concat(t)),[2,{code:a,msg:rt[a]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function gn(e,t){return x(this,void 0,void 0,(function(){var n=this;return F(this,(function(o){return E("targetId",e,v.STRING,!0)&&E("options.timestamp",t.timestamp,v.NUMBER)&&E("options.count",t.count,v.NUMBER)&&E("options.count",t.count,(function(e){var t=e>0&&e<=100;return t||null===console||void 0===console||console.error('"options.count" is invalid, It should be greater than 0 and less than 100'),t}))&&E("options.order",t.order,(function(e){return 0===e||1===e}))?[2,Ze((function(o,r){return x(n,void 0,void 0,(function(){var n,a,s,c,u;return F(this,(function(d){switch(d.label){case 0:return n="id:".concat(e),r.debug(R.O,"get chatroom history message->".concat(n)),[4,o.getChatRoomHistoryMessages(e,t.count,t.order,t.timestamp)];case 1:return a=d.sent(),s=a.code,c=a.data,s===i.SUCCESS&&c?(u=c.list.map((function(e){return Pe(e)})),[2,{code:s,data:{list:u,hasMore:!!c.hasMore}}]):(r.warn(R.O,"get chatroom history message fail ->code+:".concat(rt[s],",").concat(n)),[2,{code:s,msg:rt[s]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function In(e){return x(this,void 0,void 0,(function(){var t=this;return F(this,(function(n){return E("option.chatRoomId",e.chatRoomId,v.STRING,!0)&&E("option.rtcRoomId",e.rtcRoomId,v.STRING,!0)?[2,Ze((function(n){return x(t,void 0,void 0,(function(){var t;return F(this,(function(o){switch(o.label){case 0:return[4,n.bindRTCRoomForChatroom(e)];case 1:return[2,{code:t=o.sent(),msg:rt[t]}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function hn(e){return x(this,void 0,void 0,(function(){var t=this;return F(this,(function(n){return E("userId",e,v.STRING,!0)?[2,Ze((function(n,o){return x(t,void 0,void 0,(function(){return F(this,(function(t){switch(t.label){case 0:return o.info(R.O,"addToBlacklist -> userId: ".concat(e)),[4,n.addToBlacklist(e)];case 1:return[2,{code:t.sent()}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Rn(e){return x(this,void 0,void 0,(function(){var t=this;return F(this,(function(n){return E("userId",e,v.STRING,!0)?[2,Ze((function(n,o){return x(t,void 0,void 0,(function(){return F(this,(function(t){switch(t.label){case 0:return o.info(R.O,"removeFromBlacklist -> userId: ".concat(e)),[4,n.removeFromBlacklist(e)];case 1:return[2,{code:t.sent()}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function mn(){return x(this,void 0,void 0,(function(){var e=this;return F(this,(function(t){return[2,Ze((function(t,n){return x(e,void 0,void 0,(function(){var e,o,r;return F(this,(function(a){switch(a.label){case 0:return n.info(R.O,"getBlacklist -> "),[4,t.getBlacklist()];case 1:return e=a.sent(),o=e.code,r=e.data,o===i.SUCCESS&&r?[2,{code:o,data:r}]:(n.warn(R.O,"getBlacklist fail -> code: ".concat(o)),[2,{code:o}])}}))}))}))]}))}))}function En(e){return x(this,void 0,void 0,(function(){var t=this;return F(this,(function(n){return E("userId",e,v.STRING,!0)?[2,Ze((function(n,o){return x(t,void 0,void 0,(function(){var t,r,a;return F(this,(function(s){switch(s.label){case 0:return o.info(R.O,"getBlacklistStatus -> userId: ".concat(e)),[4,n.getBlacklistStatus(e)];case 1:return t=s.sent(),r=t.code,a=t.data,r===i.SUCCESS?[2,{code:r,data:0===a}]:(o.warn(R.O,"getBlacklistStatus fail -> code: ".concat(r,", userId: ").concat(e)),[2,{code:r}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}var Sn=function(e,t,n,o){void 0===n&&(n=!0),void 0===o&&(o=!0),this.messageType=e,this.content=t,this.isPersited=n,this.isCounted=o};function Tn(e,t,n){void 0===t&&(t=!0),void 0===n&&(n=!0);return function(o){return new Sn(e,o,t,n)}}var pn,On=Tn("RC:ImgMsg"),Nn=Tn("RC:HQVCMsg"),_n=Tn("RC:SightMsg"),Cn=Tn("RC:TxtMsg"),An=Tn("RC:CombineMsg"),Un=Tn("RC:FileMsg"),yn=Tn("RC:GIFMsg"),Mn=Tn("RC:VcMsg"),Pn=Tn("RC:LBSMsg"),Ln=Tn("RC:ReferenceMsg"),wn=Tn("RC:ImgTextMsg"),Bn=Tn("RC:CmdMsg"),Dn=Tn("RC:InfoNtf"),bn=Tn("RC:GrpNtf");!function(e){e.ALIYUN="aliyun",e.S3="s3",e.STC="stc",e.MINIO="minio",e.QINIU="qiniu",e.BAIDU="baidu",e.RCX="rcx"}(pn||(pn={}));var Gn,Vn=function(){function e(e,t,n){this.isSupportMultipart=!1,this._serverType=0,this._url=e,this._getFileToken=t,this._serverType=n}return e.prototype.upload=function(e){return e.file.size>C?Promise.resolve({code:i.UPLOAD_FAIL,msg:"the file size is over 5GB!"}):e.file.size>A&&this.isSupportMultipart?this.multipartUpload(e):this.commonUpload(e)},e}(),kn=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return V(n,t),n.prototype.commonUpload=function(t){return x(this,void 0,void 0,(function(){var n,o,r,a,s,c,u;return F(this,(function(d){switch(d.label){case 0:return n=t.file,o=t.onProgress,r=t.fileType,[4,this._getFileToken(r,n.name)];case 1:return a=d.sent(),s={},(c=new FormData).set("token",a.token),c.set("key",a.fileName),c.set("file",n),[4,e({url:y(this._url),headers:s,onProgress:function(e){return null==o?void 0:o(e.loaded,e.total)},method:"POST",body:c,timeout:0})];case 2:return 200===(u=d.sent().status)||204===u?[2,{code:i.SUCCESS,data:{uniqueName:a.fileName,uploadMethod:U.QINIU}}]:[2,{code:i.UPLOAD_FAIL,msg:u.toString()}]}}))}))},n.prototype.multipartUpload=function(e){return x(this,void 0,void 0,(function(){return F(this,(function(e){throw new Error("Method not implemented.")}))}))},n}(Vn),xn=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return V(n,t),n.prototype.commonUpload=function(t){return x(this,void 0,void 0,(function(){var n,o,r,a,s,c,u;return F(this,(function(d){switch(d.label){case 0:return n=t.file,o=t.onProgress,r=t.fileType,[4,this._getFileToken(r)];case 1:return a=d.sent(),s=y("".concat(a.ossBucketName,".").concat(this._url)),(c=new FormData).set("token",a.token),c.set("OSSAccessKeyId",a.osskeyId),c.set("policy",a.ossPolicy),c.set("Signature",a.ossSign),c.set("success_action_status","200"),c.set("key",a.fileName),c.set("file",n),[4,e({url:s,onProgress:function(e){return null==o?void 0:o(e.loaded,e.total)},method:"POST",body:c,timeout:0})];case 2:return 200===(u=d.sent().status)||204===u?[2,{code:i.SUCCESS,data:{uniqueName:a.fileName,uploadMethod:U.ALI}}]:[2,{code:i.UPLOAD_FAIL,msg:u.toString()}]}}))}))},n.prototype.multipartUpload=function(e){throw new Error("Method not implemented.")},n}(Vn),Fn=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return V(n,t),n.prototype.commonUpload=function(t){return x(this,void 0,void 0,(function(){var n,o,r,a,s,c,u,d,l;return F(this,(function(f){switch(f.label){case 0:return n=t.file,o=t.onProgress,r=t.fileType,a=t.contentDisposition,[4,this._getFileToken(r<=M.FILE?r:M.FILE)];case 1:return s=f.sent(),c=a||("text/html"===n.type?"inline":"attachment"),u={authorization:s.bosToken,"x-bce-date":s.bosDate,"Content-Disposition":"".concat(c,"; filename=").concat(encodeURIComponent(n.name),";")},d=y("".concat(this._url).concat(s.path)),[4,e({url:d,headers:u,onProgress:function(e){return null==o?void 0:o(e.loaded,e.total)},method:"POST",body:n,timeout:0})];case 2:return 200===(l=f.sent().status)||204===l?[2,{code:i.SUCCESS,data:{uniqueName:s.fileName,downloadUrl:d}}]:[2,{code:i.UPLOAD_FAIL,msg:l.toString()}]}}))}))},n.prototype.multipartUpload=function(e){throw new Error("Method not implemented.")},n}(Vn),Zn=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return V(n,t),n.prototype.commonUpload=function(t){return x(this,void 0,void 0,(function(){var n,o,r,a,s,c,u,d,l,f;return F(this,(function(v){switch(v.label){case 0:return n=t.file,o=t.onProgress,r=t.fileType,a=t.contentDisposition,[4,this._getFileToken(r,n.name)];case 1:return s=v.sent(),c={},u=y("".concat(s.s3BucketName,".").concat(this._url)),d=new FormData,a?d.set("Content-Disposition",a):d.set("Content-Disposition","text/html"===n.type?"inline;":"attachment;"),d.set("Content-Type",n.type),d.set("x-amz-credential",s.s3Credential),d.set("x-amz-algorithm",s.s3Algorithm),d.set("x-amz-date",s.s3Date),d.set("policy",s.s3Policy),d.set("x-amz-signature",s.s3Signature),d.set("key",s.fileName),d.set("file",n),[4,e({url:u,headers:c,onProgress:function(e){return null==o?void 0:o(e.loaded,e.total)},method:"POST",body:d,timeout:0})];case 2:return l=v.sent(),f=l.status,l.data,200===f||204===f?[2,{code:i.SUCCESS,data:{uniqueName:s.fileName,uploadMethod:U.AWS}}]:[2,{code:i.UPLOAD_FAIL,msg:f.toString()}]}}))}))},n.prototype.multipartUpload=function(e){throw new Error("Method not implemented.")},n}(Vn),Hn=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.isSupportMultipart=!0,e}return V(n,t),n.prototype.commonUpload=function(t){return x(this,void 0,void 0,(function(){var n,o,r,a,s,c,u;return F(this,(function(d){switch(d.label){case 0:return n=t.file,o=t.onProgress,r=t.fileType,[4,this._getFileToken(r)];case 1:return a=d.sent(),s=y("".concat(this._url,"/").concat(a.stcBucketName,"/").concat(a.fileName)),c=this.getBaseHeaders(n,a,t),[4,e({url:s,headers:c,onProgress:function(e){return null==o?void 0:o(e.loaded,e.total)},method:"PUT",body:n,timeout:0})];case 2:return 200===(u=d.sent().status)||204===u?[2,{code:i.SUCCESS,data:{uniqueName:a.fileName,uploadMethod:U.STC}}]:[2,{code:i.UPLOAD_FAIL}]}}))}))},n.prototype.multipartUpload=function(t){var n;return x(this,void 0,void 0,(function(){var o,r,a,s,c,u,d,l,f,v,g,I,h,R,m,E,S;return F(this,(function(T){switch(T.label){case 0:return o=t.file,t.onProgress,r=t.fileType,[4,this._getFileToken(r,o.name,"POST","uploads")];case 1:return a=T.sent(),s=y("".concat(this._url,"/").concat(a.stcBucketName,"/").concat(a.fileName)),c=this.getBaseHeaders(o,a,t),[4,e({url:"".concat(s,"?uploads"),headers:c,method:"POST"})];case 2:return u=T.sent(),d=u.status,l=u.data,f=null===(n=null==l?void 0:l.match(/(?:<UploadId>)(\S*?)(?:<\/UploadId>)/))||void 0===n?void 0:n[1],200!==d&&204!==d||!f?[2,{code:i.UPLOAD_FAIL,msg:"start upload fail"}]:(v=[],[4,this.requestUploadPart(s,o,f,a.fileName,t,v)]);case 3:return g=T.sent(),I=g.code,h=g.msg,I!==i.SUCCESS?[2,{code:I,msg:h}]:[4,this._getFileToken(r,a.fileName,"POST","uploadId=".concat(f))];case 4:return R=T.sent(),m=v.map((function(e,t){return"<Part><PartNumber>".concat(t+1,"</PartNumber><ETag>").concat(e,"</ETag></Part>")})).join(""),m="<CompleteMultipartUpload xmlns='http://s3.amazonaws.com/doc/2006-03-01/'>".concat(m,"</CompleteMultipartUpload>"),E=this.getBaseHeaders(o,R,t),[4,e({url:"".concat(s,"?uploadId=").concat(f),headers:E,method:"POST",body:m})];case 5:return 200===(S=T.sent().status)||204===S?[2,{code:i.SUCCESS,data:{uniqueName:a.fileName,uploadMethod:U.STC}}]:[2,{code:i.UPLOAD_FAIL,msg:"end upload fail"}]}}))}))},n.prototype.requestUploadPart=function(t,n,o,r,a,s,c,u){return void 0===c&&(c=1),void 0===u&&(u=0),x(this,void 0,void 0,(function(){var d,l,f,v,g,I,h,R,m;return F(this,(function(E){switch(E.label){case 0:return u>=5?[2,{code:i.UPLOAD_FAIL,msg:"Upload retry times exceeded 5. Procedure"}]:(d=(c-1)*A,l=Math.min(A,n.size-d),f="partNumber=".concat(c,"&uploadId=").concat(o),[4,this._getFileToken(a.fileType,r,"PUT",f)]);case 1:return v=E.sent(),g=n.slice(d,c*A),I=this.getBaseHeaders(n,v,a),[4,e({url:"".concat(t,"?").concat(f),headers:I,method:"PUT",body:g,onProgress:function(e){var t;return null===(t=null==a?void 0:a.onProgress)||void 0===t?void 0:t.call(a,d+e.loaded,n.size)},timeout:0})];case 2:return h=E.sent(),R=h.status,h.data,m=h.xhr,200===R||204===R?(s.push((null==m?void 0:m.getResponseHeader("ETag"))||""),d+l<n.size?[2,this.requestUploadPart(t,n,o,r,a,s,c+1,0)]:[2,{code:i.SUCCESS}]):[2,this.requestUploadPart(t,n,o,r,a,s,c,u+1)]}}))}))},n.prototype.getBaseHeaders=function(e,t,n){var o=n.contentDisposition||("text/html"===e.type?"inline":"attachment");return{"Content-Disposition":"".concat(o,"; filename=").concat(encodeURIComponent(e.name),";"),Authorization:t.stcAuthorization,"x-amz-content-sha256":t.stcContentSha256,"x-amz-date":t.stcDate,"Content-Type":e.type||"text/plain"}},n}(Vn),Jn=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.isSupportMultipart=!0,e}return V(n,t),n.prototype.commonUpload=function(t){return x(this,void 0,void 0,(function(){var n,o,r,a,s,c,u;return F(this,(function(d){switch(d.label){case 0:return n=t.file,o=t.onProgress,r=t.fileType,[4,this._getFileToken(r)];case 1:return a=d.sent(),s=y("".concat(this._url,"/").concat(a.minioBucketName,"/").concat(a.fileName)),c=this.getBaseHeaders(n,a,t),[4,e({url:s,headers:c,onProgress:function(e){return null==o?void 0:o(e.loaded,e.total)},method:"PUT",body:n,timeout:0})];case 2:return 200===(u=d.sent().status)||204===u?[2,{code:i.SUCCESS,data:{uniqueName:a.fileName,uploadMethod:U.MINIO}}]:[2,{code:i.UPLOAD_FAIL,msg:u.toString()}]}}))}))},n.prototype.multipartUpload=function(t){var n;return x(this,void 0,void 0,(function(){var o,r,a,s,c,u,d,l,f,v,g,I,h,R,m,E,S;return F(this,(function(T){switch(T.label){case 0:return o=t.file,r=t.fileType,[4,this._getFileToken(r,o.name,"POST","uploads")];case 1:return a=T.sent(),s=y("".concat(this._url,"/").concat(a.minioBucketName,"/").concat(a.fileName)),c=this.getBaseHeaders(o,a,t),[4,e({url:"".concat(s,"?uploads"),headers:c,method:"POST"})];case 2:return u=T.sent(),d=u.status,l=u.data,f=null===(n=null==l?void 0:l.match(/(?:<UploadId>)(\S*?)(?:<\/UploadId>)/))||void 0===n?void 0:n[1],200!==d&&204!==d||!f?[2,{code:i.UPLOAD_FAIL,msg:"start upload fail"}]:(v=[],[4,this.requestUploadPart(s,o,f,a.fileName,t,v)]);case 3:return g=T.sent(),I=g.code,h=g.msg,I!==i.SUCCESS?[2,{code:I,msg:h}]:[4,this._getFileToken(r,a.fileName,"POST","uploadId=".concat(f))];case 4:return R=T.sent(),m=v.map((function(e,t){return"<Part><PartNumber>".concat(t+1,"</PartNumber><ETag>").concat(e,"</ETag></Part>")})).join(""),m="<CompleteMultipartUpload xmlns='http://s3.amazonaws.com/doc/2006-03-01/'>".concat(m,"</CompleteMultipartUpload>"),E=this.getBaseHeaders(o,R,t),[4,e({url:"".concat(s,"?uploadId=").concat(f),headers:E,method:"POST",body:m,timeout:0})];case 5:return 200===(S=T.sent().status)||204===S?[2,{code:i.SUCCESS,data:{uniqueName:a.fileName,uploadMethod:U.MINIO}}]:[2,{code:i.UPLOAD_FAIL,msg:"end upload fail"}]}}))}))},n.prototype.requestUploadPart=function(t,n,o,r,a,s,c,u){return void 0===c&&(c=1),void 0===u&&(u=0),x(this,void 0,void 0,(function(){var d,l,f,v,g,I,h,R,m;return F(this,(function(E){switch(E.label){case 0:return u>=5?[2,{code:i.UPLOAD_FAIL,msg:"Upload retry times exceeded 5. Procedure"}]:(d=(c-1)*A,l=Math.min(A,n.size-d),f="partNumber=".concat(c,"&uploadId=").concat(o),[4,this._getFileToken(a.fileType,r,"PUT",f)]);case 1:return v=E.sent(),g=n.slice(d,c*A),I=this.getBaseHeaders(n,v,a),[4,e({url:"".concat(t,"?").concat(f),headers:I,method:"PUT",body:g,timeout:0,onProgress:function(e){var t;return null===(t=null==a?void 0:a.onProgress)||void 0===t?void 0:t.call(a,d+e.loaded,n.size)}})];case 2:return h=E.sent(),R=h.status,m=h.xhr,200===R||204===R?(s.push((null==m?void 0:m.getResponseHeader("ETag"))||""),d+l<n.size?[2,this.requestUploadPart(t,n,o,r,a,s,c+1,0)]:[2,{code:i.SUCCESS}]):[2,this.requestUploadPart(t,n,o,r,a,s,c,u+1)]}}))}))},n.prototype.getBaseHeaders=function(e,t,n){var o=n.contentDisposition||("text/html"===e.type?"inline":"attachment");return{"Content-Disposition":"".concat(o,"; filename=").concat(encodeURIComponent(e.name),";"),Authorization:t.minioAuthorization,"x-amz-content-sha256":t.minioContentSha256,"x-amz-date":t.minioDate,"Content-Type":e.type||"text/plain"}},n}(Vn),qn=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.isSupportMultipart=!0,e}return V(n,t),n.prototype.commonUpload=function(t){return x(this,void 0,void 0,(function(){var n,o,r,a,s,c,u,d,l,f,v;return F(this,(function(g){switch(g.label){case 0:return n=t.file,o=t.onProgress,r=t.fileType,[4,this._getFileToken(r,n.name)];case 1:return a=g.sent(),s={},(c=new FormData).set("token",a.token),c.set("key",a.fileName),c.set("file",n),u=y(this._url),[4,e({url:u,headers:s,onProgress:function(e){return null==o?void 0:o(e.loaded,e.total)},method:"POST",body:c,timeout:0})];case 2:return d=g.sent(),l=d.status,f=d.data,200!==l&&204!==l||!f?[2,{code:i.UPLOAD_FAIL,msg:l.toString()}]:(v=JSON.parse(f),[2,{code:i.SUCCESS,data:{uniqueName:v.rc_url.file_name,downloadUrl:"".concat(u,"/").concat(v.rc_url.path)}}])}}))}))},n.prototype.multipartUpload=function(e){return x(this,void 0,void 0,(function(){var t,n,o,r,i;return F(this,(function(a){switch(a.label){case 0:return t=e.file,n=e.onProgress,o=e.fileType,r=P(),[4,this._getFileToken(o,t.name)];case 1:return i=a.sent().token,[2,this._requestUploadPart(r,t,i,n)]}}))}))},n.prototype._requestUploadPart=function(t,n,o,r,a){return void 0===a&&(a=0),x(this,void 0,void 0,(function(){var s,c,u,d,l,f,v,g,I,h;return F(this,(function(R){switch(R.label){case 0:return s=Math.min(A,n.size-a),c=t+n.name.substring(n.name.lastIndexOf(".")),u={Range:"bytes=".concat(a,"-").concat(a+s),"X-File-TransactionId":c,"X-File-Total-Size":n.size.toString()},d=n.slice(a,a+s),(l=new FormData).set("file",d,n.name),l.set("key",c),l.set("name",c),l.set("token",o),f=y(this._url),[4,e({url:f,headers:u,onProgress:function(e){return null==r?void 0:r(a+e.loaded,n.size)},method:"POST",body:l,timeout:0})];case 1:return v=R.sent(),g=v.status,I=v.data,200===g||204===g?a+s<n.size?[2,this._requestUploadPart(t,n,o,r,a+s)]:(h=JSON.parse(I),[2,{code:i.SUCCESS,data:{uniqueName:h.rc_url.file_name,downloadUrl:"".concat(f,"/").concat(h.rc_url.path)}}]):[2,{code:i.UPLOAD_FAIL,msg:g.toString()}]}}))}))},n}(Vn);function Kn(e,t){return x(this,void 0,void 0,(function(){var n,o,r,a,s,c,u,d,l,f,v,g,I,h,R,m;return F(this,(function(E){switch(E.label){case 0:return n=t.getFileToken,o=t.serverType,r=t.customDomain,a=t.ossConfig,s=t.uploadServer,c=t.bosAddr,u=e.file,d=e.fileType,l=e.thumbnailConfig,f=function(e,t,n,o,r){if(n)return[{type:pn.RCX,url:n,p:"1"}];if(e){return JSON.parse(e).map((function(e){var t={type:pn.QINIU,url:"",p:""};return Object.keys(e).forEach((function(n){"p"===n?t.p=e[n]:(t.type=n,t.url=e[n])})),t})).sort((function(e,t){return e.p-t.p}))}var i=[];o&&i.push({type:pn.QINIU,url:o,p:"1"});r&&i.push({type:pn.BAIDU,url:r,p:"2"});return i}(a,0,r,s,c),0===f.length?[2,Promise.resolve({code:i.BIZ_ERROR_INVALID_PARAMETER,msg:"uploadUrlList is empty"})]:[4,Wn(f,e,n,o)];case 1:return v=E.sent(),g=v.code,I=v.data,h=v.msg,g===i.SUCCESS&&I?[4,Yn(e,t,I)]:[2,{code:g,msg:h}];case 2:return R=E.sent(),m={downloadUrl:R,uniqueName:(null==I?void 0:I.uniqueName)||"",name:u.name,size:u.size,type:u.type},d!==M.AUDIO?[3,4]:[4,u.arrayBuffer()];case 3:return[2,zn(E.sent(),m)];case 4:return d===M.IMAGE?[2,Qn(u,m,l)]:[2,{code:g,data:m}]}}))}))}function Yn(e,t,n){return x(this,void 0,void 0,(function(){var o,r,i,a,s,c,u;return F(this,(function(d){switch(d.label){case 0:return o=t.getFileUrl,r=e.fileType,i=e.file,a=n.uploadMethod,s=n.downloadUrl,c=n.uniqueName,(u=s)?[3,2]:[4,o(r,c,i.name,void 0,a)];case 1:u=d.sent().downloadUrl,d.label=2;case 2:return[2,u]}}))}))}function zn(e,t){var n=new AudioContext;return new Promise((function(o,r){n.decodeAudioData(e,(function(e){o({code:i.SUCCESS,data:k(k({},t),{duration:e.duration,length:e.length})})}),(function(e){o({code:i.UPLOAD_FAIL,msg:"get audio info fail:".concat(JSON.stringify(e))})}))}))}var jn=((Gn={})[pn.QINIU]=kn,Gn[pn.ALIYUN]=xn,Gn[pn.BAIDU]=Fn,Gn[pn.S3]=Zn,Gn[pn.STC]=Hn,Gn[pn.MINIO]=Jn,Gn[pn.RCX]=qn,Gn);function Wn(e,t,n,o,r){return void 0===r&&(r=[]),x(this,void 0,void 0,(function(){var a,s,c,u,d;return F(this,(function(l){switch(l.label){case 0:return 0===e.length?[2,Promise.resolve({code:i.UPLOAD_FAIL,msg:"Failed to upload all channels, msg: ".concat(JSON.stringify(r))})]:(a=e.shift(),[4,new jn[a.type](a.url,n,o).upload(t)]);case 1:return s=l.sent(),c=s.code,u=s.data,d=s.msg,c!==i.SUCCESS?(r.push({type:a.type,url:a.url,code:c,msg:d}),[2,Wn(e,t,n,o,r)]):[2,{code:c,data:u}]}}))}))}function Qn(e,t,n){return new Promise((function(o,r){var a=document.createElement("canvas"),s=a.getContext("2d"),c=new Image;c.onload=function(r){var u=n||{},d=u.maxHeight,l=void 0===d?160:d,f=u.maxWidth,v=void 0===f?160:f,g=u.quality,I=void 0===g?.7:g,h=u.scale,R=void 0===h?1:h,m=Xn(c.width,c.height,{maxHeight:l,maxWidth:v,scale:R});a.width=Math.min(m.w,v),a.height=Math.min(m.h,l),s.drawImage(c,m.x,m.y,m.w,m.h);var E=a.toDataURL("string"==typeof e?"image/jpg":e.type,I);E=E.replace(/data:image\/[^;]+;base64,/,""),o({code:i.SUCCESS,data:k(k({},t),{thumbnail:E,width:m.w,height:m.h})})},c.onerror=function(e){o({code:i.UPLOAD_FAIL,msg:"get image info fail:".concat(JSON.stringify(e))})},c.src=(window.URL||window.webkitURL).createObjectURL(e)}))}var Xn=function(e,t,n){var o,r,i=n.maxHeight,a=void 0===i?160:i,s=n.maxWidth,c=void 0===s?160:s,u=n.scale,d=e<t,l=0,f=0;return(d?t/e:e/t)>(void 0===u?1:u)?(d?(o=100,f=((r=t/(e/100))-a)/2):(r=100,l=((o=e/(t/100))-c)/2),{w:o,h:r,x:-l,y:-f}):(d?(r=a,o=e/(t/a)):(o=c,r=t/(e/c)),{w:o,h:r,x:-l,y:-f})};function $n(e){return x(this,void 0,void 0,(function(){var t,n,o;return F(this,(function(r){return t=e.contentDisposition,n=e.fileType,o=e.file,E("contentDisposition",t,(function(e){return"inline"===e||"attachment"===e}),!1)&&E("fileType",n,(function(e){return!!M[e]}),!0)&&E("file",o,(function(e){return e instanceof File&&(!(n===M.IMAGE&&!e.type.match(/^image\//))&&!(n===M.AUDIO&&!e.type.match(/^audio\//)))}),!0)?[2,Ze((function(t,n,o){return new Promise((function(n){var r=t.getNaviInfoFromCache();Kn(e,{getFileToken:t.getFileToken.bind(t),getFileUrl:t.getFileUrl.bind(t),customDomain:o.uploadDomain||"",serverType:null==r?void 0:r.type,ossConfig:null==r?void 0:r.ossConfig,uploadServer:null==r?void 0:r.uploadServer,bosAddr:null==r?void 0:r.bosAddr}).then((function(e){n(e)}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function eo(e,t,n,o){return Ze((function(r){return new Promise((function(a){r.getFileToken(e,t,n,o).then((function(e){a({code:i.SUCCESS,data:e})})).catch((function(e){a({code:e,msg:rt[e]})}))}))}))}function to(e){return E("url",e,v.STRING,!0)?Ze((function(t){return new Promise((function(n){t.getFileToken(1,void 0,void 0,void 0,e).then((function(e){var t=e.token,o=e.downloadAuthInfo,r=e.deadline;n({code:i.SUCCESS,data:{token:t,downloadAuthInfo:o,deadline:r}})})).catch((function(e){n({code:e,msg:rt[e]})}))}))})):Promise.resolve({code:i.BIZ_ERROR_INVALID_PARAMETER})}function no(e,t,n,o,r){return E("fileType",e,L,!0)&&E("filename",t,v.STRING)&&E("saveName",n,v.STRING)&&E("serverType",r,v.NUMBER)?Ze((function(a){return new Promise((function(s){a.getFileUrl(e,t,n,o,r).then((function(e){s({code:i.SUCCESS,data:e})})).catch((function(e){s({code:e})}))}))})):Promise.resolve({code:i.BIZ_ERROR_INVALID_PARAMETER})}function oo(e,t,n){return x(this,void 0,void 0,(function(){var o=this;return F(this,(function(r){return[2,Ze((function(r,c){return x(o,void 0,void 0,(function(){var o,u,d,l,f,g,I,h,m,S,T,p;return F(this,(function(O){switch(O.label){case 0:return n=n||{},t instanceof Sn==!1?(c.warn(R.O,"send message fail -> message parameter is not an instance of BaseMessage"),[2,ot.ILLGAL_PARAMS]):E("conversation",e,v.OBJECT,!0)?(o=e.conversationType,u=e.targetId,d=e.channelId,E("conversation.targetId",u,v.STRING,!0)&&E("conversation.conversationType",o,v.NUMBER,!0)&&E("conversation.channelId",d,v.CHANNEL_ID)&&E("options.isStatusMessage",null==n?void 0:n.isStatusMessage,v.BOOLEAN)&&E("options.disableNotification",null==n?void 0:n.disableNotification,v.BOOLEAN)&&E("options.pushContent",null==n?void 0:n.pushContent,v.STRING)&&E("options.pushData",null==n?void 0:n.pushData,v.STRING)&&E("options.isMentioned",null==n?void 0:n.isMentioned,v.BOOLEAN)&&E("options.mentionedType",null==n?void 0:n.mentionedType,v.NUMBER)&&E("options.mentionedUserIdList",null==n?void 0:n.mentionedUserIdList,v.ARRAY)&&E("options.directionalUserIdList",null==n?void 0:n.directionalUserIdList,v.ARRAY)&&E("options.isVoipPush",null==n?void 0:n.isVoipPush,v.BOOLEAN)&&E("options.canIncludeExpansion",null==n?void 0:n.canIncludeExpansion,v.BOOLEAN)&&E("options.expansion",null==n?void 0:n.expansion,v.OBJECT)&&E("options.pushConfig",null==n?void 0:n.pushConfig,v.OBJECT)&&E("options.messageId",null==n?void 0:n.messageId,v.NUMBER)?(l="conversationType:".concat(o,",targetId:").concat(u),c.debug(R.O,"send message ->".concat(l)),f=function(e,t,n){var o=e.isStatusMessage,r=e.disableNotification,i=e.pushContent,a=e.pushData,s=e.isMentioned,c=e.mentionedType,u=e.mentionedUserIdList,d=e.directionalUserIdList,l=e.isVoipPush,f=e.canIncludeExpansion,v=e.expansion,g=e.isFilerWhiteBlacklist,I=e.pushConfig,h=e.messageId,R=n.channelId;return k({isStatusMessage:o,disableNotification:r,pushContent:i,pushData:a,isMentioned:s,mentionedType:c,mentionedUserIdList:u,directionalUserIdList:d,isVoipPush:l,canIncludeExpansion:f,expansion:v,isFilerWhiteBlacklist:g,pushConfig:I,channelId:R||"",messageId:h},t)}(n,t,e),g={isMentioned:!!n.isMentioned,content:t.content,messageType:t.messageType,isPersited:!!t.isPersited,isCounted:!!t.isCounted,disableNotification:!!(null==n?void 0:n.disableNotification),canIncludeExpansion:!!(null==n?void 0:n.canIncludeExpansion),expansion:(null==n?void 0:n.expansion)||null,conversationType:e.conversationType,targetId:e.targetId,channelId:e.channelId,senderUserId:r.getCurrentUserId(),messageUId:"",messageDirection:B.SEND,receivedTime:0,isStatusMessage:!!n.isStatusMessage,receivedStatus:a.UNREAD,isOffLineMessage:!1,pushConfig:null==n?void 0:n.pushConfig,sentStatus:D.SENDING},o!==s.ULTRA_GROUP&&(g.isOffLineMessage=!1),I=c.createTraceId(),h=function(e){g.messageId=e;try{(null==n?void 0:n.onSendBefore)&&n.onSendBefore(Pe(g))}catch(e){c.error(R.O,'Callback method "onSendBefore" execution error.\n'.concat(null==e?void 0:e.stack),I)}},c.info(R.A_SEND_MSG_T,JSON.stringify({messageType:t.messageType,conversationType:o,targetId:u,channelId:d}),I),[4,r.sendMessage(o,u,f,h,I)]):[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]):[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}];case 1:return m=O.sent(),S=m.code,T=m.data,S===i.SUCCESS?(c.info(R.A_SEND_MSG_R,JSON.stringify({code:S,messageUId:T.messageUId,messageId:T.messageId}),I),p=Pe(T),[2,{code:S,data:p}]):(c.warn(R.A_SEND_MSG_R,"send message fail ->".concat(S,":").concat(rt[S],",").concat(l)),g.sentTime=(null==T?void 0:T.sentTime)||0,g.sentStatus=null==T?void 0:T.sentStatus,[2,{code:S,msg:rt[S],data:Pe(g)}])}}))}))}))]}))}))}function ro(e,t,n){return oo(e,new Cn(t),n)}function io(e,t){return function(n,o,r,a){if(!E("sendOptions.contentDisposition",null==a?void 0:a.contentDisposition,(function(e){return["inline","attachment"].includes(e)})))return Promise.resolve({code:i.BIZ_ERROR_INVALID_PARAMETER});var s={contentDisposition:null==a?void 0:a.contentDisposition};if(a&&"thumbnailConfig"in a){var c=null==a?void 0:a.thumbnailConfig;if(!(E("sendOptions.maxHeight",null==c?void 0:c.maxHeight,v.NUMBER)&&E("sendOptions.maxWidth",null==c?void 0:c.maxWidth,v.NUMBER)&&E("sendOptions.quality",null==c?void 0:c.quality,v.NUMBER)&&E("sendOptions.scale",null==c?void 0:c.scale,v.NUMBER)))return Promise.resolve({code:i.BIZ_ERROR_INVALID_PARAMETER});s.thumbnailConfig=c}return Ze((function(c,u,d){return new Promise((function(c){var d=u.createTraceId();u.info(R.L_MEDIA_UPLOAD_T,JSON.stringify({filesize:o.file.size,type:e}),d),$n({file:o.file,fileType:e,onProgress:function(e,t){var n;null===(n=null==r?void 0:r.onProgress)||void 0===n||n.call(r,Math.floor(e/t*100))},contentDisposition:s.contentDisposition,thumbnailConfig:s.thumbnailConfig}).then((function(e){var s,l=e.code,f=e.data,v=e.msg;if(l===i.SUCCESS&&f){var g=(null===(s=null==r?void 0:r.onComplete)||void 0===s?void 0:s.call(r,k({url:f.downloadUrl},f)))||t(f,o);return u.info(R.L_MEDIA_UPLOAD_R,JSON.stringify({downurl:f.downloadUrl,code:i.SUCCESS}),d),void oo(n,g,a).then(c)}c({code:l,msg:v})}))}))}))}}var ao=io(M.FILE,(function(e,t){var n,o,r={name:e.name,size:t.file.size,type:(n=e.name,o=n.match(/\.(\w+)$/),o?o[1]:"bin"),fileUrl:e.downloadUrl};return t.user&&(r.user=t.user),t.extra&&(r.extra=t.extra),t.mentionedInfo&&(r.mentionedInfo=t.mentionedInfo),new Un(r)})),so=io(M.IMAGE,(function(e,t){var n={content:e.thumbnail,imageUri:e.downloadUrl};return t.user&&(n.user=t.user),t.extra&&(n.extra=t.extra),t.mentionedInfo&&(n.mentionedInfo=t.mentionedInfo),new On(n)})),co=io(M.IMAGE,(function(e,t){var n={gifDataSize:e.size,remoteUrl:e.downloadUrl,width:e.width,height:e.height};return t.user&&(n.user=t.user),t.extra&&(n.extra=t.extra),t.mentionedInfo&&(n.mentionedInfo=t.mentionedInfo),new yn(n)})),uo=io(M.AUDIO,(function(e,t){var n={remoteUrl:e.downloadUrl,duration:e.duration,type:e.type};return t.user&&(n.user=t.user),t.extra&&(n.extra=t.extra),t.mentionedInfo&&(n.mentionedInfo=t.mentionedInfo),new Nn(n)})),lo=io(M.SIGHT,(function(e,t){var n={sightUrl:e.downloadUrl,content:t.thumbnail,duration:t.duration,size:t.file.size||e.size,name:t.name||e.name};return t.user&&(n.user=t.user),t.extra&&(n.extra=t.extra),t.mentionedInfo&&(n.mentionedInfo=t.mentionedInfo),new _n(n)}));function fo(e,t){return x(this,void 0,void 0,(function(){var n=this;return F(this,(function(o){return E("options.timestamp",null==t?void 0:t.timestamp,v.NUMBER)&&E("options.count",null==t?void 0:t.count,v.NUMBER)&&(w()||E("options.count",null==t?void 0:t.count,(function(e){var t=e>0&&e<=100;return t||null===console||void 0===console||console.error('"options.count" is invalid, It should be greater than 0 and less than 100'),t})))&&E("options.order",null==t?void 0:t.order,(function(e){return 0===e||1===e}))&&E("conversation",e,v.CONVERSATION,!0)?[2,Ze((function(o,r){return x(n,void 0,void 0,(function(){var n,a,s,c,u;return F(this,(function(d){switch(d.label){case 0:return n=r.createTraceId(),r.info(R.A_GET_HISTORY_MSG_T,JSON.stringify({targetId:e.targetId,conversationType:e.conversationType,channelId:e.channelId,timestamp:null==t?void 0:t.timestamp,count:null==t?void 0:t.count}),n),1!==(o.getNaviInfoFromCache()||{}).repairHisMsg?[3,2]:(null==t?void 0:t.count)&&(null==t?void 0:t.count)>100?(r.warn(R.A_GET_HISTORY_MSG_R,'"options.count" is invalid, It should be greater than 0 and less than 100',n),[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]):[4,o.getMessages(e.conversationType,e.targetId,null==t?void 0:t.timestamp,null==t?void 0:t.count,null==t?void 0:t.order,null==e?void 0:e.channelId,n)];case 1:return a=d.sent(),[3,4];case 2:return[4,o.getHistoryMessage(e.conversationType,e.targetId,null==t?void 0:t.timestamp,null==t?void 0:t.count,null==t?void 0:t.order,null==e?void 0:e.channelId,"",n)];case 3:a=d.sent(),d.label=4;case 4:return s=a.code,c=a.data,s===i.SUCCESS&&c?(u=c.list.map((function(e){return Pe(e)})),r.info(R.A_GET_HISTORY_MSG_R,JSON.stringify({code:s,messageLength:u.length}),n),[2,{code:s,data:{list:u,hasMore:c.hasMore}}]):(r.warn(R.A_GET_HISTORY_MSG_R,JSON.stringify({code:s,messageUIds:""}),n),[2,{code:s,msg:rt[s]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function vo(e,t){return x(this,void 0,void 0,(function(){var n=this;return F(this,(function(o){return E("options.timestamp",null==t?void 0:t.timestamp,v.NUMBER)&&E("options.count",null==t?void 0:t.count,v.NUMBER)&&E("options.count",null==t?void 0:t.count,(function(e){var t=e>0&&e<=100;return t||null===console||void 0===console||console.error("options.count is invalid, It should be greater than 0 and less than 100"),t}))&&E("options.order",null==t?void 0:t.order,(function(e){return 0===e||1===e}))&&E("conversation",e,v.CONVERSATION,!0)?[2,Ze((function(o,r){return x(n,void 0,void 0,(function(){var n,a,s,c,u;return F(this,(function(d){switch(d.label){case 0:return n="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),r.debug(R.O,"get history message ->".concat(n)),[4,o.getRemoteHistoryMessages(e.conversationType,e.targetId,(null==t?void 0:t.timestamp)||0,(null==t?void 0:t.count)||20,(null==t?void 0:t.order)||0,e.channelId||"")];case 1:return a=d.sent(),s=a.code,c=a.data,s===i.SUCCESS&&c?(u=c.list.map((function(e){return Pe(e)})),[2,{code:s,data:{list:u,hasMore:c.hasMore}}]):(r.warn(R.O,"get history message fail ->".concat(s,":").concat(rt[s],",").concat(n)),[2,{code:s,msg:rt[s]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function go(e,t,n,o){return x(this,void 0,void 0,(function(){var r=this;return F(this,(function(a){return E("targetId",e,v.STRING,!0)&&E("messageUId",t,v.STRING,!0)&&E("timestamp",n,v.NUMBER,!0)&&E("channelId",o,v.CHANNEL_ID)?[2,Ze((function(i){return x(r,void 0,void 0,(function(){var r,i,a,c,u;return F(this,(function(d){switch(d.label){case 0:return r={targetId:e,conversationType:s.PRIVATE,channelId:o},i=new Sn("RC:ReadNtf",{messageUId:t,lastMessageSendTime:n,type:1}),[4,oo(r,i)];case 1:return a=d.sent(),c=a.code,u=a.msg,0===c?[2,{code:c}]:[2,{code:c,msg:u}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Io(e,t,n){return x(this,void 0,void 0,(function(){var o=this;return F(this,(function(r){return E("messageUId",t,v.STRING,!0)&&E("targetId",e,v.STRING,!0)&&E("channelId",n,v.CHANNEL_ID)?[2,Ze((function(r,i){return x(o,void 0,void 0,(function(){var o,r,a,c,u;return F(this,(function(d){switch(d.label){case 0:return o="messageUId:".concat(t,",targetId:").concat(e),i.debug(R.O,"send read receipt message ->".concat(o)),r=new Sn("RC:RRReqMsg",{messageUId:t}),[4,oo({targetId:e,conversationType:s.GROUP,channelId:n},r)];case 1:return a=d.sent(),c=a.code,u=a.msg,0===c?[2,{code:c}]:[2,{code:c,msg:u}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function ho(e,t,n){return x(this,void 0,void 0,(function(){return F(this,(function(e){throw new Error("This method is deprecated, please use method sendReadReceiptResponseV2.")}))}))}function Ro(e,t,n){return x(this,void 0,void 0,(function(){var o=this;return F(this,(function(r){return E("targetId",e,v.STRING,!0)&&E("messageList",t,v.OBJECT,!0)&&E("channelId",n,v.CHANNEL_ID)&&!Object.keys(t).some((function(e){return!E(e,t[e],v.ARRAY)}))?[2,Ze((function(r,a){return x(o,void 0,void 0,(function(){var o,c,u,d,l,f;return F(this,(function(v){switch(v.label){case 0:return o={targetId:e,conversationType:s.GROUP,channelId:n},u=r.getNaviInfoFromCache(),1!==(null==u?void 0:u.grpRRVer)?[3,2]:(d=[],Object.keys(t).forEach((function(e){t[e].forEach((function(e){-1===d.indexOf(e)&&d.push(e)}))})),d.length?[4,r.sendReadReceiptMessage(e,d,n)]:(a.warn(R.O,"Error in parameter messageList."),[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]));case 1:return c=v.sent(),[3,4];case 2:return l=new Sn("RC:RRRspMsg",{receiptMessageDic:t}),[4,oo(o,l)];case 3:c=v.sent(),v.label=4;case 4:return(f=c.code)===i.SUCCESS?[2,{code:f}]:(a.warn(R.O,"send read receipt message fail ->".concat(f,":").concat(rt[f])),[2,{code:f,msg:rt[f]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function mo(e,t){return x(this,void 0,void 0,(function(){var n,o,r,a;return F(this,(function(s){switch(s.label){case 0:return E("conversation",e,v.CONVERSATION,!0)&&E("lastMessageSendTime",t,v.NUMBER,!0)?(n=new Sn("RC:SRSMsg",{lastMessageSendTime:t}),[4,oo(e,n)]):[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}];case 1:return o=s.sent(),r=o.code,a=o.msg,0===r?[2,{code:r}]:[2,{code:r,msg:a}]}}))}))}function Eo(e,t){return x(this,void 0,void 0,(function(){var n=this;return F(this,(function(o){return E("conversation",e,v.CONVERSATION,!0)&&E("options.messageUId",t.messageUId,v.STRING,!0)&&E("options.sentTime",t.sentTime,v.NUMBER,!0)&&E("options.disableNotification",null==t?void 0:t.disableNotification,v.BOOLEAN)&&E("options.pushConfig",null==t?void 0:t.pushConfig,v.OBJECT)?[2,Ze((function(o,r){return x(n,void 0,void 0,(function(){var n,a,s,c,u;return F(this,(function(d){switch(d.label){case 0:return n={user:t.user,channelId:e.channelId||"",disableNotification:null==t?void 0:t.disableNotification,pushConfig:null==t?void 0:t.pushConfig,extra:t.extra,isDelete:t.isDelete},a="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId,",messageUId:").concat(t.messageUId),r.debug(R.O,"recall message ->".concat(a)),[4,o.recallMessage(e.conversationType,e.targetId,t.messageUId,t.sentTime,n)];case 1:return s=d.sent(),c=s.code,u=s.data,c===i.SUCCESS&&u?[2,{code:c,data:Pe(u)}]:c===i.SUCCESS?[2,{code:c}]:(r.warn(R.O,"recall message fail ->".concat(c,":").concat(rt[c],",").concat(a)),[2,{code:c,msg:rt[c]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function So(e,t){return x(this,void 0,void 0,(function(){var n=this;return F(this,(function(o){return E("conversation",e,v.CONVERSATION,!0)&&E("options",t,(function(e){return g(e)&&e.length}),!0)&&!t.some((function(e){return!E("options.messageUId",e.messageUId,v.STRING,!0)||!E("options.sentTime",e.sentTime,v.NUMBER,!0)||!E("options.messageDirection",e.messageDirection,(function(e){return 1===e||2===e}),!0)}))?[2,Ze((function(o,r){return x(n,void 0,void 0,(function(){var n,a;return F(this,(function(s){switch(s.label){case 0:return n="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),r.debug(R.O,"delete messages ->".concat(n)),[4,o.deleteRemoteMessage(e.conversationType,e.targetId,t,e.channelId)];case 1:return(a=s.sent())!==i.SUCCESS?(r.warn(R.O,"delete message fail ->".concat(a,":").concat(rt[a],",").concat(n)),[2,{code:a,msg:rt[a]}]):[2,{code:i.SUCCESS}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function To(e,t){return x(this,void 0,void 0,(function(){var n=this;return F(this,(function(o){return E("conversation",e,v.CONVERSATION,!0)&&E("timestamp",t,v.NUMBER,!0)?[2,Ze((function(o,r){return x(n,void 0,void 0,(function(){var n,a;return F(this,(function(s){switch(s.label){case 0:return n="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),r.debug(R.O,"clear message ->".concat(n)),[4,o.deleteRemoteMessageByTimestamp(e.conversationType,e.targetId,t,e.channelId)];case 1:return(a=s.sent())!==i.SUCCESS?(r.warn(R.O,"clear message ->".concat(a,":").concat(rt[a],",").concat(n)),[2,{code:a,msg:rt[a]}]):[2,{code:i.SUCCESS}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function po(e,t){return x(this,void 0,void 0,(function(){var n=this;return F(this,(function(o){return E("expansion",e,v.OBJECT,!0)&&E("message",t,v.OBJECT,!0)&&E("message.conversationType",t.conversationType,v.NUMBER,!0)&&E("message.targetId",t.targetId,v.STRING,!0)&&E("message.channelId",t.channelId,v.CHANNEL_ID)&&E("message.messageUId",t.messageUId,v.STRING,!0)&&E("message.expansion",t.expansion,v.OBJECT)&&E("message.canIncludeExpansion",t.canIncludeExpansion,v.BOOLEAN,!0)?[2,Ze((function(o,r){return x(n,void 0,void 0,(function(){var n,a,s,c,u,d,l,f;return F(this,(function(v){switch(v.label){case 0:return n=t.conversationType,a=t.targetId,s=t.messageUId,c=t.canIncludeExpansion,u=t.expansion,d=t.channelId,l="conversationType:".concat(n,",targetId:").concat(a,",messageUId:").concat(s),r.debug(R.O,"update message expansion ->".concat(l)),[4,o.sendExpansionMessage({conversationType:n,targetId:a,messageUId:s,expansion:e,canIncludeExpansion:c,originExpansion:u,channelId:d})];case 1:return(f=v.sent().code)!==i.SUCCESS?(r.warn(R.O,"update message expansion fail ->".concat(f,":").concat(rt[f],",").concat(l)),[2,{code:f,msg:rt[f]}]):[2,{code:f}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Oo(e,t){return x(this,void 0,void 0,(function(){var n=this;return F(this,(function(o){return E("keys",e,v.ARRAY,!0)&&E("message",t,v.OBJECT,!0)&&E("message.conversationType",t.conversationType,v.NUMBER,!0)&&E("message.targetId",t.targetId,v.STRING,!0)&&E("message.channelId",t.channelId,v.CHANNEL_ID)&&E("message.messageUId",t.messageUId,v.STRING,!0)&&E("message.canIncludeExpansion",t.canIncludeExpansion,v.BOOLEAN,!0)?[2,Ze((function(o,r){return x(n,void 0,void 0,(function(){var n,a,s,c,u,d,l;return F(this,(function(f){switch(f.label){case 0:return n=t.conversationType,a=t.targetId,s=t.messageUId,c=t.canIncludeExpansion,u=t.channelId,d="conversationType:".concat(n,",targetId:").concat(a,",messageUId:").concat(s),r.debug(R.O,"remove message expansion ->".concat(d)),[4,o.sendExpansionMessage({conversationType:n,targetId:a,messageUId:s,canIncludeExpansion:c,keys:e,channelId:u})];case 1:return(l=f.sent().code)!==i.SUCCESS?(r.warn(R.O,"remove message expansion fail ->".concat(l,":").concat(rt[l],",").concat(d)),[2,{code:l,msg:rt[l]}]):[2,{code:l}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function No(e,t){return x(this,void 0,void 0,(function(){var n=this;return F(this,(function(o){return E("conversation",e,v.CONVERSATION,!0)&&E("typingContentType",t,v.STRING,!0)?[2,Ze((function(o,r){return x(n,void 0,void 0,(function(){var n,a,s,c,u,d;return F(this,(function(l){switch(l.label){case 0:return n={messageType:"RC:TypSts",content:{typingContentType:t},isStatusMessage:!0,channelId:e.channelId},a=r.createTraceId(),r.info(R.A_SEND_MSG_T,JSON.stringify({messageType:n.messageType,conversationType:e.conversationType,targetId:e.targetId,channelId:e.channelId}),a),[4,o.sendMessage(e.conversationType,e.targetId,n,void 0,a)];case 1:return s=l.sent(),c=s.code,u=s.data,d=c===i.SUCCESS?"info":"warn",r[d](R.A_SEND_MSG_R,JSON.stringify({code:c,messageUId:u?u.messageUId:"",messageId:u?u.messageId:""}),a),c===i.SUCCESS?[2,{code:c,data:Pe(u)}]:[2,{code:c,msg:rt[c]}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function _o(e,t,n){return x(this,void 0,void 0,(function(){var o=this;return F(this,(function(r){return E("messageUId",t,v.STRING,!0)&&E("targetId",e,v.STRING,!0)&&E("channelId",n,v.CHANNEL_ID)?[2,Ze((function(r,a){return x(o,void 0,void 0,(function(){var o,s,c,u;return F(this,(function(d){switch(d.label){case 0:return o="messageUId:".concat(t,",targetId:").concat(e),a.debug(R.O,"get message reader ->".concat(o)),[4,r.getMessageReader(e,t,n)];case 1:return s=d.sent(),c=s.code,u=s.data,c===i.SUCCESS?[2,{code:c,data:u}]:(a.warn(R.O,"get message reader fail ->".concat(c,":").concat(rt[c],",").concat(o)),[2,{code:c,msg:rt[c]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Co(e,t,n,o,r){return Fe((function(i,a){return f("messageType",e,v.STRING,!0),f("isPersited",t,v.BOOLEAN,!0),f("isCounted",n,v.BOOLEAN,!0),f("isStatusMessage",r,v.BOOLEAN,!1),f("searchProps",o,v.ARRAY),a.info(R.A_REGTYP_O,JSON.stringify({messageType:e,isCounted:n,isStatusMessage:r,isPersited:t})),i.registerMessageType(e,t,n,o,r),Tn(e,t,n)}))}function Ao(e){return x(this,void 0,void 0,(function(){var t=this;return F(this,(function(n){return w()?E("conversation",e,v.CONVERSATION,!0)?[2,Ze((function(n,o){return x(t,void 0,void 0,(function(){var t,r,a,s;return F(this,(function(c){switch(c.label){case 0:return[4,n.getFirstUnreadMessage(e.conversationType,e.targetId,e.channelId)];case 1:return t=c.sent(),r=t.code,a=t.data,r===i.SUCCESS?(s=a&&Pe(a)||null,[2,{code:r,data:s}]):(o.warn(R.O,"insertMessage ->code:".concat(r,",targetId:").concat(e.targetId)),[2,{code:r,msg:rt[r]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:rt[i.NOT_SUPPORT]}]}))}))}function Uo(e,t,n){return void 0===n&&(n={}),x(this,void 0,void 0,(function(){var o=this;return F(this,(function(r){return we("RongIMLib.insertMessage","RongIMLib.ElectronExtension.insertMessage"),w()?E("conversation",e,v.CONVERSATION,!0)&&E("message",t,v.OBJECT,!0)&&E("options",n,v.OBJECT)&&E("options.isUnread",null==n?void 0:n.isUnread,v.BOOLEAN)&&E("options.searchContent",null==n?void 0:n.searchContent,v.STRING)&&E("content.senderUserId",t.senderUserId,v.STRING,!0)&&E("content.messageType",t.messageType,v.STRING,!0)&&E("content.content",t.content,v.OBJECT,!0)&&E("content.messageDirection",t.messageDirection,v.NUMBER,!0)&&E("content.canIncludeExpansion",t.canIncludeExpansion,v.BOOLEAN)&&E("content.expansion",t.expansion,v.OBJECT)&&E("content.disableNotification",t.disableNotification,v.BOOLEAN)&&E("content.sentTime",t.sentTime,v.NUMBER)&&E("content.sentStatus",t.sentStatus,v.NUMBER)?[2,Ze((function(r,a){return x(o,void 0,void 0,(function(){var o,s,c,u,d,l,f,v,g,I,h,m,E,S,T,p;return F(this,(function(O){switch(O.label){case 0:return o=t.senderUserId,s=t.messageType,c=t.content,u=t.messageDirection,d=t.messageUId,l=t.canIncludeExpansion,f=t.expansion,v=t.disableNotification,g=t.sentTime,I=t.sentStatus,a.info(R.O,"insertMessage ->targetId:".concat(e.targetId,",conversationType:").concat(e.conversationType)),h=n.isUnread,m=n.searchContent,E={senderUserId:o,messageType:s,content:c,messageDirection:u,sentTime:g,sentStatus:I,searchContent:m,isUnread:h,messageUId:d,disableNotification:v,canIncludeExpansion:l,expansionMsg:JSON.stringify(f),channelId:e.channelId||""},[4,r.insertMessage(e.conversationType,e.targetId,E)];case 1:return S=O.sent(),T=S.code,p=S.data,T===i.SUCCESS?[2,{code:T,data:Pe(p)}]:(a.warn(R.O,"insertMessage ->code:".concat(T,",targetId:").concat(e.targetId)),[2,{code:T,msg:rt[T]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:rt[i.NOT_SUPPORT]}]}))}))}function yo(e){return x(this,void 0,void 0,(function(){var t=this;return F(this,(function(n){return w()?E("messageId",e,(function(e){return c(e)||_(e)}),!0)?[2,Ze((function(n,o){return x(t,void 0,void 0,(function(){var t,r,a;return F(this,(function(s){switch(s.label){case 0:return[4,n.getMessage(e)];case 1:return t=s.sent(),r=t.code,a=t.data,r===i.SUCCESS?[2,{code:r,data:Pe(a)}]:(o.warn(R.O,"getMessage ->code:".concat(r,",messageId:").concat(e)),[2,{code:r,msg:rt[r]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:rt[i.NOT_SUPPORT]}]}))}))}function Mo(e){if(!w())return{code:i.NOT_SUPPORT,msg:rt[i.NOT_SUPPORT]};var t,n=e.conversationType,o=e.targetId,r=e.channelId;return E("conversation",e,v.CONVERSATION,!0)?(t=function(e){var t=e.getUnreadMentionedMessages(n,o,r),a=[];return t&&t.length&&t.forEach((function(e){return a.push(Pe(e))})),{code:i.SUCCESS,data:a}},Ge?t(Ge,ke,Ve):{code:i.BIZ_ERROR_CLIENT_NOT_INIT}):{code:i.BIZ_ERROR_INVALID_PARAMETER}}function Po(e,t,n,o){return x(this,void 0,void 0,(function(){var r=this;return F(this,(function(a){return we("RongIMLib.searchMessages","RongIMLib.ElectronExtension.searchMessages"),w()?E("conversation",e,v.CONVERSATION,!0)&&E("keyword",t,v.STRING,!0)&&E("timestamp",n,v.NUMBER)&&E("count",o,v.NUMBER)?[2,Ze((function(a,s){return x(r,void 0,void 0,(function(){var r,c,u,d;return F(this,(function(l){switch(l.label){case 0:return 1,[4,a.searchMessageByContent(e.conversationType,e.targetId,t,n,o,1,e.channelId)];case 1:return r=l.sent(),c=r.code,u=r.data,c===i.SUCCESS?(d=[],(null==u?void 0:u.messages)&&u.messages.length&&u.messages.forEach((function(e){return d.push(Pe(e))})),[2,{code:c,data:{messages:d,count:null==u?void 0:u.count}}]):(s.warn(R.O,"searchMessages ->code:".concat(c,",targetId:").concat(e.targetId)),[2,{code:c,msg:rt[c]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:rt[i.NOT_SUPPORT]}]}))}))}function Lo(e,t,n){return x(this,void 0,void 0,(function(){var o,r,a,s=this;return F(this,(function(c){return we("RongIMLib.deleteLocalMessagesByTimestamp","RongIMLib.ElectronExtension.deleteMessagesByTimestamp"),w()?(o=e.conversationType,r=e.targetId,a=e.channelId,E("conversationType",o,v.NUMBER,!0)&&E("targetId",r,v.STRING,!0)&&E("timestamp",t,v.NUMBER,!0)&&E("cleanSpace",n,v.BOOLEAN)?[2,Ze((function(c,u){return x(s,void 0,void 0,(function(){var s;return F(this,(function(d){switch(d.label){case 0:return[4,c.deleteMessagesByTimestamp(o,r,t,n,a)];case 1:return s=d.sent(),u.debug(R.A_DELETE_MESSAGES_S,JSON.stringify({code:s,conversationType:o,targetId:r,channelId:a,timestamp:t})),s===i.SUCCESS?[2,{code:s}]:(u.warn(R.O,"deleteLocalMessagesByTimestamp ->code:".concat(s,",targetId:").concat(e.targetId)),[2,{code:s,msg:rt[s]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]):[2,{code:i.NOT_SUPPORT,msg:rt[i.NOT_SUPPORT]}]}))}))}function wo(e){return x(this,void 0,void 0,(function(){var t=this;return F(this,(function(n){return we("RongIMLib.clearMessages","RongIMLib.ElectronExtension.clearMessages"),w()?[2,Ze((function(n,o){return x(t,void 0,void 0,(function(){var t,r,a,s;return F(this,(function(c){switch(c.label){case 0:return t=e.conversationType,r=e.targetId,a=e.channelId,o.info(R.O,"clearMessages ->targetId:".concat(r,",conversationType:").concat(t)),[4,n.clearMessages(t,r,a)];case 1:return(s=c.sent())===i.SUCCESS?[2,{code:s}]:(o.warn(R.O,"clearMessages ->code:".concat(s,",targetId:").concat(r)),[2,{code:s,msg:rt[s]}])}}))}))}))]:[2,{code:i.NOT_SUPPORT,msg:rt[i.NOT_SUPPORT]}]}))}))}function Bo(e,t,n,o){return x(this,void 0,void 0,(function(){var r=this;return F(this,(function(a){return we("RongIMLib.searchConversationByContent","RongIMLib.ElectronExtension.searchConversationByContent"),w()?[2,Ze((function(a,s){return x(r,void 0,void 0,(function(){var r,c,u;return F(this,(function(d){switch(d.label){case 0:return s.info(R.O,"searchConversationByContent ->keyword:".concat(e)),[4,a.searchConversationByContent(e,n,o,t)];case 1:return r=d.sent(),c=r.code,u=r.data,c===i.SUCCESS?[2,{code:c,data:u}]:(s.warn(R.O,"searchConversationByContent ->code:".concat(c,",keyword:").concat(e)),[2,{code:c,msg:rt[c]}])}}))}))}))]:[2,{code:i.NOT_SUPPORT,msg:rt[i.NOT_SUPPORT]}]}))}))}function Do(e,t){return x(this,void 0,void 0,(function(){var n=this;return F(this,(function(o){return w()?E("conversation",e,v.CONVERSATION,!0)&&E("timestamp",t,v.NUMBER)?[2,Ze((function(o,r){return x(n,void 0,void 0,(function(){var n,a,s,c;return F(this,(function(u){switch(u.label){case 0:return n=e.conversationType,a=e.targetId,s=e.channelId,r.info(R.O,"clearUnreadCountByTimestamp ->targetId:".concat(a,",conversationType:").concat(n)),[4,o.clearUnreadCountByTimestamp(n,a,t,s)];case 1:return(c=u.sent())===i.SUCCESS?[2,{code:c}]:(r.warn(R.O,"clearUnreadCountByTimestamp ->code:".concat(c,",targetId:").concat(a)),[2,{code:c,msg:rt[c]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:rt[i.NOT_SUPPORT]}]}))}))}function bo(e,t){return x(this,void 0,void 0,(function(){var n=this;return F(this,(function(o){return we("RongIMLib.setMessageReceivedStatus","RongIMLib.ElectronExtension.setMessageReceivedStatus"),w()?E("messageId",e,v.NUMBER,!0)&&E("receivedStatus",t,v.NUMBER,!0)?[2,Ze((function(o,r){return x(n,void 0,void 0,(function(){var n;return F(this,(function(a){switch(a.label){case 0:return r.info(R.O,"setMessageReceivedStatus ->messageId:".concat(e,",receivedStatus:").concat(t)),[4,o.setMessageReceivedStatus(e,t)];case 1:return(n=a.sent())===i.SUCCESS?[2,{code:n}]:(r.warn(R.O,"setMessageReceivedStatus ->code:".concat(n,",messageId:").concat(e)),[2,{code:n,msg:rt[n]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:rt[i.NOT_SUPPORT]}]}))}))}function Go(e){return x(this,void 0,void 0,(function(){var t=this;return F(this,(function(n){return E("tag.tagId",e.tagId,v.STRING,!0)&&E("tag.tagId",e.tagId,(function(e){return e.length<=10}))&&E("tag.tagName",e.tagName,(function(e){return e.length<=15}))&&E("tag.tagName",e.tagName,v.STRING,!0)?[2,Ze((function(n,o){return x(t,void 0,void 0,(function(){var t;return F(this,(function(r){switch(r.label){case 0:return o.info(R.O,"createTag ->tagId:".concat(e.tagId,",tagName:").concat(e.tagName)),[4,n.createTag(e)];case 1:return(t=r.sent().code)===i.SUCCESS?[2,{code:t}]:(o.warn(R.O,"createTag ->code:".concat(t,",tagId:").concat(e.tagId)),[2,{code:t,msg:rt[t]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Vo(e){return x(this,void 0,void 0,(function(){var t=this;return F(this,(function(n){return E("tagId",e,v.STRING,!0)?[2,Ze((function(n,o){return x(t,void 0,void 0,(function(){var t;return F(this,(function(r){switch(r.label){case 0:return o.info(R.O,"removeTag ->tagId:".concat(e)),[4,n.removeTag(e)];case 1:return(t=r.sent().code)===i.SUCCESS?[2,{code:t}]:(o.warn(R.O,"removeTag ->code:".concat(t,",tagId:").concat(e)),[2,{code:t,msg:rt[t]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function ko(e){return x(this,void 0,void 0,(function(){var t=this;return F(this,(function(n){return E("tag.tagId",e.tagId,v.STRING,!0)&&E("tag.tagName",e.tagName,v.STRING,!0)&&E("tag.tagName",e.tagName,(function(e){return e.length<=15}))?[2,Ze((function(n,o){return x(t,void 0,void 0,(function(){var t;return F(this,(function(r){switch(r.label){case 0:return o.info(R.O,"updateTag ->tagId:".concat(e.tagId,",tagName:").concat(e.tagName)),[4,n.updateTag(e)];case 1:return(t=r.sent().code)===i.SUCCESS?[2,{code:t}]:(o.warn(R.O,"updateTag ->code:".concat(t,",tagId:").concat(e.tagId)),[2,{code:t,msg:rt[t]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function xo(){return x(this,void 0,void 0,(function(){var e=this;return F(this,(function(t){return[2,Ze((function(t,n){return x(e,void 0,void 0,(function(){var e,o,r;return F(this,(function(a){switch(a.label){case 0:return[4,t.getTagList()];case 1:return e=a.sent(),o=e.code,r=e.data,n.warn(R.O,"getTagList ->code:".concat(o)),[2,{code:i.SUCCESS,data:r}]}}))}))}))]}))}))}function Fo(e){return x(this,void 0,void 0,(function(){var t=this;return F(this,(function(n){return E("conversation",e,v.CONVERSATION,!0)?[2,Ze((function(n,o){return x(t,void 0,void 0,(function(){var t,r,a;return F(this,(function(s){switch(s.label){case 0:return o.info(R.O,"getTagsForConversation ->targetId:".concat(e.targetId,",conversationType:").concat(e.conversationType)),[4,n.getTagsForConversation(e)];case 1:return t=s.sent(),r=t.code,a=t.data,r===i.SUCCESS?[2,{code:r,data:a}]:[2,{code:r,msg:rt[r]}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Zo(e,t){return x(this,void 0,void 0,(function(){var n=this;return F(this,(function(o){return E("tagId",e,v.STRING,!0)&&E("conversations",t,v.ARRAY,!0)&&!t.some((function(e){return!E("conversation",e,v.CONVERSATION,!0)}))?[2,Ze((function(o,r){return x(n,void 0,void 0,(function(){var n;return F(this,(function(a){switch(a.label){case 0:return r.info(R.O,"addTagForConversations ->tagId:".concat(e)),[4,o.addTagForConversations(e,t)];case 1:return(n=a.sent().code)===i.SUCCESS?[2,{code:n}]:(r.warn(R.O,"addTagForConversations ->code:".concat(n,",tagId:").concat(e)),[2,{code:n,msg:rt[n]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Ho(e,t){return x(this,void 0,void 0,(function(){var n=this;return F(this,(function(o){return E("tagId",e,v.STRING,!0)&&E("conversations",t,v.ARRAY,!0)&&!t.some((function(e){return!E("conversation",e,v.CONVERSATION,!0)}))?[2,Ze((function(o,r){return x(n,void 0,void 0,(function(){var n;return F(this,(function(a){switch(a.label){case 0:return r.info(R.O,"removeTagForConversations ->tagId:".concat(e)),[4,o.removeTagForConversations(e,t)];case 1:return(n=a.sent().code)===i.SUCCESS?[2,{code:n}]:(r.warn(R.O,"removeTagForConversations ->code:".concat(n,",tagId:").concat(e)),[2,{code:n,msg:rt[n]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Jo(e,t){return x(this,void 0,void 0,(function(){var n=this;return F(this,(function(o){return E("conversation",e,v.CONVERSATION,!0)&&E("tagIds",t,v.ARRAY,!0)&&!t.some((function(e){return!E("tagId",e,v.STRING,!0)}))?[2,Ze((function(o,r){return x(n,void 0,void 0,(function(){var n;return F(this,(function(a){switch(a.label){case 0:return r.info(R.O,"removeTagsForConversation ->tagIds:".concat(t,",targetId:").concat(e.targetId,",conversationType:").concat(e.conversationType)),[4,o.removeTagsForConversation(e,t)];case 1:return(n=a.sent().code)===i.SUCCESS?[2,{code:n}]:(r.warn(R.O,"removeTagsForConversation ->code:".concat(n,",tagIds:").concat(t)),[2,{code:n,msg:rt[n]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function qo(e,t){return x(this,void 0,void 0,(function(){var n=this;return F(this,(function(o){return E("tagId",e,v.STRING,!0)&&E("conversations",t,v.ARRAY,!0)&&!t.some((function(e){return!E("conversation",e,v.CONVERSATION,!0)}))?[2,Ze((function(o,r){return x(n,void 0,void 0,(function(){var n;return F(this,(function(a){switch(a.label){case 0:return r.info(R.O,"removeTagForConversations ->tagId:".concat(e)),[4,o.removeTagForConversations(e,t)];case 1:return(n=a.sent().code)===i.SUCCESS?[2,{code:n}]:(r.warn(R.O,"removeTagForConversations ->code:".concat(n,",tagId:").concat(e)),[2,{code:n,msg:rt[n]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Ko(e,t,n){return x(this,void 0,void 0,(function(){var o=this;return F(this,(function(r){return E("tagId",e,v.STRING,!0)&&E("count",t,v.NUMBER,!0)&&E("startTime",n,v.NUMBER,!0)?[2,Ze((function(r,a){return x(o,void 0,void 0,(function(){var o,s,c;return F(this,(function(u){switch(u.label){case 0:return a.info(R.O,"getConversationListByTag ->tagId:".concat(e)),[4,r.getConversationListByTag(e,n,t)];case 1:return o=u.sent(),s=o.code,c=o.data,s===i.SUCCESS?[2,{code:s,data:null==c?void 0:c.map((function(e){return function(e){return k(k({},Le(e)),{isTopInTag:e.isTopInTag})}(e)}))}]:(a.warn(R.O,"getConversationListByTag ->code:".concat(s,",tagId:").concat(e)),[2,{code:s,msg:rt[s]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Yo(e,t){return x(this,void 0,void 0,(function(){var n=this;return F(this,(function(o){return E("tagId",e,v.STRING,!0)&&E("containMuted",t,v.BOOLEAN,!0)?[2,Ze((function(o,r){return x(n,void 0,void 0,(function(){var n,i,a;return F(this,(function(s){switch(s.label){case 0:return r.info(R.O,"getUnreadCountByTag ->tagId:".concat(e)),[4,o.getUnreadCountByTag(e,t)];case 1:return n=s.sent(),i=n.code,a=n.data,[2,{code:i,data:a}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function zo(e,t,n){return x(this,void 0,void 0,(function(){var o=this;return F(this,(function(r){return E("tagId",e,v.STRING,!0)&&E("conversation",t,v.CONVERSATION,!0)&&E("status.isTop",n,v.BOOLEAN,!0)?[2,Ze((function(r,a){return x(o,void 0,void 0,(function(){var o;return F(this,(function(s){switch(s.label){case 0:return a.info(R.O,"setConversationStatusInTag ->tagId:".concat(e,",targetId:").concat(t.targetId,",conversationType").concat(t.conversationType)),[4,r.setConversationStatusInTag(e,t,{isTop:n})];case 1:return(o=s.sent().code)===i.SUCCESS?[2,{code:o}]:(a.warn(R.O,"setConversationStatusInTag ->code:".concat(o,",tagId:").concat(e)),[2,{code:o,msg:rt[o]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}io(M.COMBINE_HTML,(function(e,t){var n={remoteUrl:e.downloadUrl,nameList:t.nameList,summaryList:t.summaryList,conversationType:t.conversationType};return t.user&&(n.user=t.user),t.extra&&(n.extra=t.extra),t.mentionedInfo&&(n.mentionedInfo=t.mentionedInfo),new An(n)}));var jo={COMET:"comet",WEBSOCKET:"websocket"},Wo={TEXT:"RC:TxtMsg",VOICE:"RC:VcMsg",HQ_VOICE:"RC:HQVCMsg",IMAGE:"RC:ImgMsg",GIF:"RC:GIFMsg",RICH_CONTENT:"RC:ImgTextMsg",LOCATION:"RC:LBSMsg",FILE:"RC:FileMsg",SIGHT:"RC:SightMsg",COMBINE:"RC:CombineMsg",CHRM_KV_NOTIFY:"RC:chrmKVNotiMsg",LOG_COMMAND:"RC:LogCmdMsg",EXPANSION_NOTIFY:"RC:MsgExMsg",REFERENCE:"RC:ReferenceMsg",RECALL_MESSAGE_TYPE:"RC:RcCmd"};var Qo=Object.freeze({__proto__:null,getAllConversationList:function(e){return x(this,void 0,void 0,(function(){var t=this;return F(this,(function(n){return w()?E("channelId",e,v.CHANNEL_ID)?[2,Ze((function(n,o){return x(t,void 0,void 0,(function(){var t,r,a,s;return F(this,(function(c){switch(c.label){case 0:return o.info(R.O,"getAllConversationList -> channelId: ".concat(e)),b(e)?[4,n.getConversationListWithAllChannel()]:[3,2];case 1:return t=c.sent(),[3,4];case 2:return[4,n.getConversationList(void 0,void 0,void 0,void 0,e)];case 3:t=c.sent(),c.label=4;case 4:return r=t.code,a=t.data,r===i.SUCCESS&&a?(s=a.map((function(e){return Le(e)})),[2,{code:r,data:s}]):(o.warn(R.O,"getAllConversationList fail -> code: ".concat(r," channelId: ").concat(e)),[2,{code:r,msg:rt[r]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:rt[i.NOT_SUPPORT]}]}))}))},getConversationList:function(e,t,n){return x(this,void 0,void 0,(function(){var o=this;return F(this,(function(r){return w()?E("startTime",e,v.NUMBER,!0)&&E("count",t,v.NUMBER,!0)&&E("channelId",n,v.CHANNEL_ID)?[2,Ze((function(r,a){return x(o,void 0,void 0,(function(){var o,s,c,u,d,l;return F(this,(function(f){switch(f.label){case 0:return o="startTime: ".concat(e,", count: ").concat(t,", channelId: ").concat(n),a.info(R.O,"getConversationList -> ".concat(o)),b(n)?[4,r.getConversationListWithAllChannelByPage(e,t)]:[3,2];case 1:return s=f.sent(),[3,4];case 2:return c=[1,2,3,5,6,7,8],[4,r.getConversationsByPage(c,e,t,n)];case 3:s=f.sent(),f.label=4;case 4:return u=s.code,d=s.data,u===i.SUCCESS&&d?(l=d.map((function(e){return Le(e)})),[2,{code:u,data:l}]):(a.warn(R.O,"getConversationList fail -> code: ".concat(u," ").concat(o)),[2,{code:u,msg:rt[u]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:rt[i.NOT_SUPPORT]}]}))}))},searchConversationByContent:function(e,t,n){return x(this,void 0,void 0,(function(){var o=this;return F(this,(function(r){return w()?E("keyword",e,v.STRING,!0)&&E("messageTypes",t,v.ARRAY,!0)&&E("channelId",n,v.CHANNEL_ID)&&!t.some((function(e){return!E("messageType",e,v.STRING,!0)}))?[2,Ze((function(r,a){return x(o,void 0,void 0,(function(){var o,s,c,u,d;return F(this,(function(l){switch(l.label){case 0:return o="keyword: ".concat(e,", messageTypes: ").concat(JSON.stringify(t),", channelId: ").concat(n),a.info(R.O,"searchConversationByContent -> ".concat(o)),b(n)?[4,r.searchConversationByContentWithAllChannel(e,t)]:[3,2];case 1:return s=l.sent(),[3,4];case 2:return[4,r.searchConversationByContent(e,t,n)];case 3:s=l.sent(),l.label=4;case 4:return c=s.code,u=s.data,c===i.SUCCESS&&u?(d=u.map((function(e){return Le(e)})),[2,{code:c,data:d}]):(a.warn(R.O,"searchConversationByContent fail -> code: ".concat(c," ").concat(o)),[2,{code:c,msg:rt[c]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:rt[i.NOT_SUPPORT]}]}))}))},searchMessages:function(e,t,n,o){return x(this,void 0,void 0,(function(){var r=this;return F(this,(function(a){return w()?E("conversation",e,v.CONVERSATION,!0)&&E("keyword",t,v.STRING,!0)&&E("startTime",n,v.NUMBER,!0)&&E("count",o,v.NUMBER,!0)?[2,Ze((function(a,s){return x(r,void 0,void 0,(function(){var r,c,u,d,l,f,v,g,I,h;return F(this,(function(m){switch(m.label){case 0:return r="conversation: ".concat(JSON.stringify(e),", keyword: ").concat(t,", timestamp: ").concat(n,", count: ").concat(o),s.info(R.O,"searchMessages -> ".concat(r)),c=e.targetId,u=e.conversationType,d=e.channelId,b(d)?[4,a.searchMessageByContentWithAllChannel(u,c,t,n,o)]:[3,2];case 1:return l=m.sent(),[3,4];case 2:return 0,[4,a.searchMessageByContent(u,c,t,n,o,0,d)];case 3:l=m.sent(),m.label=4;case 4:return f=l.code,v=l.data,f===i.SUCCESS&&v?(g=v.messages,I=v.count,h=g.map((function(e){return Pe(e)})),[2,{code:f,data:{messages:h,count:I}}]):(s.warn(R.O,"searchMessages fail -> code: ".concat(f," ").concat(r)),[2,{code:f,msg:rt[f]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:rt[i.NOT_SUPPORT]}]}))}))},searchMessageInTimeRange:function(e,t){return x(this,void 0,void 0,(function(){var n=this;return F(this,(function(o){return w()?E("conversation",e,v.CONVERSATION,!0)&&E("option",t,v.OBJECT,!0)&&E("option.keyword",t.keyword,v.STRING,!0)&&E("option.startTime",t.startTime,v.NUMBER,!0)&&E("option.endTime",t.endTime,v.NUMBER,!0)&&E("option.offset",t.offset,v.NUMBER)&&E("option.limit",t.limit,v.NUMBER)?[2,Ze((function(o,r){return x(n,void 0,void 0,(function(){var n,a,s,c,u,d,l,f,v,g,I;return F(this,(function(h){switch(h.label){case 0:return n="conversation: ".concat(JSON.stringify(e),", option: ").concat(JSON.stringify(t)),r.info(R.O,"searchMessageInTimeRange -> ".concat(n)),a=e.conversationType,s=e.targetId,c=t.keyword,u=t.startTime,d=t.endTime,l=t.offset,f=t.limit,l=l||0,f=f||5,[4,o.searchMessageByContentInTimeRangeWithAllChannel(a,s,c,u,d,l,f)];case 1:return v=h.sent(),g=v.code,I=v.data,g===i.SUCCESS&&I?[2,{code:g,data:{messages:I.messages.map((function(e){return Pe(e)}))}}]:(r.warn(R.O,"searchMessageInTimeRange fail -> code: ".concat(g,", ").concat(n)),[2,{code:g}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:rt[i.NOT_SUPPORT]}]}))}))},searchMessagesByUser:function(e,t,n,o){return x(this,void 0,void 0,(function(){var r=this;return F(this,(function(a){return w()?E("conversation",e,v.CONVERSATION,!0)&&E("userId",t,v.STRING,!0)&&E("startTime",n,v.NUMBER,!0)&&E("count",o,v.NUMBER,!0)?[2,Ze((function(a,s){return x(r,void 0,void 0,(function(){var r,c,u,d,l,f,v;return F(this,(function(g){switch(g.label){case 0:return r="conversation: ".concat(JSON.stringify(e),", keyword: ").concat(t,", timestamp: ").concat(n,", count: ").concat(o),s.info(R.A_SEARCH_MESSAGE_BY_USER_T,"searchMessagesByUser -> ".concat(r)),c=e.conversationType,u=e.targetId,d=e.channelId,[4,a.searchMessagesByUser(c,u,t,n,o,d)];case 1:return l=g.sent(),f=l.code,v=l.data,f===i.SUCCESS&&v?[2,{code:f,data:{messages:v.messages.map((function(e){return Pe(e)}))}}]:(s.warn(R.A_SEARCH_MESSAGE_BY_USER_R,"searchMessagesByUser fail -> code: ".concat(f,", ").concat(r)),[2,{code:f}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:rt[i.NOT_SUPPORT]}]}))}))},getHistoryMessagesByMessageTypes:function(e,t){return x(this,void 0,void 0,(function(){var n=this;return F(this,(function(o){return w()?E("conversation",e,v.CONVERSATION,!0)&&E("option",t,v.OBJECT,!0)&&E("option.count",t.count,v.NUMBER)&&E("options.count",t.count,(function(e){var t=e>0&&e<=100;return t||null===console||void 0===console||console.error("option.count is invalid, It should be greater than 0 and less than 100"),t}))&&E("option.timestamp",t.timestamp,v.NUMBER)&&E("option.order",t.order,(function(e){return[0,1].includes(e)}))&&E("option.messageTypes",t.messageTypes,v.ARRAY,!0)&&!t.messageTypes.some((function(e){return!E("option.messageType",e,v.STRING,!0)}))?[2,Ze((function(o,r){return x(n,void 0,void 0,(function(){var n,a,s,c,u,d,l,f,v,g,I,h,m,E,S,T,p,O,N;return F(this,(function(_){switch(_.label){case 0:return n=t.count,a=void 0===n?20:n,s=t.timestamp,c=void 0===s?0:s,u=t.order,d=void 0===u?0:u,l=t.messageTypes,f="conversation: ".concat(JSON.stringify(e),", option: ").concat(JSON.stringify(t)),r.info(R.O,"getHistoryMessagesByMessageTypes -> ".concat(f)),v=e.conversationType,g=e.targetId,I=e.channelId,h=void 0===I?"":I,[4,o.getHistoryMessagesByObjectNames(v,g,c,a,l,d,h)];case 1:return m=_.sent(),E=m.code,S=m.data,E===i.SUCCESS?(p=(T=S).list,O=T.hasMore,N=p.map((function(e){return Pe(e)})),[2,{code:E,data:{messages:N,hasMore:O,list:N}}]):(r.warn(R.O,"getHistoryMessagesByMessageTypes fail -> code: ".concat(E," ").concat(f)),[2,{code:E,msg:rt[E]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:rt[i.NOT_SUPPORT]}]}))}))},setMessageStatusToRead:function(e,t){return x(this,void 0,void 0,(function(){var n=this;return F(this,(function(o){return w()?E("conversation",e,v.CONVERSATION,!0)&&E("timestamp",t,v.NUMBER,!0)?[2,Ze((function(o,r){return x(n,void 0,void 0,(function(){var n,i,a,s;return F(this,(function(c){switch(c.label){case 0:return n="conversation: ".concat(JSON.stringify(e),", timestamp: ").concat(t),r.info(R.O,"updateSentMsgReceiptStatus -> ".concat(n)),i=e.conversationType,a=e.targetId,s=e.channelId,[4,o.setMessageStatusToRead(i,a,t,s)];case 1:return[2,c.sent()]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:rt[i.NOT_SUPPORT]}]}))}))},setMessageReceivedStatus:function(e,t){return x(this,void 0,void 0,(function(){var n=this;return F(this,(function(o){return w()?E("messageId",e,v.NUMBER,!0)&&E("receivedStatus",t,(function(e){return!b(a[e])}),!0)?[2,Ze((function(o,r){return x(n,void 0,void 0,(function(){return F(this,(function(n){switch(n.label){case 0:return r.info(R.O,"setMessageReceivedStatus -> messageId: ".concat(e,", receivedStatus: ").concat(t)),[4,o.setMessageReceivedStatus(e,t)];case 1:return[2,{code:n.sent()}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:rt[i.NOT_SUPPORT]}]}))}))},setMessageSentStatus:function(e,t){return x(this,void 0,void 0,(function(){var n=this;return F(this,(function(o){return w()?E("messageId",e,v.NUMBER,!0)&&E("sentStatus",t,(function(e){return!b(D[e])}),!0)?[2,Ze((function(o,r){return x(n,void 0,void 0,(function(){return F(this,(function(n){switch(n.label){case 0:return r.info(R.O,"setMessageSentStatus ->messageId: ".concat(e,", sentStatus: ").concat(t)),[4,o.setMessageSentStatus(e,t)];case 1:return[2,{code:n.sent()}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:rt[i.NOT_SUPPORT]}]}))}))},setMessageContent:function(e,t,n){return void 0===n&&(n=""),x(this,void 0,void 0,(function(){var o=this;return F(this,(function(r){return w()?E("messageId",e,v.NUMBER,!0)&&E("content",t,v.OBJECT,!0)&&E("messageType",n,v.ONLY_STRING,!0)?[2,Ze((function(r,i){return x(o,void 0,void 0,(function(){return F(this,(function(o){switch(o.label){case 0:return i.info(R.O,"setMessageSentStatus ->messageId: ".concat(e,", messageType: ").concat(n)),[4,r.setMessageContent(e,t,n)];case 1:return[2,{code:o.sent()}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:rt[i.NOT_SUPPORT]}]}))}))},deleteMessages:function(e){return x(this,void 0,void 0,(function(){var t=this;return F(this,(function(n){return w()?!E("messageIds",e,v.ARRAY,!0)||e.some((function(e){return!E("messageId",e,v.NUMBER,!0)}))?[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,Ze((function(n,o){return x(t,void 0,void 0,(function(){return F(this,(function(t){switch(t.label){case 0:return o.info(R.O,"deleteMessages ->messageIds: ".concat(JSON.stringify(e))),[4,n.deleteMessages(e)];case 1:return[2,{code:t.sent()}]}}))}))}))]:[2,{code:i.NOT_SUPPORT,msg:rt[i.NOT_SUPPORT]}]}))}))},clearMessages:function(e){return x(this,void 0,void 0,(function(){var t=this;return F(this,(function(n){return w()?[2,Ze((function(n,o){return x(t,void 0,void 0,(function(){var t,r,i;return F(this,(function(a){switch(a.label){case 0:return t=e.conversationType,r=e.targetId,i=e.channelId,o.info(R.O,"clearMessages ->targetId:".concat(r,",conversationType:").concat(t)),[4,n.clearMessages(t,r,i)];case 1:return[2,{code:a.sent()}]}}))}))}))]:[2,{code:i.NOT_SUPPORT,msg:rt[i.NOT_SUPPORT]}]}))}))},deleteMessagesByTimestamp:function(e,t,n){return x(this,void 0,void 0,(function(){var o,r,a,s=this;return F(this,(function(c){return w()?(o=e.conversationType,r=e.targetId,a=e.channelId,E("conversationType",o,v.NUMBER,!0)&&E("targetId",r,v.STRING,!0)&&E("timestamp",t,v.NUMBER,!0)&&E("cleanSpace",n,v.BOOLEAN)?[2,Ze((function(e,i){return x(s,void 0,void 0,(function(){return F(this,(function(i){switch(i.label){case 0:return[4,e.deleteMessagesByTimestamp(o,r,t,n,a)];case 1:return[2,{code:i.sent()}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]):[2,{code:i.NOT_SUPPORT,msg:rt[i.NOT_SUPPORT]}]}))}))},insertMessage:function(e,t,n){return void 0===n&&(n={}),x(this,void 0,void 0,(function(){var o=this;return F(this,(function(r){return w()?E("conversation",e,v.CONVERSATION,!0)&&E("message",t,v.OBJECT,!0)&&E("options",n,v.OBJECT)&&E("options.isUnread",null==n?void 0:n.isUnread,v.BOOLEAN)&&E("options.searchContent",null==n?void 0:n.searchContent,v.STRING)&&(t instanceof Sn||E("message.senderUserId",t.senderUserId,v.STRING,!0)&&E("message.messageType",t.messageType,v.STRING,!0)&&E("message.content",t.content,v.OBJECT,!0)&&E("message.messageDirection",t.messageDirection,v.NUMBER,!0)&&E("message.canIncludeExpansion",t.canIncludeExpansion,v.BOOLEAN)&&E("message.expansion",t.expansion,v.OBJECT)&&E("message.disableNotification",t.disableNotification,v.BOOLEAN)&&E("message.sentTime",t.sentTime,v.NUMBER)&&E("message.sentStatus",t.sentStatus,v.NUMBER))?[2,Ze((function(r,a){return x(o,void 0,void 0,(function(){var o,s,c,u,d,l,f,v,g,I,h,m,E,S,T;return F(this,(function(p){switch(p.label){case 0:return o="",s=1,l=!1,v=t.messageType,g=t.content,t instanceof Sn||(o=t.senderUserId,s=t.messageDirection,l=t.canIncludeExpansion,f=t.expansion,d=t.disableNotification,c=t.sentTime,u=t.sentStatus),a.info(R.O,"insertMessage ->targetId:".concat(e.targetId,",conversationType:").concat(e.conversationType)),I=n.isUnread,h=n.searchContent,m={senderUserId:o,messageType:v,content:g,messageDirection:s,sentTime:c,sentStatus:u,searchContent:h,isUnread:I,messageUId:"",disableNotification:d,canIncludeExpansion:l,expansionMsg:JSON.stringify(f),channelId:e.channelId||""},[4,r.insertMessage(e.conversationType,e.targetId,m)];case 1:return E=p.sent(),S=E.code,T=E.data,S===i.SUCCESS?[2,{code:S,data:Pe(T)}]:(a.warn(R.O,"insertMessage ->code:".concat(S,",targetId:").concat(e.targetId)),[2,{code:S,msg:rt[S]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:rt[i.NOT_SUPPORT]}]}))}))},batchInsertMessage:function(e,t){var n,o;return x(this,void 0,void 0,(function(){var r,a=this;return F(this,(function(c){if(!w())return[2,{code:i.NOT_SUPPORT,msg:rt[i.NOT_SUPPORT]}];if(!E("messages",e,(function(e){return g(e)&&!(e.length<=0||e.length>=500)}),!0)||!E("checkDuplicate",t,v.BOOLEAN))return[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}];for(r in e)if(!(E("message",e[r],v.OBJECT,!0)&&E("message.conversationType",e[r].conversationType,(function(e){return[s.PRIVATE,s.DISCUSSION,s.GROUP,s.CUSTOMER_SERVICE,s.SYSTEM,s.APP_PUBLIC_SERVICE,s.PUBLIC_SERVICE].includes(e)}),!0)&&E("message.targetId",e[r].targetId,v.STRING,!0)&&E("message.senderUserId",e[r].senderUserId,v.STRING,!0)&&E("message.messageType",e[r].messageType,v.STRING,!0)&&E("message.content",e[r].content,v.OBJECT,!0)&&E("message.messageDirection",e[r].messageDirection,v.NUMBER,!0)&&E("message.canIncludeExpansion",e[r].canIncludeExpansion,v.BOOLEAN)&&E("message.expansion",e[r].expansion,v.OBJECT)&&E("message.disableNotification",e[r].disableNotification,v.BOOLEAN)&&E("message.sentTime",e[r].sentTime,v.NUMBER)&&E("message.sentStatus",e[r].sentStatus,v.NUMBER)&&E("options.isUnread",null===(n=e[r])||void 0===n?void 0:n.isUnread,v.BOOLEAN)&&E("options.searchContent",null===(o=e[r])||void 0===o?void 0:o.searchContent,v.STRING)))return[2,{code:i.BIZ_ERROR_INVALID_PARAMETER,msg:String(r)}];return[2,Ze((function(n){return x(a,void 0,void 0,(function(){var o,r,a;return F(this,(function(s){switch(s.label){case 0:return[4,n.batchInsertMessage(e,t)];case 1:return o=s.sent(),r=o.code,a=o.data,r===i.SUCCESS?[2,{code:r,data:a}]:[2,{code:r,msg:rt[r]}]}}))}))}))]}))}))},getMessageCount:function(e){return x(this,void 0,void 0,(function(){var t=this;return F(this,(function(n){return w()?[2,Ze((function(n){return x(t,void 0,void 0,(function(){var t,o,r,i,a,s;return F(this,(function(c){switch(c.label){case 0:return t=e.conversationType,o=e.targetId,r=e.channelId,[4,n.getMessageCount(t,o,r)];case 1:return i=c.sent(),a=i.code,s=i.data,[2,{code:a,data:s}]}}))}))}))]:[2,{code:i.NOT_SUPPORT,msg:rt[i.NOT_SUPPORT]}]}))}))},getPrivateMessageDeliverTime:function(e){return x(this,void 0,void 0,(function(){var t=this;return F(this,(function(n){return w()?E("messageUId",e,v.STRING,!0)?[2,Ze((function(n,o){return x(t,void 0,void 0,(function(){var t,r,a;return F(this,(function(s){switch(s.label){case 0:return[4,n.getPrivateMessageDeliverTime(e)];case 1:return t=s.sent(),r=t.code,a=t.data,r===i.SUCCESS?[2,{code:r,data:a}]:(o.warn(R.A_GET_PRIVATE_MESSAGE_DELIVER_TIME_E,"code:".concat(r,",messageUId:").concat(e)),[2,{code:r,msg:rt[r]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:rt[i.NOT_SUPPORT]}]}))}))},getGroupMessageDeliverList:function(e,t){return x(this,void 0,void 0,(function(){var n=this;return F(this,(function(o){return w()?E("targetId",e,v.STRING,!0)&&E("messageUId",t,v.STRING,!0)?[2,Ze((function(o,r){return x(n,void 0,void 0,(function(){var n,a,s;return F(this,(function(c){switch(c.label){case 0:return[4,o.getGroupMessageDeliverList(e,t)];case 1:return n=c.sent(),a=n.code,s=n.data,a===i.SUCCESS?[2,{code:a,data:s}]:(r.warn(R.A_GET_GROUP_MESSAGE_DELIVER_LIST_E,"code:".concat(a,", targetId:").concat(e," messageUId:").concat(t)),[2,{code:a,msg:rt[a]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:rt[i.NOT_SUPPORT]}]}))}))},setCheckDuplicateMessage:function(e){return x(this,void 0,void 0,(function(){var t=this;return F(this,(function(n){return w()?E("enableCheck",e,v.BOOLEAN)?[2,Ze((function(n){return x(t,void 0,void 0,(function(){return F(this,(function(t){switch(t.label){case 0:return[4,n.setCheckDuplicateMessage(e)];case 1:return[2,{code:t.sent().code}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:rt[i.NOT_SUPPORT]}]}))}))},clearLocalData:function(){return x(this,void 0,void 0,(function(){var e=this;return F(this,(function(t){return w()?[2,Ze((function(t,n){return x(e,void 0,void 0,(function(){var e,o,r;return F(this,(function(i){switch(i.label){case 0:return n.info(R.O,"clearLocalData ->"),[4,t.clearData()];case 1:return e=i.sent(),o=e.code,r=e.data,[2,{code:o,data:r}]}}))}))}))]:[2,{code:i.NOT_SUPPORT,msg:rt[i.NOT_SUPPORT]}]}))}))},enable:function(){return w()}});function Xo(e){return x(this,void 0,void 0,(function(){var t=this;return F(this,(function(n){return!e||E("proxy.socksHost",e.socksHost,v.STRING,!0)&&E("proxy.socksPort",e.socksPort,v.NUMBER,!0)?[2,Ze((function(n,o){return x(t,void 0,void 0,(function(){var t;return F(this,(function(r){switch(r.label){case 0:return o.info(R.O,"setProxy: ->".concat(e)),[4,n.setProxy(e)];case 1:return(t=r.sent().code)===i.SUCCESS?[2,{code:t}]:(o.warn(R.O,"setProxy ->code:".concat(t)),[2,{code:t,msg:rt[t]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function $o(){return x(this,void 0,void 0,(function(){var e=this;return F(this,(function(t){return[2,Ze((function(t,n){return x(e,void 0,void 0,(function(){var e,o,r;return F(this,(function(a){switch(a.label){case 0:return[4,t.getProxy()];case 1:return e=a.sent(),o=e.code,r=e.data,o===i.SUCCESS?[2,{code:o,data:r}]:(n.warn(R.O,"getProxy ->code:".concat(o)),[2,{code:o,msg:rt[o]}])}}))}))}))]}))}))}function er(e,t){return x(this,void 0,void 0,(function(){var n=this;return F(this,(function(o){return!e||E("proxy.socksHost",e.socksHost,v.STRING,!0)&&E("proxy.socksPort",e.socksPort,v.NUMBER,!0)?[2,Ze((function(o,r){return x(n,void 0,void 0,(function(){var n,a,s;return F(this,(function(c){switch(c.label){case 0:return r.info(R.O,"testProxy: ->".concat(e)),[4,o.testProxy(e,t)];case 1:return n=c.sent(),a=n.status,s=n.data,a===i.SUCCESS?[2,{code:a,msg:s}]:(r.warn(R.O,"testProxy ->code:".concat(a)),[2,{code:a,msg:rt[a]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}export{Sn as BaseMessage,An as CombineMessage,Bn as CommandMessage,jo as ConnectType,Ae as Events,Un as FileMessage,yn as GIFMessage,bn as GroupNotificationMessage,Nn as HQVoiceMessage,On as ImageMessage,Dn as InformationNotificationMessage,Pn as LocationMessage,Wo as MessageType,Ln as ReferenceMessage,wn as RichContentMessage,_n as SightMessage,Cn as TextMessage,Mn as VoiceMessage,$e as __addSDKVersion,Zo as addConversationsToTag,He as addEventListener,Go as addTag,hn as addToBlacklist,In as bindRTCRoomForChatroom,St as clearAllMessagesUnreadStatus,Ye as clearEventListeners,To as clearHistoryMessages,wo as clearMessages,Et as clearMessagesUnreadStatus,gt as clearTextMessageDraft,Do as clearUnreadCountByTimestamp,st as connect,Lo as deleteLocalMessagesByTimestamp,So as deleteMessages,je as destroy,ct as disconnect,Qo as electronExtension,ln as forceRemoveChatRoomEntry,cn as forceSetChatRoomEntry,vn as getAllChatRoomEntries,wt as getAllConversationState,Kt as getAllUltraGroupUnreadCount,Yt as getAllUltraGroupUnreadMentionedCount,Lt as getAllUnreadMentionedCount,mn as getBlacklist,En as getBlacklistStatus,Dt as getBlockUltraGroupList,At as getBlockedConversationList,fn as getChatRoomEntry,rn as getChatRoomInfo,gn as getChatroomHistoryMessages,We as getConnectionStatus,dt as getConversation,ut as getConversationList,_t as getConversationNotificationLevel,Ct as getConversationNotificationStatus,Ko as getConversationsFromTagByPage,Xe as getCurrentUserId,et as getDeviceId,to as getDownloadAuth,eo as getFileToken,no as getFileUrl,Ao as getFirstUnreadMessage,fo as getHistoryMessages,yo as getMessage,_o as getMessageReader,$o as getProxy,vo as getRemoteHistoryMessages,Qe as getServerTime,xo as getTags,Fo as getTagsFromConversation,ft as getTextMessageDraft,yt as getTopConversationList,It as getTotalUnreadCount,ht as getTotalUnreadCountByLevels,Rt as getTotalUnreadMentionedCountByLevels,Ht as getUltraGroupDefaultNotificationLevel,jt as getUltraGroupFirstUnreadMessageTimestamp,Bt as getUltraGroupList,Gt as getUltraGroupMessageListByMessageUId,qt as getUltraGroupUnreadCountByTargetId,Wt as getUltraGroupUnreadInfoList,Zt as getUltraGroupUnreadMentionedCountByTargetId,zt as getUltraGroupUnreadMentionedMessages,Mt as getUnreadConversationList,mt as getUnreadCount,Yo as getUnreadCountByTag,Pt as getUnreadMentionedCount,Mo as getUnreadMentionedMessages,ze as init,Uo as insertMessage,nt as installPlugin,tn as joinChatRoom,nn as joinExistChatRoom,Ft as modifyMessage,Je as onceEventListener,on as quitChatRoom,Eo as recallMessage,Co as registerMessageType,xt as removeAllExpansionForUltraGroupMessage,dn as removeChatRoomEntries,un as removeChatRoomEntry,lt as removeConversation,Ho as removeConversationsFromTag,qe as removeEventListener,Ke as removeEventListeners,kt as removeExpansionForUltraGroupMessage,Rn as removeFromBlacklist,Oo as removeMessageExpansionForKey,Vo as removeTag,qo as removeTagFromConversations,Jo as removeTagsFromConversation,vt as saveTextMessageDraft,Bo as searchConversationByContent,Po as searchMessages,ao as sendFileMessage,co as sendGIFMessage,uo as sendHQVoiceMessage,so as sendImageMessage,oo as sendMessage,go as sendReadReceiptMessage,Io as sendReadReceiptRequest,ho as sendReadReceiptResponse,Ro as sendReadReceiptResponseV2,lo as sendSightMessage,mo as sendSyncReadStatusMessage,ro as sendTextMessage,No as sendTypingStatusMessage,bt as sendUltraGroupTypingStatus,sn as setChatRoomEntries,an as setChatRoomEntry,Ot as setConversationNotificationLevel,Nt as setConversationNotificationStatus,Ut as setConversationToTop,zo as setConversationToTopInTag,bo as setMessageReceivedStatus,Xo as setProxy,Jt as setUltraGroupDefaultNotificationLevel,er as testProxy,Vt as updateExpansionForUltraGroupMessage,po as updateMessageExpansion,ko as updateTag,$n as upload};
1
+ import{httpRequest as e,NetworkType as t,HttpMethod as n,HTTP_TIMEOUT as o,appendUrl as r,ErrorCode as i,ReceivedStatus as a,ConversationType as s,isNumber as c,EventEmitter as u,RCConnectionStatus as d,VersionManage as l,assert as f,AssertRules as v,isArray as g,isHttpUrl as I,APIContext as h,LogTagId as R,logger as m,validate as E,isValidConversationType as S,isValidNotificationLevel as T,NotificationLevel as p,isTypeInConversationList as O,UltraGroupChannelType as N,isString as _,MAX_UPLOAD_FILE_SIZE as C,UPLOAD_FILE_CHUNK_SIZE as A,UploadMethod as U,fixUrlProtocol as y,FileType as M,getUUID as P,isValidFileType as L,usingCppEngine as w,MessageDirection as B,SentStatus as D,isUndefined as b}from"@rongcloud/engine";export{AreaCode,ChatroomEntryType,ChatroomSyncStatusReason,ChatroomUserChangeType,ChrmMemBanType,ChrmMemOperateType,ChrmSyncStatus,ConnectionStatus,ConversationType,ErrorCode,FileType,LogL,LogLevel,MentionedType,MessageBlockSourceType,MessageBlockType,MessageDirection,NotificationLevel,NotificationStatus,OperateStatus,RCConnectionStatus,ReceivedStatus,SentStatus,UltraGroupChannelChangeType,UltraGroupChannelType,UploadMethod}from"@rongcloud/engine";var G=function(e,t){return G=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},G(e,t)};function V(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}G(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var k=function(){return k=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},k.apply(this,arguments)};function x(e,t,n,o){return new(n||(n=Promise))((function(r,i){function a(e){try{c(o.next(e))}catch(e){i(e)}}function s(e){try{c(o.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((o=o.apply(e,t||[])).next())}))}function F(e,t){var n,o,r,i,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,o&&(r=2&s[0]?o.return:s[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,s[1])).done)return r;switch(o=0,r&&(s=[2&s[0],r.value]),s[0]){case 0:case 1:r=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,o=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(r=a.trys,(r=r.length>0&&r[r.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]<r[3])){a.label=s[1];break}if(6===s[0]&&a.label<r[1]){a.label=r[1],r=s;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(s);break}r[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],o=0}finally{n=r=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}}var Z=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))},H=Z();var J=null,q=function(e){return x(void 0,void 0,void 0,(function(){var t;return F(this,(function(n){switch(n.label){case 0:return[4,K.getNetworkType()];case 1:return t=n.sent(),J({status:"online"===e.type,type:t}),[2]}}))}))};var K={tag:"browser",httpReq:e,localStorage:null===window||void 0===window?void 0:window.localStorage,sessionStorage:null===window||void 0===window?void 0:window.sessionStorage,useNavi:!0,connectPlatform:"",isFromUniapp:H,createWebSocket:function(e,t){var n=new WebSocket(e,t);return n.binaryType="arraybuffer",{id:Date.now(),onClose:function(e){n.onclose=function(t){var n=t.code,o=t.reason;e(n,o)}},onError:function(e){n.onerror=e},onMessage:function(e){n.onmessage=function(t){e(t.data)}},onOpen:function(e){n.onopen=e},send:function(e){n.send(e)},close:function(e,t){n.close()}}},getNetworkType:function(){var e=navigator.connection||navigator.mozConnection||navigator.webkitConnection||{effectiveType:t.UNKONWN},n=e.type,o=e.effectiveType,r=n||o||t.UNKONWN;return Promise.resolve(r)},setNetworkStatusListener:function(e){J=e,"undefined"!=typeof window&&window&&(window.addEventListener("offline",q),window.addEventListener("online",q))},removeNetworkStatusListener:function(){"undefined"!=typeof window&&window&&(window.removeEventListener("offline",q),window.removeEventListener("online",q)),J=null}},Y=Z(),z=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)}}},j={setItem:z("setStorageSync"),getItem:z("getStorageSync"),removeItem:z("removeStorageSync"),clear:z("clearStorageSync")},W=null,Q=function(e){var t=e.isConnected,n=e.networkType;W({status:t,type:n})};var X={tag:"wechat",httpReq:function(e){var t=e.method||n.GET,a=e.timeout||o,s=e.headers,c=e.query,u=e.body,d=r(e.url,c);return new Promise((function(e){wx.request({url:d,method:t,header:s,timeout:a,data:u,success:function(t){e({data:t.data,status:t.statusCode})},fail:function(){e({status:i.RC_HTTP_REQ_FAIL})}})}))},localStorage:j,sessionStorage:j,useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:Y,createWebSocket:function(e,t){var n=wx.connectSocket({url:e,protocols:t});return{id:Date.now(),onClose:function(e){n.onClose((function(t){e(t.code,t.reason)}))},onError:function(e){n.onError((function(t){e(t.errMsg)}))},onMessage:function(e){n.onMessage((function(t){e(t.data)}))},onOpen:function(e){n.onOpen(e)},send:function(e){n.send({data:e})},close:function(e,t){n.close({code:e,reason:t})}}},getNetworkType:function(){return new Promise((function(e){wx.getNetworkType({success:function(t){var n=t.networkType;e(n)},fail:function(){e(t.UNKONWN)}})}))},setNetworkStatusListener:function(e){W=e,wx.onNetworkStatusChange(Q)},removeNetworkStatusListener:function(){wx.offNetworkStatusChange(Q),W=null}},$=Z(),ee=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){}}},te={setItem:ee("setStorageSync"),getItem:ee("getStorageSync"),removeItem:ee("removeStorageSync"),clear:ee("clearStorageSync")},ne=null,oe=function(e){var t=e.isConnected,n=e.networkType;ne({status:t,type:n})};var re={tag:"alipay",httpReq:function(e){var t=e.method||n.GET,a=e.timeout||o,s=e.headers,c=e.query,u=e.body,d=r(e.url,c),l=e.dataType||"json";return new Promise((function(e){my.request({url:d,method:t,headers:s,timeout:a,data:u,dataType:l,success:function(t){e({data:t.data,status:t.status})},fail:function(){e({status:i.RC_HTTP_REQ_FAIL})}})}))},localStorage:te,sessionStorage:te,useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:$,createWebSocket:function(e){var t=my.connectSocket({url:e,multiple:!0});return{id:Date.now(),onClose:function(e){t.onClose(e)},onError:function(e){t.onError((function(t){e(t.errMsg)}))},onMessage:function(e){t.onMessage((function(t){t.data.isBuffer?e(my.base64ToArrayBuffer(t.data.data)):e(t.data.data)}))},onOpen:function(e){t.onOpen(e)},send:function(e){t.send({data:my.arrayBufferToBase64(e),isBuffer:!0})},close:function(){t.close()}}},getNetworkType:function(){return new Promise((function(e){my.getNetworkType({success:function(t){var n=t.networkType;e(n)},fail:function(){e(t.UNKONWN)}})}))},setNetworkStatusListener:function(e){ne=e,my.onNetworkStatusChange(oe)},removeNetworkStatusListener:function(){my.offNetworkStatusChange(oe),ne=null}},ie=Z(),ae=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){}}},se={setItem:ae("setStorageSync"),getItem:ae("getStorageSync"),removeItem:ae("removeStorageSync"),clear:ae("clearStorageSync")},ce=null,ue=function(e){var t=e.isConnected,n=e.networkType;ce({status:t,type:n})};var de={tag:"toutiao",useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:ie,localStorage:se,sessionStorage:se,httpReq:function(e){return new Promise((function(t){tt.request({url:e.url,data:e.body,header:e.headers,method:e.method,success:function(e){var n=(null==e?void 0:e.data)||{},o={data:JSON.stringify(n),status:e.statusCode};t(o)},fail:function(e){t({status:i.RC_HTTP_REQ_FAIL})}})}))},createWebSocket:function(e,t){var n=tt.connectSocket({url:e,protocols:t});return{id:Date.now(),onOpen:function(e){n.onOpen(e)},onClose:function(e){n.onClose((function(t){return e(t.code,t.reason)}))},onError:function(e){n.onError((function(t){return e(t.errMsg)}))},onMessage:function(e){n.onMessage((function(t){return e(t.data)}))},send:function(e){n.send({data:e})},close:function(e,t){n.close({code:e,reason:t})}}},getNetworkType:function(){return new Promise((function(e){tt.getNetworkType({success:function(t){var n=t.networkType;e(n)},fail:function(){e(t.UNKONWN)}})}))},setNetworkStatusListener:function(e){ce=e,tt.onNetworkStatusChange(ue)},removeNetworkStatusListener:function(){tt.offNetworkStatusChange(ue),ce=null}},le=Z(),fe=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){}}},ve={setItem:fe("setStorageSync"),getItem:fe("getStorageSync"),removeItem:fe("removeStorageSync"),clear:fe("clearStorageSync")},ge=null,Ie=function(e){var t=e.isConnected,n=e.networkType;ge({status:t,type:n})};var he={tag:"baidu",useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:le,localStorage:ve,sessionStorage:ve,httpReq:function(e){return new Promise((function(t,n){swan.request({url:e.url,data:e.body,header:e.headers,method:e.method,success:function(e){var n=(null==e?void 0:e.data)||{},o={data:JSON.stringify(n),status:e.statusCode};t(o)},fail:function(e){t({status:i.RC_HTTP_REQ_FAIL})}})}))},createWebSocket:function(e,t){var n=swan.connectSocket({url:e,protocols:t});return{id:Date.now(),onOpen:function(e){n.onOpen(e)},onClose:function(e){n.onClose((function(t){return e(t.code,t.reason)}))},onError:function(e){n.onError((function(t){return e(t.errMsg)}))},onMessage:function(e){n.onMessage((function(t){return e(t.data)}))},send:function(e){n.send({data:e})},close:function(e,t){n.close({code:e,reason:t})}}},getNetworkType:function(){return x(this,void 0,void 0,(function(){return F(this,(function(e){return[2,new Promise((function(e){swan.getNetworkType({success:function(t){var n=t.networkType;e(n)},fail:function(){e(t.UNKONWN)}})}))]}))}))},setNetworkStatusListener:function(e){ge=e,swan.onNetworkStatusChange(Ie)},removeNetworkStatusListener:function(){swan.offNetworkStatusChange(Ie),ge=null}},Re=Z(),me=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return jd[e].apply(jd,t)}catch(e){null===console||void 0===console||console.error(e)}}},Ee={setItem:me("setStorageSync"),getItem:me("getStorageSync"),removeItem:me("removeStorageSync"),clear:me("clearStorageSync")},Se=null,Te=function(e){var t=e.isConnected,n=e.networkType;Se({status:t,type:n})};var pe={tag:"jingdong",httpReq:function(e){var t=e.method||n.GET,a=e.timeout||o,s=e.headers,c=e.query,u=e.body,d=r(e.url,c);return new Promise((function(e){jd.request({url:d,method:t,headers:s,timeout:a,data:u,success:function(t){e({data:t.data,status:t.statusCode})},fail:function(){e({status:i.RC_HTTP_REQ_FAIL})}})}))},localStorage:Ee,sessionStorage:Ee,useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:Re,createWebSocket:function(e,t){return jd.connectSocket({url:e,protocols:t}),{id:Date.now(),onClose:function(e){jd.onSocketClose((function(t){e(t.code,t.reason)}))},onError:function(e){jd.onSocketError((function(t){e(t.errMsg)}))},onMessage:function(e){jd.onSocketMessage((function(t){e(t.data)}))},onOpen:function(e){jd.onSocketOpen(e)},send:function(e){jd.sendSocketMessage({data:e})},close:function(e,t){jd.closeSocket({code:e,reason:t})}}},getNetworkType:function(){return new Promise((function(e){jd.getNetworkType({success:function(t){var n=t.networkType;e(n)},fail:function(){e(t.UNKONWN)}})}))},setNetworkStatusListener:function(e){Se=e,jd.onNetworkStatusChange(Te)},removeNetworkStatusListener:function(){jd.offNetworkStatusChange(Te),Se=null}},Oe=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)}}},Ne={setItem:Oe("setStorageSync"),getItem:Oe("getStorageSync"),removeItem:Oe("removeStorageSync"),clear:Oe("clearStorageSync")},_e=null,Ce=function(e){var t=e.isConnected,n=e.networkType;_e({status:t,type:n})};var Ae,Ue={tag:"uniapp",httpReq:function(e){var t=e.method||n.GET,a=e.timeout||o,s=e.headers,c=e.query,u=e.body,d=r(e.url,c);return new Promise((function(e){uni.request({url:d,method:t,header:s,timeout:a,data:u,success:function(t){e({data:t.data,status:t.statusCode})},fail:function(){e({status:i.RC_HTTP_REQ_FAIL})}})}))},localStorage:Ne,sessionStorage:Ne,useNavi:!0,connectPlatform:"",isFromUniapp:!0,createWebSocket:function(e,t){var n={complete:function(){},url:e,protocols:t},o=uni.connectSocket(n);return{id:Date.now(),onClose:function(e){o.onClose((function(t){e(t.code,t.reason)}))},onError:function(e){o.onError((function(t){e(t.errMsg)}))},onMessage:function(e){o.onMessage((function(t){e(t.data)}))},onOpen:function(e){o.onOpen(e)},send:function(e){o.send({data:e})},close:function(e,t){o.close({code:e,reason:t})}}},getNetworkType:function(){return new Promise((function(e){uni.getNetworkType({success:function(t){var n=t.networkType;e(n)},fail:function(){e(t.UNKONWN)}})}))},setNetworkStatusListener:function(e){_e=e,uni.onNetworkStatusChange(Ce)},removeNetworkStatusListener:function(){uni.offNetworkStatusChange(Ce),_e=null}},ye=function(e){return e&&e.request&&e.getSystemInfo},Me="undefined"!=typeof uni&&ye(uni)?function(){switch(process.env.VUE_APP_PLATFORM){case"app-plus":return Ue;case"mp-jd":return pe;case"mp-baidu":return he;case"mp-toutiao":return de;case"mp-alipay":return re;case"mp-weixin":return X;default:return K}}():"undefined"!=typeof jd&&ye(jd)?pe:"undefined"!=typeof my&&ye(my)?re:"undefined"!=typeof tt&&ye(tt)?de:"undefined"!=typeof swan&&ye(swan)?he:"undefined"!=typeof wx&&ye(wx)?X:K;function Pe(e){var t=e.conversationType,n=e.channelId,o=e.messageType,r=e.content,i=e.senderUserId,u=e.targetId,d=e.sentTime,l=e.receivedTime,f=e.messageUId,v=e.messageDirection,g=e.isPersited,I=e.isCounted,h=e.isOffLineMessage,R=e.canIncludeExpansion,m=e.expansion,E=e.receivedStatus,S=e.disableNotification,T=e.isMentioned,p=e.isStatusMessage,O=e.readReceiptInfo,N=e.pushConfig,_=e.messageId,C=e.isInterrupt,A=e.isModifyMessage,U=e.channelType,y=e.sentStatus;E||(E=a.UNREAD);var M={messageType:o,channelId:n||"",content:r,senderUserId:i,targetId:u,conversationType:t,sentTime:d,receivedTime:l,messageUId:f,messageDirection:v,isPersited:g,isCounted:I,isMentioned:T,disableNotification:S,isStatusMessage:p,canIncludeExpansion:R,expansion:m,receivedStatus:E,readReceiptInfo:O,pushConfig:N,messageId:_,isInterrupt:C,isModifyMessage:A,sentStatus:y};return t!==s.ULTRA_GROUP&&(M.isOffLineMessage=h),t===s.ULTRA_GROUP&&c(U)&&(M.channelType=U),M}function Le(e){var t=e.conversationType,n=e.targetId,o=e.latestMessage,r=e.unreadMessageCount,i=e.hasMentioned,a=e.mentionedInfo,c=e.lastUnreadTime,u=e.notificationStatus,d=e.notificationLevel,l=e.isTop,f=e.channelId,v=e.unreadMentionedCount,g=e.matchCount,I=e.unreadMentionedMeCount,h=e.operationTime,R={conversationType:t,targetId:n,latestMessage:o&&Pe(o),unreadMessageCount:r,hasMentioned:i,mentionedInfo:i?{type:null==a?void 0:a.type,userIdList:null==a?void 0:a.userIdList}:void 0,lastUnreadTime:c,notificationStatus:u,notificationLevel:d,isTop:l,channelId:f,unreadMentionedCount:v,matchCount:g,unreadMentionedMeCount:I,operationTime:h};return R.conversationType===s.ULTRA_GROUP&&(R.firstUnreadMessage=e.firstUnreadMessage,R.channelType=e.channelType),R}function we(e,t){null===console||void 0===console||console.warn("Method '".concat(e,"' is deprecated, please use '").concat(t,"' instead"))}!function(e){e.CONNECTING="CONNECTING",e.CONNECTED="CONNECTED",e.DISCONNECT="DISCONNECT",e.SUSPEND="SUSPEND",e.MESSAGES="MESSAGES",e.READ_RECEIPT_RECEIVED="READ_RECEIPT_RECEIVED",e.MESSAGE_RECEIPT_REQUEST="MESSAGE_RECEIPT_REQUEST",e.MESSAGE_RECEIPT_RESPONSE="MESSAGE_RECEIPT_RESPONSE",e.CONVERSATION="CONVERSATION",e.CHATROOM="CHATROOM",e.EXPANSION="EXPANSION",e.PULL_OFFLINE_MESSAGE_FINISHED="PULL_OFFLINE_MESSAGE_FINISHED",e.TAG="TAG",e.CONVERSATION_TAG="CONVERSATION_TAG",e.TYPING_STATUS="TYPING_STATUS",e.MESSAGE_BLOCKED="MESSAGE_BLOCKED",e.ULTRA_GROUP_ENABLE="ULTRA_GROUP_ENABLE",e.OPERATE_STATUS="OPERATE_STATUS",e.ULTRA_GROUP_MESSAGE_EXPANSION_UPDATED="ULTRA_GROUP_MESSAGE_EXPANSION_UPDATED",e.ULTRA_GROUP_MESSAGE_MODIFIED="ULTRA_GROUP_MESSAGE_MODIFIED",e.ULTRA_GROUP_MESSAGE_RECALLED="ULTRA_GROUP_MESSAGE_RECALLED",e.ULTRA_GROUP_CHANNEL_TYPE_CHANGE="ULTRA_GROUP_CHANNEL_TYPE_CHANGE",e.ULTRA_GROUP_CHANNEL_DELETE="ULTRA_GROUP_CHANNEL_DELETE",e.ULTRA_GROUP_CHANNEL_USER_KICKED="ULTRA_GROUP_CHANNEL_USER_KICKED",e.PRIVATE_MESSAGE_DELIVERED="PRIVATE_MESSAGE_DELIVERED",e.GROUP_MESSAGE_DELIVERED="GROUP_MESSAGE_DELIVERED",e.USER_GROUP_STATUS="USER_GROUP_STATUS"}(Ae||(Ae={}));var Be=new u,De={connection:function(e,t){switch(e){case d.CONNECTED:Be.emit(Ae.CONNECTED);break;case d.CONNECTING:Be.emit(Ae.CONNECTING);break;case d.SUSPENDED:Be.emit(Ae.SUSPEND,t);break;case d.DISCONNECTED:Be.emit(Ae.DISCONNECT,t)}},batchMessage:function(e){Be.emit(Ae.MESSAGES,{messages:e.map((function(e){return Pe(e)}))})},typingState:function(e){Be.emit(Ae.TYPING_STATUS,{status:e})},readReceiptReceived:function(e,t,n){Be.emit(Ae.READ_RECEIPT_RECEIVED,{conversation:e,messageUId:t,sentTime:n})},messageReceiptRequest:function(e,t,n){Be.emit(Ae.MESSAGE_RECEIPT_REQUEST,{conversation:e,messageUId:t,senderUserId:n})},messageReceiptResponse:function(e,t,n){Be.emit(Ae.MESSAGE_RECEIPT_RESPONSE,{conversation:e,receivedUserId:t,messageUIdList:n})},conversationState:function(e){var t=e.map((function(e){var t=e.conversationType,n={conversationType:t,latestMessage:e.latestMessage?Pe(e.latestMessage):null,targetId:e.targetId,unreadMessageCount:e.unreadMessageCount,unreadMentionedCount:e.unreadMentionedCount,notificationStatus:e.notificationStatus,notificationLevel:e.notificationLevel,lastUnreadTime:e.lastUnreadTime,channelId:e.channelId};return t===s.ULTRA_GROUP?(n.versionTime=e.versionTime,n.unreadMessageCount=be(e.unreadMessageCount||0),n.unreadMentionedCount=be(e.unreadMentionedCount||0),n.unreadMentionedMeCount=be(e.unreadMentionedMeCount||0),{conversation:n}):(n.hasMentioned=e.hasMentioned,n.mentionedInfo=e.mentionedInfo,n.isTop=e.isTop,{conversation:n,updatedItems:e.updatedItems})}));Be.emit(Ae.CONVERSATION,{conversationList:t})},chatroomState:function(e){Be.emit(Ae.CHATROOM,e)},expansion:function(e){Be.emit(Ae.EXPANSION,e)},pullFinished:function(){Be.emit(Ae.PULL_OFFLINE_MESSAGE_FINISHED)},tag:function(){Be.emit(Ae.TAG)},conversationTagChanged:function(){Be.emit(Ae.CONVERSATION_TAG)},messageBlocked:function(e){Be.emit(Ae.MESSAGE_BLOCKED,e)},messageDelivered:function(e){Be.emit(Ae.PRIVATE_MESSAGE_DELIVERED,e)},groupMessageDeliveredStatus:function(e){Be.emit(Ae.GROUP_MESSAGE_DELIVERED,e)},ultraGroupEnable:function(e){Be.emit(Ae.ULTRA_GROUP_ENABLE,e.map((function(e){return Le(e)})))},operateStatus:function(e){Be.emit(Ae.OPERATE_STATUS,e)},ultraGroupMessageExpansionUpdated:function(e){Be.emit(Ae.ULTRA_GROUP_MESSAGE_EXPANSION_UPDATED,e.map((function(e){return Pe(e)})))},ultraGroupMessageModified:function(e){Be.emit(Ae.ULTRA_GROUP_MESSAGE_MODIFIED,e.map((function(e){return Pe(e)})))},ultraGroupMessageRecalled:function(e){Be.emit(Ae.ULTRA_GROUP_MESSAGE_RECALLED,e.map((function(e){return Pe(e)})))},ultraGroupChannelChangeType:function(e){Be.emit(Ae.ULTRA_GROUP_CHANNEL_TYPE_CHANGE,e)},ultraGroupChannelUserKicked:function(e){Be.emit(Ae.ULTRA_GROUP_CHANNEL_USER_KICKED,e)},ultraGroupChannelDelete:function(e){Be.emit(Ae.ULTRA_GROUP_CHANNEL_DELETE,e)},userGroupStatus:function(e){Be.emit(Ae.USER_GROUP_STATUS,e)}};function be(e){return e>999?999:e}l.add("imlib-next","5.8.6-alpha.1");var Ge=null,Ve=null,ke=null;function xe(){return x(this,void 0,void 0,(function(){return F(this,(function(e){switch(e.label){case 0:return Ge?(ke.info(R.A_DESTROY_O),[4,h.destroy()]):[2];case 1:return e.sent(),Ve=null,Ge=null,ke=null,[2]}}))}))}function Fe(e){if(!Ge)throw new Error("Not initialized yet!");return e(Ge,ke,Ve)}function Ze(e){return Ge?e(Ge,ke,Ve):Promise.resolve({code:i.BIZ_ERROR_CLIENT_NOT_INIT})}function He(e,t,n){Be.on(e,t,n)}function Je(e,t,n){Be.once(e,t,n)}function qe(e,t,n){Be.off(e,t,n)}function Ke(e){Be.removeAll(e)}function Ye(){Be.clear()}function ze(e){!function(e){var t,n=e.appkey,o=e.navigators;Ge?ke.warn(R.A_INIT_REPEAT_O):(f("options.appkey",e.appkey,v.STRING,!0),f("options.navigators",e.navigators,(function(e){return g(e)&&(0===e.length||e.every(I))})),Ve=e,Ge=h.init((null===(t=e.__runtimeCreator__)||void 0===t?void 0:t.call(e))||Me,{appkey:e.appkey,navigators:e.navigators||[],miniCMPProxy:e.customCMP||[],logOutputLevel:e.logOutputLevel,__reportLogLevel:e.__reportLogLevel,httpInMainProcess:!!e.httpInMainProcess,logExpireTime:e.logExpireTime,areaCode:e.areaCode,logServerUrl:e.logServerUrl,environment:e.environment}),(ke=Ge.createLogger("RC-IM","IM")).setOutputLevel(e.logOutputLevel),ke.info(R.A_INIT_O,JSON.stringify({appkey:n,navigators:o,version:"5.8.6-alpha.1",commit:"e063884e18fcc30fd8eb3e4c9948872008244963"})),Ge.assignWatcher(De),m.init(ke))}(e)}function je(){return x(this,void 0,void 0,(function(){return F(this,(function(e){return Ge?(Ye(),[2,xe()]):[2]}))}))}function We(){return Fe((function(e){return e.getConnectionStatus()}))}function Qe(){return Fe((function(e){return e.getServerTime()}))}function Xe(){return Fe((function(e){return e.getCurrentUserId()}))}function $e(e,t){l.add(e,t)}function et(){return Fe((function(e){return e.getDeviceId()}))}function nt(e,t){return Fe((function(n){return n.install(e,t)}))}var ot={TIMEOUT:{code:-1,msg:"Network timeout"},REJECTED_BY_BLACKLIST:{code:405,msg:"Blacklisted by the other party"},SEND_TOO_FAST:{code:20604,msg:"Sending messages too quickly"},NOT_IN_GROUP:{code:22406,msg:"Not in group"},ULTRA_GROUP_USER_NOT_IN_PRIVATE_CHANNEL:{code:i.ULTRA_GROUP_USER_NOT_IN_PRIVATE_CHANNEL,msg:"ultra group user not in private channel"},FORBIDDEN_IN_GROUP:{code:22408,msg:"Forbbiden from speaking in the group"},NOT_IN_CHATROOM:{code:23406,msg:"Not in chatRoom"},FORBIDDEN_IN_CHATROOM:{code:23408,msg:"Forbbiden from speaking in the chatRoom"},KICKED_FROM_CHATROOM:{code:23409,msg:"Kicked out and forbbiden from joining the chatRoom"},CHATROOM_NOT_EXIST:{code:23410,msg:"ChatRoom does not exist"},CHATROOM_IS_FULL:{code:23411,msg:"ChatRoom members exceeded"},PARAMETER_INVALID_CHATROOM:{code:23412,msg:"Invalid chatRoom parameters"},ROAMING_SERVICE_UNAVAILABLE_CHATROOM:{code:23414,msg:"ChatRoom message roaming service is not open, Please go to the developer to open this service"},RECALLMESSAGE_PARAMETER_INVALID:{code:25101,msg:"Invalid recall message parameter"},ROAMING_SERVICE_UNAVAILABLE_MESSAGE:{code:25102,msg:"Single group chat roaming service is not open, Please go to the developer to open this service"},PUSHSETTING_PARAMETER_INVALID:{code:26001,msg:"Invalid push parameter"},OPERATION_BLOCKED:{code:20605,msg:"Operation is blocked"},OPERATION_NOT_SUPPORT:{code:20606,msg:"Operation is not supported"},MSG_BLOCKED_SENSITIVE_WORD:{code:21501,msg:"The sent message contains sensitive words"},REPLACED_SENSITIVE_WORD:{code:21502,msg:"Sensitive words in the message have been replaced"},NOT_CONNECTED:{code:30001,msg:"Please connect successfully first"},NAVI_REQUEST_ERROR:{code:30007,msg:"Navigation http request failed"},CMP_REQUEST_ERROR:{code:30010,msg:"CMP sniff http request failed"},CONN_APPKEY_FAKE:{code:31002,msg:"Your appkey is fake"},CONN_MINI_SERVICE_NOT_OPEN:{code:31003,msg:"Mini program service is not open, Please go to the developer to open this service"},CONN_ACK_TIMEOUT:{code:31e3,msg:"Connection ACK timeout"},CONN_TOKEN_INCORRECT:{code:31004,msg:"Your token is not valid or expired"},CONN_NOT_AUTHRORIZED:{code:31005,msg:"AppKey and Token do not match"},CONN_REDIRECTED:{code:31006,msg:"Connection redirection"},CONN_APP_BLOCKED_OR_DELETED:{code:31008,msg:"AppKey is banned or deleted"},CONN_USER_BLOCKED:{code:31009,msg:"User blocked"},CONN_DOMAIN_INCORRECT:{code:31012,msg:"Connect domain error, Please check the set security domain"},ROAMING_SERVICE_UNAVAILABLE:{code:33007,msg:"Roaming service cloud is not open, Please go to the developer to open this service"},RC_CONNECTION_EXIST:{code:34001,msg:"Connection already exists"},CHATROOM_KV_EXCEED:{code:23423,msg:"ChatRoom KV setting exceeds maximum"},CHATROOM_KV_OVERWRITE_INVALID:{code:23424,msg:"ChatRoom KV already exists"},CHATROOM_KV_STORE_NOT_OPEN:{code:23426,msg:"ChatRoom KV storage service is not open, Please go to the developer to open this service"},CHATROOM_KEY_NOT_EXIST:{code:23427,msg:"ChatRoom key does not exist"},MSG_KV_NOT_SUPPORT:{code:34008,msg:"The message cannot be extended"},SEND_MESSAGE_KV_FAIL:{code:34009,msg:"Sending RC expansion message fail"},EXPANSION_LIMIT_EXCEET:{code:34010,msg:"The message expansion size is beyond the limit"},ILLGAL_PARAMS:{code:33003,msg:"Incorrect parameters passed in while calling the interface"},UPLOAD_FILE_FAILED:{code:35020,msg:"File upload failed"},CHATROOM_KV_STORE_NOT_ALL_SUCCESS:{code:23428,msg:"Chatroom kv store not all success"},CHATROOM_KV_STORE_OUT_LIMIT:{code:23429,msg:"Chatroom kv's length is out of limit"},TAG_EXISTS:{code:33101,msg:"The tag already exists"},TAG_NOT_EXIST:{code:33100,msg:"The tag does not exist"},NOT_SUPPORT:{code:i.NOT_SUPPORT,msg:"The method is not supported in a browser!"}},rt={};for(var it in ot){var at=ot[it].code;rt[at]=it}function st(e,t){return x(this,void 0,void 0,(function(){var n=this;return F(this,(function(o){return[2,Ze((function(o,r){return x(n,void 0,void 0,(function(){var n,a,s;return F(this,(function(c){switch(c.label){case 0:return E("token",e,v.STRING,!0)&&E("reconnectKickEnable",t,v.BOOLEAN)?(n=r.createTraceId(),r.info(R.A_CONNECT_T,JSON.stringify({token:e,reconnectKickEnable:t}),n),[4,o.connect(e,!!t,n)]):[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}];case 1:return a=c.sent(),s=a.code===i.SUCCESS?"info":"warn",r[s](R.A_CONNECT_R,JSON.stringify({code:a.code,userId:a.userId}),n),a.code===i.SUCCESS?[2,{code:a.code,data:{userId:a.userId}}]:[2,{code:a.code,msg:rt[a.code]}]}}))}))}))]}))}))}function ct(e){return m.info(R.A_DISCONNECT_O,{}),Fe((function(t){return t.disconnect(e)}))}function ut(e,t){return x(this,void 0,void 0,(function(){var n=this;return F(this,(function(o){return E("options.count",null==e?void 0:e.count,v.NUMBER)&&E("options.startTime",null==e?void 0:e.startTime,v.NUMBER)&&E("options.order",null==e?void 0:e.order,v.NUMBER)&&E("channelId",t,v.CHANNEL_ID)?[2,Ze((function(o,r){return x(n,void 0,void 0,(function(){var n,a,s;return F(this,(function(c){switch(c.label){case 0:return[4,o.getConversationList(null==e?void 0:e.count,void 0,null==e?void 0:e.startTime,null==e?void 0:e.order,t)];case 1:return n=c.sent(),a=n.code,s=n.data,a===i.SUCCESS&&s?[2,{code:0,data:s.map((function(e){return Le(e)}))}]:(r.warn(R.O,"get conversation list fail ->".concat(a,":").concat(rt[a])),[2,{code:a,msg:rt[a]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function dt(e){return x(this,void 0,void 0,(function(){var t=this;return F(this,(function(n){return E("options",e,v.CONVERSATION,!0)?[2,Ze((function(n,o){return x(t,void 0,void 0,(function(){var t,r,a;return F(this,(function(s){switch(s.label){case 0:return[4,n.getConversation(e.conversationType,e.targetId,e.channelId||"")];case 1:return t=s.sent(),r=t.code,a=t.data,r!==i.SUCCESS?(o.warn(R.O,"getConversation ->code:".concat(r,", targetId:").concat(e.targetId)),[2,{code:r,msg:rt[r]}]):[2,{code:r,data:a?Le(a):null}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function lt(e){return x(this,void 0,void 0,(function(){var t=this;return F(this,(function(n){return E("options",e,v.CONVERSATION,!0)?[2,Ze((function(n,o){return x(t,void 0,void 0,(function(){var t,r;return F(this,(function(a){switch(a.label){case 0:return[4,n.removeConversation(e.conversationType,e.targetId,e.channelId)];case 1:return t=a.sent(),r="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),o.debug(R.O,"destroy conversation ->".concat(r)),t!==i.SUCCESS?(o.warn(R.O,"destroy conversation fail ->".concat(t,":").concat(rt[t],",").concat(r)),[2,{code:t,msg:rt[t]}]):[2,{code:t}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function ft(e){return x(this,void 0,void 0,(function(){var t=this;return F(this,(function(n){return E("options",e,v.CONVERSATION,!0)?[2,Ze((function(n,o){return x(t,void 0,void 0,(function(){var t,r,a,s;return F(this,(function(c){switch(c.label){case 0:return[4,n.getConversationMessageDraft(e.conversationType,e.targetId,e.channelId)];case 1:return t=c.sent(),r=t.code,a=t.data,s="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),o.debug(R.O,"get draft ->".concat(s)),r===i.SUCCESS?[2,{code:r,data:a||""}]:(o.warn(R.O,"get draft fail ->".concat(r,":").concat(rt[r],",").concat(s)),[2,{code:r,msg:rt[r]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function vt(e,t){return x(this,void 0,void 0,(function(){var n=this;return F(this,(function(o){return E("options",e,v.CONVERSATION,!0)&&E("draft",t,v.STRING,!0)?[2,Ze((function(o,r){return x(n,void 0,void 0,(function(){var n,a;return F(this,(function(s){switch(s.label){case 0:return n="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),r.debug(R.O,"set draft ->".concat(n)),[4,o.saveConversationMessageDraft(e.conversationType,e.targetId,t,e.channelId)];case 1:return(a=s.sent())===i.SUCCESS?[2,{code:a}]:(r.warn(R.O,"set draft fail ->".concat(a,":").concat(rt[a],",").concat(n)),[2,{code:a,msg:rt[a]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function gt(e){return x(this,void 0,void 0,(function(){var t=this;return F(this,(function(n){return E("options",e,v.CONVERSATION,!0)?[2,Ze((function(n,o){return x(t,void 0,void 0,(function(){var t,r;return F(this,(function(a){switch(a.label){case 0:return t="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),o.debug(R.O,"delete draft ->".concat(t)),[4,n.clearConversationMessageDraft(e.conversationType,e.targetId,e.channelId)];case 1:return(r=a.sent())===i.SUCCESS?[2,{code:r}]:(o.warn(R.O,"delete draft fail ->".concat(r,":").concat(rt[r],",").concat(t)),[2,{code:r,msg:rt[r]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function It(e,t){return x(this,void 0,void 0,(function(){var n=this;return F(this,(function(o){return E("includeMuted",e,v.BOOLEAN,!1)&&E("conversationTypes",t,v.ARRAY,!1)&&!(null==t?void 0:t.some((function(e){return!E("conversationType",e,S)})))?[2,Ze((function(o,r){return x(n,void 0,void 0,(function(){var n,a,s;return F(this,(function(c){switch(c.label){case 0:return r.debug(R.O,"get total unread count -> ConversationType:".concat(JSON.stringify(t)," includeMuted:").concat(e)),[4,o.getTotalUnreadCount("",t,e)];case 1:return n=c.sent(),a=n.code,s=n.data,a===i.SUCCESS?[2,{code:a,data:s}]:(r.warn(R.O,"getTotalUnreadCount fail ->".concat(a,":").concat(rt[a])),[2,{code:a,msg:rt[a]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function ht(e,t){return x(this,void 0,void 0,(function(){var n=this;return F(this,(function(o){return!E("conversationTypes",e,v.ARRAY,!0)||!E("levels",t,v.ARRAY,!0)||e.some((function(e){return!E("conversationType",e,S)}))||t.some((function(e){return!E("level",e,T)}))?[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,Ze((function(o,r){return x(n,void 0,void 0,(function(){var n,a,s;return F(this,(function(c){switch(c.label){case 0:return[4,o.getTotalUnreadCountByLevels(e,t)];case 1:return n=c.sent(),a=n.code,s=n.data,a===i.SUCCESS?[2,{code:a,data:s}]:(r.warn(R.O,"getTotalUnreadCountByLevels fail ->".concat(a,":").concat(rt[a])),[2,{code:a,msg:rt[a]}])}}))}))}))]}))}))}function Rt(e,t){return x(this,void 0,void 0,(function(){var n=this;return F(this,(function(o){return!E("conversationTypes",e,v.ARRAY,!0)||!E("levels",t,v.ARRAY,!0)||e.some((function(e){return!E("conversationType",e,S)}))||t.some((function(e){return!E("level",e,T)}))?[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,Ze((function(o,r){return x(n,void 0,void 0,(function(){var n,a,s;return F(this,(function(c){switch(c.label){case 0:return[4,o.getTotalUnreadCountByLevels(e,t,!0)];case 1:return n=c.sent(),a=n.code,s=n.data,a===i.SUCCESS?[2,{code:a,data:s}]:(r.warn(R.O,"getTotalUnreadMentionedCountByLevels fail ->".concat(a,":").concat(rt[a])),[2,{code:a,msg:rt[a]}])}}))}))}))]}))}))}function mt(e){return x(this,void 0,void 0,(function(){var t=this;return F(this,(function(n){return E("options",e,v.CONVERSATION,!0)?[2,Ze((function(n,o){return x(t,void 0,void 0,(function(){var t,r,a,s;return F(this,(function(c){switch(c.label){case 0:return[4,n.getUnreadCount(e.conversationType,e.targetId,e.channelId)];case 1:return t=c.sent(),r=t.code,a=t.data,s="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),o.debug(R.O,"get unreadCount ->".concat(s)),r===i.SUCCESS?[2,{code:r,data:a}]:(o.warn(R.O,"get unreadCount fail ->".concat(r,":").concat(rt[r],",").concat(s)),[2,{code:r,msg:rt[r]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Et(e){return x(this,void 0,void 0,(function(){var t=this;return F(this,(function(n){return E("options",e,v.CONVERSATION,!0)?[2,Ze((function(n,o){return x(t,void 0,void 0,(function(){var t,r;return F(this,(function(a){switch(a.label){case 0:return[4,n.clearUnreadCount(e.conversationType,e.targetId,e.channelId)];case 1:return t=a.sent(),r="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),o.debug(R.O,"clear unreadMsgNum ->".concat(r)),t!==i.SUCCESS?(o.warn(R.O,"clear unreadMsgNum fail ->".concat(t,":").concat(rt[t],",").concat(r)),[2,{code:t,msg:rt[t]}]):[2,{code:t}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function St(){return x(this,void 0,void 0,(function(){var e=this;return F(this,(function(t){return[2,Ze((function(t,n){return x(e,void 0,void 0,(function(){return F(this,(function(e){switch(e.label){case 0:return[4,t.clearAllUnreadCount()];case 1:return[2,{code:e.sent()}]}}))}))}))]}))}))}ot.ROAMING_SERVICE_UNAVAILABLE.code;var Tt=function(e,t,n){void 0===n&&(n="");var o="conversationType:".concat(t.conversationType,",targetId:").concat(t.targetId);return e.debug(R.O,"".concat(n," -> ").concat(o)),o},pt=function(e,t,n,o){return void 0===o&&(o=""),x(void 0,void 0,void 0,(function(){var r,a;return F(this,(function(s){switch(s.label){case 0:return r=Tt(e,t,o),[4,n()];case 1:return(a=s.sent())!==i.SUCCESS?(e.warn(R.O,"".concat(o," fail -> ").concat(a," : ").concat(rt[a]," , ").concat(r)),[2,{code:a,msg:rt[a]}]):[2,{code:a}]}}))}))};function Ot(e,t){return x(this,void 0,void 0,(function(){return F(this,(function(n){return E("notificationLevel",t,(function(e){return void 0!==p[e]}),!0)&&E("options",e,v.CONVERSATION,!0)?[2,Ze((function(n,o){return pt(o,e,(function(){return n.setConversationNotificationLevel(e.conversationType,e.targetId,t,e.channelId)}),"setConversationNotificationLevel")}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Nt(e,t){return x(this,void 0,void 0,(function(){return F(this,(function(n){return E("notificationStatus",t,(function(e){return 1===e||2===e}),!0)&&E("options",e,v.CONVERSATION,!0)?[2,Ze((function(n,o){return pt(o,e,(function(){return n.setConversationStatus(e.conversationType,e.targetId,void 0,t,e.channelId)}),"setConversationNotificationStatus")}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function _t(e){return x(this,void 0,void 0,(function(){var t=this;return F(this,(function(n){return E("options",e,v.CONVERSATION,!0)?[2,Ze((function(n,o){return x(t,void 0,void 0,(function(){var t,r,a,s;return F(this,(function(c){switch(c.label){case 0:return t=Tt(o,e,"getConversationNotificationLevel"),[4,n.getConversationNotificationLevel(e.conversationType,e.targetId,e.channelId)];case 1:return r=c.sent(),a=r.code,s=r.data,a===i.SUCCESS?[2,{code:a,data:s}]:(o.warn(R.O,"getConversationNotificationLevel fail -> ".concat(a," : ").concat(rt[a]," , ").concat(t)),[2,{code:a,msg:rt[a]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Ct(e){return x(this,void 0,void 0,(function(){var t=this;return F(this,(function(n){return E("options",e,v.CONVERSATION,!0)?[2,Ze((function(n,o){return x(t,void 0,void 0,(function(){var t,r,a;return F(this,(function(s){switch(s.label){case 0:return o.info(R.O,"getConversationNotificationStatus ->targetId:".concat(e.targetId,",conversationType:").concat(e.conversationType)),[4,n.getConversationNotificationStatus(e.conversationType,e.targetId,e.channelId)];case 1:return t=s.sent(),r=t.code,a=t.data,r===i.SUCCESS?[2,{code:r,data:a}]:(o.warn(R.O,"getConversationNotificationStatus ->code:".concat(r,",targetId:").concat(e.targetId)),[2,{code:r,msg:rt[r]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function At(){return x(this,void 0,void 0,(function(){return F(this,(function(e){return[2,Ze((function(e){return e.getBlockConversationList()}))]}))}))}function Ut(e,t){return void 0===t&&(t=!0),x(this,void 0,void 0,(function(){var n=this;return F(this,(function(o){return E("options",e,v.CONVERSATION,!0)&&E("isTop",t,v.BOOLEAN)?[2,Ze((function(o,r){return x(n,void 0,void 0,(function(){var n,a;return F(this,(function(s){switch(s.label){case 0:return n="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),r.debug(R.O,"set conversation status ->".concat(n)),[4,o.setConversationStatus(e.conversationType,e.targetId,t,void 0,e.channelId)];case 1:return(a=s.sent())!==i.SUCCESS?(r.warn(R.O,"set conversation status fail ->".concat(a,":").concat(rt[a],",").concat(n)),[2,{code:a,msg:rt[a]}]):[2,{code:a}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function yt(e,t){return x(this,void 0,void 0,(function(){var n=this;return F(this,(function(o){return E("conversationTypes",e,v.ARRAY)&&!(null==e?void 0:e.some((function(e){return!E("conversationType",e,S)})))&&E("channelId",t,v.CHANNEL_ID)?[2,Ze((function(o,r){return x(n,void 0,void 0,(function(){var n,a,s;return F(this,(function(c){switch(c.label){case 0:return[4,o.getTopConversationList(e,t)];case 1:return n=c.sent(),a=n.code,s=n.data,a===i.SUCCESS&&s?[2,{code:0,data:s.map((function(e){return Le(e)}))}]:(r.warn(R.A_GET_TOP_CONVERSATION_LIST_E,"".concat(a,":").concat(rt[a])),[2,{code:a,msg:rt[a]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Mt(e){return x(this,void 0,void 0,(function(){var t=this;return F(this,(function(n){return!E("conversationTypes",e,v.ARRAY)||(null==e?void 0:e.some((function(e){return!E("conversationType",e,O)})))?[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,Ze((function(n,o){return x(t,void 0,void 0,(function(){var t,o,r;return F(this,(function(a){switch(a.label){case 0:return[4,n.getUnreadConversationList(e)];case 1:return t=a.sent(),o=t.code,r=t.data,o===i.SUCCESS&&r?[2,{code:0,data:r.map((function(e){return Le(e)}))}]:[2,{code:o,msg:rt[o]}]}}))}))}))]}))}))}function Pt(e){return x(this,void 0,void 0,(function(){return F(this,(function(t){return E("options",e,v.CONVERSATION,!0)?[2,Ze((function(t,n){return n.debug(R.O,"getUnreadMentionedCount".concat(e.targetId,",channelId:").concat(e.channelId)),t.getUnreadMentionedCount(e)}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Lt(){return x(this,void 0,void 0,(function(){return F(this,(function(e){return[2,Ze((function(e,t){return t.debug(R.O,"getAllUnreadMentionedCount"),e.getAllUnreadMentionedCount()}))]}))}))}function wt(){return x(this,void 0,void 0,(function(){return F(this,(function(e){return[2,Ze((function(e){return e.getAllConversationState()}))]}))}))}function Bt(e){return void 0===e&&(e={}),x(this,void 0,void 0,(function(){var t=this;return F(this,(function(n){return E("options.targetId",e.targetId,v.STRING,!1)&&E("options.channelType",e.channelType,(function(e){return void 0!==N[e]}),!1)?[2,Ze((function(n,o){return x(t,void 0,void 0,(function(){var t,r,a;return F(this,(function(s){switch(s.label){case 0:return[4,n.getUltraGroupList(e)];case 1:return t=s.sent(),r=t.code,a=t.data,r===i.SUCCESS?[2,{code:i.SUCCESS,data:a}]:(o.warn(R.O,"get ultragroup ->".concat(r,":").concat(rt[r])),[2,{code:r,msg:rt[r]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Dt(){return x(this,void 0,void 0,(function(){var e=this;return F(this,(function(t){return[2,Ze((function(t,n){return x(e,void 0,void 0,(function(){var e,o,r;return F(this,(function(a){switch(a.label){case 0:return[4,t.getBlockUltraGroupList()];case 1:return e=a.sent(),o=e.code,r=e.data,o===i.SUCCESS?[2,{code:i.SUCCESS,data:r}]:(n.warn(R.O,"get block ultragroup ->".concat(o,":").concat(rt[o])),[2,{code:o,msg:rt[o]}])}}))}))}))]}))}))}function bt(e){return x(this,void 0,void 0,(function(){var t=this;return F(this,(function(n){return E("options",e,v.CONVERSATION,!0)?[2,Ze((function(n,o){return x(t,void 0,void 0,(function(){var t;return F(this,(function(r){switch(r.label){case 0:return[4,n.sendUltraGroupTypingStatus(e)];case 1:return(t=r.sent().code)===i.SUCCESS?[2,{code:i.SUCCESS}]:(o.warn(R.O,"send ultraGroup OperateStatus ->".concat(t,":").concat(rt[t])),[2,{code:t,msg:rt[t]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Gt(e,t){return x(this,void 0,void 0,(function(){var n=this;return F(this,(function(o){return E("options",e,v.CONVERSATION,!0)&&E("msgs",t,v.ARRAY,!0)?[2,Ze((function(o,r){return x(n,void 0,void 0,(function(){var n,a,s,c,u,d,l,f,v,g;return F(this,(function(I){switch(I.label){case 0:return n=e.targetId,a=e.conversationType,s=e.channelId,c=[],t.forEach((function(e){var t=e.sendTime,n=e.messageUId;c.push({sendTime:t,messageUId:n,channelId:s})})),u={targetId:n,conversationType:a,messages:c},[4,o.getUltraGroupMessageListByMessageUId(u)];case 1:if(d=I.sent(),l=d.code,f=d.data,l===i.SUCCESS){for(g in v={},f)v[g]=f[g]?Pe(f[g]):void 0;return[2,{code:i.SUCCESS,data:v}]}return r.warn(R.O,"get UltraGroup MessageList by messageUId ->".concat(l,":").concat(rt[l])),[2,{code:l,msg:rt[l]}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Vt(e,t){return x(this,void 0,void 0,(function(){var n=this;return F(this,(function(o){return E("expansion",e,v.OBJECT,!0)&&E("message",t,v.OBJECT,!0)?[2,Ze((function(o,r){return x(n,void 0,void 0,(function(){var n,a,s,c,u,d,l,f,v;return F(this,(function(g){switch(g.label){case 0:return n=t.conversationType,a=t.targetId,s=t.messageUId,c=t.sentTime,u=t.canIncludeExpansion,d=t.channelId,l="conversationType:".concat(n,",targetId:").concat(a,",channelId:").concat(d,",messageUId:").concat(s),r.debug(R.O,"update expansion for ultragroup message ->".concat(l)),f={targetId:a,channelId:d,conversationType:n,sendTime:c,canIncludeExpansion:u,messageUId:s,expansion:e},[4,o.expandUltraMessage(f)];case 1:return(v=g.sent().code)===i.SUCCESS?[2,{code:i.SUCCESS}]:(r.warn(R.O,"update expansion for ultragroup message ->".concat(v,":").concat(rt[v])),[2,{code:v,msg:rt[v]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function kt(e,t){return x(this,void 0,void 0,(function(){var n=this;return F(this,(function(o){return E("expansion",e,v.ARRAY,!0)&&E("message",t,v.OBJECT,!0)?[2,Ze((function(o,r){return x(n,void 0,void 0,(function(){var n,a,s,c,u,d,l,f,v;return F(this,(function(g){switch(g.label){case 0:return n=t.conversationType,a=t.targetId,s=t.messageUId,c=t.sentTime,u=t.canIncludeExpansion,d=t.channelId,l="conversationType:".concat(n,",targetId:").concat(a,",channelId:").concat(d,",messageUId:").concat(s),r.debug(R.O,"remove expansion for ultragroup message ->".concat(l)),f={targetId:a,channelId:d,conversationType:n,sendTime:c,canIncludeExpansion:u,messageUId:s,keys:e},[4,o.expandUltraMessage(f)];case 1:return(v=g.sent().code)===i.SUCCESS?[2,{code:i.SUCCESS}]:(r.warn(R.O,"remove expansion for ultraGroup message ->".concat(v,":").concat(rt[v])),[2,{code:v,msg:rt[v]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function xt(e){return x(this,void 0,void 0,(function(){var t=this;return F(this,(function(n){return E("message",e,v.OBJECT,!0)?[2,Ze((function(n,o){return x(t,void 0,void 0,(function(){var t,r,a,s,c,u,d,l,f;return F(this,(function(v){switch(v.label){case 0:return t=e.conversationType,r=e.targetId,a=e.messageUId,s=e.sentTime,c=e.canIncludeExpansion,u=e.channelId,d="conversationType:".concat(t,",targetId:").concat(r,",channelId:").concat(u,",messageUId:").concat(a),o.debug(R.O,"remove all expansion for ultraGroup message ->".concat(d)),l={targetId:r,channelId:u,conversationType:t,sendTime:s,canIncludeExpansion:c,messageUId:a,removeAll:!0},[4,n.expandUltraMessage(l)];case 1:return(f=v.sent().code)===i.SUCCESS?[2,{code:i.SUCCESS}]:(o.warn(R.O,"remove all expansion for ultraGroup message ->".concat(f,":").concat(rt[f])),[2,{code:f,msg:rt[f]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Ft(e,t){return x(this,void 0,void 0,(function(){var n=this;return F(this,(function(o){return E("content",e,v.OBJECT,!0)&&E("message",t,v.OBJECT,!0)?[2,Ze((function(o,r){return x(n,void 0,void 0,(function(){var n,a,s,c,u,d,l,f,v,g;return F(this,(function(I){switch(I.label){case 0:return n=t.conversationType,a=t.targetId,s=t.messageUId,c=t.senderUserId,u=t.sentTime,d=t.canIncludeExpansion,l=t.channelId,f="conversationType:".concat(n,",targetId:").concat(a,",channelId:").concat(l,",messageUId:").concat(s),r.debug(R.O,"update ultragroup message expansion ->".concat(f)),v={targetId:a,channelId:l,conversationType:n,fromUserId:c,sendTime:u,canIncludeExpansion:d,messageUId:s,content:e},[4,o.modifyMessage(v)];case 1:return(g=I.sent().code)===i.SUCCESS?[2,{code:i.SUCCESS}]:(r.warn(R.O,"modify ultraGroup message ->".concat(g,":").concat(rt[g])),[2,{code:g,msg:rt[g]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Zt(e,t){return x(this,void 0,void 0,(function(){var n=this;return F(this,(function(o){return E("targetId",e,v.STRING,!0)&&E("notificationLevels",t,v.ARRAY)&&!(null==t?void 0:t.some((function(e){return!E("notificationLevel",e,T)})))?[2,Ze((function(o,r){return x(n,void 0,void 0,(function(){var n,a,s;return F(this,(function(c){switch(c.label){case 0:return r.debug(R.O,"get UltraGroup unreadMentionedCount by targetId: ".concat(e,", notificationLevels: ").concat(JSON.stringify(t))),[4,o.getUltraGroupUnreadMentionedCountByTargetId(e,t)];case 1:return n=c.sent(),a=n.code,s=n.data,a===i.SUCCESS?[2,{code:i.SUCCESS,data:s}]:(r.warn(R.O,"get UltraGroup unreadMentionedCount by targetId error ->".concat(a,":").concat(rt[a])),[2,{code:a,msg:rt[a]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Ht(e){return x(this,void 0,void 0,(function(){var t=this;return F(this,(function(n){return E("options.targetId",e.targetId,v.STRING,!0)&&E("options.channelId",e.channelId,v.CHANNEL_ID)?[2,Ze((function(n,o){return x(t,void 0,void 0,(function(){var t,r,a,s,c;return F(this,(function(u){switch(u.label){case 0:return t="getUltraGroupDefaultNotificationLevel",r="targetId: ".concat(e.targetId,", channelId: ").concat(e.channelId),o.debug(R.O,"".concat(t," -> ").concat(r)),[4,n.getUltraGroupDefaultNotificationLevel(e.targetId,e.channelId)];case 1:return a=u.sent(),s=a.code,c=a.data,s===i.SUCCESS?[2,{code:s,data:c}]:(o.warn(R.O,"".concat(t," fail -> ").concat(s," : ").concat(rt[s]," , ").concat(r)),[2,{code:s,msg:rt[s]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Jt(e,t){return x(this,void 0,void 0,(function(){var n=this;return F(this,(function(o){return e.channelId=e.channelId||"",E("options.targetId",e.targetId,v.STRING,!0)&&E("options.channelId",e.channelId,v.CHANNEL_ID,!0)&&E("notificationLevel",t,(function(e){return void 0!==p[e]}),!0)?[2,Ze((function(o,r){return x(n,void 0,void 0,(function(){var n,a,s;return F(this,(function(c){switch(c.label){case 0:return n="setUltraGroupDefaultNotificationLevel",a="targetId: ".concat(e.targetId,", channelId: ").concat(e.channelId),r.debug(R.O,"".concat(n," -> ").concat(a)),[4,o.setUltraGroupDefaultNotificationLevel(e.targetId,t,e.channelId)];case 1:return(s=c.sent().code)===i.SUCCESS?[2,{code:s}]:(r.warn(R.O,"".concat(n," fail -> ").concat(s," : ").concat(rt[s]," , ").concat(a)),[2,{code:s,msg:rt[s]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function qt(e,t){return x(this,void 0,void 0,(function(){var n=this;return F(this,(function(o){return E("targetId",e,v.STRING,!0)&&E("notificationLevels",t,v.ARRAY)&&!(null==t?void 0:t.some((function(e){return!E("notificationLevel",e,T)})))?[2,Ze((function(o,r){return x(n,void 0,void 0,(function(){var n,i,a,s,c;return F(this,(function(u){switch(u.label){case 0:return n="getUltraGroupUnreadCountByTargetId",[4,o.getUltraGroupUnreadCountByTargetId(e,t)];case 1:return i=u.sent(),a=i.code,s=i.data,c="targetId: ".concat(e,", levels: ").concat(JSON.stringify(t)),r.debug(R.O,"".concat(n," -> ").concat(c)),[2,{code:a,data:s}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Kt(){return x(this,void 0,void 0,(function(){var e=this;return F(this,(function(t){return[2,Ze((function(t,n){return x(e,void 0,void 0,(function(){var e,o,r,a;return F(this,(function(s){switch(s.label){case 0:return e="getAllUltraGroupUnreadCount",[4,t.getAllUltraGroupUnreadCount()];case 1:return o=s.sent(),r=o.code,a=o.data,n.debug(R.O,e),r===i.SUCCESS?[2,{code:r,data:a}]:(n.warn(R.O,"".concat(e," fail ->").concat(r,": ").concat(rt[r])),[2,{code:r,msg:rt[r]}])}}))}))}))]}))}))}function Yt(){return x(this,void 0,void 0,(function(){var e=this;return F(this,(function(t){return[2,Ze((function(t,n){return x(e,void 0,void 0,(function(){var e,o,r,a;return F(this,(function(s){switch(s.label){case 0:return e="getAllUltraGroupUnreadMentionedCount",!0,[4,t.getAllUltraGroupUnreadCount(true)];case 1:return o=s.sent(),r=o.code,a=o.data,n.debug(R.O,e),r===i.SUCCESS?[2,{code:r,data:a}]:(n.warn(R.O,"".concat(e," fail ->").concat(r,": ").concat(rt[r])),[2,{code:r,msg:rt[r]}])}}))}))}))]}))}))}function zt(e){return x(this,void 0,void 0,(function(){var t=this;return F(this,(function(n){return e.channelId=e.channelId||"",E("options.targetId",e.targetId,v.STRING,!0)&&E("options.channelId",e.channelId,v.CHANNEL_ID,!0)&&E("options.sentTime",e.sentTime,v.NUMBER,!0)&&E("options.count",e.count,(function(e){return c(e)&&e>0&&e<=50}),!0)?[2,Ze((function(n,o){return x(t,void 0,void 0,(function(){var t,r,a,s,c,u,d,l;return F(this,(function(f){switch(f.label){case 0:return t=e.targetId,r=e.channelId,a=e.sentTime,s=e.count,c={targetId:t,channelId:r,sentTime:a,count:s},[4,n.getUltraGroupUnreadMentionedMessages(c)];case 1:return u=f.sent(),d=u.code,l=u.data,d===i.SUCCESS?[2,{code:d,data:l}]:(o.warn(R.O,"getUltraGroupUnreadMentionedMessages fail ->".concat(d,": ").concat(rt[d])),[2,{code:d,msg:rt[d]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function jt(e){return x(this,void 0,void 0,(function(){var t=this;return F(this,(function(n){return E("conversation.targetId",e.targetId,v.STRING,!0)&&E("conversation.channelId",e.channelId,v.CHANNEL_ID,!0)?[2,Ze((function(n){return x(t,void 0,void 0,(function(){var t,o,r,a,s,c;return F(this,(function(u){switch(u.label){case 0:return t=e.targetId,o=e.channelId,r={targetId:t,channelId:o},[4,n.getUltraGroupFirstUnreadMessageTimestamp(r)];case 1:return a=u.sent(),s=a.code,c=a.data,s===i.SUCCESS?[2,{code:s,data:c}]:[2,{code:s,msg:rt[s]}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Wt(e){return x(this,void 0,void 0,(function(){var t,n=this;return F(this,(function(o){return E("targetIds",e,v.ARRAY,!0)&&E("targetIds.length",e,(function(e){return e.length>0&&e.length<20}))&&!e.some((function(e){return!E("targetId",e,v.STRING)}))?(t=e.filter((function(t,n){return e.indexOf(t)===n})),[2,Ze((function(e){return x(n,void 0,void 0,(function(){var n,o,r;return F(this,(function(a){switch(a.label){case 0:return[4,e.getUltraGroupUnreadInfoList(t)];case 1:return n=a.sent(),o=n.code,r=n.data,o===i.SUCCESS?[2,{code:o,data:r}]:[2,{code:o,msg:rt[o]}]}}))}))}))]):[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}var Qt=function(e){return!!(E("options.key",e.key,v.STRING,!0)&&E("options.value",e.value,v.STRING,!0)&&E("options.isAutoDelete",e.isAutoDelete,v.BOOLEAN)&&E("options.isSendNotification",e.isSendNotification,v.BOOLEAN)&&E("options.notificationExtra",e.notificationExtra,v.STRING))},Xt=function(e){return e.entries.every((function(e){return E("entry.key",e.key,v.STRING,!0)&&E("entry.value",e.value,v.STRING,!0)}))&&E("options.isAutoDelete",e.isAutoDelete,v.BOOLEAN)&&E("options.notificationExtra",e.notificationExtra,v.STRING)&&E("options.isForce",e.isForce,v.BOOLEAN)},$t=function(e){return E("options.key",e.key,v.STRING,!0)&&E("options.isSendNotification",e.isSendNotification,v.BOOLEAN)&&E("options.notificationExtra",e.notificationExtra,v.STRING)},en=function(e){return e.entries.every((function(e){return E("key",e,v.STRING,!0)}))&&E("options.notificationExtra",e.notificationExtra,v.STRING)};function tn(e,t){return x(this,void 0,void 0,(function(){var n=this;return F(this,(function(o){return E("targetId",e,v.STRING,!0)&&E("options.count",t.count,v.NUMBER,!0)?[2,Ze((function(o,r){return x(n,void 0,void 0,(function(){var n,a,s;return F(this,(function(c){switch(c.label){case 0:return n=r.createTraceId(),r.info(R.A_JOIN_CHATROOM_T,JSON.stringify({chatroomId:e,count:t.count,joinExist:!1}),n),[4,o.joinChatroom(e,t.count,n)];case 1:return a=c.sent(),s=a===i.SUCCESS?"info":"warn",r[s](R.A_JOIN_CHATROOM_R,JSON.stringify({code:a,timestamp:(new Date).getTime()}),n),a!==i.SUCCESS?[2,{code:a,msg:rt[a]}]:[2,{code:a}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function nn(e,t){return x(this,void 0,void 0,(function(){var n=this;return F(this,(function(o){return E("targetId",e,v.STRING,!0)&&E("options.count",t.count,v.NUMBER,!0)?[2,Ze((function(o,r){return x(n,void 0,void 0,(function(){var n,a,s,c,u;return F(this,(function(d){switch(d.label){case 0:return n=r.createTraceId(),r.info(R.A_JOIN_CHATROOM_T,JSON.stringify({chatroomId:e,count:t.count,joinExist:!0}),n),[4,o.joinExistChatroom(e,t.count,n)];case 1:return a=d.sent(),s=a.code,c=a.data,u=s===i.SUCCESS?"info":"warn",r[u](R.A_JOIN_CHATROOM_R,JSON.stringify({code:s,timestamp:(new Date).getTime()}),n),s!==i.SUCCESS?[2,{code:s,msg:rt[s]}]:[2,{code:s,data:c}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function on(e){return x(this,void 0,void 0,(function(){var t=this;return F(this,(function(n){return E("targetId",e,v.STRING,!0)?[2,Ze((function(n,o){return x(t,void 0,void 0,(function(){var t,r,a;return F(this,(function(s){switch(s.label){case 0:return t=o.createTraceId(),o.info(R.A_QUIT_CHATROOM_T,JSON.stringify({chatroomId:e}),t),[4,n.quitChatroom(e)];case 1:return r=s.sent(),a=r===i.SUCCESS?"info":"warn",o[a](R.A_QUIT_CHATROOM_R,JSON.stringify({code:r}),t),r!==i.SUCCESS?[2,{code:r,msg:rt[r]}]:[2,{code:r}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function rn(e,t){return x(this,void 0,void 0,(function(){var n=this;return F(this,(function(o){return E("targetId",e,v.STRING,!0)&&E("options.count",t.count,v.NUMBER)&&E("options.order",t.order,(function(e){return[0,1,2].includes(e)}))?[2,Ze((function(o,r){return x(n,void 0,void 0,(function(){var n,a,s,c;return F(this,(function(u){switch(u.label){case 0:return n="id:".concat(e),r.debug(R.O,"get chatroom info ->".concat(n)),[4,o.getChatroomInfo(e,t.count,t.order)];case 1:return a=u.sent(),s=a.code,c=a.data,s===i.SUCCESS&&c?[2,{code:s,data:c}]:(r.warn(R.O,"get chatroom info fail ->code+:".concat(rt[s],",").concat(n)),[2,{code:s,msg:rt[s]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function an(e,t){return x(this,void 0,void 0,(function(){var n=this;return F(this,(function(o){return E("targetId",e,v.STRING,!0)&&Qt(t)?[2,Ze((function(o,r){return x(n,void 0,void 0,(function(){var n,a;return F(this,(function(s){switch(s.label){case 0:return n="id:".concat(e),r.debug(R.O,"set chatroom entry->".concat(n)),[4,o.setChatroomEntry(e,t)];case 1:return(a=s.sent())!==i.SUCCESS?(r.warn(R.O,"set chatroom entry fail ->code+:".concat(rt[a],",").concat(n)),[2,{code:a,msg:rt[a]}]):[2,{code:a}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function sn(e,t){return x(this,void 0,void 0,(function(){var n=this;return F(this,(function(o){return E("targetId",e,v.STRING,!0)&&Xt(t)?t.entries.length>10?[2,ot.CHATROOM_KV_STORE_OUT_LIMIT]:[2,Ze((function(o,r){return x(n,void 0,void 0,(function(){var n,a,s,c;return F(this,(function(u){switch(u.label){case 0:return n="id:".concat(e),r.debug(R.O,"set chatroom entry->".concat(n)),[4,o.setChatroomEntries(e,t)];case 1:return a=u.sent(),s=a.code,c=a.data,s!==i.SUCCESS?(r.warn(R.O,"set chatroom entry fail ->code+:".concat(rt[s],",").concat(n)),[2,{code:s,msg:rt[s],data:c}]):[2,{code:s}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function cn(e,t){return x(this,void 0,void 0,(function(){var n=this;return F(this,(function(o){return E("targetId",e,v.STRING,!0)&&Qt(t)?[2,Ze((function(o,r){return x(n,void 0,void 0,(function(){var n,a;return F(this,(function(s){switch(s.label){case 0:return n="id:".concat(e),r.debug(R.O,"force set chatroom entry ->".concat(n)),[4,o.forceSetChatroomEntry(e,t)];case 1:return(a=s.sent())!==i.SUCCESS?(r.warn(R.O,"force set chatroom entry fail ->code+:".concat(rt[a],",").concat(n)),[2,{code:a,msg:rt[a]}]):[2,{code:a}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function un(e,t){return x(this,void 0,void 0,(function(){var n=this;return F(this,(function(o){return E("targetId",e,v.STRING,!0)&&$t(t)?[2,Ze((function(o,r){return x(n,void 0,void 0,(function(){var n,a;return F(this,(function(s){switch(s.label){case 0:return n="id:".concat(e),r.debug(R.O,"remove chatroom entry->".concat(n)),[4,o.removeChatroomEntry(e,t)];case 1:return(a=s.sent())!==i.SUCCESS?(r.warn(R.O,"remove chatroom entry fail ->code+:".concat(rt[a],",").concat(n)),[2,{code:a,msg:rt[a]}]):[2,{code:a}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function dn(e,t){return x(this,void 0,void 0,(function(){var n=this;return F(this,(function(o){return E("targetId",e,v.STRING,!0)&&en(t)?[2,Ze((function(o,r){return x(n,void 0,void 0,(function(){var n,a,s,c,u;return F(this,(function(d){switch(d.label){case 0:return n="id:".concat(e),r.info(R.O,"remove chatroom entry->".concat(n)),(a=k({},t)).entries=t.entries.map((function(e){return{key:e}})),[4,o.removeChatroomEntries(e,a)];case 1:return s=d.sent(),c=s.code,u=s.data,c!==i.SUCCESS?(r.warn(R.O,"remove chatroom entry fail ->code+:".concat(rt[c],",").concat(n)),[2,{code:c,msg:rt[c],data:u}]):[2,{code:c}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function ln(e,t){return x(this,void 0,void 0,(function(){var n=this;return F(this,(function(o){return E("targetId",e,v.STRING,!0)&&$t(t)?[2,Ze((function(o,r){return x(n,void 0,void 0,(function(){var n,a;return F(this,(function(s){switch(s.label){case 0:return n="id:".concat(e),r.info(R.O,"force remove chatroom entry ->".concat(n)),[4,o.forceRemoveChatroomEntry(e,t)];case 1:return(a=s.sent())!==i.SUCCESS?(r.warn(R.O,"force remove chatroom entry fail ->code+:".concat(rt[a],",").concat(n)),[2,{code:a,msg:rt[a]}]):[2,{code:a}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function fn(e,t){return x(this,void 0,void 0,(function(){var n=this;return F(this,(function(o){return E("targetId",e,v.STRING,!0)&&E("key",t,(function(e){return _(e)&&/[\w+=-]+/.test(e)&&e.length<=128}),!0)?[2,Ze((function(o,r){return x(n,void 0,void 0,(function(){var n,a,s,c;return F(this,(function(u){switch(u.label){case 0:return n="id:".concat(e),r.debug(R.O,"get chatroom entry->".concat(n)),[4,o.getChatroomEntry(e,t)];case 1:return a=u.sent(),s=a.code,c=a.data,s===i.SUCCESS&&c?[2,{code:s,data:c}]:(r.warn(R.O,"get chatroom entry fail ->code+:".concat(rt[s],",").concat(n)),[2,{code:s,msg:rt[s]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function vn(e){return x(this,void 0,void 0,(function(){var t=this;return F(this,(function(n){return E("targetId",e,v.STRING,!0)?[2,Ze((function(n,o){return x(t,void 0,void 0,(function(){var t,r,a,s;return F(this,(function(c){switch(c.label){case 0:return t="id:".concat(e),o.debug(R.O,"get all chatroom entries->".concat(t)),[4,n.getAllChatroomEntries(e)];case 1:return r=c.sent(),a=r.code,s=r.data,a===i.SUCCESS&&s?[2,{code:a,data:s}]:(o.warn(R.O,"get all chatroom entries fail ->code+:".concat(rt[a],",").concat(t)),[2,{code:a,msg:rt[a]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function gn(e,t){return x(this,void 0,void 0,(function(){var n=this;return F(this,(function(o){return E("targetId",e,v.STRING,!0)&&E("options.timestamp",t.timestamp,v.NUMBER)&&E("options.count",t.count,v.NUMBER)&&E("options.count",t.count,(function(e){var t=e>0&&e<=100;return t||null===console||void 0===console||console.error('"options.count" is invalid, It should be greater than 0 and less than 100'),t}))&&E("options.order",t.order,(function(e){return 0===e||1===e}))?[2,Ze((function(o,r){return x(n,void 0,void 0,(function(){var n,a,s,c,u;return F(this,(function(d){switch(d.label){case 0:return n="id:".concat(e),r.debug(R.O,"get chatroom history message->".concat(n)),[4,o.getChatRoomHistoryMessages(e,t.count,t.order,t.timestamp)];case 1:return a=d.sent(),s=a.code,c=a.data,s===i.SUCCESS&&c?(u=c.list.map((function(e){return Pe(e)})),[2,{code:s,data:{list:u,hasMore:!!c.hasMore}}]):(r.warn(R.O,"get chatroom history message fail ->code+:".concat(rt[s],",").concat(n)),[2,{code:s,msg:rt[s]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function In(e){return x(this,void 0,void 0,(function(){var t=this;return F(this,(function(n){return E("option.chatRoomId",e.chatRoomId,v.STRING,!0)&&E("option.rtcRoomId",e.rtcRoomId,v.STRING,!0)?[2,Ze((function(n){return x(t,void 0,void 0,(function(){var t;return F(this,(function(o){switch(o.label){case 0:return[4,n.bindRTCRoomForChatroom(e)];case 1:return[2,{code:t=o.sent(),msg:rt[t]}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function hn(e){return x(this,void 0,void 0,(function(){var t=this;return F(this,(function(n){return E("userId",e,v.STRING,!0)?[2,Ze((function(n,o){return x(t,void 0,void 0,(function(){return F(this,(function(t){switch(t.label){case 0:return o.info(R.O,"addToBlacklist -> userId: ".concat(e)),[4,n.addToBlacklist(e)];case 1:return[2,{code:t.sent()}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Rn(e){return x(this,void 0,void 0,(function(){var t=this;return F(this,(function(n){return E("userId",e,v.STRING,!0)?[2,Ze((function(n,o){return x(t,void 0,void 0,(function(){return F(this,(function(t){switch(t.label){case 0:return o.info(R.O,"removeFromBlacklist -> userId: ".concat(e)),[4,n.removeFromBlacklist(e)];case 1:return[2,{code:t.sent()}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function mn(){return x(this,void 0,void 0,(function(){var e=this;return F(this,(function(t){return[2,Ze((function(t,n){return x(e,void 0,void 0,(function(){var e,o,r;return F(this,(function(a){switch(a.label){case 0:return n.info(R.O,"getBlacklist -> "),[4,t.getBlacklist()];case 1:return e=a.sent(),o=e.code,r=e.data,o===i.SUCCESS&&r?[2,{code:o,data:r}]:(n.warn(R.O,"getBlacklist fail -> code: ".concat(o)),[2,{code:o}])}}))}))}))]}))}))}function En(e){return x(this,void 0,void 0,(function(){var t=this;return F(this,(function(n){return E("userId",e,v.STRING,!0)?[2,Ze((function(n,o){return x(t,void 0,void 0,(function(){var t,r,a;return F(this,(function(s){switch(s.label){case 0:return o.info(R.O,"getBlacklistStatus -> userId: ".concat(e)),[4,n.getBlacklistStatus(e)];case 1:return t=s.sent(),r=t.code,a=t.data,r===i.SUCCESS?[2,{code:r,data:0===a}]:(o.warn(R.O,"getBlacklistStatus fail -> code: ".concat(r,", userId: ").concat(e)),[2,{code:r}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}var Sn=function(e,t,n,o){void 0===n&&(n=!0),void 0===o&&(o=!0),this.messageType=e,this.content=t,this.isPersited=n,this.isCounted=o};function Tn(e,t,n){void 0===t&&(t=!0),void 0===n&&(n=!0);return function(o){return new Sn(e,o,t,n)}}var pn,On=Tn("RC:ImgMsg"),Nn=Tn("RC:HQVCMsg"),_n=Tn("RC:SightMsg"),Cn=Tn("RC:TxtMsg"),An=Tn("RC:CombineMsg"),Un=Tn("RC:FileMsg"),yn=Tn("RC:GIFMsg"),Mn=Tn("RC:VcMsg"),Pn=Tn("RC:LBSMsg"),Ln=Tn("RC:ReferenceMsg"),wn=Tn("RC:ImgTextMsg"),Bn=Tn("RC:CmdMsg"),Dn=Tn("RC:InfoNtf"),bn=Tn("RC:GrpNtf");!function(e){e.ALIYUN="aliyun",e.S3="s3",e.STC="stc",e.MINIO="minio",e.QINIU="qiniu",e.BAIDU="baidu",e.RCX="rcx"}(pn||(pn={}));var Gn,Vn=function(){function e(e,t,n){this.isSupportMultipart=!1,this._serverType=0,this._url=e,this._getFileToken=t,this._serverType=n}return e.prototype.upload=function(e){return e.file.size>C?Promise.resolve({code:i.UPLOAD_FAIL,msg:"the file size is over 5GB!"}):e.file.size>A&&this.isSupportMultipart?this.multipartUpload(e):this.commonUpload(e)},e}(),kn=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return V(n,t),n.prototype.commonUpload=function(t){return x(this,void 0,void 0,(function(){var n,o,r,a,s,c,u;return F(this,(function(d){switch(d.label){case 0:return n=t.file,o=t.onProgress,r=t.fileType,[4,this._getFileToken(r,n.name)];case 1:return a=d.sent(),s={},(c=new FormData).set("token",a.token),c.set("key",a.fileName),c.set("file",n),[4,e({url:y(this._url),headers:s,onProgress:function(e){return null==o?void 0:o(e.loaded,e.total)},method:"POST",body:c,timeout:0})];case 2:return 200===(u=d.sent().status)||204===u?[2,{code:i.SUCCESS,data:{uniqueName:a.fileName,uploadMethod:U.QINIU}}]:[2,{code:i.UPLOAD_FAIL,msg:u.toString()}]}}))}))},n.prototype.multipartUpload=function(e){return x(this,void 0,void 0,(function(){return F(this,(function(e){throw new Error("Method not implemented.")}))}))},n}(Vn),xn=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return V(n,t),n.prototype.commonUpload=function(t){return x(this,void 0,void 0,(function(){var n,o,r,a,s,c,u;return F(this,(function(d){switch(d.label){case 0:return n=t.file,o=t.onProgress,r=t.fileType,[4,this._getFileToken(r)];case 1:return a=d.sent(),s=y("".concat(a.ossBucketName,".").concat(this._url)),(c=new FormData).set("token",a.token),c.set("OSSAccessKeyId",a.osskeyId),c.set("policy",a.ossPolicy),c.set("Signature",a.ossSign),c.set("success_action_status","200"),c.set("key",a.fileName),c.set("file",n),[4,e({url:s,onProgress:function(e){return null==o?void 0:o(e.loaded,e.total)},method:"POST",body:c,timeout:0})];case 2:return 200===(u=d.sent().status)||204===u?[2,{code:i.SUCCESS,data:{uniqueName:a.fileName,uploadMethod:U.ALI}}]:[2,{code:i.UPLOAD_FAIL,msg:u.toString()}]}}))}))},n.prototype.multipartUpload=function(e){throw new Error("Method not implemented.")},n}(Vn),Fn=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return V(n,t),n.prototype.commonUpload=function(t){return x(this,void 0,void 0,(function(){var n,o,r,a,s,c,u,d,l;return F(this,(function(f){switch(f.label){case 0:return n=t.file,o=t.onProgress,r=t.fileType,a=t.contentDisposition,[4,this._getFileToken(r<=M.FILE?r:M.FILE)];case 1:return s=f.sent(),c=a||("text/html"===n.type?"inline":"attachment"),u={authorization:s.bosToken,"x-bce-date":s.bosDate,"Content-Disposition":"".concat(c,"; filename=").concat(encodeURIComponent(n.name),";")},d=y("".concat(this._url).concat(s.path)),[4,e({url:d,headers:u,onProgress:function(e){return null==o?void 0:o(e.loaded,e.total)},method:"POST",body:n,timeout:0})];case 2:return 200===(l=f.sent().status)||204===l?[2,{code:i.SUCCESS,data:{uniqueName:s.fileName,downloadUrl:d}}]:[2,{code:i.UPLOAD_FAIL,msg:l.toString()}]}}))}))},n.prototype.multipartUpload=function(e){throw new Error("Method not implemented.")},n}(Vn),Zn=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return V(n,t),n.prototype.commonUpload=function(t){return x(this,void 0,void 0,(function(){var n,o,r,a,s,c,u,d,l,f;return F(this,(function(v){switch(v.label){case 0:return n=t.file,o=t.onProgress,r=t.fileType,a=t.contentDisposition,[4,this._getFileToken(r,n.name)];case 1:return s=v.sent(),c={},u=y("".concat(s.s3BucketName,".").concat(this._url)),d=new FormData,a?d.set("Content-Disposition",a):d.set("Content-Disposition","text/html"===n.type?"inline;":"attachment;"),d.set("Content-Type",n.type),d.set("x-amz-credential",s.s3Credential),d.set("x-amz-algorithm",s.s3Algorithm),d.set("x-amz-date",s.s3Date),d.set("policy",s.s3Policy),d.set("x-amz-signature",s.s3Signature),d.set("key",s.fileName),d.set("file",n),[4,e({url:u,headers:c,onProgress:function(e){return null==o?void 0:o(e.loaded,e.total)},method:"POST",body:d,timeout:0})];case 2:return l=v.sent(),f=l.status,l.data,200===f||204===f?[2,{code:i.SUCCESS,data:{uniqueName:s.fileName,uploadMethod:U.AWS}}]:[2,{code:i.UPLOAD_FAIL,msg:f.toString()}]}}))}))},n.prototype.multipartUpload=function(e){throw new Error("Method not implemented.")},n}(Vn),Hn=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.isSupportMultipart=!0,e}return V(n,t),n.prototype.commonUpload=function(t){return x(this,void 0,void 0,(function(){var n,o,r,a,s,c,u;return F(this,(function(d){switch(d.label){case 0:return n=t.file,o=t.onProgress,r=t.fileType,[4,this._getFileToken(r)];case 1:return a=d.sent(),s=y("".concat(this._url,"/").concat(a.stcBucketName,"/").concat(a.fileName)),c=this.getBaseHeaders(n,a,t),[4,e({url:s,headers:c,onProgress:function(e){return null==o?void 0:o(e.loaded,e.total)},method:"PUT",body:n,timeout:0})];case 2:return 200===(u=d.sent().status)||204===u?[2,{code:i.SUCCESS,data:{uniqueName:a.fileName,uploadMethod:U.STC}}]:[2,{code:i.UPLOAD_FAIL}]}}))}))},n.prototype.multipartUpload=function(t){var n;return x(this,void 0,void 0,(function(){var o,r,a,s,c,u,d,l,f,v,g,I,h,R,m,E,S;return F(this,(function(T){switch(T.label){case 0:return o=t.file,t.onProgress,r=t.fileType,[4,this._getFileToken(r,o.name,"POST","uploads")];case 1:return a=T.sent(),s=y("".concat(this._url,"/").concat(a.stcBucketName,"/").concat(a.fileName)),c=this.getBaseHeaders(o,a,t),[4,e({url:"".concat(s,"?uploads"),headers:c,method:"POST"})];case 2:return u=T.sent(),d=u.status,l=u.data,f=null===(n=null==l?void 0:l.match(/(?:<UploadId>)(\S*?)(?:<\/UploadId>)/))||void 0===n?void 0:n[1],200!==d&&204!==d||!f?[2,{code:i.UPLOAD_FAIL,msg:"start upload fail"}]:(v=[],[4,this.requestUploadPart(s,o,f,a.fileName,t,v)]);case 3:return g=T.sent(),I=g.code,h=g.msg,I!==i.SUCCESS?[2,{code:I,msg:h}]:[4,this._getFileToken(r,a.fileName,"POST","uploadId=".concat(f))];case 4:return R=T.sent(),m=v.map((function(e,t){return"<Part><PartNumber>".concat(t+1,"</PartNumber><ETag>").concat(e,"</ETag></Part>")})).join(""),m="<CompleteMultipartUpload xmlns='http://s3.amazonaws.com/doc/2006-03-01/'>".concat(m,"</CompleteMultipartUpload>"),E=this.getBaseHeaders(o,R,t),[4,e({url:"".concat(s,"?uploadId=").concat(f),headers:E,method:"POST",body:m})];case 5:return 200===(S=T.sent().status)||204===S?[2,{code:i.SUCCESS,data:{uniqueName:a.fileName,uploadMethod:U.STC}}]:[2,{code:i.UPLOAD_FAIL,msg:"end upload fail"}]}}))}))},n.prototype.requestUploadPart=function(t,n,o,r,a,s,c,u){return void 0===c&&(c=1),void 0===u&&(u=0),x(this,void 0,void 0,(function(){var d,l,f,v,g,I,h,R,m;return F(this,(function(E){switch(E.label){case 0:return u>=5?[2,{code:i.UPLOAD_FAIL,msg:"Upload retry times exceeded 5. Procedure"}]:(d=(c-1)*A,l=Math.min(A,n.size-d),f="partNumber=".concat(c,"&uploadId=").concat(o),[4,this._getFileToken(a.fileType,r,"PUT",f)]);case 1:return v=E.sent(),g=n.slice(d,c*A),I=this.getBaseHeaders(n,v,a),[4,e({url:"".concat(t,"?").concat(f),headers:I,method:"PUT",body:g,onProgress:function(e){var t;return null===(t=null==a?void 0:a.onProgress)||void 0===t?void 0:t.call(a,d+e.loaded,n.size)},timeout:0})];case 2:return h=E.sent(),R=h.status,h.data,m=h.xhr,200===R||204===R?(s.push((null==m?void 0:m.getResponseHeader("ETag"))||""),d+l<n.size?[2,this.requestUploadPart(t,n,o,r,a,s,c+1,0)]:[2,{code:i.SUCCESS}]):[2,this.requestUploadPart(t,n,o,r,a,s,c,u+1)]}}))}))},n.prototype.getBaseHeaders=function(e,t,n){var o=n.contentDisposition||("text/html"===e.type?"inline":"attachment");return{"Content-Disposition":"".concat(o,"; filename=").concat(encodeURIComponent(e.name),";"),Authorization:t.stcAuthorization,"x-amz-content-sha256":t.stcContentSha256,"x-amz-date":t.stcDate,"Content-Type":e.type||"text/plain"}},n}(Vn),Jn=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.isSupportMultipart=!0,e}return V(n,t),n.prototype.commonUpload=function(t){return x(this,void 0,void 0,(function(){var n,o,r,a,s,c,u;return F(this,(function(d){switch(d.label){case 0:return n=t.file,o=t.onProgress,r=t.fileType,[4,this._getFileToken(r)];case 1:return a=d.sent(),s=y("".concat(this._url,"/").concat(a.minioBucketName,"/").concat(a.fileName)),c=this.getBaseHeaders(n,a,t),[4,e({url:s,headers:c,onProgress:function(e){return null==o?void 0:o(e.loaded,e.total)},method:"PUT",body:n,timeout:0})];case 2:return 200===(u=d.sent().status)||204===u?[2,{code:i.SUCCESS,data:{uniqueName:a.fileName,uploadMethod:U.MINIO}}]:[2,{code:i.UPLOAD_FAIL,msg:u.toString()}]}}))}))},n.prototype.multipartUpload=function(t){var n;return x(this,void 0,void 0,(function(){var o,r,a,s,c,u,d,l,f,v,g,I,h,R,m,E,S;return F(this,(function(T){switch(T.label){case 0:return o=t.file,r=t.fileType,[4,this._getFileToken(r,o.name,"POST","uploads")];case 1:return a=T.sent(),s=y("".concat(this._url,"/").concat(a.minioBucketName,"/").concat(a.fileName)),c=this.getBaseHeaders(o,a,t),[4,e({url:"".concat(s,"?uploads"),headers:c,method:"POST"})];case 2:return u=T.sent(),d=u.status,l=u.data,f=null===(n=null==l?void 0:l.match(/(?:<UploadId>)(\S*?)(?:<\/UploadId>)/))||void 0===n?void 0:n[1],200!==d&&204!==d||!f?[2,{code:i.UPLOAD_FAIL,msg:"start upload fail"}]:(v=[],[4,this.requestUploadPart(s,o,f,a.fileName,t,v)]);case 3:return g=T.sent(),I=g.code,h=g.msg,I!==i.SUCCESS?[2,{code:I,msg:h}]:[4,this._getFileToken(r,a.fileName,"POST","uploadId=".concat(f))];case 4:return R=T.sent(),m=v.map((function(e,t){return"<Part><PartNumber>".concat(t+1,"</PartNumber><ETag>").concat(e,"</ETag></Part>")})).join(""),m="<CompleteMultipartUpload xmlns='http://s3.amazonaws.com/doc/2006-03-01/'>".concat(m,"</CompleteMultipartUpload>"),E=this.getBaseHeaders(o,R,t),[4,e({url:"".concat(s,"?uploadId=").concat(f),headers:E,method:"POST",body:m,timeout:0})];case 5:return 200===(S=T.sent().status)||204===S?[2,{code:i.SUCCESS,data:{uniqueName:a.fileName,uploadMethod:U.MINIO}}]:[2,{code:i.UPLOAD_FAIL,msg:"end upload fail"}]}}))}))},n.prototype.requestUploadPart=function(t,n,o,r,a,s,c,u){return void 0===c&&(c=1),void 0===u&&(u=0),x(this,void 0,void 0,(function(){var d,l,f,v,g,I,h,R,m;return F(this,(function(E){switch(E.label){case 0:return u>=5?[2,{code:i.UPLOAD_FAIL,msg:"Upload retry times exceeded 5. Procedure"}]:(d=(c-1)*A,l=Math.min(A,n.size-d),f="partNumber=".concat(c,"&uploadId=").concat(o),[4,this._getFileToken(a.fileType,r,"PUT",f)]);case 1:return v=E.sent(),g=n.slice(d,c*A),I=this.getBaseHeaders(n,v,a),[4,e({url:"".concat(t,"?").concat(f),headers:I,method:"PUT",body:g,timeout:0,onProgress:function(e){var t;return null===(t=null==a?void 0:a.onProgress)||void 0===t?void 0:t.call(a,d+e.loaded,n.size)}})];case 2:return h=E.sent(),R=h.status,m=h.xhr,200===R||204===R?(s.push((null==m?void 0:m.getResponseHeader("ETag"))||""),d+l<n.size?[2,this.requestUploadPart(t,n,o,r,a,s,c+1,0)]:[2,{code:i.SUCCESS}]):[2,this.requestUploadPart(t,n,o,r,a,s,c,u+1)]}}))}))},n.prototype.getBaseHeaders=function(e,t,n){var o=n.contentDisposition||("text/html"===e.type?"inline":"attachment");return{"Content-Disposition":"".concat(o,"; filename=").concat(encodeURIComponent(e.name),";"),Authorization:t.minioAuthorization,"x-amz-content-sha256":t.minioContentSha256,"x-amz-date":t.minioDate,"Content-Type":e.type||"text/plain"}},n}(Vn),qn=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.isSupportMultipart=!0,e}return V(n,t),n.prototype.commonUpload=function(t){return x(this,void 0,void 0,(function(){var n,o,r,a,s,c,u,d,l,f,v;return F(this,(function(g){switch(g.label){case 0:return n=t.file,o=t.onProgress,r=t.fileType,[4,this._getFileToken(r,n.name)];case 1:return a=g.sent(),s={},(c=new FormData).set("token",a.token),c.set("key",a.fileName),c.set("file",n),u=y(this._url),[4,e({url:u,headers:s,onProgress:function(e){return null==o?void 0:o(e.loaded,e.total)},method:"POST",body:c,timeout:0})];case 2:return d=g.sent(),l=d.status,f=d.data,200!==l&&204!==l||!f?[2,{code:i.UPLOAD_FAIL,msg:l.toString()}]:(v=JSON.parse(f),[2,{code:i.SUCCESS,data:{uniqueName:v.rc_url.file_name,downloadUrl:"".concat(u,"/").concat(v.rc_url.path)}}])}}))}))},n.prototype.multipartUpload=function(e){return x(this,void 0,void 0,(function(){var t,n,o,r,i;return F(this,(function(a){switch(a.label){case 0:return t=e.file,n=e.onProgress,o=e.fileType,r=P(),[4,this._getFileToken(o,t.name)];case 1:return i=a.sent().token,[2,this._requestUploadPart(r,t,i,n)]}}))}))},n.prototype._requestUploadPart=function(t,n,o,r,a){return void 0===a&&(a=0),x(this,void 0,void 0,(function(){var s,c,u,d,l,f,v,g,I,h;return F(this,(function(R){switch(R.label){case 0:return s=Math.min(A,n.size-a),c=t+n.name.substring(n.name.lastIndexOf(".")),u={Range:"bytes=".concat(a,"-").concat(a+s),"X-File-TransactionId":c,"X-File-Total-Size":n.size.toString()},d=n.slice(a,a+s),(l=new FormData).set("file",d,n.name),l.set("key",c),l.set("name",c),l.set("token",o),f=y(this._url),[4,e({url:f,headers:u,onProgress:function(e){return null==r?void 0:r(a+e.loaded,n.size)},method:"POST",body:l,timeout:0})];case 1:return v=R.sent(),g=v.status,I=v.data,200===g||204===g?a+s<n.size?[2,this._requestUploadPart(t,n,o,r,a+s)]:(h=JSON.parse(I),[2,{code:i.SUCCESS,data:{uniqueName:h.rc_url.file_name,downloadUrl:"".concat(f,"/").concat(h.rc_url.path)}}]):[2,{code:i.UPLOAD_FAIL,msg:g.toString()}]}}))}))},n}(Vn);function Kn(e,t){return x(this,void 0,void 0,(function(){var n,o,r,a,s,c,u,d,l,f,v,g,I,h,R,m;return F(this,(function(E){switch(E.label){case 0:return n=t.getFileToken,o=t.serverType,r=t.customDomain,a=t.ossConfig,s=t.uploadServer,c=t.bosAddr,u=e.file,d=e.fileType,l=e.thumbnailConfig,f=function(e,t,n,o,r){if(n)return[{type:pn.RCX,url:n,p:"1"}];if(e){return JSON.parse(e).map((function(e){var t={type:pn.QINIU,url:"",p:""};return Object.keys(e).forEach((function(n){"p"===n?t.p=e[n]:(t.type=n,t.url=e[n])})),t})).sort((function(e,t){return e.p-t.p}))}var i=[];o&&i.push({type:pn.QINIU,url:o,p:"1"});r&&i.push({type:pn.BAIDU,url:r,p:"2"});return i}(a,0,r,s,c),0===f.length?[2,Promise.resolve({code:i.BIZ_ERROR_INVALID_PARAMETER,msg:"uploadUrlList is empty"})]:[4,Wn(f,e,n,o)];case 1:return v=E.sent(),g=v.code,I=v.data,h=v.msg,g===i.SUCCESS&&I?[4,Yn(e,t,I)]:[2,{code:g,msg:h}];case 2:return R=E.sent(),m={downloadUrl:R,uniqueName:(null==I?void 0:I.uniqueName)||"",name:u.name,size:u.size,type:u.type},d!==M.AUDIO?[3,4]:[4,u.arrayBuffer()];case 3:return[2,zn(E.sent(),m)];case 4:return d===M.IMAGE?[2,Qn(u,m,l)]:[2,{code:g,data:m}]}}))}))}function Yn(e,t,n){return x(this,void 0,void 0,(function(){var o,r,i,a,s,c,u;return F(this,(function(d){switch(d.label){case 0:return o=t.getFileUrl,r=e.fileType,i=e.file,a=n.uploadMethod,s=n.downloadUrl,c=n.uniqueName,(u=s)?[3,2]:[4,o(r,c,i.name,void 0,a)];case 1:u=d.sent().downloadUrl,d.label=2;case 2:return[2,u]}}))}))}function zn(e,t){var n=new AudioContext;return new Promise((function(o,r){n.decodeAudioData(e,(function(e){o({code:i.SUCCESS,data:k(k({},t),{duration:e.duration,length:e.length})})}),(function(e){o({code:i.UPLOAD_FAIL,msg:"get audio info fail:".concat(JSON.stringify(e))})}))}))}var jn=((Gn={})[pn.QINIU]=kn,Gn[pn.ALIYUN]=xn,Gn[pn.BAIDU]=Fn,Gn[pn.S3]=Zn,Gn[pn.STC]=Hn,Gn[pn.MINIO]=Jn,Gn[pn.RCX]=qn,Gn);function Wn(e,t,n,o,r){return void 0===r&&(r=[]),x(this,void 0,void 0,(function(){var a,s,c,u,d;return F(this,(function(l){switch(l.label){case 0:return 0===e.length?[2,Promise.resolve({code:i.UPLOAD_FAIL,msg:"Failed to upload all channels, msg: ".concat(JSON.stringify(r))})]:(a=e.shift(),[4,new jn[a.type](a.url,n,o).upload(t)]);case 1:return s=l.sent(),c=s.code,u=s.data,d=s.msg,c!==i.SUCCESS?(r.push({type:a.type,url:a.url,code:c,msg:d}),[2,Wn(e,t,n,o,r)]):[2,{code:c,data:u}]}}))}))}function Qn(e,t,n){return new Promise((function(o,r){var a=document.createElement("canvas"),s=a.getContext("2d"),c=new Image;c.onload=function(r){var u=n||{},d=u.maxHeight,l=void 0===d?160:d,f=u.maxWidth,v=void 0===f?160:f,g=u.quality,I=void 0===g?.7:g,h=u.scale,R=void 0===h?1:h,m=Xn(c.width,c.height,{maxHeight:l,maxWidth:v,scale:R});a.width=Math.min(m.w,v),a.height=Math.min(m.h,l),s.drawImage(c,m.x,m.y,m.w,m.h);var E=a.toDataURL("string"==typeof e?"image/jpg":e.type,I);E=E.replace(/data:image\/[^;]+;base64,/,""),o({code:i.SUCCESS,data:k(k({},t),{thumbnail:E,width:m.w,height:m.h})})},c.onerror=function(e){o({code:i.UPLOAD_FAIL,msg:"get image info fail:".concat(JSON.stringify(e))})},c.src=(window.URL||window.webkitURL).createObjectURL(e)}))}var Xn=function(e,t,n){var o,r,i=n.maxHeight,a=void 0===i?160:i,s=n.maxWidth,c=void 0===s?160:s,u=n.scale,d=e<t,l=0,f=0;return(d?t/e:e/t)>(void 0===u?1:u)?(d?(o=100,f=((r=t/(e/100))-a)/2):(r=100,l=((o=e/(t/100))-c)/2),{w:o,h:r,x:-l,y:-f}):(d?(r=a,o=e/(t/a)):(o=c,r=t/(e/c)),{w:o,h:r,x:-l,y:-f})};function $n(e){return x(this,void 0,void 0,(function(){var t,n,o;return F(this,(function(r){return t=e.contentDisposition,n=e.fileType,o=e.file,E("contentDisposition",t,(function(e){return"inline"===e||"attachment"===e}),!1)&&E("fileType",n,(function(e){return!!M[e]}),!0)&&E("file",o,(function(e){return e instanceof File&&(!(n===M.IMAGE&&!e.type.match(/^image\//))&&!(n===M.AUDIO&&!e.type.match(/^audio\//)))}),!0)?[2,Ze((function(t,n,o){return new Promise((function(n){var r=t.getNaviInfoFromCache();Kn(e,{getFileToken:t.getFileToken.bind(t),getFileUrl:t.getFileUrl.bind(t),customDomain:o.uploadDomain||"",serverType:null==r?void 0:r.type,ossConfig:null==r?void 0:r.ossConfig,uploadServer:null==r?void 0:r.uploadServer,bosAddr:null==r?void 0:r.bosAddr}).then((function(e){n(e)}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function eo(e,t,n,o){return Ze((function(r){return new Promise((function(a){r.getFileToken(e,t,n,o).then((function(e){a({code:i.SUCCESS,data:e})})).catch((function(e){a({code:e,msg:rt[e]})}))}))}))}function to(e){return E("url",e,v.STRING,!0)?Ze((function(t){return new Promise((function(n){t.getFileToken(1,void 0,void 0,void 0,e).then((function(e){var t=e.token,o=e.downloadAuthInfo,r=e.deadline;n({code:i.SUCCESS,data:{token:t,downloadAuthInfo:o,deadline:r}})})).catch((function(e){n({code:e,msg:rt[e]})}))}))})):Promise.resolve({code:i.BIZ_ERROR_INVALID_PARAMETER})}function no(e,t,n,o,r){return E("fileType",e,L,!0)&&E("filename",t,v.STRING)&&E("saveName",n,v.STRING)&&E("serverType",r,v.NUMBER)?Ze((function(a){return new Promise((function(s){a.getFileUrl(e,t,n,o,r).then((function(e){s({code:i.SUCCESS,data:e})})).catch((function(e){s({code:e})}))}))})):Promise.resolve({code:i.BIZ_ERROR_INVALID_PARAMETER})}function oo(e,t,n){return x(this,void 0,void 0,(function(){var o=this;return F(this,(function(r){return[2,Ze((function(r,c){return x(o,void 0,void 0,(function(){var o,u,d,l,f,g,I,h,m,S,T,p;return F(this,(function(O){switch(O.label){case 0:return n=n||{},t instanceof Sn==!1?(c.warn(R.O,"send message fail -> message parameter is not an instance of BaseMessage"),[2,ot.ILLGAL_PARAMS]):E("conversation",e,v.OBJECT,!0)?(o=e.conversationType,u=e.targetId,d=e.channelId,E("conversation.targetId",u,v.STRING,!0)&&E("conversation.conversationType",o,v.NUMBER,!0)&&E("conversation.channelId",d,v.CHANNEL_ID)&&E("options.isStatusMessage",null==n?void 0:n.isStatusMessage,v.BOOLEAN)&&E("options.disableNotification",null==n?void 0:n.disableNotification,v.BOOLEAN)&&E("options.pushContent",null==n?void 0:n.pushContent,v.STRING)&&E("options.pushData",null==n?void 0:n.pushData,v.STRING)&&E("options.isMentioned",null==n?void 0:n.isMentioned,v.BOOLEAN)&&E("options.mentionedType",null==n?void 0:n.mentionedType,v.NUMBER)&&E("options.mentionedUserIdList",null==n?void 0:n.mentionedUserIdList,v.ARRAY)&&E("options.directionalUserIdList",null==n?void 0:n.directionalUserIdList,v.ARRAY)&&E("options.isVoipPush",null==n?void 0:n.isVoipPush,v.BOOLEAN)&&E("options.canIncludeExpansion",null==n?void 0:n.canIncludeExpansion,v.BOOLEAN)&&E("options.expansion",null==n?void 0:n.expansion,v.OBJECT)&&E("options.pushConfig",null==n?void 0:n.pushConfig,v.OBJECT)&&E("options.messageId",null==n?void 0:n.messageId,v.NUMBER)?(l="conversationType:".concat(o,",targetId:").concat(u),c.debug(R.O,"send message ->".concat(l)),f=function(e,t,n){var o=e.isStatusMessage,r=e.disableNotification,i=e.pushContent,a=e.pushData,s=e.isMentioned,c=e.mentionedType,u=e.mentionedUserIdList,d=e.directionalUserIdList,l=e.isVoipPush,f=e.canIncludeExpansion,v=e.expansion,g=e.isFilerWhiteBlacklist,I=e.pushConfig,h=e.messageId,R=n.channelId;return k({isStatusMessage:o,disableNotification:r,pushContent:i,pushData:a,isMentioned:s,mentionedType:c,mentionedUserIdList:u,directionalUserIdList:d,isVoipPush:l,canIncludeExpansion:f,expansion:v,isFilerWhiteBlacklist:g,pushConfig:I,channelId:R||"",messageId:h},t)}(n,t,e),g={isMentioned:!!n.isMentioned,content:t.content,messageType:t.messageType,isPersited:!!t.isPersited,isCounted:!!t.isCounted,disableNotification:!!(null==n?void 0:n.disableNotification),canIncludeExpansion:!!(null==n?void 0:n.canIncludeExpansion),expansion:(null==n?void 0:n.expansion)||null,conversationType:e.conversationType,targetId:e.targetId,channelId:e.channelId,senderUserId:r.getCurrentUserId(),messageUId:"",messageDirection:B.SEND,receivedTime:0,isStatusMessage:!!n.isStatusMessage,receivedStatus:a.UNREAD,isOffLineMessage:!1,pushConfig:null==n?void 0:n.pushConfig,sentStatus:D.SENDING},o!==s.ULTRA_GROUP&&(g.isOffLineMessage=!1),I=c.createTraceId(),h=function(e){g.messageId=e;try{(null==n?void 0:n.onSendBefore)&&n.onSendBefore(Pe(g))}catch(e){c.error(R.O,'Callback method "onSendBefore" execution error.\n'.concat(null==e?void 0:e.stack),I)}},c.info(R.A_SEND_MSG_T,JSON.stringify({messageType:t.messageType,conversationType:o,targetId:u,channelId:d}),I),[4,r.sendMessage(o,u,f,h,I)]):[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]):[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}];case 1:return m=O.sent(),S=m.code,T=m.data,S===i.SUCCESS?(c.info(R.A_SEND_MSG_R,JSON.stringify({code:S,messageUId:T.messageUId,messageId:T.messageId}),I),p=Pe(T),[2,{code:S,data:p}]):(c.warn(R.A_SEND_MSG_R,"send message fail ->".concat(S,":").concat(rt[S],",").concat(l)),g.sentTime=(null==T?void 0:T.sentTime)||0,g.sentStatus=null==T?void 0:T.sentStatus,[2,{code:S,msg:rt[S],data:Pe(g)}])}}))}))}))]}))}))}function ro(e,t,n){return oo(e,new Cn(t),n)}function io(e,t){return function(n,o,r,a){if(!E("sendOptions.contentDisposition",null==a?void 0:a.contentDisposition,(function(e){return["inline","attachment"].includes(e)})))return Promise.resolve({code:i.BIZ_ERROR_INVALID_PARAMETER});var s={contentDisposition:null==a?void 0:a.contentDisposition};if(a&&"thumbnailConfig"in a){var c=null==a?void 0:a.thumbnailConfig;if(!(E("sendOptions.maxHeight",null==c?void 0:c.maxHeight,v.NUMBER)&&E("sendOptions.maxWidth",null==c?void 0:c.maxWidth,v.NUMBER)&&E("sendOptions.quality",null==c?void 0:c.quality,v.NUMBER)&&E("sendOptions.scale",null==c?void 0:c.scale,v.NUMBER)))return Promise.resolve({code:i.BIZ_ERROR_INVALID_PARAMETER});s.thumbnailConfig=c}return Ze((function(c,u,d){return new Promise((function(c){var d=u.createTraceId();u.info(R.L_MEDIA_UPLOAD_T,JSON.stringify({filesize:o.file.size,type:e}),d),$n({file:o.file,fileType:e,onProgress:function(e,t){var n;null===(n=null==r?void 0:r.onProgress)||void 0===n||n.call(r,Math.floor(e/t*100))},contentDisposition:s.contentDisposition,thumbnailConfig:s.thumbnailConfig}).then((function(e){var s,l=e.code,f=e.data,v=e.msg;if(l===i.SUCCESS&&f){var g=(null===(s=null==r?void 0:r.onComplete)||void 0===s?void 0:s.call(r,k({url:f.downloadUrl},f)))||t(f,o);return u.info(R.L_MEDIA_UPLOAD_R,JSON.stringify({downurl:f.downloadUrl,code:i.SUCCESS}),d),void oo(n,g,a).then(c)}c({code:l,msg:v})}))}))}))}}var ao=io(M.FILE,(function(e,t){var n,o,r={name:e.name,size:t.file.size,type:(n=e.name,o=n.match(/\.(\w+)$/),o?o[1]:"bin"),fileUrl:e.downloadUrl};return t.user&&(r.user=t.user),t.extra&&(r.extra=t.extra),t.mentionedInfo&&(r.mentionedInfo=t.mentionedInfo),new Un(r)})),so=io(M.IMAGE,(function(e,t){var n={content:e.thumbnail,imageUri:e.downloadUrl};return t.user&&(n.user=t.user),t.extra&&(n.extra=t.extra),t.mentionedInfo&&(n.mentionedInfo=t.mentionedInfo),new On(n)})),co=io(M.IMAGE,(function(e,t){var n={gifDataSize:e.size,remoteUrl:e.downloadUrl,width:e.width,height:e.height};return t.user&&(n.user=t.user),t.extra&&(n.extra=t.extra),t.mentionedInfo&&(n.mentionedInfo=t.mentionedInfo),new yn(n)})),uo=io(M.AUDIO,(function(e,t){var n={remoteUrl:e.downloadUrl,duration:e.duration,type:e.type};return t.user&&(n.user=t.user),t.extra&&(n.extra=t.extra),t.mentionedInfo&&(n.mentionedInfo=t.mentionedInfo),new Nn(n)})),lo=io(M.SIGHT,(function(e,t){var n={sightUrl:e.downloadUrl,content:t.thumbnail,duration:t.duration,size:t.file.size||e.size,name:t.name||e.name};return t.user&&(n.user=t.user),t.extra&&(n.extra=t.extra),t.mentionedInfo&&(n.mentionedInfo=t.mentionedInfo),new _n(n)}));function fo(e,t){return x(this,void 0,void 0,(function(){var n=this;return F(this,(function(o){return E("options.timestamp",null==t?void 0:t.timestamp,v.NUMBER)&&E("options.count",null==t?void 0:t.count,v.NUMBER)&&(w()||E("options.count",null==t?void 0:t.count,(function(e){var t=e>0&&e<=100;return t||null===console||void 0===console||console.error('"options.count" is invalid, It should be greater than 0 and less than 100'),t})))&&E("options.order",null==t?void 0:t.order,(function(e){return 0===e||1===e}))&&E("conversation",e,v.CONVERSATION,!0)?[2,Ze((function(o,r){return x(n,void 0,void 0,(function(){var n,a,s,c,u;return F(this,(function(d){switch(d.label){case 0:return n=r.createTraceId(),r.info(R.A_GET_HISTORY_MSG_T,JSON.stringify({targetId:e.targetId,conversationType:e.conversationType,channelId:e.channelId,timestamp:null==t?void 0:t.timestamp,count:null==t?void 0:t.count}),n),1!==(o.getNaviInfoFromCache()||{}).repairHisMsg?[3,2]:(null==t?void 0:t.count)&&(null==t?void 0:t.count)>100?(r.warn(R.A_GET_HISTORY_MSG_R,'"options.count" is invalid, It should be greater than 0 and less than 100',n),[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]):[4,o.getMessages(e.conversationType,e.targetId,null==t?void 0:t.timestamp,null==t?void 0:t.count,null==t?void 0:t.order,null==e?void 0:e.channelId,n)];case 1:return a=d.sent(),[3,4];case 2:return[4,o.getHistoryMessage(e.conversationType,e.targetId,null==t?void 0:t.timestamp,null==t?void 0:t.count,null==t?void 0:t.order,null==e?void 0:e.channelId,"",n)];case 3:a=d.sent(),d.label=4;case 4:return s=a.code,c=a.data,s===i.SUCCESS&&c?(u=c.list.map((function(e){return Pe(e)})),r.info(R.A_GET_HISTORY_MSG_R,JSON.stringify({code:s,messageLength:u.length}),n),[2,{code:s,data:{list:u,hasMore:c.hasMore}}]):(r.warn(R.A_GET_HISTORY_MSG_R,JSON.stringify({code:s,messageUIds:""}),n),[2,{code:s,msg:rt[s]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function vo(e,t){return x(this,void 0,void 0,(function(){var n=this;return F(this,(function(o){return E("options.timestamp",null==t?void 0:t.timestamp,v.NUMBER)&&E("options.count",null==t?void 0:t.count,v.NUMBER)&&E("options.count",null==t?void 0:t.count,(function(e){var t=e>0&&e<=100;return t||null===console||void 0===console||console.error("options.count is invalid, It should be greater than 0 and less than 100"),t}))&&E("options.order",null==t?void 0:t.order,(function(e){return 0===e||1===e}))&&E("conversation",e,v.CONVERSATION,!0)?[2,Ze((function(o,r){return x(n,void 0,void 0,(function(){var n,a,s,c,u;return F(this,(function(d){switch(d.label){case 0:return n="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),r.debug(R.O,"get history message ->".concat(n)),[4,o.getRemoteHistoryMessages(e.conversationType,e.targetId,(null==t?void 0:t.timestamp)||0,(null==t?void 0:t.count)||20,(null==t?void 0:t.order)||0,e.channelId||"")];case 1:return a=d.sent(),s=a.code,c=a.data,s===i.SUCCESS&&c?(u=c.list.map((function(e){return Pe(e)})),[2,{code:s,data:{list:u,hasMore:c.hasMore}}]):(r.warn(R.O,"get history message fail ->".concat(s,":").concat(rt[s],",").concat(n)),[2,{code:s,msg:rt[s]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function go(e,t,n,o){return x(this,void 0,void 0,(function(){var r=this;return F(this,(function(a){return E("targetId",e,v.STRING,!0)&&E("messageUId",t,v.STRING,!0)&&E("timestamp",n,v.NUMBER,!0)&&E("channelId",o,v.CHANNEL_ID)?[2,Ze((function(i){return x(r,void 0,void 0,(function(){var r,i,a,c,u;return F(this,(function(d){switch(d.label){case 0:return r={targetId:e,conversationType:s.PRIVATE,channelId:o},i=new Sn("RC:ReadNtf",{messageUId:t,lastMessageSendTime:n,type:1}),[4,oo(r,i)];case 1:return a=d.sent(),c=a.code,u=a.msg,0===c?[2,{code:c}]:[2,{code:c,msg:u}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Io(e,t,n){return x(this,void 0,void 0,(function(){var o=this;return F(this,(function(r){return E("messageUId",t,v.STRING,!0)&&E("targetId",e,v.STRING,!0)&&E("channelId",n,v.CHANNEL_ID)?[2,Ze((function(r,i){return x(o,void 0,void 0,(function(){var o,r,a,c,u;return F(this,(function(d){switch(d.label){case 0:return o="messageUId:".concat(t,",targetId:").concat(e),i.debug(R.O,"send read receipt message ->".concat(o)),r=new Sn("RC:RRReqMsg",{messageUId:t}),[4,oo({targetId:e,conversationType:s.GROUP,channelId:n},r)];case 1:return a=d.sent(),c=a.code,u=a.msg,0===c?[2,{code:c}]:[2,{code:c,msg:u}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function ho(e,t,n){return x(this,void 0,void 0,(function(){return F(this,(function(e){throw new Error("This method is deprecated, please use method sendReadReceiptResponseV2.")}))}))}function Ro(e,t,n){return x(this,void 0,void 0,(function(){var o=this;return F(this,(function(r){return E("targetId",e,v.STRING,!0)&&E("messageList",t,v.OBJECT,!0)&&E("channelId",n,v.CHANNEL_ID)&&!Object.keys(t).some((function(e){return!E(e,t[e],v.ARRAY)}))?[2,Ze((function(r,a){return x(o,void 0,void 0,(function(){var o,c,u,d,l,f;return F(this,(function(v){switch(v.label){case 0:return o={targetId:e,conversationType:s.GROUP,channelId:n},u=r.getNaviInfoFromCache(),1!==(null==u?void 0:u.grpRRVer)?[3,2]:(d=[],Object.keys(t).forEach((function(e){t[e].forEach((function(e){-1===d.indexOf(e)&&d.push(e)}))})),d.length?[4,r.sendReadReceiptMessage(e,d,n)]:(a.warn(R.O,"Error in parameter messageList."),[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]));case 1:return c=v.sent(),[3,4];case 2:return l=new Sn("RC:RRRspMsg",{receiptMessageDic:t}),[4,oo(o,l)];case 3:c=v.sent(),v.label=4;case 4:return(f=c.code)===i.SUCCESS?[2,{code:f}]:(a.warn(R.O,"send read receipt message fail ->".concat(f,":").concat(rt[f])),[2,{code:f,msg:rt[f]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function mo(e,t){return x(this,void 0,void 0,(function(){var n,o,r,a;return F(this,(function(s){switch(s.label){case 0:return E("conversation",e,v.CONVERSATION,!0)&&E("lastMessageSendTime",t,v.NUMBER,!0)?(n=new Sn("RC:SRSMsg",{lastMessageSendTime:t}),[4,oo(e,n)]):[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}];case 1:return o=s.sent(),r=o.code,a=o.msg,0===r?[2,{code:r}]:[2,{code:r,msg:a}]}}))}))}function Eo(e,t){return x(this,void 0,void 0,(function(){var n=this;return F(this,(function(o){return E("conversation",e,v.CONVERSATION,!0)&&E("options.messageUId",t.messageUId,v.STRING,!0)&&E("options.sentTime",t.sentTime,v.NUMBER,!0)&&E("options.disableNotification",null==t?void 0:t.disableNotification,v.BOOLEAN)&&E("options.pushConfig",null==t?void 0:t.pushConfig,v.OBJECT)?[2,Ze((function(o,r){return x(n,void 0,void 0,(function(){var n,a,s,c,u;return F(this,(function(d){switch(d.label){case 0:return n={user:t.user,channelId:e.channelId||"",disableNotification:null==t?void 0:t.disableNotification,pushConfig:null==t?void 0:t.pushConfig,extra:t.extra,isDelete:t.isDelete},a="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId,",messageUId:").concat(t.messageUId),r.debug(R.O,"recall message ->".concat(a)),[4,o.recallMessage(e.conversationType,e.targetId,t.messageUId,t.sentTime,n)];case 1:return s=d.sent(),c=s.code,u=s.data,c===i.SUCCESS&&u?[2,{code:c,data:Pe(u)}]:c===i.SUCCESS?[2,{code:c}]:(r.warn(R.O,"recall message fail ->".concat(c,":").concat(rt[c],",").concat(a)),[2,{code:c,msg:rt[c]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function So(e,t){return x(this,void 0,void 0,(function(){var n=this;return F(this,(function(o){return E("conversation",e,v.CONVERSATION,!0)&&E("options",t,(function(e){return g(e)&&e.length}),!0)&&!t.some((function(e){return!E("options.messageUId",e.messageUId,v.STRING,!0)||!E("options.sentTime",e.sentTime,v.NUMBER,!0)||!E("options.messageDirection",e.messageDirection,(function(e){return 1===e||2===e}),!0)}))?[2,Ze((function(o,r){return x(n,void 0,void 0,(function(){var n,a;return F(this,(function(s){switch(s.label){case 0:return n="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),r.debug(R.O,"delete messages ->".concat(n)),[4,o.deleteRemoteMessage(e.conversationType,e.targetId,t,e.channelId)];case 1:return(a=s.sent())!==i.SUCCESS?(r.warn(R.O,"delete message fail ->".concat(a,":").concat(rt[a],",").concat(n)),[2,{code:a,msg:rt[a]}]):[2,{code:i.SUCCESS}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function To(e,t){return x(this,void 0,void 0,(function(){var n=this;return F(this,(function(o){return E("conversation",e,v.CONVERSATION,!0)&&E("timestamp",t,v.NUMBER,!0)?[2,Ze((function(o,r){return x(n,void 0,void 0,(function(){var n,a;return F(this,(function(s){switch(s.label){case 0:return n="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),r.debug(R.O,"clear message ->".concat(n)),[4,o.deleteRemoteMessageByTimestamp(e.conversationType,e.targetId,t,e.channelId)];case 1:return(a=s.sent())!==i.SUCCESS?(r.warn(R.O,"clear message ->".concat(a,":").concat(rt[a],",").concat(n)),[2,{code:a,msg:rt[a]}]):[2,{code:i.SUCCESS}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function po(e,t){return x(this,void 0,void 0,(function(){var n=this;return F(this,(function(o){return E("expansion",e,v.OBJECT,!0)&&E("message",t,v.OBJECT,!0)&&E("message.conversationType",t.conversationType,v.NUMBER,!0)&&E("message.targetId",t.targetId,v.STRING,!0)&&E("message.channelId",t.channelId,v.CHANNEL_ID)&&E("message.messageUId",t.messageUId,v.STRING,!0)&&E("message.expansion",t.expansion,v.OBJECT)&&E("message.canIncludeExpansion",t.canIncludeExpansion,v.BOOLEAN,!0)?[2,Ze((function(o,r){return x(n,void 0,void 0,(function(){var n,a,s,c,u,d,l,f;return F(this,(function(v){switch(v.label){case 0:return n=t.conversationType,a=t.targetId,s=t.messageUId,c=t.canIncludeExpansion,u=t.expansion,d=t.channelId,l="conversationType:".concat(n,",targetId:").concat(a,",messageUId:").concat(s),r.debug(R.O,"update message expansion ->".concat(l)),[4,o.sendExpansionMessage({conversationType:n,targetId:a,messageUId:s,expansion:e,canIncludeExpansion:c,originExpansion:u,channelId:d})];case 1:return(f=v.sent().code)!==i.SUCCESS?(r.warn(R.O,"update message expansion fail ->".concat(f,":").concat(rt[f],",").concat(l)),[2,{code:f,msg:rt[f]}]):[2,{code:f}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Oo(e,t){return x(this,void 0,void 0,(function(){var n=this;return F(this,(function(o){return E("keys",e,v.ARRAY,!0)&&E("message",t,v.OBJECT,!0)&&E("message.conversationType",t.conversationType,v.NUMBER,!0)&&E("message.targetId",t.targetId,v.STRING,!0)&&E("message.channelId",t.channelId,v.CHANNEL_ID)&&E("message.messageUId",t.messageUId,v.STRING,!0)&&E("message.canIncludeExpansion",t.canIncludeExpansion,v.BOOLEAN,!0)?[2,Ze((function(o,r){return x(n,void 0,void 0,(function(){var n,a,s,c,u,d,l;return F(this,(function(f){switch(f.label){case 0:return n=t.conversationType,a=t.targetId,s=t.messageUId,c=t.canIncludeExpansion,u=t.channelId,d="conversationType:".concat(n,",targetId:").concat(a,",messageUId:").concat(s),r.debug(R.O,"remove message expansion ->".concat(d)),[4,o.sendExpansionMessage({conversationType:n,targetId:a,messageUId:s,canIncludeExpansion:c,keys:e,channelId:u})];case 1:return(l=f.sent().code)!==i.SUCCESS?(r.warn(R.O,"remove message expansion fail ->".concat(l,":").concat(rt[l],",").concat(d)),[2,{code:l,msg:rt[l]}]):[2,{code:l}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function No(e,t){return x(this,void 0,void 0,(function(){var n=this;return F(this,(function(o){return E("conversation",e,v.CONVERSATION,!0)&&E("typingContentType",t,v.STRING,!0)?[2,Ze((function(o,r){return x(n,void 0,void 0,(function(){var n,a,s,c,u,d;return F(this,(function(l){switch(l.label){case 0:return n={messageType:"RC:TypSts",content:{typingContentType:t},isStatusMessage:!0,channelId:e.channelId},a=r.createTraceId(),r.info(R.A_SEND_MSG_T,JSON.stringify({messageType:n.messageType,conversationType:e.conversationType,targetId:e.targetId,channelId:e.channelId}),a),[4,o.sendMessage(e.conversationType,e.targetId,n,void 0,a)];case 1:return s=l.sent(),c=s.code,u=s.data,d=c===i.SUCCESS?"info":"warn",r[d](R.A_SEND_MSG_R,JSON.stringify({code:c,messageUId:u?u.messageUId:"",messageId:u?u.messageId:""}),a),c===i.SUCCESS?[2,{code:c,data:Pe(u)}]:[2,{code:c,msg:rt[c]}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function _o(e,t,n){return x(this,void 0,void 0,(function(){var o=this;return F(this,(function(r){return E("messageUId",t,v.STRING,!0)&&E("targetId",e,v.STRING,!0)&&E("channelId",n,v.CHANNEL_ID)?[2,Ze((function(r,a){return x(o,void 0,void 0,(function(){var o,s,c,u;return F(this,(function(d){switch(d.label){case 0:return o="messageUId:".concat(t,",targetId:").concat(e),a.debug(R.O,"get message reader ->".concat(o)),[4,r.getMessageReader(e,t,n)];case 1:return s=d.sent(),c=s.code,u=s.data,c===i.SUCCESS?[2,{code:c,data:u}]:(a.warn(R.O,"get message reader fail ->".concat(c,":").concat(rt[c],",").concat(o)),[2,{code:c,msg:rt[c]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Co(e,t,n,o,r){return Fe((function(i,a){return f("messageType",e,v.STRING,!0),f("isPersited",t,v.BOOLEAN,!0),f("isCounted",n,v.BOOLEAN,!0),f("isStatusMessage",r,v.BOOLEAN,!1),f("searchProps",o,v.ARRAY),a.info(R.A_REGTYP_O,JSON.stringify({messageType:e,isCounted:n,isStatusMessage:r,isPersited:t})),i.registerMessageType(e,t,n,o,r),Tn(e,t,n)}))}function Ao(e){return x(this,void 0,void 0,(function(){var t=this;return F(this,(function(n){return w()?E("conversation",e,v.CONVERSATION,!0)?[2,Ze((function(n,o){return x(t,void 0,void 0,(function(){var t,r,a,s;return F(this,(function(c){switch(c.label){case 0:return[4,n.getFirstUnreadMessage(e.conversationType,e.targetId,e.channelId)];case 1:return t=c.sent(),r=t.code,a=t.data,r===i.SUCCESS?(s=a&&Pe(a)||null,[2,{code:r,data:s}]):(o.warn(R.O,"insertMessage ->code:".concat(r,",targetId:").concat(e.targetId)),[2,{code:r,msg:rt[r]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:rt[i.NOT_SUPPORT]}]}))}))}function Uo(e,t,n){return void 0===n&&(n={}),x(this,void 0,void 0,(function(){var o=this;return F(this,(function(r){return we("RongIMLib.insertMessage","RongIMLib.ElectronExtension.insertMessage"),w()?E("conversation",e,v.CONVERSATION,!0)&&E("message",t,v.OBJECT,!0)&&E("options",n,v.OBJECT)&&E("options.isUnread",null==n?void 0:n.isUnread,v.BOOLEAN)&&E("options.searchContent",null==n?void 0:n.searchContent,v.STRING)&&E("content.senderUserId",t.senderUserId,v.STRING,!0)&&E("content.messageType",t.messageType,v.STRING,!0)&&E("content.content",t.content,v.OBJECT,!0)&&E("content.messageDirection",t.messageDirection,v.NUMBER,!0)&&E("content.canIncludeExpansion",t.canIncludeExpansion,v.BOOLEAN)&&E("content.expansion",t.expansion,v.OBJECT)&&E("content.disableNotification",t.disableNotification,v.BOOLEAN)&&E("content.sentTime",t.sentTime,v.NUMBER)&&E("content.sentStatus",t.sentStatus,v.NUMBER)?[2,Ze((function(r,a){return x(o,void 0,void 0,(function(){var o,s,c,u,d,l,f,v,g,I,h,m,E,S,T,p;return F(this,(function(O){switch(O.label){case 0:return o=t.senderUserId,s=t.messageType,c=t.content,u=t.messageDirection,d=t.messageUId,l=t.canIncludeExpansion,f=t.expansion,v=t.disableNotification,g=t.sentTime,I=t.sentStatus,a.info(R.O,"insertMessage ->targetId:".concat(e.targetId,",conversationType:").concat(e.conversationType)),h=n.isUnread,m=n.searchContent,E={senderUserId:o,messageType:s,content:c,messageDirection:u,sentTime:g,sentStatus:I,searchContent:m,isUnread:h,messageUId:d,disableNotification:v,canIncludeExpansion:l,expansionMsg:JSON.stringify(f),channelId:e.channelId||""},[4,r.insertMessage(e.conversationType,e.targetId,E)];case 1:return S=O.sent(),T=S.code,p=S.data,T===i.SUCCESS?[2,{code:T,data:Pe(p)}]:(a.warn(R.O,"insertMessage ->code:".concat(T,",targetId:").concat(e.targetId)),[2,{code:T,msg:rt[T]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:rt[i.NOT_SUPPORT]}]}))}))}function yo(e){return x(this,void 0,void 0,(function(){var t=this;return F(this,(function(n){return w()?E("messageId",e,(function(e){return c(e)||_(e)}),!0)?[2,Ze((function(n,o){return x(t,void 0,void 0,(function(){var t,r,a;return F(this,(function(s){switch(s.label){case 0:return[4,n.getMessage(e)];case 1:return t=s.sent(),r=t.code,a=t.data,r===i.SUCCESS?[2,{code:r,data:Pe(a)}]:(o.warn(R.O,"getMessage ->code:".concat(r,",messageId:").concat(e)),[2,{code:r,msg:rt[r]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:rt[i.NOT_SUPPORT]}]}))}))}function Mo(e){if(!w())return{code:i.NOT_SUPPORT,msg:rt[i.NOT_SUPPORT]};var t,n=e.conversationType,o=e.targetId,r=e.channelId;return E("conversation",e,v.CONVERSATION,!0)?(t=function(e){var t=e.getUnreadMentionedMessages(n,o,r),a=[];return t&&t.length&&t.forEach((function(e){return a.push(Pe(e))})),{code:i.SUCCESS,data:a}},Ge?t(Ge,ke,Ve):{code:i.BIZ_ERROR_CLIENT_NOT_INIT}):{code:i.BIZ_ERROR_INVALID_PARAMETER}}function Po(e,t,n,o){return x(this,void 0,void 0,(function(){var r=this;return F(this,(function(a){return we("RongIMLib.searchMessages","RongIMLib.ElectronExtension.searchMessages"),w()?E("conversation",e,v.CONVERSATION,!0)&&E("keyword",t,v.STRING,!0)&&E("timestamp",n,v.NUMBER)&&E("count",o,v.NUMBER)?[2,Ze((function(a,s){return x(r,void 0,void 0,(function(){var r,c,u,d;return F(this,(function(l){switch(l.label){case 0:return 1,[4,a.searchMessageByContent(e.conversationType,e.targetId,t,n,o,1,e.channelId)];case 1:return r=l.sent(),c=r.code,u=r.data,c===i.SUCCESS?(d=[],(null==u?void 0:u.messages)&&u.messages.length&&u.messages.forEach((function(e){return d.push(Pe(e))})),[2,{code:c,data:{messages:d,count:null==u?void 0:u.count}}]):(s.warn(R.O,"searchMessages ->code:".concat(c,",targetId:").concat(e.targetId)),[2,{code:c,msg:rt[c]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:rt[i.NOT_SUPPORT]}]}))}))}function Lo(e,t,n){return x(this,void 0,void 0,(function(){var o,r,a,s=this;return F(this,(function(c){return we("RongIMLib.deleteLocalMessagesByTimestamp","RongIMLib.ElectronExtension.deleteMessagesByTimestamp"),w()?(o=e.conversationType,r=e.targetId,a=e.channelId,E("conversationType",o,v.NUMBER,!0)&&E("targetId",r,v.STRING,!0)&&E("timestamp",t,v.NUMBER,!0)&&E("cleanSpace",n,v.BOOLEAN)?[2,Ze((function(c,u){return x(s,void 0,void 0,(function(){var s;return F(this,(function(d){switch(d.label){case 0:return[4,c.deleteMessagesByTimestamp(o,r,t,n,a)];case 1:return s=d.sent(),u.debug(R.A_DELETE_MESSAGES_S,JSON.stringify({code:s,conversationType:o,targetId:r,channelId:a,timestamp:t})),s===i.SUCCESS?[2,{code:s}]:(u.warn(R.O,"deleteLocalMessagesByTimestamp ->code:".concat(s,",targetId:").concat(e.targetId)),[2,{code:s,msg:rt[s]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]):[2,{code:i.NOT_SUPPORT,msg:rt[i.NOT_SUPPORT]}]}))}))}function wo(e){return x(this,void 0,void 0,(function(){var t=this;return F(this,(function(n){return we("RongIMLib.clearMessages","RongIMLib.ElectronExtension.clearMessages"),w()?[2,Ze((function(n,o){return x(t,void 0,void 0,(function(){var t,r,a,s;return F(this,(function(c){switch(c.label){case 0:return t=e.conversationType,r=e.targetId,a=e.channelId,o.info(R.O,"clearMessages ->targetId:".concat(r,",conversationType:").concat(t)),[4,n.clearMessages(t,r,a)];case 1:return(s=c.sent())===i.SUCCESS?[2,{code:s}]:(o.warn(R.O,"clearMessages ->code:".concat(s,",targetId:").concat(r)),[2,{code:s,msg:rt[s]}])}}))}))}))]:[2,{code:i.NOT_SUPPORT,msg:rt[i.NOT_SUPPORT]}]}))}))}function Bo(e,t,n,o){return x(this,void 0,void 0,(function(){var r=this;return F(this,(function(a){return we("RongIMLib.searchConversationByContent","RongIMLib.ElectronExtension.searchConversationByContent"),w()?[2,Ze((function(a,s){return x(r,void 0,void 0,(function(){var r,c,u;return F(this,(function(d){switch(d.label){case 0:return s.info(R.O,"searchConversationByContent ->keyword:".concat(e)),[4,a.searchConversationByContent(e,n,o,t)];case 1:return r=d.sent(),c=r.code,u=r.data,c===i.SUCCESS?[2,{code:c,data:u}]:(s.warn(R.O,"searchConversationByContent ->code:".concat(c,",keyword:").concat(e)),[2,{code:c,msg:rt[c]}])}}))}))}))]:[2,{code:i.NOT_SUPPORT,msg:rt[i.NOT_SUPPORT]}]}))}))}function Do(e,t){return x(this,void 0,void 0,(function(){var n=this;return F(this,(function(o){return w()?E("conversation",e,v.CONVERSATION,!0)&&E("timestamp",t,v.NUMBER)?[2,Ze((function(o,r){return x(n,void 0,void 0,(function(){var n,a,s,c;return F(this,(function(u){switch(u.label){case 0:return n=e.conversationType,a=e.targetId,s=e.channelId,r.info(R.O,"clearUnreadCountByTimestamp ->targetId:".concat(a,",conversationType:").concat(n)),[4,o.clearUnreadCountByTimestamp(n,a,t,s)];case 1:return(c=u.sent())===i.SUCCESS?[2,{code:c}]:(r.warn(R.O,"clearUnreadCountByTimestamp ->code:".concat(c,",targetId:").concat(a)),[2,{code:c,msg:rt[c]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:rt[i.NOT_SUPPORT]}]}))}))}function bo(e,t){return x(this,void 0,void 0,(function(){var n=this;return F(this,(function(o){return we("RongIMLib.setMessageReceivedStatus","RongIMLib.ElectronExtension.setMessageReceivedStatus"),w()?E("messageId",e,v.NUMBER,!0)&&E("receivedStatus",t,v.NUMBER,!0)?[2,Ze((function(o,r){return x(n,void 0,void 0,(function(){var n;return F(this,(function(a){switch(a.label){case 0:return r.info(R.O,"setMessageReceivedStatus ->messageId:".concat(e,",receivedStatus:").concat(t)),[4,o.setMessageReceivedStatus(e,t)];case 1:return(n=a.sent())===i.SUCCESS?[2,{code:n}]:(r.warn(R.O,"setMessageReceivedStatus ->code:".concat(n,",messageId:").concat(e)),[2,{code:n,msg:rt[n]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:rt[i.NOT_SUPPORT]}]}))}))}function Go(e){return x(this,void 0,void 0,(function(){var t=this;return F(this,(function(n){return E("tag.tagId",e.tagId,v.STRING,!0)&&E("tag.tagId",e.tagId,(function(e){return e.length<=10}))&&E("tag.tagName",e.tagName,(function(e){return e.length<=15}))&&E("tag.tagName",e.tagName,v.STRING,!0)?[2,Ze((function(n,o){return x(t,void 0,void 0,(function(){var t;return F(this,(function(r){switch(r.label){case 0:return o.info(R.O,"createTag ->tagId:".concat(e.tagId,",tagName:").concat(e.tagName)),[4,n.createTag(e)];case 1:return(t=r.sent().code)===i.SUCCESS?[2,{code:t}]:(o.warn(R.O,"createTag ->code:".concat(t,",tagId:").concat(e.tagId)),[2,{code:t,msg:rt[t]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Vo(e){return x(this,void 0,void 0,(function(){var t=this;return F(this,(function(n){return E("tagId",e,v.STRING,!0)?[2,Ze((function(n,o){return x(t,void 0,void 0,(function(){var t;return F(this,(function(r){switch(r.label){case 0:return o.info(R.O,"removeTag ->tagId:".concat(e)),[4,n.removeTag(e)];case 1:return(t=r.sent().code)===i.SUCCESS?[2,{code:t}]:(o.warn(R.O,"removeTag ->code:".concat(t,",tagId:").concat(e)),[2,{code:t,msg:rt[t]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function ko(e){return x(this,void 0,void 0,(function(){var t=this;return F(this,(function(n){return E("tag.tagId",e.tagId,v.STRING,!0)&&E("tag.tagName",e.tagName,v.STRING,!0)&&E("tag.tagName",e.tagName,(function(e){return e.length<=15}))?[2,Ze((function(n,o){return x(t,void 0,void 0,(function(){var t;return F(this,(function(r){switch(r.label){case 0:return o.info(R.O,"updateTag ->tagId:".concat(e.tagId,",tagName:").concat(e.tagName)),[4,n.updateTag(e)];case 1:return(t=r.sent().code)===i.SUCCESS?[2,{code:t}]:(o.warn(R.O,"updateTag ->code:".concat(t,",tagId:").concat(e.tagId)),[2,{code:t,msg:rt[t]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function xo(){return x(this,void 0,void 0,(function(){var e=this;return F(this,(function(t){return[2,Ze((function(t,n){return x(e,void 0,void 0,(function(){var e,o,r;return F(this,(function(a){switch(a.label){case 0:return[4,t.getTagList()];case 1:return e=a.sent(),o=e.code,r=e.data,n.warn(R.O,"getTagList ->code:".concat(o)),[2,{code:i.SUCCESS,data:r}]}}))}))}))]}))}))}function Fo(e){return x(this,void 0,void 0,(function(){var t=this;return F(this,(function(n){return E("conversation",e,v.CONVERSATION,!0)?[2,Ze((function(n,o){return x(t,void 0,void 0,(function(){var t,r,a;return F(this,(function(s){switch(s.label){case 0:return o.info(R.O,"getTagsForConversation ->targetId:".concat(e.targetId,",conversationType:").concat(e.conversationType)),[4,n.getTagsForConversation(e)];case 1:return t=s.sent(),r=t.code,a=t.data,r===i.SUCCESS?[2,{code:r,data:a}]:[2,{code:r,msg:rt[r]}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Zo(e,t){return x(this,void 0,void 0,(function(){var n=this;return F(this,(function(o){return E("tagId",e,v.STRING,!0)&&E("conversations",t,v.ARRAY,!0)&&!t.some((function(e){return!E("conversation",e,v.CONVERSATION,!0)}))?[2,Ze((function(o,r){return x(n,void 0,void 0,(function(){var n;return F(this,(function(a){switch(a.label){case 0:return r.info(R.O,"addTagForConversations ->tagId:".concat(e)),[4,o.addTagForConversations(e,t)];case 1:return(n=a.sent().code)===i.SUCCESS?[2,{code:n}]:(r.warn(R.O,"addTagForConversations ->code:".concat(n,",tagId:").concat(e)),[2,{code:n,msg:rt[n]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Ho(e,t){return x(this,void 0,void 0,(function(){var n=this;return F(this,(function(o){return E("tagId",e,v.STRING,!0)&&E("conversations",t,v.ARRAY,!0)&&!t.some((function(e){return!E("conversation",e,v.CONVERSATION,!0)}))?[2,Ze((function(o,r){return x(n,void 0,void 0,(function(){var n;return F(this,(function(a){switch(a.label){case 0:return r.info(R.O,"removeTagForConversations ->tagId:".concat(e)),[4,o.removeTagForConversations(e,t)];case 1:return(n=a.sent().code)===i.SUCCESS?[2,{code:n}]:(r.warn(R.O,"removeTagForConversations ->code:".concat(n,",tagId:").concat(e)),[2,{code:n,msg:rt[n]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Jo(e,t){return x(this,void 0,void 0,(function(){var n=this;return F(this,(function(o){return E("conversation",e,v.CONVERSATION,!0)&&E("tagIds",t,v.ARRAY,!0)&&!t.some((function(e){return!E("tagId",e,v.STRING,!0)}))?[2,Ze((function(o,r){return x(n,void 0,void 0,(function(){var n;return F(this,(function(a){switch(a.label){case 0:return r.info(R.O,"removeTagsForConversation ->tagIds:".concat(t,",targetId:").concat(e.targetId,",conversationType:").concat(e.conversationType)),[4,o.removeTagsForConversation(e,t)];case 1:return(n=a.sent().code)===i.SUCCESS?[2,{code:n}]:(r.warn(R.O,"removeTagsForConversation ->code:".concat(n,",tagIds:").concat(t)),[2,{code:n,msg:rt[n]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function qo(e,t){return x(this,void 0,void 0,(function(){var n=this;return F(this,(function(o){return E("tagId",e,v.STRING,!0)&&E("conversations",t,v.ARRAY,!0)&&!t.some((function(e){return!E("conversation",e,v.CONVERSATION,!0)}))?[2,Ze((function(o,r){return x(n,void 0,void 0,(function(){var n;return F(this,(function(a){switch(a.label){case 0:return r.info(R.O,"removeTagForConversations ->tagId:".concat(e)),[4,o.removeTagForConversations(e,t)];case 1:return(n=a.sent().code)===i.SUCCESS?[2,{code:n}]:(r.warn(R.O,"removeTagForConversations ->code:".concat(n,",tagId:").concat(e)),[2,{code:n,msg:rt[n]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Ko(e,t,n){return x(this,void 0,void 0,(function(){var o=this;return F(this,(function(r){return E("tagId",e,v.STRING,!0)&&E("count",t,v.NUMBER,!0)&&E("startTime",n,v.NUMBER,!0)?[2,Ze((function(r,a){return x(o,void 0,void 0,(function(){var o,s,c;return F(this,(function(u){switch(u.label){case 0:return a.info(R.O,"getConversationListByTag ->tagId:".concat(e)),[4,r.getConversationListByTag(e,n,t)];case 1:return o=u.sent(),s=o.code,c=o.data,s===i.SUCCESS?[2,{code:s,data:null==c?void 0:c.map((function(e){return function(e){return k(k({},Le(e)),{isTopInTag:e.isTopInTag})}(e)}))}]:(a.warn(R.O,"getConversationListByTag ->code:".concat(s,",tagId:").concat(e)),[2,{code:s,msg:rt[s]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Yo(e,t){return x(this,void 0,void 0,(function(){var n=this;return F(this,(function(o){return E("tagId",e,v.STRING,!0)&&E("containMuted",t,v.BOOLEAN,!0)?[2,Ze((function(o,r){return x(n,void 0,void 0,(function(){var n,i,a;return F(this,(function(s){switch(s.label){case 0:return r.info(R.O,"getUnreadCountByTag ->tagId:".concat(e)),[4,o.getUnreadCountByTag(e,t)];case 1:return n=s.sent(),i=n.code,a=n.data,[2,{code:i,data:a}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function zo(e,t,n){return x(this,void 0,void 0,(function(){var o=this;return F(this,(function(r){return E("tagId",e,v.STRING,!0)&&E("conversation",t,v.CONVERSATION,!0)&&E("status.isTop",n,v.BOOLEAN,!0)?[2,Ze((function(r,a){return x(o,void 0,void 0,(function(){var o;return F(this,(function(s){switch(s.label){case 0:return a.info(R.O,"setConversationStatusInTag ->tagId:".concat(e,",targetId:").concat(t.targetId,",conversationType").concat(t.conversationType)),[4,r.setConversationStatusInTag(e,t,{isTop:n})];case 1:return(o=s.sent().code)===i.SUCCESS?[2,{code:o}]:(a.warn(R.O,"setConversationStatusInTag ->code:".concat(o,",tagId:").concat(e)),[2,{code:o,msg:rt[o]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}io(M.COMBINE_HTML,(function(e,t){var n={remoteUrl:e.downloadUrl,nameList:t.nameList,summaryList:t.summaryList,conversationType:t.conversationType};return t.user&&(n.user=t.user),t.extra&&(n.extra=t.extra),t.mentionedInfo&&(n.mentionedInfo=t.mentionedInfo),new An(n)}));var jo={COMET:"comet",WEBSOCKET:"websocket"},Wo={TEXT:"RC:TxtMsg",VOICE:"RC:VcMsg",HQ_VOICE:"RC:HQVCMsg",IMAGE:"RC:ImgMsg",GIF:"RC:GIFMsg",RICH_CONTENT:"RC:ImgTextMsg",LOCATION:"RC:LBSMsg",FILE:"RC:FileMsg",SIGHT:"RC:SightMsg",COMBINE:"RC:CombineMsg",CHRM_KV_NOTIFY:"RC:chrmKVNotiMsg",LOG_COMMAND:"RC:LogCmdMsg",EXPANSION_NOTIFY:"RC:MsgExMsg",REFERENCE:"RC:ReferenceMsg",RECALL_MESSAGE_TYPE:"RC:RcCmd"};var Qo=Object.freeze({__proto__:null,getAllConversationList:function(e){return x(this,void 0,void 0,(function(){var t=this;return F(this,(function(n){return w()?E("channelId",e,v.CHANNEL_ID)?[2,Ze((function(n,o){return x(t,void 0,void 0,(function(){var t,r,a,s;return F(this,(function(c){switch(c.label){case 0:return o.info(R.O,"getAllConversationList -> channelId: ".concat(e)),b(e)?[4,n.getConversationListWithAllChannel()]:[3,2];case 1:return t=c.sent(),[3,4];case 2:return[4,n.getConversationList(void 0,void 0,void 0,void 0,e)];case 3:t=c.sent(),c.label=4;case 4:return r=t.code,a=t.data,r===i.SUCCESS&&a?(s=a.map((function(e){return Le(e)})),[2,{code:r,data:s}]):(o.warn(R.O,"getAllConversationList fail -> code: ".concat(r," channelId: ").concat(e)),[2,{code:r,msg:rt[r]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:rt[i.NOT_SUPPORT]}]}))}))},getConversationList:function(e,t,n){return x(this,void 0,void 0,(function(){var o=this;return F(this,(function(r){return w()?E("startTime",e,v.NUMBER,!0)&&E("count",t,v.NUMBER,!0)&&E("channelId",n,v.CHANNEL_ID)?[2,Ze((function(r,a){return x(o,void 0,void 0,(function(){var o,s,c,u,d,l;return F(this,(function(f){switch(f.label){case 0:return o="startTime: ".concat(e,", count: ").concat(t,", channelId: ").concat(n),a.info(R.O,"getConversationList -> ".concat(o)),b(n)?[4,r.getConversationListWithAllChannelByPage(e,t)]:[3,2];case 1:return s=f.sent(),[3,4];case 2:return c=[1,2,3,5,6,7,8],[4,r.getConversationsByPage(c,e,t,n)];case 3:s=f.sent(),f.label=4;case 4:return u=s.code,d=s.data,u===i.SUCCESS&&d?(l=d.map((function(e){return Le(e)})),[2,{code:u,data:l}]):(a.warn(R.O,"getConversationList fail -> code: ".concat(u," ").concat(o)),[2,{code:u,msg:rt[u]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:rt[i.NOT_SUPPORT]}]}))}))},searchConversationByContent:function(e,t,n){return x(this,void 0,void 0,(function(){var o=this;return F(this,(function(r){return w()?E("keyword",e,v.STRING,!0)&&E("messageTypes",t,v.ARRAY,!0)&&E("channelId",n,v.CHANNEL_ID)&&!t.some((function(e){return!E("messageType",e,v.STRING,!0)}))?[2,Ze((function(r,a){return x(o,void 0,void 0,(function(){var o,s,c,u,d;return F(this,(function(l){switch(l.label){case 0:return o="keyword: ".concat(e,", messageTypes: ").concat(JSON.stringify(t),", channelId: ").concat(n),a.info(R.O,"searchConversationByContent -> ".concat(o)),b(n)?[4,r.searchConversationByContentWithAllChannel(e,t)]:[3,2];case 1:return s=l.sent(),[3,4];case 2:return[4,r.searchConversationByContent(e,t,n)];case 3:s=l.sent(),l.label=4;case 4:return c=s.code,u=s.data,c===i.SUCCESS&&u?(d=u.map((function(e){return Le(e)})),[2,{code:c,data:d}]):(a.warn(R.O,"searchConversationByContent fail -> code: ".concat(c," ").concat(o)),[2,{code:c,msg:rt[c]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:rt[i.NOT_SUPPORT]}]}))}))},searchMessages:function(e,t,n,o){return x(this,void 0,void 0,(function(){var r=this;return F(this,(function(a){return w()?E("conversation",e,v.CONVERSATION,!0)&&E("keyword",t,v.STRING,!0)&&E("startTime",n,v.NUMBER,!0)&&E("count",o,v.NUMBER,!0)?[2,Ze((function(a,s){return x(r,void 0,void 0,(function(){var r,c,u,d,l,f,v,g,I,h;return F(this,(function(m){switch(m.label){case 0:return r="conversation: ".concat(JSON.stringify(e),", keyword: ").concat(t,", timestamp: ").concat(n,", count: ").concat(o),s.info(R.O,"searchMessages -> ".concat(r)),c=e.targetId,u=e.conversationType,d=e.channelId,b(d)?[4,a.searchMessageByContentWithAllChannel(u,c,t,n,o)]:[3,2];case 1:return l=m.sent(),[3,4];case 2:return 0,[4,a.searchMessageByContent(u,c,t,n,o,0,d)];case 3:l=m.sent(),m.label=4;case 4:return f=l.code,v=l.data,f===i.SUCCESS&&v?(g=v.messages,I=v.count,h=g.map((function(e){return Pe(e)})),[2,{code:f,data:{messages:h,count:I}}]):(s.warn(R.O,"searchMessages fail -> code: ".concat(f," ").concat(r)),[2,{code:f,msg:rt[f]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:rt[i.NOT_SUPPORT]}]}))}))},searchMessageInTimeRange:function(e,t){return x(this,void 0,void 0,(function(){var n=this;return F(this,(function(o){return w()?E("conversation",e,v.CONVERSATION,!0)&&E("option",t,v.OBJECT,!0)&&E("option.keyword",t.keyword,v.STRING,!0)&&E("option.startTime",t.startTime,v.NUMBER,!0)&&E("option.endTime",t.endTime,v.NUMBER,!0)&&E("option.offset",t.offset,v.NUMBER)&&E("option.limit",t.limit,v.NUMBER)?[2,Ze((function(o,r){return x(n,void 0,void 0,(function(){var n,a,s,c,u,d,l,f,v,g,I;return F(this,(function(h){switch(h.label){case 0:return n="conversation: ".concat(JSON.stringify(e),", option: ").concat(JSON.stringify(t)),r.info(R.O,"searchMessageInTimeRange -> ".concat(n)),a=e.conversationType,s=e.targetId,c=t.keyword,u=t.startTime,d=t.endTime,l=t.offset,f=t.limit,l=l||0,f=f||5,[4,o.searchMessageByContentInTimeRangeWithAllChannel(a,s,c,u,d,l,f)];case 1:return v=h.sent(),g=v.code,I=v.data,g===i.SUCCESS&&I?[2,{code:g,data:{messages:I.messages.map((function(e){return Pe(e)}))}}]:(r.warn(R.O,"searchMessageInTimeRange fail -> code: ".concat(g,", ").concat(n)),[2,{code:g}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:rt[i.NOT_SUPPORT]}]}))}))},searchMessagesByUser:function(e,t,n,o){return x(this,void 0,void 0,(function(){var r=this;return F(this,(function(a){return w()?E("conversation",e,v.CONVERSATION,!0)&&E("userId",t,v.STRING,!0)&&E("startTime",n,v.NUMBER,!0)&&E("count",o,v.NUMBER,!0)?[2,Ze((function(a,s){return x(r,void 0,void 0,(function(){var r,c,u,d,l,f,v;return F(this,(function(g){switch(g.label){case 0:return r="conversation: ".concat(JSON.stringify(e),", keyword: ").concat(t,", timestamp: ").concat(n,", count: ").concat(o),s.info(R.A_SEARCH_MESSAGE_BY_USER_T,"searchMessagesByUser -> ".concat(r)),c=e.conversationType,u=e.targetId,d=e.channelId,[4,a.searchMessagesByUser(c,u,t,n,o,d)];case 1:return l=g.sent(),f=l.code,v=l.data,f===i.SUCCESS&&v?[2,{code:f,data:{messages:v.messages.map((function(e){return Pe(e)}))}}]:(s.warn(R.A_SEARCH_MESSAGE_BY_USER_R,"searchMessagesByUser fail -> code: ".concat(f,", ").concat(r)),[2,{code:f}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:rt[i.NOT_SUPPORT]}]}))}))},getHistoryMessagesByMessageTypes:function(e,t){return x(this,void 0,void 0,(function(){var n=this;return F(this,(function(o){return w()?E("conversation",e,v.CONVERSATION,!0)&&E("option",t,v.OBJECT,!0)&&E("option.count",t.count,v.NUMBER)&&E("options.count",t.count,(function(e){var t=e>0&&e<=100;return t||null===console||void 0===console||console.error("option.count is invalid, It should be greater than 0 and less than 100"),t}))&&E("option.timestamp",t.timestamp,v.NUMBER)&&E("option.order",t.order,(function(e){return[0,1].includes(e)}))&&E("option.messageTypes",t.messageTypes,v.ARRAY,!0)&&!t.messageTypes.some((function(e){return!E("option.messageType",e,v.STRING,!0)}))?[2,Ze((function(o,r){return x(n,void 0,void 0,(function(){var n,a,s,c,u,d,l,f,v,g,I,h,m,E,S,T,p,O,N;return F(this,(function(_){switch(_.label){case 0:return n=t.count,a=void 0===n?20:n,s=t.timestamp,c=void 0===s?0:s,u=t.order,d=void 0===u?0:u,l=t.messageTypes,f="conversation: ".concat(JSON.stringify(e),", option: ").concat(JSON.stringify(t)),r.info(R.O,"getHistoryMessagesByMessageTypes -> ".concat(f)),v=e.conversationType,g=e.targetId,I=e.channelId,h=void 0===I?"":I,[4,o.getHistoryMessagesByObjectNames(v,g,c,a,l,d,h)];case 1:return m=_.sent(),E=m.code,S=m.data,E===i.SUCCESS?(p=(T=S).list,O=T.hasMore,N=p.map((function(e){return Pe(e)})),[2,{code:E,data:{messages:N,hasMore:O,list:N}}]):(r.warn(R.O,"getHistoryMessagesByMessageTypes fail -> code: ".concat(E," ").concat(f)),[2,{code:E,msg:rt[E]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:rt[i.NOT_SUPPORT]}]}))}))},setMessageStatusToRead:function(e,t){return x(this,void 0,void 0,(function(){var n=this;return F(this,(function(o){return w()?E("conversation",e,v.CONVERSATION,!0)&&E("timestamp",t,v.NUMBER,!0)?[2,Ze((function(o,r){return x(n,void 0,void 0,(function(){var n,i,a,s;return F(this,(function(c){switch(c.label){case 0:return n="conversation: ".concat(JSON.stringify(e),", timestamp: ").concat(t),r.info(R.O,"updateSentMsgReceiptStatus -> ".concat(n)),i=e.conversationType,a=e.targetId,s=e.channelId,[4,o.setMessageStatusToRead(i,a,t,s)];case 1:return[2,c.sent()]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:rt[i.NOT_SUPPORT]}]}))}))},setMessageReceivedStatus:function(e,t){return x(this,void 0,void 0,(function(){var n=this;return F(this,(function(o){return w()?E("messageId",e,v.NUMBER,!0)&&E("receivedStatus",t,(function(e){return!b(a[e])}),!0)?[2,Ze((function(o,r){return x(n,void 0,void 0,(function(){return F(this,(function(n){switch(n.label){case 0:return r.info(R.O,"setMessageReceivedStatus -> messageId: ".concat(e,", receivedStatus: ").concat(t)),[4,o.setMessageReceivedStatus(e,t)];case 1:return[2,{code:n.sent()}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:rt[i.NOT_SUPPORT]}]}))}))},setMessageSentStatus:function(e,t){return x(this,void 0,void 0,(function(){var n=this;return F(this,(function(o){return w()?E("messageId",e,v.NUMBER,!0)&&E("sentStatus",t,(function(e){return!b(D[e])}),!0)?[2,Ze((function(o,r){return x(n,void 0,void 0,(function(){return F(this,(function(n){switch(n.label){case 0:return r.info(R.O,"setMessageSentStatus ->messageId: ".concat(e,", sentStatus: ").concat(t)),[4,o.setMessageSentStatus(e,t)];case 1:return[2,{code:n.sent()}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:rt[i.NOT_SUPPORT]}]}))}))},setMessageContent:function(e,t,n){return void 0===n&&(n=""),x(this,void 0,void 0,(function(){var o=this;return F(this,(function(r){return w()?E("messageId",e,v.NUMBER,!0)&&E("content",t,v.OBJECT,!0)&&E("messageType",n,v.ONLY_STRING,!0)?[2,Ze((function(r,i){return x(o,void 0,void 0,(function(){return F(this,(function(o){switch(o.label){case 0:return i.info(R.O,"setMessageSentStatus ->messageId: ".concat(e,", messageType: ").concat(n)),[4,r.setMessageContent(e,t,n)];case 1:return[2,{code:o.sent()}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:rt[i.NOT_SUPPORT]}]}))}))},deleteMessages:function(e){return x(this,void 0,void 0,(function(){var t=this;return F(this,(function(n){return w()?!E("messageIds",e,v.ARRAY,!0)||e.some((function(e){return!E("messageId",e,v.NUMBER,!0)}))?[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,Ze((function(n,o){return x(t,void 0,void 0,(function(){return F(this,(function(t){switch(t.label){case 0:return o.info(R.O,"deleteMessages ->messageIds: ".concat(JSON.stringify(e))),[4,n.deleteMessages(e)];case 1:return[2,{code:t.sent()}]}}))}))}))]:[2,{code:i.NOT_SUPPORT,msg:rt[i.NOT_SUPPORT]}]}))}))},clearMessages:function(e){return x(this,void 0,void 0,(function(){var t=this;return F(this,(function(n){return w()?[2,Ze((function(n,o){return x(t,void 0,void 0,(function(){var t,r,i;return F(this,(function(a){switch(a.label){case 0:return t=e.conversationType,r=e.targetId,i=e.channelId,o.info(R.O,"clearMessages ->targetId:".concat(r,",conversationType:").concat(t)),[4,n.clearMessages(t,r,i)];case 1:return[2,{code:a.sent()}]}}))}))}))]:[2,{code:i.NOT_SUPPORT,msg:rt[i.NOT_SUPPORT]}]}))}))},deleteMessagesByTimestamp:function(e,t,n){return x(this,void 0,void 0,(function(){var o,r,a,s=this;return F(this,(function(c){return w()?(o=e.conversationType,r=e.targetId,a=e.channelId,E("conversationType",o,v.NUMBER,!0)&&E("targetId",r,v.STRING,!0)&&E("timestamp",t,v.NUMBER,!0)&&E("cleanSpace",n,v.BOOLEAN)?[2,Ze((function(e,i){return x(s,void 0,void 0,(function(){return F(this,(function(i){switch(i.label){case 0:return[4,e.deleteMessagesByTimestamp(o,r,t,n,a)];case 1:return[2,{code:i.sent()}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]):[2,{code:i.NOT_SUPPORT,msg:rt[i.NOT_SUPPORT]}]}))}))},insertMessage:function(e,t,n){return void 0===n&&(n={}),x(this,void 0,void 0,(function(){var o=this;return F(this,(function(r){return w()?E("conversation",e,v.CONVERSATION,!0)&&E("message",t,v.OBJECT,!0)&&E("options",n,v.OBJECT)&&E("options.isUnread",null==n?void 0:n.isUnread,v.BOOLEAN)&&E("options.searchContent",null==n?void 0:n.searchContent,v.STRING)&&(t instanceof Sn||E("message.senderUserId",t.senderUserId,v.STRING,!0)&&E("message.messageType",t.messageType,v.STRING,!0)&&E("message.content",t.content,v.OBJECT,!0)&&E("message.messageDirection",t.messageDirection,v.NUMBER,!0)&&E("message.canIncludeExpansion",t.canIncludeExpansion,v.BOOLEAN)&&E("message.expansion",t.expansion,v.OBJECT)&&E("message.disableNotification",t.disableNotification,v.BOOLEAN)&&E("message.sentTime",t.sentTime,v.NUMBER)&&E("message.sentStatus",t.sentStatus,v.NUMBER))?[2,Ze((function(r,a){return x(o,void 0,void 0,(function(){var o,s,c,u,d,l,f,v,g,I,h,m,E,S,T;return F(this,(function(p){switch(p.label){case 0:return o="",s=1,l=!1,v=t.messageType,g=t.content,t instanceof Sn||(o=t.senderUserId,s=t.messageDirection,l=t.canIncludeExpansion,f=t.expansion,d=t.disableNotification,c=t.sentTime,u=t.sentStatus),a.info(R.O,"insertMessage ->targetId:".concat(e.targetId,",conversationType:").concat(e.conversationType)),I=n.isUnread,h=n.searchContent,m={senderUserId:o,messageType:v,content:g,messageDirection:s,sentTime:c,sentStatus:u,searchContent:h,isUnread:I,messageUId:"",disableNotification:d,canIncludeExpansion:l,expansionMsg:JSON.stringify(f),channelId:e.channelId||""},[4,r.insertMessage(e.conversationType,e.targetId,m)];case 1:return E=p.sent(),S=E.code,T=E.data,S===i.SUCCESS?[2,{code:S,data:Pe(T)}]:(a.warn(R.O,"insertMessage ->code:".concat(S,",targetId:").concat(e.targetId)),[2,{code:S,msg:rt[S]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:rt[i.NOT_SUPPORT]}]}))}))},batchInsertMessage:function(e,t){var n,o;return x(this,void 0,void 0,(function(){var r,a=this;return F(this,(function(c){if(!w())return[2,{code:i.NOT_SUPPORT,msg:rt[i.NOT_SUPPORT]}];if(!E("messages",e,(function(e){return g(e)&&!(e.length<=0||e.length>=500)}),!0)||!E("checkDuplicate",t,v.BOOLEAN))return[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}];for(r in e)if(!(E("message",e[r],v.OBJECT,!0)&&E("message.conversationType",e[r].conversationType,(function(e){return[s.PRIVATE,s.DISCUSSION,s.GROUP,s.CUSTOMER_SERVICE,s.SYSTEM,s.APP_PUBLIC_SERVICE,s.PUBLIC_SERVICE].includes(e)}),!0)&&E("message.targetId",e[r].targetId,v.STRING,!0)&&E("message.senderUserId",e[r].senderUserId,v.STRING,!0)&&E("message.messageType",e[r].messageType,v.STRING,!0)&&E("message.content",e[r].content,v.OBJECT,!0)&&E("message.messageDirection",e[r].messageDirection,v.NUMBER,!0)&&E("message.canIncludeExpansion",e[r].canIncludeExpansion,v.BOOLEAN)&&E("message.expansion",e[r].expansion,v.OBJECT)&&E("message.disableNotification",e[r].disableNotification,v.BOOLEAN)&&E("message.sentTime",e[r].sentTime,v.NUMBER)&&E("message.sentStatus",e[r].sentStatus,v.NUMBER)&&E("options.isUnread",null===(n=e[r])||void 0===n?void 0:n.isUnread,v.BOOLEAN)&&E("options.searchContent",null===(o=e[r])||void 0===o?void 0:o.searchContent,v.STRING)))return[2,{code:i.BIZ_ERROR_INVALID_PARAMETER,msg:String(r)}];return[2,Ze((function(n){return x(a,void 0,void 0,(function(){var o,r,a;return F(this,(function(s){switch(s.label){case 0:return[4,n.batchInsertMessage(e,t)];case 1:return o=s.sent(),r=o.code,a=o.data,r===i.SUCCESS?[2,{code:r,data:a}]:[2,{code:r,msg:rt[r]}]}}))}))}))]}))}))},getMessageCount:function(e){return x(this,void 0,void 0,(function(){var t=this;return F(this,(function(n){return w()?[2,Ze((function(n){return x(t,void 0,void 0,(function(){var t,o,r,i,a,s;return F(this,(function(c){switch(c.label){case 0:return t=e.conversationType,o=e.targetId,r=e.channelId,[4,n.getMessageCount(t,o,r)];case 1:return i=c.sent(),a=i.code,s=i.data,[2,{code:a,data:s}]}}))}))}))]:[2,{code:i.NOT_SUPPORT,msg:rt[i.NOT_SUPPORT]}]}))}))},getPrivateMessageDeliverTime:function(e){return x(this,void 0,void 0,(function(){var t=this;return F(this,(function(n){return w()?E("messageUId",e,v.STRING,!0)?[2,Ze((function(n,o){return x(t,void 0,void 0,(function(){var t,r,a;return F(this,(function(s){switch(s.label){case 0:return[4,n.getPrivateMessageDeliverTime(e)];case 1:return t=s.sent(),r=t.code,a=t.data,r===i.SUCCESS?[2,{code:r,data:a}]:(o.warn(R.A_GET_PRIVATE_MESSAGE_DELIVER_TIME_E,"code:".concat(r,",messageUId:").concat(e)),[2,{code:r,msg:rt[r]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:rt[i.NOT_SUPPORT]}]}))}))},getGroupMessageDeliverList:function(e,t){return x(this,void 0,void 0,(function(){var n=this;return F(this,(function(o){return w()?E("targetId",e,v.STRING,!0)&&E("messageUId",t,v.STRING,!0)?[2,Ze((function(o,r){return x(n,void 0,void 0,(function(){var n,a,s;return F(this,(function(c){switch(c.label){case 0:return[4,o.getGroupMessageDeliverList(e,t)];case 1:return n=c.sent(),a=n.code,s=n.data,a===i.SUCCESS?[2,{code:a,data:s}]:(r.warn(R.A_GET_GROUP_MESSAGE_DELIVER_LIST_E,"code:".concat(a,", targetId:").concat(e," messageUId:").concat(t)),[2,{code:a,msg:rt[a]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:rt[i.NOT_SUPPORT]}]}))}))},setCheckDuplicateMessage:function(e){return x(this,void 0,void 0,(function(){var t=this;return F(this,(function(n){return w()?E("enableCheck",e,v.BOOLEAN)?[2,Ze((function(n){return x(t,void 0,void 0,(function(){return F(this,(function(t){switch(t.label){case 0:return[4,n.setCheckDuplicateMessage(e)];case 1:return[2,{code:t.sent().code}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:rt[i.NOT_SUPPORT]}]}))}))},clearLocalData:function(){return x(this,void 0,void 0,(function(){var e=this;return F(this,(function(t){return w()?[2,Ze((function(t,n){return x(e,void 0,void 0,(function(){var e,o,r;return F(this,(function(i){switch(i.label){case 0:return n.info(R.O,"clearLocalData ->"),[4,t.clearData()];case 1:return e=i.sent(),o=e.code,r=e.data,[2,{code:o,data:r}]}}))}))}))]:[2,{code:i.NOT_SUPPORT,msg:rt[i.NOT_SUPPORT]}]}))}))},enable:function(){return w()}});function Xo(e){return x(this,void 0,void 0,(function(){var t=this;return F(this,(function(n){return!e||E("proxy.socksHost",e.socksHost,v.STRING,!0)&&E("proxy.socksPort",e.socksPort,v.NUMBER,!0)?[2,Ze((function(n,o){return x(t,void 0,void 0,(function(){var t;return F(this,(function(r){switch(r.label){case 0:return o.info(R.O,"setProxy: ->".concat(e)),[4,n.setProxy(e)];case 1:return(t=r.sent().code)===i.SUCCESS?[2,{code:t}]:(o.warn(R.O,"setProxy ->code:".concat(t)),[2,{code:t,msg:rt[t]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function $o(){return x(this,void 0,void 0,(function(){var e=this;return F(this,(function(t){return[2,Ze((function(t,n){return x(e,void 0,void 0,(function(){var e,o,r;return F(this,(function(a){switch(a.label){case 0:return[4,t.getProxy()];case 1:return e=a.sent(),o=e.code,r=e.data,o===i.SUCCESS?[2,{code:o,data:r}]:(n.warn(R.O,"getProxy ->code:".concat(o)),[2,{code:o,msg:rt[o]}])}}))}))}))]}))}))}function er(e,t){return x(this,void 0,void 0,(function(){var n=this;return F(this,(function(o){return!e||E("proxy.socksHost",e.socksHost,v.STRING,!0)&&E("proxy.socksPort",e.socksPort,v.NUMBER,!0)?[2,Ze((function(o,r){return x(n,void 0,void 0,(function(){var n,a,s;return F(this,(function(c){switch(c.label){case 0:return r.info(R.O,"testProxy: ->".concat(e)),[4,o.testProxy(e,t)];case 1:return n=c.sent(),a=n.status,s=n.data,a===i.SUCCESS?[2,{code:a,msg:s}]:(r.warn(R.O,"testProxy ->code:".concat(a)),[2,{code:a,msg:rt[a]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}export{Sn as BaseMessage,An as CombineMessage,Bn as CommandMessage,jo as ConnectType,Ae as Events,Un as FileMessage,yn as GIFMessage,bn as GroupNotificationMessage,Nn as HQVoiceMessage,On as ImageMessage,Dn as InformationNotificationMessage,Pn as LocationMessage,Wo as MessageType,Ln as ReferenceMessage,wn as RichContentMessage,_n as SightMessage,Cn as TextMessage,Mn as VoiceMessage,$e as __addSDKVersion,Zo as addConversationsToTag,He as addEventListener,Go as addTag,hn as addToBlacklist,In as bindRTCRoomForChatroom,St as clearAllMessagesUnreadStatus,Ye as clearEventListeners,To as clearHistoryMessages,wo as clearMessages,Et as clearMessagesUnreadStatus,gt as clearTextMessageDraft,Do as clearUnreadCountByTimestamp,st as connect,Lo as deleteLocalMessagesByTimestamp,So as deleteMessages,je as destroy,ct as disconnect,Qo as electronExtension,ln as forceRemoveChatRoomEntry,cn as forceSetChatRoomEntry,vn as getAllChatRoomEntries,wt as getAllConversationState,Kt as getAllUltraGroupUnreadCount,Yt as getAllUltraGroupUnreadMentionedCount,Lt as getAllUnreadMentionedCount,mn as getBlacklist,En as getBlacklistStatus,Dt as getBlockUltraGroupList,At as getBlockedConversationList,fn as getChatRoomEntry,rn as getChatRoomInfo,gn as getChatroomHistoryMessages,We as getConnectionStatus,dt as getConversation,ut as getConversationList,_t as getConversationNotificationLevel,Ct as getConversationNotificationStatus,Ko as getConversationsFromTagByPage,Xe as getCurrentUserId,et as getDeviceId,to as getDownloadAuth,eo as getFileToken,no as getFileUrl,Ao as getFirstUnreadMessage,fo as getHistoryMessages,yo as getMessage,_o as getMessageReader,$o as getProxy,vo as getRemoteHistoryMessages,Qe as getServerTime,xo as getTags,Fo as getTagsFromConversation,ft as getTextMessageDraft,yt as getTopConversationList,It as getTotalUnreadCount,ht as getTotalUnreadCountByLevels,Rt as getTotalUnreadMentionedCountByLevels,Ht as getUltraGroupDefaultNotificationLevel,jt as getUltraGroupFirstUnreadMessageTimestamp,Bt as getUltraGroupList,Gt as getUltraGroupMessageListByMessageUId,qt as getUltraGroupUnreadCountByTargetId,Wt as getUltraGroupUnreadInfoList,Zt as getUltraGroupUnreadMentionedCountByTargetId,zt as getUltraGroupUnreadMentionedMessages,Mt as getUnreadConversationList,mt as getUnreadCount,Yo as getUnreadCountByTag,Pt as getUnreadMentionedCount,Mo as getUnreadMentionedMessages,ze as init,Uo as insertMessage,nt as installPlugin,tn as joinChatRoom,nn as joinExistChatRoom,Ft as modifyMessage,Je as onceEventListener,on as quitChatRoom,Eo as recallMessage,Co as registerMessageType,xt as removeAllExpansionForUltraGroupMessage,dn as removeChatRoomEntries,un as removeChatRoomEntry,lt as removeConversation,Ho as removeConversationsFromTag,qe as removeEventListener,Ke as removeEventListeners,kt as removeExpansionForUltraGroupMessage,Rn as removeFromBlacklist,Oo as removeMessageExpansionForKey,Vo as removeTag,qo as removeTagFromConversations,Jo as removeTagsFromConversation,vt as saveTextMessageDraft,Bo as searchConversationByContent,Po as searchMessages,ao as sendFileMessage,co as sendGIFMessage,uo as sendHQVoiceMessage,so as sendImageMessage,oo as sendMessage,go as sendReadReceiptMessage,Io as sendReadReceiptRequest,ho as sendReadReceiptResponse,Ro as sendReadReceiptResponseV2,lo as sendSightMessage,mo as sendSyncReadStatusMessage,ro as sendTextMessage,No as sendTypingStatusMessage,bt as sendUltraGroupTypingStatus,sn as setChatRoomEntries,an as setChatRoomEntry,Ot as setConversationNotificationLevel,Nt as setConversationNotificationStatus,Ut as setConversationToTop,zo as setConversationToTopInTag,bo as setMessageReceivedStatus,Xo as setProxy,Jt as setUltraGroupDefaultNotificationLevel,er as testProxy,Vt as updateExpansionForUltraGroupMessage,po as updateMessageExpansion,ko as updateTag,$n as upload};