@rongcloud/imlib-next 5.7.8 → 5.7.10

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{NetworkType as e,HttpMethod as n,HTTP_TIMEOUT as t,appendUrl as o,ErrorCode as i,ReceivedStatus as r,ConversationType as a,isNumber as s,EventEmitter as c,RCConnectionStatus as u,VersionManage as d,assert as f,AssertRules as l,isArray as g,isHttpUrl as v,APIContext as I,LogTagId as R,logger as h,validate as m,isValidConversationType as E,isValidNotificationLevel as T,NotificationLevel as S,isTypeInConversationList as p,UltraGroupChannelType as O,isString as N,UploadMethod as _,getUUID as C,isValidFileType as A,FileType as y,usingCppEngine as M,MessageDirection as U,SentStatus as P,isUndefined as L}from"@rongcloud/engine";export{ChatroomEntryType,ChatroomUserChangeType,ConnectionStatus,ConversationType,ErrorCode,FileType,LogL,LogLevel,MentionedType,MessageBlockSourceType,MessageBlockType,MessageDirection,NotificationLevel,NotificationStatus,OperateStatus,RCConnectionStatus,ReceivedStatus,SentStatus,UltraGroupChannelChangeType,UltraGroupChannelType,UploadMethod}from"@rongcloud/engine";var w=function(){return w=Object.assign||function(e){for(var n,t=1,o=arguments.length;t<o;t++)for(var i in n=arguments[t])Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i]);return e},w.apply(this,arguments)};function B(e,n,t,o){return new(t||(t=Promise))((function(i,r){function a(e){try{c(o.next(e))}catch(e){r(e)}}function s(e){try{c(o.throw(e))}catch(e){r(e)}}function c(e){var n;e.done?i(e.value):(n=e.value,n instanceof t?n:new t((function(e){e(n)}))).then(a,s)}c((o=o.apply(e,n||[])).next())}))}function D(e,n){var t,o,i,r,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return r={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function s(s){return function(c){return function(s){if(t)throw new TypeError("Generator is already executing.");for(;r&&(r=0,s[0]&&(a=0)),a;)try{if(t=1,o&&(i=2&s[0]?o.return:s[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,s[1])).done)return i;switch(o=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=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(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=n.call(e,a)}catch(e){s=[6,e],o=0}finally{t=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}}var b=function(){return!("undefined"==typeof uni||!function(e){for(var n=["request","getSystemInfo"],t=0,o=n.length;t<o;t++)if(!e[n[t]])return!1;return!0}(uni))},G=b(),x=function(){var e="undefined"!=typeof XMLHttpRequest&&"withCredentials"in new XMLHttpRequest;return"undefined"!=typeof XMLHttpRequest&&e?new XMLHttpRequest:"undefined"!=typeof XDomainRequest?new XDomainRequest:new ActiveXObject("Microsoft.XMLHTTP")};var V,k={tag:"browser",httpReq:function(e){var i=e.method||n.GET,r=e.timeout||t,a=e.headers,s=e.query,c=e.body,u=o(e.url,s);return new Promise((function(e){var n=x(),t="[object XDomainRequest]"===Object.prototype.toString.call(n);if(n.open(i,u),a&&n.setRequestHeader)for(var o in a)n.setRequestHeader(o,a[o]);if(t){n.timeout=r,n.onload=function(){e({data:n.responseText,status:n.status||200})},n.onerror=function(){e({status:n.status})},n.ontimeout=function(){e({status:n.status})};var s="object"==typeof c?JSON.stringify(c):c;n.send(s)}else n.onreadystatechange=function(){4===n.readyState&&e({data:n.responseText,status:n.status})},n.onerror=function(){e({status:n.status})},setTimeout((function(){n.abort(),e({status:n.status})}),r),n.send(c)}))},localStorage:null===window||void 0===window?void 0:window.localStorage,sessionStorage:null===window||void 0===window?void 0:window.sessionStorage,useNavi:!0,connectPlatform:"",isFromUniapp:G,createWebSocket:function(e,n){var t=new WebSocket(e,n);return t.binaryType="arraybuffer",{id:Date.now(),onClose:function(e){t.onclose=function(n){var t=n.code,o=n.reason;e(t,o)}},onError:function(e){t.onerror=e},onMessage:function(e){t.onmessage=function(n){e(n.data)}},onOpen:function(e){t.onopen=e},send:function(e){t.send(e)},close:function(e,n){t.close()}}},getNetworkType:function(){var n=navigator.connection||navigator.mozConnection||navigator.webkitConnection,t=n.type,o=n.effectiveType,i=t||o||e.UNKONWN;return Promise.resolve(i)}},H=b(),F=function(e){return function(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];try{return wx[e].apply(wx,n)}catch(e){null===console||void 0===console||console.error(e)}}},Z={setItem:F("setStorageSync"),getItem:F("getStorageSync"),removeItem:F("removeStorageSync"),clear:F("clearStorageSync")},q={tag:"wechat",httpReq:function(e){var r=e.method||n.GET,a=e.timeout||t,s=e.headers,c=e.query,u=e.body,d=o(e.url,c);return new Promise((function(e){wx.request({url:d,method:r,header:s,timeout:a,data:u,success:function(n){e({data:n.data,status:n.statusCode})},fail:function(){e({status:i.RC_HTTP_REQ_FAIL})}})}))},localStorage:Z,sessionStorage:Z,useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:H,createWebSocket:function(e,n){var t=wx.connectSocket({url:e,protocols:n});return{id:Date.now(),onClose:function(e){t.onClose((function(n){e(n.code,n.reason)}))},onError:function(e){t.onError((function(n){e(n.errMsg)}))},onMessage:function(e){t.onMessage((function(n){e(n.data)}))},onOpen:function(e){t.onOpen(e)},send:function(e){t.send({data:e})},close:function(e,n){t.close({code:e,reason:n})}}},getNetworkType:function(){return new Promise((function(n){wx.getNetworkType({success:function(e){var t=e.networkType;n(t)},fail:function(){n(e.UNKONWN)}})}))}},J=b(),z=function(e){return function(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];try{if("setStorageSync"===e)return my[e]({key:n[0],data:JSON.parse(n[1])});if("clearStorageSync"===e)return my[e]();if("removeStorageSync"===e)return my[e]({key:n[0]});var o=my[e]({key:n[0]}).data;return o?JSON.stringify(o):o}catch(e){}}},K={setItem:z("setStorageSync"),getItem:z("getStorageSync"),removeItem:z("removeStorageSync"),clear:z("clearStorageSync")},Y={tag:"alipay",httpReq:function(e){var r=e.method||n.GET,a=e.timeout||t,s=e.headers,c=e.query,u=e.body,d=o(e.url,c),f=e.dataType||"json";return new Promise((function(e){my.request({url:d,method:r,headers:s,timeout:a,data:u,dataType:f,success:function(n){e({data:n.data,status:n.status})},fail:function(){e({status:i.RC_HTTP_REQ_FAIL})}})}))},localStorage:K,sessionStorage:K,useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:J,createWebSocket:function(e){return my.connectSocket({url:e}),{id:Date.now(),onClose:function(e){my.onSocketClose(e)},onError:function(e){my.onSocketError((function(n){e(n.errMsg)}))},onMessage:function(e){my.onSocketMessage((function(n){n.isBuffer?e(my.base64ToArrayBuffer(n.data)):e(n.data)}))},onOpen:function(e){my.onSocketOpen(e)},send:function(e){my.sendSocketMessage({data:my.arrayBufferToBase64(e),isBuffer:!0})},close:function(){my.closeSocket()}}},getNetworkType:function(){return new Promise((function(n){my.getNetworkType({success:function(e){var t=e.networkType;n(t)},fail:function(){n(e.UNKONWN)}})}))}},j=b(),W=function(e){return function(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];try{return tt[e].apply(tt,n)}catch(e){}}},X={setItem:W("setStorageSync"),getItem:W("getStorageSync"),removeItem:W("removeStorageSync"),clear:W("clearStorageSync")},Q={tag:"toutiao",useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:j,localStorage:X,sessionStorage:X,httpReq:function(e){return new Promise((function(n){tt.request({url:e.url,data:e.body,header:e.headers,method:e.method,success:function(e){var t=(null==e?void 0:e.data)||{},o={data:JSON.stringify(t),status:e.statusCode};n(o)},fail:function(e){n({status:i.RC_HTTP_REQ_FAIL})}})}))},createWebSocket:function(e,n){var t=tt.connectSocket({url:e,protocols:n});return{id:Date.now(),onOpen:function(e){t.onOpen(e)},onClose:function(e){t.onClose((function(n){return e(n.code,n.reason)}))},onError:function(e){t.onError((function(n){return e(n.errMsg)}))},onMessage:function(e){t.onMessage((function(n){return e(n.data)}))},send:function(e){t.send({data:e})},close:function(e,n){t.close({code:e,reason:n})}}},getNetworkType:function(){return new Promise((function(n){tt.getNetworkType({success:function(e){var t=e.networkType;n(t)},fail:function(){n(e.UNKONWN)}})}))}},$=b(),ee=function(e){return function(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];try{return swan[e].apply(swan,n)}catch(e){}}},ne={setItem:ee("setStorageSync"),getItem:ee("getStorageSync"),removeItem:ee("removeStorageSync"),clear:ee("clearStorageSync")},te={tag:"baidu",useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:$,localStorage:ne,sessionStorage:ne,httpReq:function(e){return new Promise((function(n,t){swan.request({url:e.url,data:e.body,header:e.headers,method:e.method,success:function(e){var t=(null==e?void 0:e.data)||{},o={data:JSON.stringify(t),status:e.statusCode};n(o)},fail:function(e){n({status:i.RC_HTTP_REQ_FAIL})}})}))},createWebSocket:function(e,n){var t=swan.connectSocket({url:e,protocols:n});return{id:Date.now(),onOpen:function(e){t.onOpen(e)},onClose:function(e){t.onClose((function(n){return e(n.code,n.reason)}))},onError:function(e){t.onError((function(n){return e(n.errMsg)}))},onMessage:function(e){t.onMessage((function(n){return e(n.data)}))},send:function(e){t.send({data:e})},close:function(e,n){t.close({code:e,reason:n})}}},getNetworkType:function(){return B(this,void 0,void 0,(function(){return D(this,(function(n){return[2,new Promise((function(n){swan.getNetworkType({success:function(e){var t=e.networkType;n(t)},fail:function(){n(e.UNKONWN)}})}))]}))}))}},oe=b(),ie=function(e){return function(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];try{return jd[e].apply(jd,n)}catch(e){null===console||void 0===console||console.error(e)}}},re={setItem:ie("setStorageSync"),getItem:ie("getStorageSync"),removeItem:ie("removeStorageSync"),clear:ie("clearStorageSync")},ae={tag:"jingdong",httpReq:function(e){var r=e.method||n.GET,a=e.timeout||t,s=e.headers,c=e.query,u=e.body,d=o(e.url,c);return new Promise((function(e){jd.request({url:d,method:r,headers:s,timeout:a,data:u,success:function(n){e({data:n.data,status:n.statusCode})},fail:function(){e({status:i.RC_HTTP_REQ_FAIL})}})}))},localStorage:re,sessionStorage:re,useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:oe,createWebSocket:function(e,n){return jd.connectSocket({url:e,protocols:n}),{id:Date.now(),onClose:function(e){jd.onSocketClose((function(n){e(n.code,n.reason)}))},onError:function(e){jd.onSocketError((function(n){e(n.errMsg)}))},onMessage:function(e){jd.onSocketMessage((function(n){e(n.data)}))},onOpen:function(e){jd.onSocketOpen(e)},send:function(e){jd.sendSocketMessage({data:e})},close:function(e,n){jd.closeSocket({code:e,reason:n})}}},getNetworkType:function(){return new Promise((function(n){jd.getNetworkType({success:function(e){var t=e.networkType;n(t)},fail:function(){n(e.UNKONWN)}})}))}},se=function(e){return function(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];try{return uni[e].apply(uni,n)}catch(e){null===console||void 0===console||console.error(e)}}},ce={setItem:se("setStorageSync"),getItem:se("getStorageSync"),removeItem:se("removeStorageSync"),clear:se("clearStorageSync")},ue={tag:"uniapp",httpReq:function(e){var r=e.method||n.GET,a=e.timeout||t,s=e.headers,c=e.query,u=e.body,d=o(e.url,c);return new Promise((function(e){uni.request({url:d,method:r,header:s,timeout:a,data:u,success:function(n){e({data:n.data,status:n.statusCode})},fail:function(){e({status:i.RC_HTTP_REQ_FAIL})}})}))},localStorage:ce,sessionStorage:ce,useNavi:!0,connectPlatform:"",isFromUniapp:!0,createWebSocket:function(e,n){var t={complete:function(){},url:e,protocols:n},o=uni.connectSocket(t);return{id:Date.now(),onClose:function(e){o.onClose((function(n){e(n.code,n.reason)}))},onError:function(e){o.onError((function(n){e(n.errMsg)}))},onMessage:function(e){o.onMessage((function(n){e(n.data)}))},onOpen:function(e){o.onOpen(e)},send:function(e){o.send({data:e})},close:function(e,n){o.close({code:e,reason:n})}}},getNetworkType:function(){return new Promise((function(n){uni.getNetworkType({success:function(e){var t=e.networkType;n(t)},fail:function(){n(e.UNKONWN)}})}))}},de=function(e){return e&&e.request&&e.getSystemInfo},fe="undefined"!=typeof uni&&de(uni)?function(){switch(process.env.VUE_APP_PLATFORM){case"app-plus":return ue;case"mp-jd":return ae;case"mp-baidu":return te;case"mp-toutiao":return Q;case"mp-alipay":return Y;case"mp-weixin":return q;default:return k}}():"undefined"!=typeof jd&&de(jd)?ae:"undefined"!=typeof my&&de(my)?Y:"undefined"!=typeof tt&&de(tt)?Q:"undefined"!=typeof swan&&de(swan)?te:"undefined"!=typeof wx&&de(wx)?q:k;function le(e){var n=e.conversationType,t=e.channelId,o=e.messageType,i=e.content,c=e.senderUserId,u=e.targetId,d=e.sentTime,f=e.receivedTime,l=e.messageUId,g=e.messageDirection,v=e.isPersited,I=e.isCounted,R=e.isOffLineMessage,h=e.canIncludeExpansion,m=e.expansion,E=e.receivedStatus,T=e.disableNotification,S=e.isMentioned,p=e.isStatusMessage,O=e.readReceiptInfo,N=e.pushConfig,_=e.messageId,C=e.isInterrupt,A=e.isModifyMessage,y=e.channelType,M=e.sentStatus;E||(E=r.UNREAD);var U={messageType:o,channelId:t||"",content:i,senderUserId:c,targetId:u,conversationType:n,sentTime:d,receivedTime:f,messageUId:l,messageDirection:g,isPersited:v,isCounted:I,isMentioned:S,disableNotification:T,isStatusMessage:p,canIncludeExpansion:h,expansion:m,receivedStatus:E,readReceiptInfo:O,pushConfig:N,messageId:_,isInterrupt:C,isModifyMessage:A,sentStatus:M};return n!==a.ULTRA_GROUP&&(U.isOffLineMessage=R),n===a.ULTRA_GROUP&&s(y)&&(U.channelType=y),U}function ge(e){var n=e.conversationType,t=e.targetId,o=e.latestMessage,i=e.unreadMessageCount,r=e.hasMentioned,s=e.mentionedInfo,c=e.lastUnreadTime,u=e.notificationStatus,d=e.notificationLevel,f=e.isTop,l=e.channelId,g=e.unreadMentionedCount,v=e.matchCount,I={conversationType:n,targetId:t,latestMessage:o&&le(o),unreadMessageCount:i,hasMentioned:r,mentionedInfo:r?{type:null==s?void 0:s.type,userIdList:null==s?void 0:s.userIdList}:void 0,lastUnreadTime:c,notificationStatus:u,notificationLevel:d,isTop:f,channelId:l,unreadMentionedCount:g,matchCount:v};return I.conversationType===a.ULTRA_GROUP&&(I.firstUnreadMessage=e.firstUnreadMessage,I.channelType=e.channelType),I}function ve(e,n){null===console||void 0===console||console.warn("Method '".concat(e,"' is deprecated, please use '").concat(n,"' 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"}(V||(V={}));var Ie=new c,Re={connection:function(e,n){switch(e){case u.CONNECTED:Ie.emit(V.CONNECTED);break;case u.CONNECTING:Ie.emit(V.CONNECTING);break;case u.SUSPENDED:Ie.emit(V.SUSPEND,n);break;case u.DISCONNECTED:Ie.emit(V.DISCONNECT,n)}},batchMessage:function(e){Ie.emit(V.MESSAGES,{messages:e.map((function(e){return le(e)}))})},typingState:function(e){Ie.emit(V.TYPING_STATUS,{status:e})},readReceiptReceived:function(e,n,t){Ie.emit(V.READ_RECEIPT_RECEIVED,{conversation:e,messageUId:n,sentTime:t})},messageReceiptRequest:function(e,n,t){Ie.emit(V.MESSAGE_RECEIPT_REQUEST,{conversation:e,messageUId:n,senderUserId:t})},messageReceiptResponse:function(e,n,t){Ie.emit(V.MESSAGE_RECEIPT_RESPONSE,{conversation:e,receivedUserId:n,messageUIdList:t})},conversationState:function(e){var n=e.map((function(e){var n=e.conversationType,t={conversationType:n,latestMessage:e.latestMessage?le(e.latestMessage):null,targetId:e.targetId,unreadMessageCount:e.unreadMessageCount,unreadMentionedCount:e.unreadMentionedCount,notificationStatus:e.notificationStatus,notificationLevel:e.notificationLevel,lastUnreadTime:e.lastUnreadTime,channelId:e.channelId};return n===a.ULTRA_GROUP?(t.versionTime=e.versionTime,{conversation:t}):(t.hasMentioned=e.hasMentioned,t.mentionedInfo=e.mentionedInfo,t.isTop=e.isTop,{conversation:t,updatedItems:e.updatedItems})}));Ie.emit(V.CONVERSATION,{conversationList:n})},chatroomState:function(e){Ie.emit(V.CHATROOM,e)},expansion:function(e){Ie.emit(V.EXPANSION,e)},pullFinished:function(){Ie.emit(V.PULL_OFFLINE_MESSAGE_FINISHED)},tag:function(){Ie.emit(V.TAG)},conversationTagChanged:function(){Ie.emit(V.CONVERSATION_TAG)},messageBlocked:function(e){Ie.emit(V.MESSAGE_BLOCKED,e)},messageDelivered:function(e){Ie.emit(V.PRIVATE_MESSAGE_DELIVERED,e)},groupMessageDeliveredStatus:function(e){Ie.emit(V.GROUP_MESSAGE_DELIVERED,e)},ultraGroupEnable:function(e){Ie.emit(V.ULTRA_GROUP_ENABLE,e.map((function(e){return ge(e)})))},operateStatus:function(e){Ie.emit(V.OPERATE_STATUS,e)},ultraGroupMessageExpansionUpdated:function(e){Ie.emit(V.ULTRA_GROUP_MESSAGE_EXPANSION_UPDATED,e.map((function(e){return le(e)})))},ultraGroupMessageModified:function(e){Ie.emit(V.ULTRA_GROUP_MESSAGE_MODIFIED,e.map((function(e){return le(e)})))},ultraGroupMessageRecalled:function(e){Ie.emit(V.ULTRA_GROUP_MESSAGE_RECALLED,e.map((function(e){return le(e)})))},ultraGroupChannelChangeType:function(e){Ie.emit(V.ULTRA_GROUP_CHANNEL_TYPE_CHANGE,e)},ultraGroupChannelUserKicked:function(e){Ie.emit(V.ULTRA_GROUP_CHANNEL_USER_KICKED,e)},ultraGroupChannelDelete:function(e){Ie.emit(V.ULTRA_GROUP_CHANNEL_DELETE,e)},userGroupStatus:function(e){Ie.emit(V.USER_GROUP_STATUS,e)}};d.add("imlib-next","5.7.8");var he=null,me=null,Ee=null;function Te(){return B(this,void 0,void 0,(function(){return D(this,(function(e){switch(e.label){case 0:return he?(Ee.info(R.A_DESTROY_O),[4,I.destroy()]):[2];case 1:return e.sent(),me=null,he=null,Ee=null,[2]}}))}))}function Se(e){if(!he)throw new Error("Not initialized yet!");return e(he,Ee,me)}function pe(e){return he?e(he,Ee,me):Promise.resolve({code:i.BIZ_ERROR_CLIENT_NOT_INIT})}function Oe(e,n,t){Ie.on(e,n,t)}function Ne(e,n,t){Ie.once(e,n,t)}function _e(e,n,t){Ie.off(e,n,t)}function Ce(e){Ie.removeAll(e)}function Ae(){Ie.clear()}function ye(e){!function(e){var n,t=e.appkey,o=e.navigators;he?Ee.warn(R.A_INIT_REPEAT_O):(f("options.appkey",e.appkey,l.STRING,!0),f("options.navigators",e.navigators,(function(e){return g(e)&&(0===e.length||e.every(v))})),me=e,he=I.init((null===(n=e.__runtimeCreator__)||void 0===n?void 0:n.call(e))||fe,{appkey:e.appkey,navigators:e.navigators||[],miniCMPProxy:e.customCMP||[],logOutputLevel:e.logOutputLevel,__reportLogLevel:e.__reportLogLevel,httpInMainProcess:!!e.httpInMainProcess,logExpireTime:e.logExpireTime}),(Ee=he.createLogger("RC-IM","IM")).setOutputLevel(e.logOutputLevel),Ee.info(R.A_INIT_O,JSON.stringify({appkey:t,navigators:o,version:"5.7.8",commit:"a8c6bdefd42b849d4ba9a105ecf5c00403c17522"})),he.assignWatcher(Re),h.init(Ee))}(e)}function Me(){return B(this,void 0,void 0,(function(){return D(this,(function(e){return he?(Ae(),[2,Te()]):[2]}))}))}function Ue(){return Se((function(e){return e.getConnectionStatus()}))}function Pe(){return Se((function(e){return e.getServerTime()}))}function Le(){return Se((function(e){return e.getCurrentUserId()}))}function we(e,n){d.add(e,n)}function Be(){return Se((function(e){return e.getDeviceId()}))}function De(e,n){return Se((function(t){return t.install(e,n)}))}var be={TIMEOUT:{code:-1,msg:"Network timeout"},SDK_INTERNAL_ERROR:{code:-2,msg:"SDK internal error"},PARAMETER_ERROR:{code:-3,msg:"Please check the parameters, the {param} expected a value of {expect} but received {current}"},REJECTED_BY_BLACKLIST:{code:405,msg:"Blacklisted by the other party"},SEND_TOO_FAST:{code:20604,msg:"Sending messages too quickly"},NOT_IN_GROUP:{code:22406,msg:"Not in group"},ULTRA_GROUP_USER_NOT_IN_PRIVATE_CHANNEL:{code:i.ULTRA_GROUP_USER_NOT_IN_PRIVATE_CHANNEL,msg:"ultra group user not in private channel"},FORBIDDEN_IN_GROUP:{code:22408,msg:"Forbbiden from speaking in the group"},NOT_IN_CHATROOM:{code:23406,msg:"Not in chatRoom"},FORBIDDEN_IN_CHATROOM:{code:23408,msg:"Forbbiden from speaking in the chatRoom"},KICKED_FROM_CHATROOM:{code:23409,msg:"Kicked out and forbbiden from joining the chatRoom"},CHATROOM_NOT_EXIST:{code:23410,msg:"ChatRoom does not exist"},CHATROOM_IS_FULL:{code:23411,msg:"ChatRoom members exceeded"},PARAMETER_INVALID_CHATROOM:{code:23412,msg:"Invalid chatRoom parameters"},ROAMING_SERVICE_UNAVAILABLE_CHATROOM:{code:23414,msg:"ChatRoom message roaming service is not open, Please go to the developer to open this service"},RECALLMESSAGE_PARAMETER_INVALID:{code:25101,msg:"Invalid recall message parameter"},ROAMING_SERVICE_UNAVAILABLE_MESSAGE:{code:25102,msg:"Single group chat roaming service is not open, Please go to the developer to open this service"},PUSHSETTING_PARAMETER_INVALID:{code:26001,msg:"Invalid push parameter"},OPERATION_BLOCKED:{code:20605,msg:"Operation is blocked"},OPERATION_NOT_SUPPORT:{code:20606,msg:"Operation is not supported"},MSG_BLOCKED_SENSITIVE_WORD:{code:21501,msg:"The sent message contains sensitive words"},REPLACED_SENSITIVE_WORD:{code:21502,msg:"Sensitive words in the message have been replaced"},NOT_CONNECTED:{code:30001,msg:"Please connect successfully first"},NAVI_REQUEST_ERROR:{code:30007,msg:"Navigation http request failed"},CMP_REQUEST_ERROR:{code:30010,msg:"CMP sniff http request failed"},CONN_APPKEY_FAKE:{code:31002,msg:"Your appkey is fake"},CONN_MINI_SERVICE_NOT_OPEN:{code:31003,msg:"Mini program service is not open, Please go to the developer to open this service"},CONN_ACK_TIMEOUT:{code:31e3,msg:"Connection ACK timeout"},CONN_TOKEN_INCORRECT:{code:31004,msg:"Your token is not valid or expired"},CONN_NOT_AUTHRORIZED:{code:31005,msg:"AppKey and Token do not match"},CONN_REDIRECTED:{code:31006,msg:"Connection redirection"},CONN_APP_BLOCKED_OR_DELETED:{code:31008,msg:"AppKey is banned or deleted"},CONN_USER_BLOCKED:{code:31009,msg:"User blocked"},CONN_DOMAIN_INCORRECT:{code:31012,msg:"Connect domain error, Please check the set security domain"},ROAMING_SERVICE_UNAVAILABLE:{code:33007,msg:"Roaming service cloud is not open, Please go to the developer to open this service"},RC_CONNECTION_EXIST:{code:34001,msg:"Connection already exists"},CHATROOM_KV_EXCEED:{code:23423,msg:"ChatRoom KV setting exceeds maximum"},CHATROOM_KV_OVERWRITE_INVALID:{code:23424,msg:"ChatRoom KV already exists"},CHATROOM_KV_STORE_NOT_OPEN:{code:23426,msg:"ChatRoom KV storage service is not open, Please go to the developer to open this service"},CHATROOM_KEY_NOT_EXIST:{code:23427,msg:"ChatRoom key does not exist"},MSG_KV_NOT_SUPPORT:{code:34008,msg:"The message cannot be extended"},SEND_MESSAGE_KV_FAIL:{code:34009,msg:"Sending RC expansion message fail"},EXPANSION_LIMIT_EXCEET:{code:34010,msg:"The message expansion size is beyond the limit"},ILLGAL_PARAMS:{code:33003,msg:"Incorrect parameters passed in while calling the interface"},UPLOAD_FILE_FAILED:{code:35020,msg:"File upload failed"},CHATROOM_KV_STORE_NOT_ALL_SUCCESS:{code:23428,msg:"Chatroom kv store not all success"},CHATROOM_KV_STORE_OUT_LIMIT:{code:23429,msg:"Chatroom kv's length is out of limit"},TAG_EXISTS:{code:33101,msg:"The tag already exists"},TAG_NOT_EXIST:{code:33100,msg:"The tag does not exist"},NOT_SUPPORT:{code:i.NOT_SUPPORT,msg:"The method is not supported in a browser!"}},Ge={};for(var xe in be){var Ve=be[xe].code;Ge[Ve]=xe}function ke(e,n){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(o){return[2,pe((function(o,r){return B(t,void 0,void 0,(function(){var t,a,s;return D(this,(function(c){switch(c.label){case 0:return m("token",e,l.STRING,!0)&&m("reconnectKickEnable",n,l.BOOLEAN)?(t=r.createTraceId(),r.info(R.A_CONNECT_T,JSON.stringify({token:e,reconnectKickEnable:n}),t),[4,o.connect(e,!!n,t)]):[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}),t),a.code===i.SUCCESS?[2,{code:a.code,data:{userId:a.userId}}]:[2,{code:a.code,msg:Ge[a.code]}]}}))}))}))]}))}))}function He(e){return h.info(R.A_DISCONNECT_O,{}),Se((function(n){return n.disconnect(e)}))}function Fe(e,n){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(o){return m("options.count",null==e?void 0:e.count,l.NUMBER)&&m("options.startTime",null==e?void 0:e.startTime,l.NUMBER)&&m("options.order",null==e?void 0:e.order,l.NUMBER)&&m("channelId",n,l.CHANNEL_ID)?[2,pe((function(o,r){return B(t,void 0,void 0,(function(){var t,a,s;return D(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,n)];case 1:return t=c.sent(),a=t.code,s=t.data,a===i.SUCCESS&&s?[2,{code:0,data:s.map((function(e){return ge(e)}))}]:(r.warn(R.O,"get conversation list fail ->".concat(a,":").concat(Ge[a])),[2,{code:a,msg:Ge[a]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Ze(e){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(t){return m("options",e,l.CONVERSATION,!0)?[2,pe((function(t,o){return B(n,void 0,void 0,(function(){var n,r,a;return D(this,(function(s){switch(s.label){case 0:return[4,t.getConversation(e.conversationType,e.targetId,e.channelId||"")];case 1:return n=s.sent(),r=n.code,a=n.data,r!==i.SUCCESS?(o.warn(R.O,"getConversation ->code:".concat(r,", targetId:").concat(e.targetId)),[2,{code:r,msg:Ge[r]}]):[2,{code:r,data:a?ge(a):null}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function qe(e){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(t){return m("options",e,l.CONVERSATION,!0)?[2,pe((function(t,o){return B(n,void 0,void 0,(function(){var n,r;return D(this,(function(a){switch(a.label){case 0:return[4,t.removeConversation(e.conversationType,e.targetId,e.channelId)];case 1:return n=a.sent(),r="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),o.debug(R.O,"destroy conversation ->".concat(r)),n!==i.SUCCESS?(o.warn(R.O,"destroy conversation fail ->".concat(n,":").concat(Ge[n],",").concat(r)),[2,{code:n,msg:Ge[n]}]):[2,{code:n}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Je(e){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(t){return m("options",e,l.CONVERSATION,!0)?[2,pe((function(t,o){return B(n,void 0,void 0,(function(){var n,r,a,s;return D(this,(function(c){switch(c.label){case 0:return[4,t.getConversationMessageDraft(e.conversationType,e.targetId,e.channelId)];case 1:return n=c.sent(),r=n.code,a=n.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(Ge[r],",").concat(s)),[2,{code:r,msg:Ge[r]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function ze(e,n){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(o){return m("options",e,l.CONVERSATION,!0)&&m("draft",n,l.STRING,!0)?[2,pe((function(o,r){return B(t,void 0,void 0,(function(){var t,a;return D(this,(function(s){switch(s.label){case 0:return t="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),r.debug(R.O,"set draft ->".concat(t)),[4,o.saveConversationMessageDraft(e.conversationType,e.targetId,n,e.channelId)];case 1:return(a=s.sent())===i.SUCCESS?[2,{code:a}]:(r.warn(R.O,"set draft fail ->".concat(a,":").concat(Ge[a],",").concat(t)),[2,{code:a,msg:Ge[a]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Ke(e){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(t){return m("options",e,l.CONVERSATION,!0)?[2,pe((function(t,o){return B(n,void 0,void 0,(function(){var n,r;return D(this,(function(a){switch(a.label){case 0:return n="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),o.debug(R.O,"delete draft ->".concat(n)),[4,t.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(Ge[r],",").concat(n)),[2,{code:r,msg:Ge[r]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Ye(e,n){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(o){return m("includeMuted",e,l.BOOLEAN,!1)&&m("conversationTypes",n,l.ARRAY,!1)&&!(null==n?void 0:n.some((function(e){return!m("conversationType",e,E)})))?[2,pe((function(o,r){return B(t,void 0,void 0,(function(){var t,a,s;return D(this,(function(c){switch(c.label){case 0:return r.debug(R.O,"get total unread count -> ConversationType:".concat(JSON.stringify(n)," includeMuted:").concat(e)),[4,o.getTotalUnreadCount("",n,e)];case 1:return t=c.sent(),a=t.code,s=t.data,a===i.SUCCESS?[2,{code:a,data:s}]:(r.warn(R.O,"getTotalUnreadCount fail ->".concat(a,":").concat(Ge[a])),[2,{code:a,msg:Ge[a]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function je(e,n){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(o){return!m("conversationTypes",e,l.ARRAY,!0)||!m("levels",n,l.ARRAY,!0)||e.some((function(e){return!m("conversationType",e,E)}))||n.some((function(e){return!m("level",e,T)}))?[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,pe((function(o,r){return B(t,void 0,void 0,(function(){var t,a,s;return D(this,(function(c){switch(c.label){case 0:return[4,o.getTotalUnreadCountByLevels(e,n)];case 1:return t=c.sent(),a=t.code,s=t.data,a===i.SUCCESS?[2,{code:a,data:s}]:(r.warn(R.O,"getTotalUnreadCountByLevels fail ->".concat(a,":").concat(Ge[a])),[2,{code:a,msg:Ge[a]}])}}))}))}))]}))}))}function We(e,n){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(o){return!m("conversationTypes",e,l.ARRAY,!0)||!m("levels",n,l.ARRAY,!0)||e.some((function(e){return!m("conversationType",e,E)}))||n.some((function(e){return!m("level",e,T)}))?[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,pe((function(o,r){return B(t,void 0,void 0,(function(){var t,a,s;return D(this,(function(c){switch(c.label){case 0:return[4,o.getTotalUnreadCountByLevels(e,n,!0)];case 1:return t=c.sent(),a=t.code,s=t.data,a===i.SUCCESS?[2,{code:a,data:s}]:(r.warn(R.O,"getTotalUnreadMentionedCountByLevels fail ->".concat(a,":").concat(Ge[a])),[2,{code:a,msg:Ge[a]}])}}))}))}))]}))}))}function Xe(e){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(t){return m("options",e,l.CONVERSATION,!0)?[2,pe((function(t,o){return B(n,void 0,void 0,(function(){var n,r,a,s;return D(this,(function(c){switch(c.label){case 0:return[4,t.getUnreadCount(e.conversationType,e.targetId,e.channelId)];case 1:return n=c.sent(),r=n.code,a=n.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(Ge[r],",").concat(s)),[2,{code:r,msg:Ge[r]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Qe(e){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(t){return m("options",e,l.CONVERSATION,!0)?[2,pe((function(t,o){return B(n,void 0,void 0,(function(){var n,r;return D(this,(function(a){switch(a.label){case 0:return[4,t.clearUnreadCount(e.conversationType,e.targetId,e.channelId)];case 1:return n=a.sent(),r="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),o.debug(R.O,"clear unreadMsgNum ->".concat(r)),n!==i.SUCCESS?(o.warn(R.O,"clear unreadMsgNum fail ->".concat(n,":").concat(Ge[n],",").concat(r)),[2,{code:n,msg:Ge[n]}]):[2,{code:n}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function $e(){return B(this,void 0,void 0,(function(){var e=this;return D(this,(function(n){return[2,pe((function(n,t){return B(e,void 0,void 0,(function(){return D(this,(function(e){switch(e.label){case 0:return[4,n.clearAllUnreadCount()];case 1:return[2,{code:e.sent()}]}}))}))}))]}))}))}be.ROAMING_SERVICE_UNAVAILABLE.code;var en=function(e,n,t){void 0===t&&(t="");var o="conversationType:".concat(n.conversationType,",targetId:").concat(n.targetId);return e.debug(R.O,"".concat(t," -> ").concat(o)),o},nn=function(e,n,t,o){return void 0===o&&(o=""),B(void 0,void 0,void 0,(function(){var r,a;return D(this,(function(s){switch(s.label){case 0:return r=en(e,n,o),[4,t()];case 1:return(a=s.sent())!==i.SUCCESS?(e.warn(R.O,"".concat(o," fail -> ").concat(a," : ").concat(Ge[a]," , ").concat(r)),[2,{code:a,msg:Ge[a]}]):[2,{code:a}]}}))}))};function tn(e,n){return B(this,void 0,void 0,(function(){return D(this,(function(t){return m("notificationLevel",n,(function(e){return void 0!==S[e]}),!0)&&m("options",e,l.CONVERSATION,!0)?[2,pe((function(t,o){return nn(o,e,(function(){return t.setConversationNotificationLevel(e.conversationType,e.targetId,n,e.channelId)}),"setConversationNotificationLevel")}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function on(e,n){return B(this,void 0,void 0,(function(){return D(this,(function(t){return m("notificationStatus",n,(function(e){return 1===e||2===e}),!0)&&m("options",e,l.CONVERSATION,!0)?[2,pe((function(t,o){return nn(o,e,(function(){return t.setConversationStatus(e.conversationType,e.targetId,void 0,n,e.channelId)}),"setConversationNotificationStatus")}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function rn(e){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(t){return m("options",e,l.CONVERSATION,!0)?[2,pe((function(t,o){return B(n,void 0,void 0,(function(){var n,r,a,s;return D(this,(function(c){switch(c.label){case 0:return n=en(o,e,"getConversationNotificationLevel"),[4,t.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(Ge[a]," , ").concat(n)),[2,{code:a,msg:Ge[a]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function an(e){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(t){return m("options",e,l.CONVERSATION,!0)?[2,pe((function(t,o){return B(n,void 0,void 0,(function(){var n,r,a;return D(this,(function(s){switch(s.label){case 0:return o.info(R.O,"getConversationNotificationStatus ->targetId:".concat(e.targetId,",conversationType:").concat(e.conversationType)),[4,t.getConversationNotificationStatus(e.conversationType,e.targetId,e.channelId)];case 1:return n=s.sent(),r=n.code,a=n.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:Ge[r]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function sn(){return B(this,void 0,void 0,(function(){return D(this,(function(e){return[2,pe((function(e){return e.getBlockConversationList()}))]}))}))}function cn(e,n){return void 0===n&&(n=!0),B(this,void 0,void 0,(function(){var t=this;return D(this,(function(o){return m("options",e,l.CONVERSATION,!0)&&m("isTop",n,l.BOOLEAN)?[2,pe((function(o,r){return B(t,void 0,void 0,(function(){var t,a;return D(this,(function(s){switch(s.label){case 0:return t="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),r.debug(R.O,"set conversation status ->".concat(t)),[4,o.setConversationStatus(e.conversationType,e.targetId,n,void 0,e.channelId)];case 1:return(a=s.sent())!==i.SUCCESS?(r.warn(R.O,"set conversation status fail ->".concat(a,":").concat(Ge[a],",").concat(t)),[2,{code:a,msg:Ge[a]}]):[2,{code:a}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function un(e,n){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(o){return m("conversationTypes",e,l.ARRAY)&&!(null==e?void 0:e.some((function(e){return!m("conversationType",e,E)})))&&m("channelId",n,l.CHANNEL_ID)?[2,pe((function(o,r){return B(t,void 0,void 0,(function(){var t,a,s;return D(this,(function(c){switch(c.label){case 0:return[4,o.getTopConversationList(e,n)];case 1:return t=c.sent(),a=t.code,s=t.data,a===i.SUCCESS&&s?[2,{code:0,data:s.map((function(e){return ge(e)}))}]:(r.warn(R.A_GET_TOP_CONVERSATION_LIST_E,"".concat(a,":").concat(Ge[a])),[2,{code:a,msg:Ge[a]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function dn(e){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(t){return!m("conversationTypes",e,l.ARRAY)||(null==e?void 0:e.some((function(e){return!m("conversationType",e,p)})))?[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,pe((function(t,o){return B(n,void 0,void 0,(function(){var n,o,r;return D(this,(function(a){switch(a.label){case 0:return[4,t.getUnreadConversationList(e)];case 1:return n=a.sent(),o=n.code,r=n.data,o===i.SUCCESS&&r?[2,{code:0,data:r.map((function(e){return ge(e)}))}]:[2,{code:o,msg:Ge[o]}]}}))}))}))]}))}))}function fn(e){return B(this,void 0,void 0,(function(){return D(this,(function(n){return m("options",e,l.CONVERSATION,!0)?[2,pe((function(n,t){return t.debug(R.O,"getUnreadMentionedCount".concat(e.targetId,",channelId:").concat(e.channelId)),n.getUnreadMentionedCount(e)}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function ln(){return B(this,void 0,void 0,(function(){return D(this,(function(e){return[2,pe((function(e,n){return n.debug(R.O,"getAllUnreadMentionedCount"),e.getAllUnreadMentionedCount()}))]}))}))}function gn(){return B(this,void 0,void 0,(function(){return D(this,(function(e){return[2,pe((function(e){return e.getAllConversationState()}))]}))}))}function vn(e){return void 0===e&&(e={}),B(this,void 0,void 0,(function(){var n=this;return D(this,(function(t){return m("options.targetId",e.targetId,l.STRING,!1)&&m("options.channelType",e.channelType,(function(e){return void 0!==O[e]}),!1)?[2,pe((function(t,o){return B(n,void 0,void 0,(function(){var n,r,a;return D(this,(function(s){switch(s.label){case 0:return[4,t.getUltraGroupList(e)];case 1:return n=s.sent(),r=n.code,a=n.data,r===i.SUCCESS?[2,{code:i.SUCCESS,data:a}]:(o.warn(R.O,"get ultragroup ->".concat(r,":").concat(Ge[r])),[2,{code:r,msg:Ge[r]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function In(){return B(this,void 0,void 0,(function(){var e=this;return D(this,(function(n){return[2,pe((function(n,t){return B(e,void 0,void 0,(function(){var e,o,r;return D(this,(function(a){switch(a.label){case 0:return[4,n.getBlockUltraGroupList()];case 1:return e=a.sent(),o=e.code,r=e.data,o===i.SUCCESS?[2,{code:i.SUCCESS,data:r}]:(t.warn(R.O,"get block ultragroup ->".concat(o,":").concat(Ge[o])),[2,{code:o,msg:Ge[o]}])}}))}))}))]}))}))}function Rn(e){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(t){return m("options",e,l.CONVERSATION,!0)?[2,pe((function(t,o){return B(n,void 0,void 0,(function(){var n;return D(this,(function(r){switch(r.label){case 0:return[4,t.sendUltraGroupTypingStatus(e)];case 1:return(n=r.sent().code)===i.SUCCESS?[2,{code:i.SUCCESS}]:(o.warn(R.O,"send ultraGroup OperateStatus ->".concat(n,":").concat(Ge[n])),[2,{code:n,msg:Ge[n]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function hn(e,n){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(o){return m("options",e,l.CONVERSATION,!0)&&m("msgs",n,l.ARRAY,!0)?[2,pe((function(o,r){return B(t,void 0,void 0,(function(){var t,a,s,c,u,d,f,l,g,v;return D(this,(function(I){switch(I.label){case 0:return t=e.targetId,a=e.conversationType,s=e.channelId,c=[],n.forEach((function(e){var n=e.sendTime,t=e.messageUId;c.push({sendTime:n,messageUId:t,channelId:s})})),u={targetId:t,conversationType:a,messages:c},[4,o.getUltraGroupMessageListByMessageUId(u)];case 1:if(d=I.sent(),f=d.code,l=d.data,f===i.SUCCESS){for(v in g={},l)g[v]=l[v]?le(l[v]):void 0;return[2,{code:i.SUCCESS,data:g}]}return r.warn(R.O,"get UltraGroup MessageList by messageUId ->".concat(f,":").concat(Ge[f])),[2,{code:f,msg:Ge[f]}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function mn(e,n){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(o){return m("expansion",e,l.OBJECT,!0)&&m("message",n,l.OBJECT,!0)?[2,pe((function(o,r){return B(t,void 0,void 0,(function(){var t,a,s,c,u,d,f,l,g;return D(this,(function(v){switch(v.label){case 0:return t=n.conversationType,a=n.targetId,s=n.messageUId,c=n.sentTime,u=n.canIncludeExpansion,d=n.channelId,f="conversationType:".concat(t,",targetId:").concat(a,",channelId:").concat(d,",messageUId:").concat(s),r.debug(R.O,"update expansion for ultragroup message ->".concat(f)),l={targetId:a,channelId:d,conversationType:t,sendTime:c,canIncludeExpansion:u,messageUId:s,expansion:e},[4,o.expandUltraMessage(l)];case 1:return(g=v.sent().code)===i.SUCCESS?[2,{code:i.SUCCESS}]:(r.warn(R.O,"update expansion for ultragroup message ->".concat(g,":").concat(Ge[g])),[2,{code:g,msg:Ge[g]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function En(e,n){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(o){return m("expansion",e,l.ARRAY,!0)&&m("message",n,l.OBJECT,!0)?[2,pe((function(o,r){return B(t,void 0,void 0,(function(){var t,a,s,c,u,d,f,l,g;return D(this,(function(v){switch(v.label){case 0:return t=n.conversationType,a=n.targetId,s=n.messageUId,c=n.sentTime,u=n.canIncludeExpansion,d=n.channelId,f="conversationType:".concat(t,",targetId:").concat(a,",channelId:").concat(d,",messageUId:").concat(s),r.debug(R.O,"remove expansion for ultragroup message ->".concat(f)),l={targetId:a,channelId:d,conversationType:t,sendTime:c,canIncludeExpansion:u,messageUId:s,keys:e},[4,o.expandUltraMessage(l)];case 1:return(g=v.sent().code)===i.SUCCESS?[2,{code:i.SUCCESS}]:(r.warn(R.O,"remove expansion for ultraGroup message ->".concat(g,":").concat(Ge[g])),[2,{code:g,msg:Ge[g]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Tn(e){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(t){return m("message",e,l.OBJECT,!0)?[2,pe((function(t,o){return B(n,void 0,void 0,(function(){var n,r,a,s,c,u,d,f,l;return D(this,(function(g){switch(g.label){case 0:return n=e.conversationType,r=e.targetId,a=e.messageUId,s=e.sentTime,c=e.canIncludeExpansion,u=e.channelId,d="conversationType:".concat(n,",targetId:").concat(r,",channelId:").concat(u,",messageUId:").concat(a),o.debug(R.O,"remove all expansion for ultraGroup message ->".concat(d)),f={targetId:r,channelId:u,conversationType:n,sendTime:s,canIncludeExpansion:c,messageUId:a,removeAll:!0},[4,t.expandUltraMessage(f)];case 1:return(l=g.sent().code)===i.SUCCESS?[2,{code:i.SUCCESS}]:(o.warn(R.O,"remove all expansion for ultraGroup message ->".concat(l,":").concat(Ge[l])),[2,{code:l,msg:Ge[l]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Sn(e,n){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(o){return m("content",e,l.OBJECT,!0)&&m("message",n,l.OBJECT,!0)?[2,pe((function(o,r){return B(t,void 0,void 0,(function(){var t,a,s,c,u,d,f,l,g,v;return D(this,(function(I){switch(I.label){case 0:return t=n.conversationType,a=n.targetId,s=n.messageUId,c=n.senderUserId,u=n.sentTime,d=n.canIncludeExpansion,f=n.channelId,l="conversationType:".concat(t,",targetId:").concat(a,",channelId:").concat(f,",messageUId:").concat(s),r.debug(R.O,"update ultragroup message expansion ->".concat(l)),g={targetId:a,channelId:f,conversationType:t,fromUserId:c,sendTime:u,canIncludeExpansion:d,messageUId:s,content:e},[4,o.modifyMessage(g)];case 1:return(v=I.sent().code)===i.SUCCESS?[2,{code:i.SUCCESS}]:(r.warn(R.O,"modify ultraGroup message ->".concat(v,":").concat(Ge[v])),[2,{code:v,msg:Ge[v]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function pn(e,n){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(o){return m("targetId",e,l.STRING,!0)&&m("notificationLevels",n,l.ARRAY)&&!(null==n?void 0:n.some((function(e){return!m("notificationLevel",e,T)})))?[2,pe((function(o,r){return B(t,void 0,void 0,(function(){var t,a,s;return D(this,(function(c){switch(c.label){case 0:return r.debug(R.O,"get UltraGroup unreadMentionedCount by targetId: ".concat(e,", notificationLevels: ").concat(JSON.stringify(n))),[4,o.getUltraGroupUnreadMentionedCountByTargetId(e,n)];case 1:return t=c.sent(),a=t.code,s=t.data,a===i.SUCCESS?[2,{code:i.SUCCESS,data:s}]:(r.warn(R.O,"get UltraGroup unreadMentionedCount by targetId error ->".concat(a,":").concat(Ge[a])),[2,{code:a,msg:Ge[a]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function On(e){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(t){return m("options.targetId",e.targetId,l.STRING,!0)&&m("options.channelId",e.channelId,l.CHANNEL_ID)?[2,pe((function(t,o){return B(n,void 0,void 0,(function(){var n,r,a,s,c;return D(this,(function(u){switch(u.label){case 0:return n="getUltraGroupDefaultNotificationLevel",r="targetId: ".concat(e.targetId,", channelId: ").concat(e.channelId),o.debug(R.O,"".concat(n," -> ").concat(r)),[4,t.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(n," fail -> ").concat(s," : ").concat(Ge[s]," , ").concat(r)),[2,{code:s,msg:Ge[s]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Nn(e,n){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(o){return e.channelId=e.channelId||"",m("options.targetId",e.targetId,l.STRING,!0)&&m("options.channelId",e.channelId,l.CHANNEL_ID,!0)&&m("notificationLevel",n,(function(e){return void 0!==S[e]}),!0)?[2,pe((function(o,r){return B(t,void 0,void 0,(function(){var t,a,s;return D(this,(function(c){switch(c.label){case 0:return t="setUltraGroupDefaultNotificationLevel",a="targetId: ".concat(e.targetId,", channelId: ").concat(e.channelId),r.debug(R.O,"".concat(t," -> ").concat(a)),[4,o.setUltraGroupDefaultNotificationLevel(e.targetId,n,e.channelId)];case 1:return(s=c.sent().code)===i.SUCCESS?[2,{code:s}]:(r.warn(R.O,"".concat(t," fail -> ").concat(s," : ").concat(Ge[s]," , ").concat(a)),[2,{code:s,msg:Ge[s]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function _n(e,n){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(o){return m("targetId",e,l.STRING,!0)&&m("notificationLevels",n,l.ARRAY)&&!(null==n?void 0:n.some((function(e){return!m("notificationLevel",e,T)})))?[2,pe((function(o,i){return B(t,void 0,void 0,(function(){var t,r,a,s,c;return D(this,(function(u){switch(u.label){case 0:return t="getUltraGroupUnreadCountByTargetId",[4,o.getUltraGroupUnreadCountByTargetId(e,n)];case 1:return r=u.sent(),a=r.code,s=r.data,c="targetId: ".concat(e,", levels: ").concat(JSON.stringify(n)),i.debug(R.O,"".concat(t," -> ").concat(c)),[2,{code:a,data:s}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Cn(){return B(this,void 0,void 0,(function(){var e=this;return D(this,(function(n){return[2,pe((function(n,t){return B(e,void 0,void 0,(function(){var e,o,r,a;return D(this,(function(s){switch(s.label){case 0:return e="getAllUltraGroupUnreadCount",[4,n.getAllUltraGroupUnreadCount()];case 1:return o=s.sent(),r=o.code,a=o.data,t.debug(R.O,e),r===i.SUCCESS?[2,{code:r,data:a}]:(t.warn(R.O,"".concat(e," fail ->").concat(r,": ").concat(Ge[r])),[2,{code:r,msg:Ge[r]}])}}))}))}))]}))}))}function An(){return B(this,void 0,void 0,(function(){var e=this;return D(this,(function(n){return[2,pe((function(n,t){return B(e,void 0,void 0,(function(){var e,o,r,a;return D(this,(function(s){switch(s.label){case 0:return e="getAllUltraGroupUnreadMentionedCount",!0,[4,n.getAllUltraGroupUnreadCount(true)];case 1:return o=s.sent(),r=o.code,a=o.data,t.debug(R.O,e),r===i.SUCCESS?[2,{code:r,data:a}]:(t.warn(R.O,"".concat(e," fail ->").concat(r,": ").concat(Ge[r])),[2,{code:r,msg:Ge[r]}])}}))}))}))]}))}))}function yn(e){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(t){return e.channelId=e.channelId||"",m("options.targetId",e.targetId,l.STRING,!0)&&m("options.channelId",e.channelId,l.CHANNEL_ID,!0)&&m("options.sentTime",e.sentTime,l.NUMBER,!0)&&m("options.count",e.count,(function(e){return s(e)&&e>0&&e<=50}),!0)?[2,pe((function(t,o){return B(n,void 0,void 0,(function(){var n,r,a,s,c,u,d,f;return D(this,(function(l){switch(l.label){case 0:return n=e.targetId,r=e.channelId,a=e.sentTime,s=e.count,c={targetId:n,channelId:r,sentTime:a,count:s},[4,t.getUltraGroupUnreadMentionedMessages(c)];case 1:return u=l.sent(),d=u.code,f=u.data,d===i.SUCCESS?[2,{code:d,data:f}]:(o.warn(R.O,"getUltraGroupUnreadMentionedMessages fail ->".concat(d,": ").concat(Ge[d])),[2,{code:d,msg:Ge[d]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Mn(e){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(t){return m("conversation.targetId",e.targetId,l.STRING,!0)&&m("conversation.channelId",e.channelId,l.CHANNEL_ID,!0)?[2,pe((function(t){return B(n,void 0,void 0,(function(){var n,o,r,a,s,c;return D(this,(function(u){switch(u.label){case 0:return n=e.targetId,o=e.channelId,r={targetId:n,channelId:o},[4,t.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:Ge[s]}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}var Un=function(e){return!!(m("options.key",e.key,l.STRING,!0)&&m("options.value",e.value,l.STRING,!0)&&m("options.isAutoDelete",e.isAutoDelete,l.BOOLEAN)&&m("options.isSendNotification",e.isSendNotification,l.BOOLEAN)&&m("options.notificationExtra",e.notificationExtra,l.STRING))},Pn=function(e){return e.entries.every((function(e){return m("entry.key",e.key,l.STRING,!0)&&m("entry.value",e.value,l.STRING,!0)}))&&m("options.isAutoDelete",e.isAutoDelete,l.BOOLEAN)&&m("options.notificationExtra",e.notificationExtra,l.STRING)&&m("options.isForce",e.isForce,l.BOOLEAN)},Ln=function(e){return m("options.key",e.key,l.STRING,!0)&&m("options.isSendNotification",e.isSendNotification,l.BOOLEAN)&&m("options.notificationExtra",e.notificationExtra,l.STRING)},wn=function(e){return e.entries.every((function(e){return m("key",e,l.STRING,!0)}))&&m("options.notificationExtra",e.notificationExtra,l.STRING)};function Bn(e,n){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(o){return m("targetId",e,l.STRING,!0)&&m("options.count",n.count,l.NUMBER,!0)?[2,pe((function(o,r){return B(t,void 0,void 0,(function(){var t,a,s;return D(this,(function(c){switch(c.label){case 0:return t=r.createTraceId(),r.info(R.A_JOIN_CHATROOM_T,JSON.stringify({chatroomId:e,count:n.count,joinExist:!1}),t),[4,o.joinChatroom(e,n.count,t)];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()}),t),a!==i.SUCCESS?[2,{code:a,msg:Ge[a]}]:[2,{code:a}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Dn(e,n){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(o){return m("targetId",e,l.STRING,!0)&&m("options.count",n.count,l.NUMBER,!0)?[2,pe((function(o,r){return B(t,void 0,void 0,(function(){var t,a,s;return D(this,(function(c){switch(c.label){case 0:return t=r.createTraceId(),r.info(R.A_JOIN_CHATROOM_T,JSON.stringify({chatroomId:e,count:n.count,joinExist:!0}),t),[4,o.joinExistChatroom(e,n.count,t)];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()}),t),a!==i.SUCCESS?[2,{code:a,msg:Ge[a]}]:[2,{code:a}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function bn(e){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(t){return m("targetId",e,l.STRING,!0)?[2,pe((function(t,o){return B(n,void 0,void 0,(function(){var n,r,a;return D(this,(function(s){switch(s.label){case 0:return n=o.createTraceId(),o.info(R.A_QUIT_CHATROOM_T,JSON.stringify({chatroomId:e}),n),[4,t.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}),n),r!==i.SUCCESS?[2,{code:r,msg:Ge[r]}]:[2,{code:r}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Gn(e,n){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(o){return m("targetId",e,l.STRING,!0)&&m("options.count",n.count,l.NUMBER)&&m("options.order",n.order,(function(e){return[0,1,2].includes(e)}))?[2,pe((function(o,r){return B(t,void 0,void 0,(function(){var t,a,s,c;return D(this,(function(u){switch(u.label){case 0:return t="id:".concat(e),r.debug(R.O,"get chatroom info ->".concat(t)),[4,o.getChatroomInfo(e,n.count,n.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(Ge[s],",").concat(t)),[2,{code:s,msg:Ge[s]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function xn(e,n){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(o){return m("targetId",e,l.STRING,!0)&&Un(n)?[2,pe((function(o,r){return B(t,void 0,void 0,(function(){var t,a;return D(this,(function(s){switch(s.label){case 0:return t="id:".concat(e),r.debug(R.O,"set chatroom entry->".concat(t)),[4,o.setChatroomEntry(e,n)];case 1:return(a=s.sent())!==i.SUCCESS?(r.warn(R.O,"set chatroom entry fail ->code+:".concat(Ge[a],",").concat(t)),[2,{code:a,msg:Ge[a]}]):[2,{code:a}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Vn(e,n){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(o){return m("targetId",e,l.STRING,!0)&&Pn(n)?n.entries.length>10?[2,be.CHATROOM_KV_STORE_OUT_LIMIT]:[2,pe((function(o,r){return B(t,void 0,void 0,(function(){var t,a,s,c;return D(this,(function(u){switch(u.label){case 0:return t="id:".concat(e),r.debug(R.O,"set chatroom entry->".concat(t)),[4,o.setChatroomEntries(e,n)];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(Ge[s],",").concat(t)),[2,{code:s,msg:Ge[s],data:c}]):[2,{code:s}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function kn(e,n){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(o){return m("targetId",e,l.STRING,!0)&&Un(n)?[2,pe((function(o,r){return B(t,void 0,void 0,(function(){var t,a;return D(this,(function(s){switch(s.label){case 0:return t="id:".concat(e),r.debug(R.O,"force set chatroom entry ->".concat(t)),[4,o.forceSetChatroomEntry(e,n)];case 1:return(a=s.sent())!==i.SUCCESS?(r.warn(R.O,"force set chatroom entry fail ->code+:".concat(Ge[a],",").concat(t)),[2,{code:a,msg:Ge[a]}]):[2,{code:a}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Hn(e,n){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(o){return m("targetId",e,l.STRING,!0)&&Ln(n)?[2,pe((function(o,r){return B(t,void 0,void 0,(function(){var t,a;return D(this,(function(s){switch(s.label){case 0:return t="id:".concat(e),r.debug(R.O,"remove chatroom entry->".concat(t)),[4,o.removeChatroomEntry(e,n)];case 1:return(a=s.sent())!==i.SUCCESS?(r.warn(R.O,"remove chatroom entry fail ->code+:".concat(Ge[a],",").concat(t)),[2,{code:a,msg:Ge[a]}]):[2,{code:a}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Fn(e,n){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(o){return m("targetId",e,l.STRING,!0)&&wn(n)?[2,pe((function(o,r){return B(t,void 0,void 0,(function(){var t,a,s,c,u;return D(this,(function(d){switch(d.label){case 0:return t="id:".concat(e),r.info(R.O,"remove chatroom entry->".concat(t)),(a=w({},n)).entries=n.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(Ge[c],",").concat(t)),[2,{code:c,msg:Ge[c],data:u}]):[2,{code:c}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Zn(e,n){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(o){return m("targetId",e,l.STRING,!0)&&Ln(n)?[2,pe((function(o,r){return B(t,void 0,void 0,(function(){var t,a;return D(this,(function(s){switch(s.label){case 0:return t="id:".concat(e),r.info(R.O,"force remove chatroom entry ->".concat(t)),[4,o.forceRemoveChatroomEntry(e,n)];case 1:return(a=s.sent())!==i.SUCCESS?(r.warn(R.O,"force remove chatroom entry fail ->code+:".concat(Ge[a],",").concat(t)),[2,{code:a,msg:Ge[a]}]):[2,{code:a}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function qn(e,n){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(o){return m("targetId",e,l.STRING,!0)&&m("key",n,(function(e){return N(e)&&/[\w+=-]+/.test(e)&&e.length<=128}),!0)?[2,pe((function(o,r){return B(t,void 0,void 0,(function(){var t,a,s,c;return D(this,(function(u){switch(u.label){case 0:return t="id:".concat(e),r.debug(R.O,"get chatroom entry->".concat(t)),[4,o.getChatroomEntry(e,n)];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(Ge[s],",").concat(t)),[2,{code:s,msg:Ge[s]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Jn(e){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(t){return m("targetId",e,l.STRING,!0)?[2,pe((function(t,o){return B(n,void 0,void 0,(function(){var n,r,a,s;return D(this,(function(c){switch(c.label){case 0:return n="id:".concat(e),o.debug(R.O,"get all chatroom entries->".concat(n)),[4,t.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(Ge[a],",").concat(n)),[2,{code:a,msg:Ge[a]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function zn(e,n){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(o){return m("targetId",e,l.STRING,!0)&&m("options.timestamp",n.timestamp,l.NUMBER)&&m("options.count",n.count,l.NUMBER)&&m("options.count",n.count,(function(e){var n=e>0&&e<=100;return n||null===console||void 0===console||console.error('"options.count" is invalid, It should be greater than 0 and less than 100'),n}))&&m("options.order",n.order,(function(e){return 0===e||1===e}))?[2,pe((function(o,r){return B(t,void 0,void 0,(function(){var t,a,s,c,u;return D(this,(function(d){switch(d.label){case 0:return t="id:".concat(e),r.debug(R.O,"get chatroom history message->".concat(t)),[4,o.getChatRoomHistoryMessages(e,n.count,n.order,n.timestamp)];case 1:return a=d.sent(),s=a.code,c=a.data,s===i.SUCCESS&&c?(u=c.list.map((function(e){return le(e)})),[2,{code:s,data:{list:u,hasMore:!!c.hasMore}}]):(r.warn(R.O,"get chatroom history message fail ->code+:".concat(Ge[s],",").concat(t)),[2,{code:s,msg:Ge[s]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Kn(e){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(t){return m("option.chatRoomId",e.chatRoomId,l.STRING,!0)&&m("option.rtcRoomId",e.rtcRoomId,l.STRING,!0)?[2,pe((function(t){return B(n,void 0,void 0,(function(){var n;return D(this,(function(o){switch(o.label){case 0:return[4,t.bindRTCRoomForChatroom(e)];case 1:return[2,{code:n=o.sent(),msg:Ge[n]}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Yn(e){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(t){return m("userId",e,l.STRING,!0)?[2,pe((function(t,o){return B(n,void 0,void 0,(function(){return D(this,(function(n){switch(n.label){case 0:return o.info(R.O,"addToBlacklist -> userId: ".concat(e)),[4,t.addToBlacklist(e)];case 1:return[2,{code:n.sent()}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function jn(e){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(t){return m("userId",e,l.STRING,!0)?[2,pe((function(t,o){return B(n,void 0,void 0,(function(){return D(this,(function(n){switch(n.label){case 0:return o.info(R.O,"removeFromBlacklist -> userId: ".concat(e)),[4,t.removeFromBlacklist(e)];case 1:return[2,{code:n.sent()}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Wn(){return B(this,void 0,void 0,(function(){var e=this;return D(this,(function(n){return[2,pe((function(n,t){return B(e,void 0,void 0,(function(){var e,o,r;return D(this,(function(a){switch(a.label){case 0:return t.info(R.O,"getBlacklist -> "),[4,n.getBlacklist()];case 1:return e=a.sent(),o=e.code,r=e.data,o===i.SUCCESS&&r?[2,{code:o,data:r}]:(t.warn(R.O,"getBlacklist fail -> code: ".concat(o)),[2,{code:o}])}}))}))}))]}))}))}function Xn(e){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(t){return m("userId",e,l.STRING,!0)?[2,pe((function(t,o){return B(n,void 0,void 0,(function(){var n,r,a;return D(this,(function(s){switch(s.label){case 0:return o.info(R.O,"getBlacklistStatus -> userId: ".concat(e)),[4,t.getBlacklistStatus(e)];case 1:return n=s.sent(),r=n.code,a=n.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 Qn=function(e,n,t,o){void 0===t&&(t=!0),void 0===o&&(o=!0),this.messageType=e,this.content=n,this.isPersited=t,this.isCounted=o};function $n(e,n,t){void 0===n&&(n=!0),void 0===t&&(t=!0);return function(o){return new Qn(e,o,n,t)}}var et,nt,ot=$n("RC:ImgMsg"),it=$n("RC:HQVCMsg"),rt=$n("RC:SightMsg"),at=$n("RC:TxtMsg"),st=$n("RC:CombineMsg"),ct=$n("RC:FileMsg"),ut=$n("RC:GIFMsg"),dt=$n("RC:VcMsg"),ft=$n("RC:LBSMsg"),lt=$n("RC:ReferenceMsg"),gt=$n("RC:ImgTextMsg"),vt={qiniu:function(e,n,t,o){Se((function(i){var r=i.getNaviInfoFromCache();if(1===(null==r?void 0:r.type)&&n.chunk_size&&o.size>n.chunk_size){var a=C();a+=o.name.substr(o.name.lastIndexOf(".")),o.uniqueName=a,Ot(o,n,t)}else pt(e,n,t,o)}))},baidu:function(e,n,t,o){if(o.size>Rt.BOS_CHUNCK_SIZE)throw new Error("the file size is over 5GB!");var i=n||{};n=n||nt;var r=new XMLHttpRequest,a=Et();if(!i.uploadHost.bos&&!i.bosUploadPath)return;var s=a+It[0][1]+i.bosUploadPath;It.shift();var c=i.bosHeader||{},u={filename:n.uniqueValue||o.uniqueName,name:o.name,downloadUrl:s,isBosRes:!0};r.upload&&n.support_options&&(r.upload.onprogress=function(e){t.onProgress(e.loaded,e.total,!0)});r.onreadystatechange=function(){if(4===r.readyState)if(JSON.parse(r.responseText||"{}").filename=n.uniqueValue,200===r.status){t.onCompleted(u,!0)}else It.length?vt[It[0][0]](e,n,t,o):t.onError("upload fail")},r.open(n.method,s,!0),r.setRequestHeader("authorization",c.bosToken),r.setRequestHeader("x-bce-date",c.bosDate),r.send(o)},aliyun:function(e,n,t,o){if(o.size>Rt.BOS_CHUNCK_SIZE)throw new Error("the file size is over 5GB!");var i=new FormData;i.set("file",e.get("file")),i.set("key",e.get("key")),i.set("token",e.get("token"));var r=It[0][1];It.shift(),e=e||et,n=(n=n||{})||nt;var a=new XMLHttpRequest,s=Et(),c="".concat(s+n.ossBucketName,".").concat(r);a.upload&&n.support_options&&(a.upload.onprogress=function(e){t.onProgress(e.loaded,e.total)});a.onreadystatechange=function(){if(4===a.readyState){var e=JSON.parse(a.responseText||"{}");e.name=n.uniqueValue,e.filename=n.uploadFileName,e.uploadMethod=_?_.ALI:"",200===a.status?t.onCompleted(e):It.length?vt[It[0][0]](i,n,t,o):t.onError("upload fail")}},a.open(n.method,c,!0),console.log("ali:url",c);var u=n.aliHeader||{};e.set("OSSAccessKeyId",u.osskeyId),e.set("policy",u.ossPolicy),e.set("Signature",u.ossSign),e.set("success_action_status",200),e.delete("key"),e.append("key",n.uploadFileName),e.delete("file"),e.append("file",o),a.send(e)},s3:function(e,n,t,o){var i=new FormData,r=new XMLHttpRequest,a=Et(),s=n.contentDisposition,c=It[0][1],u="".concat(a+n.s3BucketName,".").concat(c);console.log("uploadS3:url",u),It.shift(),r.upload&&n.support_options&&(r.upload.onprogress=function(e){t.onProgress(e.loaded,e.total)});r.onreadystatechange=function(){if(4===r.readyState){var i=JSON.parse(r.responseText||"{}");if(i.name=n.uniqueValue,i.filename=n.uploadFileName,i.uploadMethod=_.AWS,200===r.status||204===r.status)t.onCompleted(i);else if(It.length){var a=new FormData;a.set("file",e.get("file")),a.set("key",e.get("key")),a.set("token",e.get("token")),vt[It[0][0]](a,n,t,o)}else t.onError("upload fail")}},r.open(n.method,u,!0);var d=n?n.s3Header:{},f=o&&o.type;s?i.set("Content-Disposition","".concat(s,";")):i.set("Content-Disposition","text/html"===f?"inline;":"attachment;");i.set("Content-Type",f),i.set("x-amz-credential",d.s3Credential),i.set("x-amz-algorithm",d.s3Algorithm),i.set("x-amz-date",d.s3Date),i.set("policy",d.s3Policy),i.set("x-amz-signature",d.s3Signature),i.set("key",n.uploadFileName),i.set("file",o),r.send(i)},stc:Nt,minio:Nt},It=[],Rt={BOS_CHUNCK_SIZE:5368709120},ht="http://",mt="https://";function Et(){var e=mt;return"http:"!==location.protocol&&"file:"!==location.protocol||(e=ht),e}var Tt,St=(Tt="RC-upload-",{get:function(e){e=Tt+e;var n=localStorage.getItem(e);if(n)return null!==(n=JSON.parse(n||"{}"))&&n.type&&n.data?n.data:null},set:function(e,n){var t=localStorage;e=Tt+e,n={data:n,type:typeof n,updateTime:Date.now()},t.setItem(e,JSON.stringify(n))},remove:function(e){e=Tt+e,localStorage.removeItem(e)}});function pt(e,n,t,o){var i=mt+n.uploadHost.qiniu,r=(/http/.test(It[0][1])?"":Et())+It[0][1]||i;n.isChunk||It.shift();var a=new XMLHttpRequest;a.upload&&n.support_options&&(a.upload.onprogress=function(e){t.onProgress(e.loaded,e.total)}),a.onreadystatechange=function(){if(4===a.readyState){var i=JSON.parse(a.responseText||"{}");i.filename=n.uniqueValue,i.uploadMethod=_?_.QINIU:"",200===a.status||204===a.status?t.onCompleted(i):It.length?vt[It[0][0]](e,n,t,o):t.onError("upload fail")}},a.open(n.method,r,!0),t.onOpen(a),n.stream&&a.setRequestHeader("authorization","UpToken ".concat(n.multi_parmas.token)),function(e,n){for(var t in e)n(t,e[t])}(n.headers,(function(e,n){a.setRequestHeader(e,n)})),a.send(e)}function Ot(e,n,t,o){var i=0,r=o||C(),a=St.get(r);a&&(e.uniqueName=a.sessionId,i=a.offset);var s=Math.min(n.chunk_size,e.size-i),c=e.slice(i,i+s),u=e.uniqueName;n.multi_parmas.name=u,n.filesize=e.size;var d="bytes=".concat(i,"-").concat(i+s);n.headers={Range:d,"X-File-TransactionId":u,"X-File-Total-Size":e.size},n.isChunk=!0,c.name=e.name,c=function(e,n,t){var o=new FormData;for(var i in n.unique_key&&o.append(n.unique_key,t),o.append(n.file_data_name,e,e.name),n.multi_parmas){var r=n.multi_parmas[i];o.append(i,r)}return o}(c,n,e.uniqueName),pt(c,n,{onCompleted:function(o){i+=s;var a=e.uniqueName;St.set(r,{offset:i,sessionId:a}),i<e.size?Ot(e,n,t,r):(i=0,St.remove(r),t.onCompleted(o))},onError:function(e){console.error(e),t.onError(e)},onProgress:function(e,o){var r=e+i;t.onProgress(r,n.filesize)},onOpen:function(e){t.onOpen(e)}},e)}function Nt(e,n,t,o,i){var r=new XMLHttpRequest,a=n.contentDisposition,s=It[0][1],c=i===_.STC?n.stcBucketName:n.minioBucketName,u="https://".concat(s,"/").concat(c,"/").concat(n.uploadFileName);It.shift(),r.upload&&n.support_options&&(r.upload.onprogress=function(e){t.onProgress(e.loaded,e.total)}),r.onreadystatechange=function(){if(4===r.readyState){var a=JSON.parse(r.responseText||"{}");if(a.name=n.uniqueValue,a.filename=n.uploadFileName,a.uploadMethod=i,200===r.status||204===r.status)t.onCompleted(a);else if(It.length){var s=new FormData;s.set("file",e.get("file")),s.set("key",e.get("key")),s.set("token",e.get("token")),vt[It[0][0]](s,n,t,o)}else t.onError("upload fail")}},r.open("PUT",u,!0);var d=n.stcHeader.stcAuthorization,f=n.stcHeader.stcContentSha256,l=n.stcHeader.stcDate;i===_.MINIO&&(d=n.minioHeader.minioAuthorization,f=n.minioHeader.minioContentSha256,l=n.minioHeader.minioDate),r.setRequestHeader("Content-Type",o.type),a?r.setRequestHeader("Content-Disposition","".concat(a,";")):r.setRequestHeader("Content-Disposition","text/html"===o.type?"inline;":"attachment;"),r.setRequestHeader("Authorization",d),r.setRequestHeader("x-amz-content-sha256",f),r.setRequestHeader("x-amz-date",l),r.send(o)}function _t(e,n,t,o,i,r){var a,s,c=n&&n.type||"text/plain",u=c.indexOf("image")>-1?1:4,d=t.contentDisposition,f=Math.ceil(n.size/t.stc_chunk_size),l=i===_.STC?t.stcBucketName:t.minioBucketName,g="uploads";e.getFileToken(u,n.name,"POST",g).then((function(e){a=e.fileName,s="https://".concat(r,"/").concat(l,"/").concat(a),console.log("uploadStcMultipart:url",s);var t=new XMLHttpRequest;t.open("POST","".concat(s,"?").concat(g),!0),d?t.setRequestHeader("Content-Disposition","".concat(d,";")):t.setRequestHeader("Content-Disposition","text/html"===n.type?"inline;":"attachment;");var u=e.stcAuthorization,v=e.stcContentSha256,I=e.stcDate;i===_.MINIO&&(u=e.minioAuthorization,v=e.minioContentSha256,I=e.minioDate),t.setRequestHeader("Authorization",u),t.setRequestHeader("x-amz-content-sha256",v),t.setRequestHeader("x-amz-date",I),t.setRequestHeader("Content-Type",c),t.send(),t.onreadystatechange=function(){if(4===t.readyState){var e=t.response.match(/(?:<UploadId>)(\S*?)(?:<\/UploadId>)/);console.log("uploadId",e),200===t.status||204===t.status?function(e){for(var n=[],t=1;t<=f;t++)n.push(h(e,t));R(e,n)}(Array.isArray(e)&&e[1]):o.onError("uploadStcMultipart:did not get uploadId")}}}),(function(e){o.onError("uploadStcMultipart:".concat(e))}));var v=[],I=new Map;function R(t,r){r&&Array.isArray(r)&&0!==r.length&&Promise.all(r).then((function(){var r="uploadId=".concat(t);if(I.size===f)e.getFileToken(u,a,"POST",r).then((function(e){console.log("onSuccess",e),console.log("onSuccess:uploadId",t);var u=e.stcAuthorization,d=e.stcContentSha256,f=e.stcDate;i===_.MINIO&&(u=e.minioAuthorization,d=e.minioContentSha256,f=e.minioDate);var l=new XMLHttpRequest;l.open("POST","".concat(s,"?").concat(r),!0),l.setRequestHeader("Authorization",u),l.setRequestHeader("x-amz-content-sha256",d),l.setRequestHeader("x-amz-date",f),l.setRequestHeader("Content-Type",c);var g="<CompleteMultipartUpload xmlns='http://s3.amazonaws.com/doc/2006-03-01/'>",v=Array.from(I.keys()||[]).sort((function(e,n){return e-n}));console.log("keys",v),v.forEach((function(e){g+="<Part><ETag>".concat(I.get(e),"</ETag><PartNumber>").concat(e,"</PartNumber></Part>")})),g+="</CompleteMultipartUpload>",l.send(g),console.log("xml",g),l.onreadystatechange=function(){if(4===l.readyState)if(200===l.status||204===l.status){var e={name:n.name,filename:a,uploadMethod:i};o.onCompleted(e)}else o.onError("uploadStcMultipart:upload does not end")}}),(function(e){o.onError("uploadStcMultipart:".concat(e))}));else{for(var d=[],l=0,g=v;l<g.length;l++){var m=g[l];d.push(h(t,m))}R(t,d)}}),(function(e){console.error(e),o.onError("uploadStcMultipart: chunkFiles upload failed and those will reupload");for(var n=[],i=0,r=v;i<r.length;i++){var a=r[i];n.push(h(t,a))}R(t,n)}))}function h(o,r){return new Promise((function(d,f){var l="partNumber=".concat(r,"&uploadId=").concat(o);e.getFileToken(u,a,"PUT",l).then((function(e){console.log("signature ".concat(r," onSuccess"),e);var o=n&&n.slice((r-1)*t.stc_chunk_size,r*t.stc_chunk_size);console.log("fileChunk:size",o.size);var a=e.stcAuthorization,u=e.stcContentSha256,g=e.stcDate;i===_.MINIO&&(a=e.minioAuthorization,u=e.minioContentSha256,g=e.minioDate);var R=new XMLHttpRequest;R.open("PUT","".concat(s,"?").concat(l),!0),R.setRequestHeader("Authorization",a),R.setRequestHeader("x-amz-content-sha256",u),R.setRequestHeader("x-amz-date",g),R.setRequestHeader("Content-Type",c),R.send(o),R.onreadystatechange=function(){if(4===R.readyState)if(200===R.status||204===R.status){var e=R.getResponseHeader("etag");console.log("etag:".concat(r),e),I.set(r,e),d(e)}else v.includes(r)||v.push(r),f(r)}}),(function(e){console.log("getETags:签名验证失败"),v.includes(r)||v.push(r),f(r)}))}))}}var Ct={form:function(e,n){var t=new FormData;if(n.unique_key){var o=e.name.substr(e.name.lastIndexOf(".")),i=At()+o;t.append(n.unique_key,i),n.uniqueValue=i}return t.append(n.file_data_name,e),yt(n.multi_parmas,(function(e,n){t.append(e,n)})),t},json:function(e,n){var t={};if(n.unique_key){var o=e.name.substr(e.name.lastIndexOf(".")),i=At()+o;t[n.unique_key]=i,n.uniqueValue=i}return t[n.file_data_name]=e,yt(n.multi_parmas,(function(e,n){t[e]=n})),JSON.stringify(t)},data:function(e,n){return e}};function At(){var e=(new Date).getTime();return"xxxxxx4xxxyxxxxxxx".replace(/[xy]/g,(function(n){var t=(e+16*Math.random())%16|0;return e=Math.floor(e/16),("x"===n?t:3&t|8).toString(16)}))}function yt(e,n){for(var t in e)n(t,e[t])}var Mt,Ut=0,Pt=function(){function e(e){this.options=function(e){var n={domain:"",method:"POST",file_data_name:"file",unique_key:"key",base64_size:4194304,chunk_size:4194304,bos_chunk_size:4294967296,stc_chunk_size:10485760,headers:{},multi_parmas:{},query:{},support_options:!0,data:Ct.form,genUId:At};if(!e||!e.domain)throw new Error("domain is null");for(var t in e)n[t]=e[t];return n}(e)}return e.prototype.setOptions=function(e){var n=this;yt(e,(function(e,t){n.options[e]=t}))},e.prototype.upload=function(e,n,t,o){if(t){var i=this;!function(e,n,t,o,i){et=t,nt=o,It=[];var r,a,s=e.getNaviInfoFromCache();if(1===(null==s?void 0:s.type)&&n.uploadDomain&&!o.ossConfig)It=[["qiniu",n.uploadDomain]];else if(o.ossConfig){var c,u,d,f=JSON.parse(o.ossConfig),l="",g=[];f.forEach((function(e){var n=Number(e.p)-1;for(var t in e)"aliyun"===t&&(l=e[t]),"s3"===t&&(c=e[t]),"stc"===t&&(u=e[t]),"minio"===t&&(d=e[t]),"p"!==t&&(g[n]=[t,e[t]])})),g.forEach((function(e){e&&It.push(e)})),f.length!==It.length&&(It=[["qiniu",o.domain],["baidu",o.uploadHost.bos],["aliyun",l],["s3",c],["stc",u],["minio",d]])}else It=[["qiniu",o.domain],["baidu",o.uploadHost.bos]];if(o.ossConfig){var v=o&&JSON.parse(o.ossConfig);Array.isArray(v)||(v=[]),r=v.find((function(e){return Object.keys(e).includes("stc")})),a=v.find((function(e){return Object.keys(e).includes("minio")}))}if(r&&1===parseInt(r.p,10)&&t.size>=4194304)_t(e,t,o,i,_.STC,r.stc);else if(a&&1===parseInt(a.p,10)&&t.size>=4194304)_t(e,t,o,i,_.MINIO,a.minio);else{var I=o.data(t,o);vt[It[0][0]](I,o,i,t,_.MINIO)}}(e,n,t,this.options,{onProgress:function(e,n,t){(Mt=e,t)?Mt=Ut+e/n*(n-Ut):Ut=Mt;o.onProgress(Mt,n)},onCompleted:function(e){o.onCompleted(e)},onError:function(e){o.onError(e)},onOpen:function(e){i.xhr=e}})}else o.onError("upload file is null.")},e.prototype.cancel=function(){var e;null===(e=this.xhr)||void 0===e||e.abort()},e}();var Lt,wt,Bt={init:function(e){return new Pt(e)},dataType:Ct,resize:function(e,n,t){var o=document.createElement("canvas"),i=new FileReader;i.readAsDataURL(e),i.onload=function(e){var i=e.target.result,r=new Image;r.src=i;var a=r.width,s=r.height,c=function(e,n){var t=1,o=e.width,i=n.maxWidth||0;i>0&&o>i&&(t=i/o);var r=e.height,a=n.maxHeight||0;if(a>0&&r>a){var s=a/r;t=Math.min(t,s)}var c=n.maxSize||0,u=Math.ceil(e.size/1e3);if(u>c){var d=c/u;t=Math.min(t,d)}return t}({width:a,height:s,size:e.total},n),u=i;c<1&&(u=function(e,n,t){o.width=n,o.height=t;var i=o.getContext("2d");return i.drawImage(e,0,0,n,t),o.toDataURL("image/jpg")}(r,a*c,s*c)),t(u)}},Upload:Pt},Dt=function(e,n,t){var o=document.createElement("canvas"),i=o.getContext("2d"),r=new Image,a="string"==typeof e;r.onload=function(a){var s=function(e,n,t){var o,i,r,a=e<n,s=0,c=0;return(a?n/e:e/n)>t.scale?(a?(i=100,c=((r=n/(o=e/100))-t.maxHeight)/2):(r=100,s=((i=e/(o=n/100))-t.maxWidth)/2),{w:i,h:r,x:-s,y:-c}):(a?(o=n/t.maxHeight,r=t.maxHeight,i=e/o):(o=e/t.maxWidth,i=t.maxWidth,r=n/o),{w:i,h:r,x:-s,y:-c})}(r.width,r.height,n);o.width=s.w>n.maxWidth?n.maxWidth:s.w,o.height=s.h>n.maxHeight?n.maxHeight:s.h,i.drawImage(r,s.x,s.y,s.w,s.h);var c=o.toDataURL("string"==typeof e?"image/jpg":e.type,n.quality);c=c.replace(/data:image\/[^;]+;base64,/,""),t(c)},r.src=a?"data:image/jpg;base64,".concat(e):function(e){var n=window.URL||window.webkitURL;return n?n.createObjectURL(e):""}(e)},bt=function(e,n){var t=e.file,o=e.compress;Dt(t,o,n)},Gt=function(e,n){if(e.getToken)e.getToken((function(t,o){o=o||{},e.multi_parmas=e.multi_parmas||{},e.multi_parmas.token=t,e.uploadHost=e.uploadHost||{},e.uploadHost.bos=o.bos,e.ossConfig=o.ossConfig,e.bosHeader=e.bosHeader||{},e.bosHeader.bosDate=o.bosDate,e.bosHeader.bosToken=o.bosToken,e.bosUploadPath=o.path,e.aliHeader={},e.aliHeader.osskeyId=o.osskeyId,e.aliHeader.ossPolicy=o.ossPolicy,e.aliHeader.ossSign=o.ossSign,e.ossBucketName=o.ossBucketName,e.uploadFileName=o.fileName,e.s3Header={},e.s3Header.s3Credential=o.s3Credential,e.s3Header.s3Algorithm=o.s3Algorithm,e.s3Header.s3Date=o.s3Date,e.s3Header.s3Policy=o.s3Policy,e.s3Header.s3Signature=o.s3Signature,e.s3BucketName=o.s3BucketName,e.stcHeader={},e.stcHeader.stcAuthorization=o.stcAuthorization,e.stcHeader.stcContentSha256=o.stcContentSha256,e.stcHeader.stcDate=o.stcDate,e.stcBucketName=o.stcBucketName,e.minioHeader={},e.minioHeader.minioAuthorization=o.minioAuthorization,e.minioHeader.minioContentSha256=o.minioContentSha256,e.minioHeader.minioDate=o.minioDate,e.minioBucketName=o.minioBucketName,e.headers=e.headers||{},e.base64&&(e.headers["Content-type"]="application/octet-stream",e.headers.Authorization="UpToken ".concat(t));var i=Bt.init(e);n(i)}));else{e.headers=e.headers||{},e.base64&&(e.headers["Content-type"]="application/octet-stream");var t=Bt.init(e);n(t)}},xt=function(e,n,t,o,i){o.upload(e,n,t.file,{onError:function(e){i.onError(e)},onProgress:function(e,n){i.onProgress(e,n)},onCompleted:function(e){e.filename=e.filename||e.hash;var n=t.compressThumbnail||bt;t.compress?n(t,(function(n){e.thumbnail=n,i.onCompleted(e)})):i.onCompleted(e)}})},Vt=function(){function e(e){this.instance=e}return e.prototype.upload=function(e,n,t,o){xt(e,n,{file:t},this.instance,o)},e.prototype.cancel=function(){this.instance.cancel()},e}(),kt=function(){function e(e,n){this.instance=e,this.cfg=n}return e.prototype.upload=function(e,n,t,o){var i={file:t,compress:this.cfg};xt(e,n,i,this.instance,o)},e.prototype.cancel=function(){this.instance.cancel()},e}(),Ht={initFile:function(e,n){Gt(e,(function(e){var t=new Vt(e);n(t)}))},initImage:function(e,n){Gt(e,(function(t){var o,i,r,a,s={maxHeight:(null===(o=e.thumbnailConfig)||void 0===o?void 0:o.maxHeight)||160,maxWidth:(null===(i=e.thumbnailConfig)||void 0===i?void 0:i.maxWidth)||160,quality:(null===(r=e.thumbnailConfig)||void 0===r?void 0:r.quality)||.5,scale:(null===(a=e.thumbnailConfig)||void 0===a?void 0:a.scale)||2.4},c=new kt(t,s);n(c)}))},dataType:Bt.dataType};function Ft(e,n,t,o,i,r,a){var s=this;void 0===a&&(a=y.FILE);var c=y.FILE;a===y.IMAGE&&(c=y.IMAGE);var u=e.getNaviInfoFromCache();if(!wt&&(wt="upload.qiniup.com",u&&u.ossConfig))try{var d=JSON.parse(u.ossConfig).find((function(e){return void 0!==e.qiniu}));d&&(wt=d.qiniu)}catch(e){}var f=w({domain:wt,getToken:function(n){e.getFileToken(c,o.name).then((function(e){n(e.token,e)})).catch((function(e){i.onFail(e)}))}},r),l=Ht.initFile;c===y.IMAGE&&(l=Ht.initImage),l(f,(function(n){n.upload(e,t,o,{onProgress:function(e,n){var t,o=Math.floor(e/n*100);null===(t=i.onProgress)||void 0===t||t.call(i,o)},onCompleted:function(e){return B(s,void 0,void 0,(function(){return D(this,(function(n){return 1!==(null==u?void 0:u.type)||(null==u?void 0:u.ossConfig)?(function(e,n,t,o,i){zt(n,o.filename,o.name,o,o.uploadMethod).then((function(r){if(0===r.code){var a=r.data;a.type=t.type,a.name=o.name||o.filename,e!==y.AUDIO?(n===y.IMAGE&&(a.thumbnail=o.thumbnail,a.width=o.w,a.height=o.h,a.size=o.size),i.onSuccess(a)):Zt(t).then((function(e){i.onSuccess(w(w({},a),e))}))}else i.onFail(r)})).catch((function(e){i.onFail(e)}))}(a,c,o,e,i),[2]):(function(e,n,t,o,i,r){var a={type:o.type,name:i.rc_url.file_name,downloadUrl:e.uploadDomain+i.rc_url.path};if(n===y.AUDIO)return void Zt(o).then((function(e){r.onSuccess(w(w({},a),e))}));n===y.IMAGE&&(a.thumbnail=i.thumbnail,a.width=i.w,a.height=i.h,a.size=i.size);r.onSuccess(a)}(t,a,0,o,e,i),[2])}))}))},onError:function(e){i.onFail(e)}})}))}function Zt(e){return new Promise((function(n){if("function"!=typeof e.arrayBuffer){var t=new FileReader;t.onload=function(){t.result?qt(t.result).then((function(e){n(e)}),(function(){n({})})):n({})},t.onerror=function(){n({duration:0})},t.readAsArrayBuffer(e)}else e.arrayBuffer().then(qt).then((function(e){n(e)}))}))}function qt(e){return Lt=Lt||new AudioContext,new Promise((function(n,t){Lt.decodeAudioData(e,(function(e){n({duration:e.duration,length:e.length})}),t)}))}function Jt(e,n,t,o){return pe((function(r){return new Promise((function(a){r.getFileToken(e,n,t,o).then((function(e){a({code:i.SUCCESS,data:e})})).catch((function(e){a({code:e,msg:Ge[e]})}))}))}))}function zt(e,n,t,o,r){return m("fileType",e,A,!0)&&m("filename",n,l.STRING)&&m("saveName",t,l.STRING)&&m("serverType",r,l.NUMBER)?pe((function(a){return new Promise((function(s){a.getFileUrl(e,n,t,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 Kt(e,n,t){return B(this,void 0,void 0,(function(){var o=this;return D(this,(function(s){return[2,pe((function(s,c){return B(o,void 0,void 0,(function(){var o,u,d,f,g,v,I,h,E,T,S,p;return D(this,(function(O){switch(O.label){case 0:return t=t||{},n instanceof Qn==!1?(c.warn(R.O,"send message fail -> message parameter is not an instance of BaseMessage"),[2,be.ILLGAL_PARAMS]):m("conversation",e,l.OBJECT,!0)?(o=e.conversationType,u=e.targetId,d=e.channelId,m("conversation.targetId",u,l.STRING,!0)&&m("conversation.conversationType",o,l.NUMBER,!0)&&m("conversation.channelId",d,l.CHANNEL_ID)&&m("options.isStatusMessage",null==t?void 0:t.isStatusMessage,l.BOOLEAN)&&m("options.disableNotification",null==t?void 0:t.disableNotification,l.BOOLEAN)&&m("options.pushContent",null==t?void 0:t.pushContent,l.STRING)&&m("options.pushData",null==t?void 0:t.pushData,l.STRING)&&m("options.isMentioned",null==t?void 0:t.isMentioned,l.BOOLEAN)&&m("options.mentionedType",null==t?void 0:t.mentionedType,l.NUMBER)&&m("options.mentionedUserIdList",null==t?void 0:t.mentionedUserIdList,l.ARRAY)&&m("options.directionalUserIdList",null==t?void 0:t.directionalUserIdList,l.ARRAY)&&m("options.isVoipPush",null==t?void 0:t.isVoipPush,l.BOOLEAN)&&m("options.canIncludeExpansion",null==t?void 0:t.canIncludeExpansion,l.BOOLEAN)&&m("options.expansion",null==t?void 0:t.expansion,l.OBJECT)&&m("options.pushConfig",null==t?void 0:t.pushConfig,l.OBJECT)&&m("options.messageId",null==t?void 0:t.messageId,l.NUMBER)?(f="conversationType:".concat(o,",targetId:").concat(u),c.debug(R.O,"send message ->".concat(f)),g=function(e,n,t){var o=e.isStatusMessage,i=e.disableNotification,r=e.pushContent,a=e.pushData,s=e.isMentioned,c=e.mentionedType,u=e.mentionedUserIdList,d=e.directionalUserIdList,f=e.isVoipPush,l=e.canIncludeExpansion,g=e.expansion,v=e.isFilerWhiteBlacklist,I=e.pushConfig,R=e.messageId,h=t.channelId;return w({isStatusMessage:o,disableNotification:i,pushContent:r,pushData:a,isMentioned:s,mentionedType:c,mentionedUserIdList:u,directionalUserIdList:d,isVoipPush:f,canIncludeExpansion:l,expansion:g,isFilerWhiteBlacklist:v,pushConfig:I,channelId:h||"",messageId:R},n)}(t,n,e),v={isMentioned:!!t.isMentioned,content:n.content,messageType:n.messageType,isPersited:!!n.isPersited,isCounted:!!n.isCounted,disableNotification:!!(null==t?void 0:t.disableNotification),canIncludeExpansion:!!(null==t?void 0:t.canIncludeExpansion),expansion:(null==t?void 0:t.expansion)||null,conversationType:e.conversationType,targetId:e.targetId,channelId:e.channelId,senderUserId:s.getCurrentUserId(),messageUId:"",messageDirection:U.SEND,receivedTime:0,isStatusMessage:!!t.isStatusMessage,receivedStatus:r.UNREAD,isOffLineMessage:!1,pushConfig:null==t?void 0:t.pushConfig,sentStatus:P.SENDING},o!==a.ULTRA_GROUP&&(v.isOffLineMessage=!1),I=c.createTraceId(),h=function(e){v.messageId=e;try{(null==t?void 0:t.onSendBefore)&&t.onSendBefore(le(v))}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:n.messageType,conversationType:o,targetId:u,channelId:d}),I),[4,s.sendMessage(o,u,g,h,I)]):[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]):[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}];case 1:return E=O.sent(),T=E.code,S=E.data,T===i.SUCCESS?(c.info(R.A_SEND_MSG_R,JSON.stringify({code:T,messageUId:S.messageUId,messageId:S.messageId}),I),p=le(S),[2,{code:T,data:p}]):(c.warn(R.A_SEND_MSG_R,"send message fail ->".concat(T,":").concat(Ge[T],",").concat(f)),v.sentTime=(null==S?void 0:S.sentTime)||0,v.sentStatus=null==S?void 0:S.sentStatus,[2,{code:T,msg:Ge[T],data:le(v)}])}}))}))}))]}))}))}function Yt(e,n,t){return Kt(e,new at(n),t)}function jt(e,n){return function(t,o,r,a){if(!m("sendOptions.contentDisposition",null==a?void 0:a.contentDisposition,(function(e){return["inline","attachment"].includes(e)})))return Promise.resolve({code:i.BIZ_ERROR_INVALID_PARAMETER});var s={contentDisposition:null==a?void 0:a.contentDisposition};if(a&&"thumbnailConfig"in a){var c=null==a?void 0:a.thumbnailConfig;if(!(m("sendOptions.maxHeight",null==c?void 0:c.maxHeight,l.NUMBER)&&m("sendOptions.maxWidth",null==c?void 0:c.maxWidth,l.NUMBER)&&m("sendOptions.quality",null==c?void 0:c.quality,l.NUMBER)&&m("sendOptions.scale",null==c?void 0:c.scale,l.NUMBER)))return Promise.resolve({code:i.BIZ_ERROR_INVALID_PARAMETER});s.thumbnailConfig=c}return pe((function(c,u,d){return new Promise((function(f){var l=u.createTraceId();u.info(R.L_MEDIA_UPLOAD_T,JSON.stringify({filesize:o.file.size,type:e}),l),Ft(c,0,d,o.file,{onProgress:null==r?void 0:r.onProgress,onSuccess:function(e){var s,c=(null===(s=null==r?void 0:r.onComplete)||void 0===s?void 0:s.call(r,w({url:e.downloadUrl},e)))||n(e,o);e&&e.downloadUrl&&u.info(R.L_MEDIA_UPLOAD_R,JSON.stringify({downurl:e.downloadUrl,code:i.SUCCESS}),l),Kt(t,c,a).then(f)},onFail:function(e){u.warn(R.L_MEDIA_UPLOAD_R,JSON.stringify({code:i.UPLOAD_FILE_FAILED}),l),f({code:i.UPLOAD_FILE_FAILED,msg:e||i[i.UPLOAD_FILE_FAILED]})}},s,e)}))}))}}var Wt=jt(y.FILE,(function(e,n){return new ct({name:e.name,size:n.file.size,type:(t=e.name,o=t.match(/\.(\w+)$/),o?o[1]:"bin"),fileUrl:e.downloadUrl,user:n.user,extra:n.extra});var t,o})),Xt=jt(y.IMAGE,(function(e,n){return new ot({content:e.thumbnail,imageUri:e.downloadUrl,user:n.user,extra:n.extra})})),Qt=jt(y.IMAGE,(function(e,n){return new ut({gifDataSize:e.size,remoteUrl:e.downloadUrl,width:e.width,height:e.height,user:n.user,extra:n.extra})})),$t=jt(y.AUDIO,(function(e,n){return new it({remoteUrl:e.downloadUrl,duration:e.duration,type:e.type,user:n.user,extra:n.extra})})),eo=jt(y.SIGHT,(function(e,n){return new rt({sightUrl:e.downloadUrl,content:n.thumbnail,duration:n.duration,size:n.file.size||e.size,name:n.name||e.name,user:n.user,extra:n.extra})}));function no(e,n){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(o){return m("options.timestamp",null==n?void 0:n.timestamp,l.NUMBER)&&m("options.count",null==n?void 0:n.count,l.NUMBER)&&(M()||m("options.count",null==n?void 0:n.count,(function(e){var n=e>0&&e<=100;return n||null===console||void 0===console||console.error('"options.count" is invalid, It should be greater than 0 and less than 100'),n})))&&m("options.order",null==n?void 0:n.order,(function(e){return 0===e||1===e}))&&m("conversation",e,l.CONVERSATION,!0)?[2,pe((function(o,r){return B(t,void 0,void 0,(function(){var t,a,s,c,u;return D(this,(function(d){switch(d.label){case 0:return t=r.createTraceId(),r.info(R.A_GET_HISTORY_MSG_T,JSON.stringify({targetId:e.targetId,conversationType:e.conversationType,channelId:e.channelId,timestamp:null==n?void 0:n.timestamp,count:null==n?void 0:n.count}),t),[4,o.getHistoryMessage(e.conversationType,e.targetId,null==n?void 0:n.timestamp,null==n?void 0:n.count,null==n?void 0:n.order,null==e?void 0:e.channelId,"",t)];case 1:return a=d.sent(),s=a.code,c=a.data,s===i.SUCCESS&&c?(u=c.list.map((function(e){return le(e)})),r.info(R.A_GET_HISTORY_MSG_R,JSON.stringify({code:s,messageLength:u.length}),t),[2,{code:s,data:{list:u,hasMore:c.hasMore}}]):(r.warn(R.A_GET_HISTORY_MSG_R,JSON.stringify({code:s,messageUIds:""}),t),[2,{code:s,msg:Ge[s]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function to(e,n){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(o){return m("options.timestamp",null==n?void 0:n.timestamp,l.NUMBER)&&m("options.count",null==n?void 0:n.count,l.NUMBER)&&m("options.count",null==n?void 0:n.count,(function(e){var n=e>0&&e<=100;return n||null===console||void 0===console||console.error("options.count is invalid, It should be greater than 0 and less than 100"),n}))&&m("options.order",null==n?void 0:n.order,(function(e){return 0===e||1===e}))&&m("conversation",e,l.CONVERSATION,!0)?[2,pe((function(o,r){return B(t,void 0,void 0,(function(){var t,a,s,c,u;return D(this,(function(d){switch(d.label){case 0:return t="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),r.debug(R.O,"get history message ->".concat(t)),[4,o.getRemoteHistoryMessages(e.conversationType,e.targetId,(null==n?void 0:n.timestamp)||0,(null==n?void 0:n.count)||20,(null==n?void 0:n.order)||0,e.channelId||"")];case 1:return a=d.sent(),s=a.code,c=a.data,s===i.SUCCESS&&c?(u=c.list.map((function(e){return le(e)})),[2,{code:s,data:{list:u,hasMore:c.hasMore}}]):(r.warn(R.O,"get history message fail ->".concat(s,":").concat(Ge[s],",").concat(t)),[2,{code:s,msg:Ge[s]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function oo(e,n,t,o){return B(this,void 0,void 0,(function(){var r=this;return D(this,(function(s){return m("targetId",e,l.STRING,!0)&&m("messageUId",n,l.STRING,!0)&&m("timestamp",t,l.NUMBER,!0)&&m("channelId",o,l.CHANNEL_ID)?[2,pe((function(i){return B(r,void 0,void 0,(function(){var i,r,s,c,u;return D(this,(function(d){switch(d.label){case 0:return i={targetId:e,conversationType:a.PRIVATE,channelId:o},r=new Qn("RC:ReadNtf",{messageUId:n,lastMessageSendTime:t,type:1}),[4,Kt(i,r)];case 1:return s=d.sent(),c=s.code,u=s.msg,0===c?[2,{code:c}]:[2,{code:c,msg:u}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function io(e,n,t){return B(this,void 0,void 0,(function(){var o=this;return D(this,(function(r){return m("messageUId",n,l.STRING,!0)&&m("targetId",e,l.STRING,!0)&&m("channelId",t,l.CHANNEL_ID)?[2,pe((function(i,r){return B(o,void 0,void 0,(function(){var o,i,s,c,u;return D(this,(function(d){switch(d.label){case 0:return o="messageUId:".concat(n,",targetId:").concat(e),r.debug(R.O,"send read receipt message ->".concat(o)),i=new Qn("RC:RRReqMsg",{messageUId:n}),[4,Kt({targetId:e,conversationType:a.GROUP,channelId:t},i)];case 1:return s=d.sent(),c=s.code,u=s.msg,0===c?[2,{code:c}]:[2,{code:c,msg:u}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function ro(e,n,t){return B(this,void 0,void 0,(function(){return D(this,(function(e){throw new Error("This method is deprecated, please use method sendReadReceiptResponseV2.")}))}))}function ao(e,n,t){return B(this,void 0,void 0,(function(){var o=this;return D(this,(function(r){return m("targetId",e,l.STRING,!0)&&m("messageList",n,l.OBJECT,!0)&&m("channelId",t,l.CHANNEL_ID)&&!Object.keys(n).some((function(e){return!m(e,n[e],l.ARRAY)}))?[2,pe((function(r,s){return B(o,void 0,void 0,(function(){var o,c,u,d,f,l;return D(this,(function(g){switch(g.label){case 0:return o={targetId:e,conversationType:a.GROUP,channelId:t},u=r.getNaviInfoFromCache(),1!==(null==u?void 0:u.grpRRVer)?[3,2]:(d=[],Object.keys(n).forEach((function(e){n[e].forEach((function(e){-1===d.indexOf(e)&&d.push(e)}))})),d.length?[4,r.sendReadReceiptMessage(e,d,t)]:(s.warn(R.O,"Error in parameter messageList."),[2,{code:i.PARAMETER_ERROR}]));case 1:return c=g.sent(),[3,4];case 2:return f=new Qn("RC:RRRspMsg",{receiptMessageDic:n}),[4,Kt(o,f)];case 3:c=g.sent(),g.label=4;case 4:return(l=c.code)===i.SUCCESS?[2,{code:l}]:(s.warn(R.O,"send read receipt message fail ->".concat(l,":").concat(Ge[l])),[2,{code:l,msg:Ge[l]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function so(e,n){return B(this,void 0,void 0,(function(){var t,o,r,a;return D(this,(function(s){switch(s.label){case 0:return m("conversation",e,l.CONVERSATION,!0)&&m("lastMessageSendTime",n,l.NUMBER,!0)?(t=new Qn("RC:SRSMsg",{lastMessageSendTime:n}),[4,Kt(e,t)]):[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 co(e,n){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(o){return m("conversation",e,l.CONVERSATION,!0)&&m("options.messageUId",n.messageUId,l.STRING,!0)&&m("options.sentTime",n.sentTime,l.NUMBER,!0)&&m("options.disableNotification",null==n?void 0:n.disableNotification,l.BOOLEAN)&&m("options.pushConfig",null==n?void 0:n.pushConfig,l.OBJECT)?[2,pe((function(o,r){return B(t,void 0,void 0,(function(){var t,a,s,c,u;return D(this,(function(d){switch(d.label){case 0:return t={user:n.user,channelId:e.channelId||"",disableNotification:null==n?void 0:n.disableNotification,pushConfig:null==n?void 0:n.pushConfig,extra:n.extra,isDelete:n.isDelete},a="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId,",messageUId:").concat(n.messageUId),r.debug(R.O,"recall message ->".concat(a)),[4,o.recallMessage(e.conversationType,e.targetId,n.messageUId,n.sentTime,t)];case 1:return s=d.sent(),c=s.code,u=s.data,c===i.SUCCESS&&u?[2,{code:c,data:le(u)}]:c===i.SUCCESS?[2,{code:c}]:(r.warn(R.O,"recall message fail ->".concat(c,":").concat(Ge[c],",").concat(a)),[2,{code:c,msg:Ge[c]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function uo(e,n){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(o){return m("conversation",e,l.CONVERSATION,!0)&&m("options",n,(function(e){return g(e)&&e.length}),!0)&&!n.some((function(e){return!m("options.messageUId",e.messageUId,l.STRING,!0)||!m("options.sentTime",e.sentTime,l.NUMBER,!0)||!m("options.messageDirection",e.messageDirection,(function(e){return 1===e||2===e}),!0)}))?[2,pe((function(o,r){return B(t,void 0,void 0,(function(){var t,a;return D(this,(function(s){switch(s.label){case 0:return t="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),r.debug(R.O,"delete messages ->".concat(t)),[4,o.deleteRemoteMessage(e.conversationType,e.targetId,n,e.channelId)];case 1:return(a=s.sent())!==i.SUCCESS?(r.warn(R.O,"delete message fail ->".concat(a,":").concat(Ge[a],",").concat(t)),[2,{code:a,msg:Ge[a]}]):[2,{code:i.SUCCESS}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function fo(e,n){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(o){return m("conversation",e,l.CONVERSATION,!0)&&m("timestamp",n,l.NUMBER,!0)?[2,pe((function(o,r){return B(t,void 0,void 0,(function(){var t,a;return D(this,(function(s){switch(s.label){case 0:return t="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),r.debug(R.O,"clear message ->".concat(t)),[4,o.deleteRemoteMessageByTimestamp(e.conversationType,e.targetId,n,e.channelId)];case 1:return(a=s.sent())!==i.SUCCESS?(r.warn(R.O,"clear message ->".concat(a,":").concat(Ge[a],",").concat(t)),[2,{code:a,msg:Ge[a]}]):[2,{code:i.SUCCESS}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function lo(e,n){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(o){return m("expansion",e,l.OBJECT,!0)&&m("message",n,l.OBJECT,!0)&&m("message.conversationType",n.conversationType,l.NUMBER,!0)&&m("message.targetId",n.targetId,l.STRING,!0)&&m("message.channelId",n.channelId,l.CHANNEL_ID)&&m("message.messageUId",n.messageUId,l.STRING,!0)&&m("message.expansion",n.expansion,l.OBJECT)&&m("message.canIncludeExpansion",n.canIncludeExpansion,l.BOOLEAN,!0)?[2,pe((function(o,r){return B(t,void 0,void 0,(function(){var t,a,s,c,u,d,f,l;return D(this,(function(g){switch(g.label){case 0:return t=n.conversationType,a=n.targetId,s=n.messageUId,c=n.canIncludeExpansion,u=n.expansion,d=n.channelId,f="conversationType:".concat(t,",targetId:").concat(a,",messageUId:").concat(s),r.debug(R.O,"update message expansion ->".concat(f)),[4,o.sendExpansionMessage({conversationType:t,targetId:a,messageUId:s,expansion:e,canIncludeExpansion:c,originExpansion:u,channelId:d})];case 1:return(l=g.sent().code)!==i.SUCCESS?(r.warn(R.O,"update message expansion fail ->".concat(l,":").concat(Ge[l],",").concat(f)),[2,{code:l,msg:Ge[l]}]):[2,{code:l}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function go(e,n){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(o){return m("keys",e,l.ARRAY,!0)&&m("message",n,l.OBJECT,!0)&&m("message.conversationType",n.conversationType,l.NUMBER,!0)&&m("message.targetId",n.targetId,l.STRING,!0)&&m("message.channelId",n.channelId,l.CHANNEL_ID)&&m("message.messageUId",n.messageUId,l.STRING,!0)&&m("message.canIncludeExpansion",n.canIncludeExpansion,l.BOOLEAN,!0)?[2,pe((function(o,r){return B(t,void 0,void 0,(function(){var t,a,s,c,u,d,f;return D(this,(function(l){switch(l.label){case 0:return t=n.conversationType,a=n.targetId,s=n.messageUId,c=n.canIncludeExpansion,u=n.channelId,d="conversationType:".concat(t,",targetId:").concat(a,",messageUId:").concat(s),r.debug(R.O,"remove message expansion ->".concat(d)),[4,o.sendExpansionMessage({conversationType:t,targetId:a,messageUId:s,canIncludeExpansion:c,keys:e,channelId:u})];case 1:return(f=l.sent().code)!==i.SUCCESS?(r.warn(R.O,"remove message expansion fail ->".concat(f,":").concat(Ge[f],",").concat(d)),[2,{code:f,msg:Ge[f]}]):[2,{code:f}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function vo(e,n){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(o){return m("conversation",e,l.CONVERSATION,!0)&&m("typingContentType",n,l.STRING,!0)?[2,pe((function(o,r){return B(t,void 0,void 0,(function(){var t,a,s,c,u,d;return D(this,(function(f){switch(f.label){case 0:return t={messageType:"RC:TypSts",content:{typingContentType:n},isStatusMessage:!0,channelId:e.channelId},a=r.createTraceId(),r.info(R.A_SEND_MSG_T,JSON.stringify({messageType:t.messageType,conversationType:e.conversationType,targetId:e.targetId,channelId:e.channelId}),a),[4,o.sendMessage(e.conversationType,e.targetId,t,void 0,a)];case 1:return s=f.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:le(u)}]:[2,{code:c,msg:Ge[c]}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Io(e,n,t){return B(this,void 0,void 0,(function(){var o=this;return D(this,(function(r){return m("messageUId",n,l.STRING,!0)&&m("targetId",e,l.STRING,!0)&&m("channelId",t,l.CHANNEL_ID)?[2,pe((function(r,a){return B(o,void 0,void 0,(function(){var o,s,c,u;return D(this,(function(d){switch(d.label){case 0:return o="messageUId:".concat(n,",targetId:").concat(e),a.debug(R.O,"get message reader ->".concat(o)),[4,r.getMessageReader(e,n,t)];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(Ge[c],",").concat(o)),[2,{code:c,msg:Ge[c]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Ro(e,n,t,o,i){return Se((function(r,a){return f("messageType",e,l.STRING,!0),f("isPersited",n,l.BOOLEAN,!0),f("isCounted",t,l.BOOLEAN,!0),f("isStatusMessage",i,l.BOOLEAN,!1),f("searchProps",o,l.ARRAY),a.info(R.A_REGTYP_O,JSON.stringify({messageType:e,isCounted:t,isStatusMessage:i,isPersited:n})),r.registerMessageType(e,n,t,o,i),$n(e,n,t)}))}function ho(e){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(t){return M()?m("conversation",e,l.CONVERSATION,!0)?[2,pe((function(t,o){return B(n,void 0,void 0,(function(){var n,r,a,s;return D(this,(function(c){switch(c.label){case 0:return[4,t.getFirstUnreadMessage(e.conversationType,e.targetId,e.channelId)];case 1:return n=c.sent(),r=n.code,a=n.data,r===i.SUCCESS?(s=a&&le(a)||null,[2,{code:r,data:s}]):(o.warn(R.O,"insertMessage ->code:".concat(r,",targetId:").concat(e.targetId)),[2,{code:r,msg:Ge[r]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:Ge[i.NOT_SUPPORT]}]}))}))}function mo(e,n,t){return void 0===t&&(t={}),B(this,void 0,void 0,(function(){var o=this;return D(this,(function(r){return ve("RongIMLib.insertMessage","RongIMLib.ElectronExtension.insertMessage"),M()?m("conversation",e,l.CONVERSATION,!0)&&m("message",n,l.OBJECT,!0)&&m("options",t,l.OBJECT)&&m("options.isUnread",null==t?void 0:t.isUnread,l.BOOLEAN)&&m("options.searchContent",null==t?void 0:t.searchContent,l.STRING)&&m("content.senderUserId",n.senderUserId,l.STRING,!0)&&m("content.messageType",n.messageType,l.STRING,!0)&&m("content.content",n.content,l.OBJECT,!0)&&m("content.messageDirection",n.messageDirection,l.NUMBER,!0)&&m("content.canIncludeExpansion",n.canIncludeExpansion,l.BOOLEAN)&&m("content.expansion",n.expansion,l.OBJECT)&&m("content.disableNotification",n.disableNotification,l.BOOLEAN)&&m("content.sentTime",n.sentTime,l.NUMBER)&&m("content.sentStatus",n.sentStatus,l.NUMBER)?[2,pe((function(r,a){return B(o,void 0,void 0,(function(){var o,s,c,u,d,f,l,g,v,I,h,m,E,T,S,p;return D(this,(function(O){switch(O.label){case 0:return o=n.senderUserId,s=n.messageType,c=n.content,u=n.messageDirection,d=n.messageUId,f=n.canIncludeExpansion,l=n.expansion,g=n.disableNotification,v=n.sentTime,I=n.sentStatus,a.info(R.O,"insertMessage ->targetId:".concat(e.targetId,",conversationType:").concat(e.conversationType)),h=t.isUnread,m=t.searchContent,E={senderUserId:o,messageType:s,content:c,messageDirection:u,sentTime:v,sentStatus:I,searchContent:m,isUnread:h,messageUId:d,disableNotification:g,canIncludeExpansion:f,expansionMsg:JSON.stringify(l),channelId:e.channelId||""},[4,r.insertMessage(e.conversationType,e.targetId,E)];case 1:return T=O.sent(),S=T.code,p=T.data,S===i.SUCCESS?[2,{code:S,data:le(p)}]:(a.warn(R.O,"insertMessage ->code:".concat(S,",targetId:").concat(e.targetId)),[2,{code:S,msg:Ge[S]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:Ge[i.NOT_SUPPORT]}]}))}))}function Eo(e){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(t){return M()?m("messageId",e,(function(e){return s(e)||N(e)}),!0)?[2,pe((function(t,o){return B(n,void 0,void 0,(function(){var n,r,a;return D(this,(function(s){switch(s.label){case 0:return[4,t.getMessage(e)];case 1:return n=s.sent(),r=n.code,a=n.data,r===i.SUCCESS?[2,{code:r,data:le(a)}]:(o.warn(R.O,"getMessage ->code:".concat(r,",messageId:").concat(e)),[2,{code:r,msg:Ge[r]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:Ge[i.NOT_SUPPORT]}]}))}))}function To(e){if(!M())return{code:i.NOT_SUPPORT,msg:Ge[i.NOT_SUPPORT]};var n,t=e.conversationType,o=e.targetId,r=e.channelId;return m("conversation",e,l.CONVERSATION,!0)?(n=function(e){var n=e.getUnreadMentionedMessages(t,o,r),a=[];return n&&n.length&&n.forEach((function(e){return a.push(le(e))})),{code:i.SUCCESS,data:a}},he?n(he,Ee,me):{code:i.BIZ_ERROR_CLIENT_NOT_INIT}):{code:i.BIZ_ERROR_INVALID_PARAMETER}}function So(e,n,t,o){return B(this,void 0,void 0,(function(){var r=this;return D(this,(function(a){return ve("RongIMLib.searchMessages","RongIMLib.ElectronExtension.searchMessages"),M()?m("conversation",e,l.CONVERSATION,!0)&&m("keyword",n,l.STRING,!0)&&m("timestamp",t,l.NUMBER)&&m("count",o,l.NUMBER)?[2,pe((function(a,s){return B(r,void 0,void 0,(function(){var r,c,u,d;return D(this,(function(f){switch(f.label){case 0:return 1,[4,a.searchMessageByContent(e.conversationType,e.targetId,n,t,o,1,e.channelId)];case 1:return r=f.sent(),c=r.code,u=r.data,c===i.SUCCESS?(d=[],(null==u?void 0:u.messages)&&u.messages.length&&u.messages.forEach((function(e){return d.push(le(e))})),[2,{code:c,data:{messages:d,count:null==u?void 0:u.count}}]):(s.warn(R.O,"searchMessages ->code:".concat(c,",targetId:").concat(e.targetId)),[2,{code:c,msg:Ge[c]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:Ge[i.NOT_SUPPORT]}]}))}))}function po(e,n,t){return B(this,void 0,void 0,(function(){var o,r,a,s=this;return D(this,(function(c){return ve("RongIMLib.deleteLocalMessagesByTimestamp","RongIMLib.ElectronExtension.deleteMessagesByTimestamp"),M()?(o=e.conversationType,r=e.targetId,a=e.channelId,m("conversationType",o,l.NUMBER,!0)&&m("targetId",r,l.STRING,!0)&&m("timestamp",n,l.NUMBER,!0)&&m("cleanSpace",t,l.BOOLEAN)?[2,pe((function(c,u){return B(s,void 0,void 0,(function(){var s;return D(this,(function(d){switch(d.label){case 0:return[4,c.deleteMessagesByTimestamp(o,r,n,t,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:n})),s===i.SUCCESS?[2,{code:s}]:(u.warn(R.O,"deleteLocalMessagesByTimestamp ->code:".concat(s,",targetId:").concat(e.targetId)),[2,{code:s,msg:Ge[s]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]):[2,{code:i.NOT_SUPPORT,msg:Ge[i.NOT_SUPPORT]}]}))}))}function Oo(e){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(t){return ve("RongIMLib.clearMessages","RongIMLib.ElectronExtension.clearMessages"),M()?[2,pe((function(t,o){return B(n,void 0,void 0,(function(){var n,r,a,s;return D(this,(function(c){switch(c.label){case 0:return n=e.conversationType,r=e.targetId,a=e.channelId,o.info(R.O,"clearMessages ->targetId:".concat(r,",conversationType:").concat(n)),[4,t.clearMessages(n,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:Ge[s]}])}}))}))}))]:[2,{code:i.NOT_SUPPORT,msg:Ge[i.NOT_SUPPORT]}]}))}))}function No(e,n,t,o){return B(this,void 0,void 0,(function(){var r=this;return D(this,(function(a){return ve("RongIMLib.searchConversationByContent","RongIMLib.ElectronExtension.searchConversationByContent"),M()?[2,pe((function(a,s){return B(r,void 0,void 0,(function(){var r,c,u;return D(this,(function(d){switch(d.label){case 0:return s.info(R.O,"searchConversationByContent ->keyword:".concat(e)),[4,a.searchConversationByContent(e,t,o,n)];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:Ge[c]}])}}))}))}))]:[2,{code:i.NOT_SUPPORT,msg:Ge[i.NOT_SUPPORT]}]}))}))}function _o(e,n){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(o){return M()?m("conversation",e,l.CONVERSATION,!0)&&m("timestamp",n,l.NUMBER)?[2,pe((function(o,r){return B(t,void 0,void 0,(function(){var t,a,s,c;return D(this,(function(u){switch(u.label){case 0:return t=e.conversationType,a=e.targetId,s=e.channelId,r.info(R.O,"clearUnreadCountByTimestamp ->targetId:".concat(a,",conversationType:").concat(t)),[4,o.clearUnreadCountByTimestamp(t,a,n,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:Ge[c]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:Ge[i.NOT_SUPPORT]}]}))}))}function Co(e,n){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(o){return ve("RongIMLib.setMessageReceivedStatus","RongIMLib.ElectronExtension.setMessageReceivedStatus"),M()?m("messageId",e,l.NUMBER,!0)&&m("receivedStatus",n,l.NUMBER,!0)?[2,pe((function(o,r){return B(t,void 0,void 0,(function(){var t;return D(this,(function(a){switch(a.label){case 0:return r.info(R.O,"setMessageReceivedStatus ->messageId:".concat(e,",receivedStatus:").concat(n)),[4,o.setMessageReceivedStatus(e,n)];case 1:return(t=a.sent())===i.SUCCESS?[2,{code:t}]:(r.warn(R.O,"setMessageReceivedStatus ->code:".concat(t,",messageId:").concat(e)),[2,{code:t,msg:Ge[t]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:Ge[i.NOT_SUPPORT]}]}))}))}function Ao(e){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(t){return m("tag.tagId",e.tagId,l.STRING,!0)&&m("tag.tagId",e.tagId,(function(e){return e.length<=10}))&&m("tag.tagName",e.tagName,(function(e){return e.length<=15}))&&m("tag.tagName",e.tagName,l.STRING,!0)?[2,pe((function(t,o){return B(n,void 0,void 0,(function(){var n;return D(this,(function(r){switch(r.label){case 0:return o.info(R.O,"createTag ->tagId:".concat(e.tagId,",tagName:").concat(e.tagName)),[4,t.createTag(e)];case 1:return(n=r.sent().code)===i.SUCCESS?[2,{code:n}]:(o.warn(R.O,"createTag ->code:".concat(n,",tagId:").concat(e.tagId)),[2,{code:n,msg:Ge[n]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function yo(e){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(t){return m("tagId",e,l.STRING,!0)?[2,pe((function(t,o){return B(n,void 0,void 0,(function(){var n;return D(this,(function(r){switch(r.label){case 0:return o.info(R.O,"removeTag ->tagId:".concat(e)),[4,t.removeTag(e)];case 1:return(n=r.sent().code)===i.SUCCESS?[2,{code:n}]:(o.warn(R.O,"removeTag ->code:".concat(n,",tagId:").concat(e)),[2,{code:n,msg:Ge[n]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Mo(e){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(t){return m("tag.tagId",e.tagId,l.STRING,!0)&&m("tag.tagName",e.tagName,l.STRING,!0)&&m("tag.tagName",e.tagName,(function(e){return e.length<=15}))?[2,pe((function(t,o){return B(n,void 0,void 0,(function(){var n;return D(this,(function(r){switch(r.label){case 0:return o.info(R.O,"updateTag ->tagId:".concat(e.tagId,",tagName:").concat(e.tagName)),[4,t.updateTag(e)];case 1:return(n=r.sent().code)===i.SUCCESS?[2,{code:n}]:(o.warn(R.O,"updateTag ->code:".concat(n,",tagId:").concat(e.tagId)),[2,{code:n,msg:Ge[n]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Uo(){return B(this,void 0,void 0,(function(){var e=this;return D(this,(function(n){return[2,pe((function(n,t){return B(e,void 0,void 0,(function(){var e,o,r;return D(this,(function(a){switch(a.label){case 0:return[4,n.getTagList()];case 1:return e=a.sent(),o=e.code,r=e.data,t.warn(R.O,"getTagList ->code:".concat(o)),[2,{code:i.SUCCESS,data:r}]}}))}))}))]}))}))}function Po(e){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(t){return m("conversation",e,l.CONVERSATION,!0)?[2,pe((function(t,o){return B(n,void 0,void 0,(function(){var n,r,a;return D(this,(function(s){switch(s.label){case 0:return o.info(R.O,"getTagsForConversation ->targetId:".concat(e.targetId,",conversationType:").concat(e.conversationType)),[4,t.getTagsForConversation(e)];case 1:return n=s.sent(),r=n.code,a=n.data,r===i.SUCCESS?[2,{code:r,data:a}]:[2,{code:r,msg:Ge[r]}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Lo(e,n){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(o){return m("tagId",e,l.STRING,!0)&&m("conversations",n,l.ARRAY,!0)&&!n.some((function(e){return!m("conversation",e,l.CONVERSATION,!0)}))?[2,pe((function(o,r){return B(t,void 0,void 0,(function(){var t;return D(this,(function(a){switch(a.label){case 0:return r.info(R.O,"addTagForConversations ->tagId:".concat(e)),[4,o.addTagForConversations(e,n)];case 1:return(t=a.sent().code)===i.SUCCESS?[2,{code:t}]:(r.warn(R.O,"addTagForConversations ->code:".concat(t,",tagId:").concat(e)),[2,{code:t,msg:Ge[t]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function wo(e,n){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(o){return m("tagId",e,l.STRING,!0)&&m("conversations",n,l.ARRAY,!0)&&!n.some((function(e){return!m("conversation",e,l.CONVERSATION,!0)}))?[2,pe((function(o,r){return B(t,void 0,void 0,(function(){var t;return D(this,(function(a){switch(a.label){case 0:return r.info(R.O,"removeTagForConversations ->tagId:".concat(e)),[4,o.removeTagForConversations(e,n)];case 1:return(t=a.sent().code)===i.SUCCESS?[2,{code:t}]:(r.warn(R.O,"removeTagForConversations ->code:".concat(t,",tagId:").concat(e)),[2,{code:t,msg:Ge[t]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Bo(e,n){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(o){return m("conversation",e,l.CONVERSATION,!0)&&m("tagIds",n,l.ARRAY,!0)&&!n.some((function(e){return!m("tagId",e,l.STRING,!0)}))?[2,pe((function(o,r){return B(t,void 0,void 0,(function(){var t;return D(this,(function(a){switch(a.label){case 0:return r.info(R.O,"removeTagsForConversation ->tagIds:".concat(n,",targetId:").concat(e.targetId,",conversationType:").concat(e.conversationType)),[4,o.removeTagsForConversation(e,n)];case 1:return(t=a.sent().code)===i.SUCCESS?[2,{code:t}]:(r.warn(R.O,"removeTagsForConversation ->code:".concat(t,",tagIds:").concat(n)),[2,{code:t,msg:Ge[t]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Do(e,n){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(o){return m("tagId",e,l.STRING,!0)&&m("conversations",n,l.ARRAY,!0)&&!n.some((function(e){return!m("conversation",e,l.CONVERSATION,!0)}))?[2,pe((function(o,r){return B(t,void 0,void 0,(function(){var t;return D(this,(function(a){switch(a.label){case 0:return r.info(R.O,"removeTagForConversations ->tagId:".concat(e)),[4,o.removeTagForConversations(e,n)];case 1:return(t=a.sent().code)===i.SUCCESS?[2,{code:t}]:(r.warn(R.O,"removeTagForConversations ->code:".concat(t,",tagId:").concat(e)),[2,{code:t,msg:Ge[t]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function bo(e,n,t){return B(this,void 0,void 0,(function(){var o=this;return D(this,(function(r){return m("tagId",e,l.STRING,!0)&&m("count",n,l.NUMBER,!0)&&m("startTime",t,l.NUMBER,!0)?[2,pe((function(r,a){return B(o,void 0,void 0,(function(){var o,s,c;return D(this,(function(u){switch(u.label){case 0:return a.info(R.O,"getConversationListByTag ->tagId:".concat(e)),[4,r.getConversationListByTag(e,t,n)];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 w(w({},ge(e)),{isTopInTag:e.isTopInTag})}(e)}))}]:(a.warn(R.O,"getConversationListByTag ->code:".concat(s,",tagId:").concat(e)),[2,{code:s,msg:Ge[s]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Go(e,n){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(o){return m("tagId",e,l.STRING,!0)&&m("containMuted",n,l.BOOLEAN,!0)?[2,pe((function(o,i){return B(t,void 0,void 0,(function(){var t,r,a;return D(this,(function(s){switch(s.label){case 0:return i.info(R.O,"getUnreadCountByTag ->tagId:".concat(e)),[4,o.getUnreadCountByTag(e,n)];case 1:return t=s.sent(),r=t.code,a=t.data,[2,{code:r,data:a}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function xo(e,n,t){return B(this,void 0,void 0,(function(){var o=this;return D(this,(function(r){return m("tagId",e,l.STRING,!0)&&m("conversation",n,l.CONVERSATION,!0)&&m("status.isTop",t,l.BOOLEAN,!0)?[2,pe((function(r,a){return B(o,void 0,void 0,(function(){var o;return D(this,(function(s){switch(s.label){case 0:return a.info(R.O,"setConversationStatusInTag ->tagId:".concat(e,",targetId:").concat(n.targetId,",conversationType").concat(n.conversationType)),[4,r.setConversationStatusInTag(e,n,{isTop:t})];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:Ge[o]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}jt(y.COMBINE_HTML,(function(e,n){return new st({remoteUrl:e.downloadUrl,nameList:n.nameList,summaryList:n.summaryList,conversationType:n.conversationType,user:n.user,extra:n.extra})}));var Vo={COMET:"comet",WEBSOCKET:"websocket"},ko={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 Ho=Object.freeze({__proto__:null,getAllConversationList:function(e){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(t){return M()?m("channelId",e,l.CHANNEL_ID)?[2,pe((function(t,o){return B(n,void 0,void 0,(function(){var n,r,a,s;return D(this,(function(c){switch(c.label){case 0:return o.info(R.O,"getAllConversationList -> channelId: ".concat(e)),L(e)?[4,t.getConversationListWithAllChannel()]:[3,2];case 1:return n=c.sent(),[3,4];case 2:return[4,t.getConversationList(void 0,void 0,void 0,void 0,e)];case 3:n=c.sent(),c.label=4;case 4:return r=n.code,a=n.data,r===i.SUCCESS&&a?(s=a.map((function(e){return ge(e)})),[2,{code:r,data:s}]):(o.warn(R.O,"getAllConversationList fail -> code: ".concat(r," channelId: ").concat(e)),[2,{code:r,msg:Ge[r]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:Ge[i.NOT_SUPPORT]}]}))}))},getConversationList:function(e,n,t){return B(this,void 0,void 0,(function(){var o=this;return D(this,(function(r){return M()?m("startTime",e,l.NUMBER,!0)&&m("count",n,l.NUMBER,!0)&&m("channelId",t,l.CHANNEL_ID)?[2,pe((function(r,a){return B(o,void 0,void 0,(function(){var o,s,c,u,d,f;return D(this,(function(l){switch(l.label){case 0:return o="startTime: ".concat(e,", count: ").concat(n,", channelId: ").concat(t),a.info(R.O,"getConversationList -> ".concat(o)),L(t)?[4,r.getConversationListWithAllChannelByPage(e,n)]:[3,2];case 1:return s=l.sent(),[3,4];case 2:return c=[1,2,3,5,6,7,8],[4,r.getConversationsByPage(c,e,n,t)];case 3:s=l.sent(),l.label=4;case 4:return u=s.code,d=s.data,u===i.SUCCESS&&d?(f=d.map((function(e){return ge(e)})),[2,{code:u,data:f}]):(a.warn(R.O,"getConversationList fail -> code: ".concat(u," ").concat(o)),[2,{code:u,msg:Ge[u]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:Ge[i.NOT_SUPPORT]}]}))}))},searchConversationByContent:function e(n,t,o){return B(this,void 0,void 0,(function(){var r=this;return D(this,(function(a){return M()?m("keyword",n,l.STRING,!0)&&m("messageTypes",t,l.ARRAY,!0)&&m("channelId",o,l.CHANNEL_ID)&&!t.some((function(e){return!m("messageType",e,l.STRING,!0)}))?[2,pe((function(a,s){return B(r,void 0,void 0,(function(){var r,c,u,d,f;return D(this,(function(l){switch(l.label){case 0:return r="keyword: ".concat(n,", messageTypes: ").concat(JSON.stringify(t),", channelId: ").concat(o),s.info(R.O,"searchConversationByContent -> ".concat(e)),L(o)?[4,a.searchConversationByContentWithAllChannel(n,t)]:[3,2];case 1:return c=l.sent(),[3,4];case 2:return[4,a.searchConversationByContent(n,t,o)];case 3:c=l.sent(),l.label=4;case 4:return u=c.code,d=c.data,u===i.SUCCESS&&d?(f=d.map((function(e){return ge(e)})),[2,{code:u,data:f}]):(s.warn(R.O,"searchConversationByContent fail -> code: ".concat(u," ").concat(r)),[2,{code:u,msg:Ge[u]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:Ge[i.NOT_SUPPORT]}]}))}))},searchMessages:function(e,n,t,o){return B(this,void 0,void 0,(function(){var r=this;return D(this,(function(a){return M()?m("conversation",e,l.CONVERSATION,!0)&&m("keyword",n,l.STRING,!0)&&m("startTime",t,l.NUMBER,!0)&&m("count",o,l.NUMBER,!0)?[2,pe((function(a,s){return B(r,void 0,void 0,(function(){var r,c,u,d,f,l,g,v,I,h;return D(this,(function(m){switch(m.label){case 0:return r="conversation: ".concat(JSON.stringify(e),", keyword: ").concat(n,", timestamp: ").concat(t,", count: ").concat(o),s.info(R.O,"searchMessages -> ".concat(r)),c=e.targetId,u=e.conversationType,d=e.channelId,L(d)?[4,a.searchMessageByContentWithAllChannel(u,c,n,t,o)]:[3,2];case 1:return f=m.sent(),[3,4];case 2:return 0,[4,a.searchMessageByContent(u,c,n,t,o,0,d)];case 3:f=m.sent(),m.label=4;case 4:return l=f.code,g=f.data,l===i.SUCCESS&&g?(v=g.messages,I=g.count,h=v.map((function(e){return le(e)})),[2,{code:l,data:{messages:h,count:I}}]):(s.warn(R.O,"searchMessages fail -> code: ".concat(l," ").concat(r)),[2,{code:l,msg:Ge[l]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:Ge[i.NOT_SUPPORT]}]}))}))},searchMessageInTimeRange:function(e,n){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(o){return M()?m("conversation",e,l.CONVERSATION,!0)&&m("option",n,l.OBJECT,!0)&&m("option.keyword",n.keyword,l.STRING,!0)&&m("option.startTime",n.startTime,l.NUMBER,!0)&&m("option.endTime",n.endTime,l.NUMBER,!0)&&m("option.offset",n.offset,l.NUMBER)&&m("option.limit",n.limit,l.NUMBER)?[2,pe((function(o,r){return B(t,void 0,void 0,(function(){var t,a,s,c,u,d,f,l,g,v,I;return D(this,(function(h){switch(h.label){case 0:return t="conversation: ".concat(JSON.stringify(e),", option: ").concat(JSON.stringify(n)),r.info(R.O,"searchMessageInTimeRange -> ".concat(t)),a=e.conversationType,s=e.targetId,c=n.keyword,u=n.startTime,d=n.endTime,f=n.offset,l=n.limit,f=f||0,l=l||5,[4,o.searchMessageByContentInTimeRangeWithAllChannel(a,s,c,u,d,f,l)];case 1:return g=h.sent(),v=g.code,I=g.data,v===i.SUCCESS&&I?[2,{code:v,data:{messages:I.messages.map((function(e){return le(e)}))}}]:(r.warn(R.O,"searchMessageInTimeRange fail -> code: ".concat(v,", ").concat(t)),[2,{code:v}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:Ge[i.NOT_SUPPORT]}]}))}))},getHistoryMessagesByMessageTypes:function(e,n){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(o){return M()?m("conversation",e,l.CONVERSATION,!0)&&m("option",n,l.OBJECT,!0)&&m("option.count",n.count,l.NUMBER)&&m("options.count",n.count,(function(e){var n=e>0&&e<=100;return n||null===console||void 0===console||console.error("option.count is invalid, It should be greater than 0 and less than 100"),n}))&&m("option.timestamp",n.timestamp,l.NUMBER)&&m("option.order",n.order,(function(e){return[0,1].includes(e)}))&&m("option.messageTypes",n.messageTypes,l.ARRAY,!0)&&!n.messageTypes.some((function(e){return!m("option.messageType",e,l.STRING,!0)}))?[2,pe((function(o,r){return B(t,void 0,void 0,(function(){var t,a,s,c,u,d,f,l,g,v,I,h,m,E,T;return D(this,(function(S){switch(S.label){case 0:return t=n.count,a=n.timestamp,s=n.order,c=n.messageTypes,u="conversation: ".concat(JSON.stringify(e),", option: ").concat(JSON.stringify(n)),r.info(R.O,"getHistoryMessagesByMessageTypes -> ".concat(u)),d=e.conversationType,f=e.targetId,l=e.channelId,t||(t=20),a||(a=0),s||(s=0),l||(l=""),[4,o.getHistoryMessagesByObjectNames(d,f,a,t,c,s,l)];case 1:return g=S.sent(),v=g.code,I=g.data,v===i.SUCCESS?(m=(h=I).list,E=h.hasMore,T=m.map((function(e){return le(e)})),[2,{code:v,data:{messages:T,hasMore:E,list:T}}]):(r.warn(R.O,"getHistoryMessagesByMessageTypes fail -> code: ".concat(v," ").concat(u)),[2,{code:v,msg:Ge[v]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:Ge[i.NOT_SUPPORT]}]}))}))},setMessageStatusToRead:function(e,n){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(o){return M()?m("conversation",e,l.CONVERSATION,!0)&&m("timestamp",n,l.NUMBER,!0)?[2,pe((function(o,i){return B(t,void 0,void 0,(function(){var t,r,a,s;return D(this,(function(c){switch(c.label){case 0:return t="conversation: ".concat(JSON.stringify(e),", timestamp: ").concat(n),i.info(R.O,"updateSentMsgReceiptStatus -> ".concat(t)),r=e.conversationType,a=e.targetId,s=e.channelId,[4,o.setMessageStatusToRead(r,a,n,s)];case 1:return[2,c.sent()]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:Ge[i.NOT_SUPPORT]}]}))}))},setMessageReceivedStatus:function(e,n){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(o){return M()?m("messageId",e,l.NUMBER,!0)&&m("receivedStatus",n,(function(e){return!L(r[e])}),!0)?[2,pe((function(o,i){return B(t,void 0,void 0,(function(){return D(this,(function(t){switch(t.label){case 0:return i.info(R.O,"setMessageReceivedStatus -> messageId: ".concat(e,", receivedStatus: ").concat(n)),[4,o.setMessageReceivedStatus(e,n)];case 1:return[2,{code:t.sent()}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:Ge[i.NOT_SUPPORT]}]}))}))},setMessageSentStatus:function(e,n){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(o){return M()?m("messageId",e,l.NUMBER,!0)&&m("sentStatus",n,(function(e){return!L(P[e])}),!0)?[2,pe((function(o,i){return B(t,void 0,void 0,(function(){return D(this,(function(t){switch(t.label){case 0:return i.info(R.O,"setMessageSentStatus ->messageId: ".concat(e,", sentStatus: ").concat(n)),[4,o.setMessageSentStatus(e,n)];case 1:return[2,{code:t.sent()}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:Ge[i.NOT_SUPPORT]}]}))}))},setMessageContent:function(e,n,t){return void 0===t&&(t=""),B(this,void 0,void 0,(function(){var o=this;return D(this,(function(r){return M()?m("messageId",e,l.NUMBER,!0)&&m("content",n,l.OBJECT,!0)&&m("messageType",t,l.ONLY_STRING,!0)?[2,pe((function(i,r){return B(o,void 0,void 0,(function(){return D(this,(function(o){switch(o.label){case 0:return r.info(R.O,"setMessageSentStatus ->messageId: ".concat(e,", messageType: ").concat(t)),[4,i.setMessageContent(e,n,t)];case 1:return[2,{code:o.sent()}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:Ge[i.NOT_SUPPORT]}]}))}))},deleteMessages:function(e){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(t){return M()?!m("messageIds",e,l.ARRAY,!0)||e.some((function(e){return!m("messageId",e,l.NUMBER,!0)}))?[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,pe((function(t,o){return B(n,void 0,void 0,(function(){return D(this,(function(n){switch(n.label){case 0:return o.info(R.O,"deleteMessages ->messageIds: ".concat(JSON.stringify(e))),[4,t.deleteMessages(e)];case 1:return[2,{code:n.sent()}]}}))}))}))]:[2,{code:i.NOT_SUPPORT,msg:Ge[i.NOT_SUPPORT]}]}))}))},clearMessages:function(e){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(t){return M()?[2,pe((function(t,o){return B(n,void 0,void 0,(function(){var n,i,r;return D(this,(function(a){switch(a.label){case 0:return n=e.conversationType,i=e.targetId,r=e.channelId,o.info(R.O,"clearMessages ->targetId:".concat(i,",conversationType:").concat(n)),[4,t.clearMessages(n,i,r)];case 1:return[2,{code:a.sent()}]}}))}))}))]:[2,{code:i.NOT_SUPPORT,msg:Ge[i.NOT_SUPPORT]}]}))}))},deleteMessagesByTimestamp:function(e,n,t){return B(this,void 0,void 0,(function(){var o,r,a,s=this;return D(this,(function(c){return M()?(o=e.conversationType,r=e.targetId,a=e.channelId,m("conversationType",o,l.NUMBER,!0)&&m("targetId",r,l.STRING,!0)&&m("timestamp",n,l.NUMBER,!0)&&m("cleanSpace",t,l.BOOLEAN)?[2,pe((function(e,i){return B(s,void 0,void 0,(function(){return D(this,(function(i){switch(i.label){case 0:return[4,e.deleteMessagesByTimestamp(o,r,n,t,a)];case 1:return[2,{code:i.sent()}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]):[2,{code:i.NOT_SUPPORT,msg:Ge[i.NOT_SUPPORT]}]}))}))},insertMessage:function(e,n,t){return void 0===t&&(t={}),B(this,void 0,void 0,(function(){var o=this;return D(this,(function(r){return console.log(M()),M()?m("conversation",e,l.CONVERSATION,!0)&&m("message",n,l.OBJECT,!0)&&m("options",t,l.OBJECT)&&m("options.isUnread",null==t?void 0:t.isUnread,l.BOOLEAN)&&m("options.searchContent",null==t?void 0:t.searchContent,l.STRING)&&(n instanceof Qn||m("message.senderUserId",n.senderUserId,l.STRING,!0)&&m("message.messageType",n.messageType,l.STRING,!0)&&m("message.content",n.content,l.OBJECT,!0)&&m("message.messageDirection",n.messageDirection,l.NUMBER,!0)&&m("message.canIncludeExpansion",n.canIncludeExpansion,l.BOOLEAN)&&m("message.expansion",n.expansion,l.OBJECT)&&m("message.disableNotification",n.disableNotification,l.BOOLEAN)&&m("message.sentTime",n.sentTime,l.NUMBER)&&m("message.sentStatus",n.sentStatus,l.NUMBER))?[2,pe((function(r,a){return B(o,void 0,void 0,(function(){var o,s,c,u,d,f,l,g,v,I,h,m,E,T,S;return D(this,(function(p){switch(p.label){case 0:return o="",s=1,f=!1,g=n.messageType,v=n.content,n instanceof Qn||(o=n.senderUserId,s=n.messageDirection,f=n.canIncludeExpansion,l=n.expansion,d=n.disableNotification,c=n.sentTime,u=n.sentStatus),a.info(R.O,"insertMessage ->targetId:".concat(e.targetId,",conversationType:").concat(e.conversationType)),I=t.isUnread,h=t.searchContent,m={senderUserId:o,messageType:g,content:v,messageDirection:s,sentTime:c,sentStatus:u,searchContent:h,isUnread:I,messageUId:"",disableNotification:d,canIncludeExpansion:f,expansionMsg:JSON.stringify(l),channelId:e.channelId||""},[4,r.insertMessage(e.conversationType,e.targetId,m)];case 1:return E=p.sent(),T=E.code,S=E.data,T===i.SUCCESS?[2,{code:T,data:le(S)}]:(a.warn(R.O,"insertMessage ->code:".concat(T,",targetId:").concat(e.targetId)),[2,{code:T,msg:Ge[T]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:Ge[i.NOT_SUPPORT]}]}))}))},batchInsertMessage:function(e,n){var t,o;return B(this,void 0,void 0,(function(){var r,s=this;return D(this,(function(c){if(!M())return[2,{code:i.NOT_SUPPORT,msg:Ge[i.NOT_SUPPORT]}];if(!m("messages",e,(function(e){return g(e)&&!(e.length<=0||e.length>=500)}),!0)||!m("checkDuplicate",n,l.BOOLEAN))return[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}];for(r in e)if(!(m("message",e[r],l.OBJECT,!0)&&m("message.conversationType",e[r].conversationType,(function(e){return[a.PRIVATE,a.DISCUSSION,a.GROUP,a.CUSTOMER_SERVICE,a.SYSTEM,a.APP_PUBLIC_SERVICE,a.PUBLIC_SERVICE].includes(e)}),!0)&&m("message.targetId",e[r].targetId,l.STRING,!0)&&m("message.senderUserId",e[r].senderUserId,l.STRING,!0)&&m("message.messageType",e[r].messageType,l.STRING,!0)&&m("message.content",e[r].content,l.OBJECT,!0)&&m("message.messageDirection",e[r].messageDirection,l.NUMBER,!0)&&m("message.canIncludeExpansion",e[r].canIncludeExpansion,l.BOOLEAN)&&m("message.expansion",e[r].expansion,l.OBJECT)&&m("message.disableNotification",e[r].disableNotification,l.BOOLEAN)&&m("message.sentTime",e[r].sentTime,l.NUMBER)&&m("message.sentStatus",e[r].sentStatus,l.NUMBER)&&m("options.isUnread",null===(t=e[r])||void 0===t?void 0:t.isUnread,l.BOOLEAN)&&m("options.searchContent",null===(o=e[r])||void 0===o?void 0:o.searchContent,l.STRING)))return[2,{code:i.BIZ_ERROR_INVALID_PARAMETER,msg:String(r)}];return[2,pe((function(t){return B(s,void 0,void 0,(function(){var o,r,a;return D(this,(function(s){switch(s.label){case 0:return[4,t.batchInsertMessage(e,n)];case 1:return o=s.sent(),r=o.code,a=o.data,r===i.SUCCESS?[2,{code:r,data:a}]:[2,{code:r,msg:Ge[r]}]}}))}))}))]}))}))},getMessageCount:function(e){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(t){return M()?[2,pe((function(t){return B(n,void 0,void 0,(function(){var n,o,i,r,a,s;return D(this,(function(c){switch(c.label){case 0:return n=e.conversationType,o=e.targetId,i=e.channelId,[4,t.getMessageCount(n,o,i)];case 1:return r=c.sent(),a=r.code,s=r.data,[2,{code:a,data:s}]}}))}))}))]:[2,{code:i.NOT_SUPPORT,msg:Ge[i.NOT_SUPPORT]}]}))}))},getPrivateMessageDeliverTime:function(e){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(t){return M()?m("messageUId",e,l.STRING,!0)?[2,pe((function(t,o){return B(n,void 0,void 0,(function(){var n,r,a;return D(this,(function(s){switch(s.label){case 0:return[4,t.getPrivateMessageDeliverTime(e)];case 1:return n=s.sent(),r=n.code,a=n.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:Ge[r]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:Ge[i.NOT_SUPPORT]}]}))}))},getGroupMessageDeliverList:function(e,n){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(o){return M()?m("targetId",e,l.STRING,!0)&&m("messageUId",n,l.STRING,!0)?[2,pe((function(o,r){return B(t,void 0,void 0,(function(){var t,a,s;return D(this,(function(c){switch(c.label){case 0:return[4,o.getGroupMessageDeliverList(e,n)];case 1:return t=c.sent(),a=t.code,s=t.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(n)),[2,{code:a,msg:Ge[a]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:Ge[i.NOT_SUPPORT]}]}))}))},setCheckDuplicateMessage:function(e){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(t){return M()?m("enableCheck",e,l.BOOLEAN)?[2,pe((function(t){return B(n,void 0,void 0,(function(){return D(this,(function(n){switch(n.label){case 0:return[4,t.setCheckDuplicateMessage(e)];case 1:return[2,{code:n.sent().code}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:Ge[i.NOT_SUPPORT]}]}))}))},clearLocalData:function(){return B(this,void 0,void 0,(function(){var e=this;return D(this,(function(n){return M()?[2,pe((function(n,t){return B(e,void 0,void 0,(function(){var e,o,i;return D(this,(function(r){switch(r.label){case 0:return t.info(R.O,"clearLocalData ->"),[4,n.clearData()];case 1:return e=r.sent(),o=e.code,i=e.data,[2,{code:o,data:i}]}}))}))}))]:[2,{code:i.NOT_SUPPORT,msg:Ge[i.NOT_SUPPORT]}]}))}))}}),Fo=function(e,n,t){this.type=e,this.userIdList=n,this.mentionedContent=t};function Zo(e){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(t){return!e||m("proxy.socksHost",e.socksHost,l.STRING,!0)&&m("proxy.socksPort",e.socksPort,l.NUMBER,!0)?[2,pe((function(t,o){return B(n,void 0,void 0,(function(){var n;return D(this,(function(r){switch(r.label){case 0:return o.info(R.O,"setProxy: ->".concat(e)),[4,t.setProxy(e)];case 1:return(n=r.sent().code)===i.SUCCESS?[2,{code:n}]:(o.warn(R.O,"setProxy ->code:".concat(n)),[2,{code:n,msg:Ge[n]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function qo(){return B(this,void 0,void 0,(function(){var e=this;return D(this,(function(n){return[2,pe((function(n,t){return B(e,void 0,void 0,(function(){var e,o,r;return D(this,(function(a){switch(a.label){case 0:return[4,n.getProxy()];case 1:return e=a.sent(),o=e.code,r=e.data,o===i.SUCCESS?[2,{code:o,data:r}]:(t.warn(R.O,"getProxy ->code:".concat(o)),[2,{code:o,msg:Ge[o]}])}}))}))}))]}))}))}function Jo(e,n){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(o){return!e||m("proxy.socksHost",e.socksHost,l.STRING,!0)&&m("proxy.socksPort",e.socksPort,l.NUMBER,!0)?[2,pe((function(o,r){return B(t,void 0,void 0,(function(){var t,a,s;return D(this,(function(c){switch(c.label){case 0:return r.info(R.O,"testProxy: ->".concat(e)),[4,o.testProxy(e,n)];case 1:return t=c.sent(),a=t.status,s=t.data,a===i.SUCCESS?[2,{code:a,msg:s}]:(r.warn(R.O,"testProxy ->code:".concat(a)),[2,{code:a,msg:Ge[a]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}export{Qn as BaseMessage,st as CombineMessage,Vo as ConnectType,V as Events,ct as FileMessage,ut as GIFMessage,it as HQVoiceMessage,ot as ImageMessage,ft as LocationMessage,Fo as MentionedInfoBody,ko as MessageType,lt as ReferenceMessage,gt as RichContentMessage,rt as SightMessage,at as TextMessage,dt as VoiceMessage,we as __addSDKVersion,Lo as addConversationsToTag,Oe as addEventListener,Ao as addTag,Yn as addToBlacklist,Kn as bindRTCRoomForChatroom,$e as clearAllMessagesUnreadStatus,Ae as clearEventListeners,fo as clearHistoryMessages,Oo as clearMessages,Qe as clearMessagesUnreadStatus,Ke as clearTextMessageDraft,_o as clearUnreadCountByTimestamp,ke as connect,po as deleteLocalMessagesByTimestamp,uo as deleteMessages,Me as destroy,He as disconnect,Ho as electronExtension,Zn as forceRemoveChatRoomEntry,kn as forceSetChatRoomEntry,Jn as getAllChatRoomEntries,gn as getAllConversationState,Cn as getAllUltraGroupUnreadCount,An as getAllUltraGroupUnreadMentionedCount,ln as getAllUnreadMentionedCount,Wn as getBlacklist,Xn as getBlacklistStatus,In as getBlockUltraGroupList,sn as getBlockedConversationList,qn as getChatRoomEntry,Gn as getChatRoomInfo,zn as getChatroomHistoryMessages,Ue as getConnectionStatus,Ze as getConversation,Fe as getConversationList,rn as getConversationNotificationLevel,an as getConversationNotificationStatus,bo as getConversationsFromTagByPage,Le as getCurrentUserId,Be as getDeviceId,Jt as getFileToken,zt as getFileUrl,ho as getFirstUnreadMessage,no as getHistoryMessages,Eo as getMessage,Io as getMessageReader,qo as getProxy,to as getRemoteHistoryMessages,Pe as getServerTime,Uo as getTags,Po as getTagsFromConversation,Je as getTextMessageDraft,un as getTopConversationList,Ye as getTotalUnreadCount,je as getTotalUnreadCountByLevels,We as getTotalUnreadMentionedCountByLevels,On as getUltraGroupDefaultNotificationLevel,Mn as getUltraGroupFirstUnreadMessageTimestamp,vn as getUltraGroupList,hn as getUltraGroupMessageListByMessageUId,_n as getUltraGroupUnreadCountByTargetId,pn as getUltraGroupUnreadMentionedCountByTargetId,yn as getUltraGroupUnreadMentionedMessages,dn as getUnreadConversationList,Xe as getUnreadCount,Go as getUnreadCountByTag,fn as getUnreadMentionedCount,To as getUnreadMentionedMessages,ye as init,mo as insertMessage,De as installPlugin,Bn as joinChatRoom,Dn as joinExistChatRoom,Sn as modifyMessage,Ne as onceEventListener,bn as quitChatRoom,co as recallMessage,Ro as registerMessageType,Tn as removeAllExpansionForUltraGroupMessage,Fn as removeChatRoomEntries,Hn as removeChatRoomEntry,qe as removeConversation,wo as removeConversationsFromTag,_e as removeEventListener,Ce as removeEventListeners,En as removeExpansionForUltraGroupMessage,jn as removeFromBlacklist,go as removeMessageExpansionForKey,yo as removeTag,Do as removeTagFromConversations,Bo as removeTagsFromConversation,ze as saveTextMessageDraft,No as searchConversationByContent,So as searchMessages,Wt as sendFileMessage,Qt as sendGIFMessage,$t as sendHQVoiceMessage,Xt as sendImageMessage,Kt as sendMessage,oo as sendReadReceiptMessage,io as sendReadReceiptRequest,ro as sendReadReceiptResponse,ao as sendReadReceiptResponseV2,eo as sendSightMessage,so as sendSyncReadStatusMessage,Yt as sendTextMessage,vo as sendTypingStatusMessage,Rn as sendUltraGroupTypingStatus,Vn as setChatRoomEntries,xn as setChatRoomEntry,tn as setConversationNotificationLevel,on as setConversationNotificationStatus,cn as setConversationToTop,xo as setConversationToTopInTag,Co as setMessageReceivedStatus,Zo as setProxy,Nn as setUltraGroupDefaultNotificationLevel,Jo as testProxy,mn as updateExpansionForUltraGroupMessage,lo as updateMessageExpansion,Mo as updateTag};
1
+ import{NetworkType as e,HttpMethod as t,HTTP_TIMEOUT as n,appendUrl as o,ErrorCode as r,ReceivedStatus as i,ConversationType as a,isNumber as s,EventEmitter as c,RCConnectionStatus as u,VersionManage as d,assert as l,AssertRules as f,isArray as g,isHttpUrl as v,APIContext as h,LogTagId as I,logger as R,validate as m,isValidConversationType as E,isValidNotificationLevel as S,NotificationLevel as T,isTypeInConversationList as p,UltraGroupChannelType as O,isString as N,MAX_UPLOAD_FILE_SIZE as _,UPLOAD_FILE_CHUNK_SIZE as C,UploadMethod as A,FileType as U,getUUID as y,isValidFileType as M,usingCppEngine as P,MessageDirection as L,SentStatus as w,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 b=function(e,t){return b=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])},b(e,t)};function D(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}b(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var G=function(){return G=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},G.apply(this,arguments)};function V(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 k(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 x=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))},F=x(),Z=function(){var e="undefined"!=typeof XMLHttpRequest&&"withCredentials"in new XMLHttpRequest;return"undefined"!=typeof XMLHttpRequest&&e?new XMLHttpRequest:"undefined"!=typeof XDomainRequest?new XDomainRequest:new ActiveXObject("Microsoft.XMLHTTP")};var H=null,q=function(e){return V(void 0,void 0,void 0,(function(){var t;return k(this,(function(n){switch(n.label){case 0:return[4,J.getNetworkType()];case 1:return t=n.sent(),H({status:"online"===e.type,type:t}),[2]}}))}))};var J={tag:"browser",httpReq:function(e){var r=e.method||t.GET,i=e.timeout||n,a=e.headers,s=e.query,c=e.body,u=o(e.url,s);return new Promise((function(t){var n=Z(),o="[object XDomainRequest]"===Object.prototype.toString.call(n);if(n.open(r,u),a&&n.setRequestHeader)for(var s in a)n.setRequestHeader(s,a[s]);if(o){0!==e.timeout&&(n.timeout=i),n.onload=function(){t({data:n.responseText,status:n.status||200})},n.onerror=function(){t({status:n.status})},n.ontimeout=function(){t({status:n.status})};var d="object"==typeof c?JSON.stringify(c):c;n.send(d)}else n.onreadystatechange=function(){4===n.readyState&&t({data:n.responseText,status:n.status,xhr:n})},n.onerror=function(){t({status:n.status})},e.onProgress&&(n.upload.onprogress=function(t){return e.onProgress&&e.onProgress(t)}),0!==e.timeout&&setTimeout((function(){n.abort(),t({status:n.status})}),i),n.send(c)}))},localStorage:null===window||void 0===window?void 0:window.localStorage,sessionStorage:null===window||void 0===window?void 0:window.sessionStorage,useNavi:!0,connectPlatform:"",isFromUniapp:F,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 t=navigator.connection||navigator.mozConnection||navigator.webkitConnection||{effectiveType:e.UNKONWN},n=t.type,o=t.effectiveType,r=n||o||e.UNKONWN;return Promise.resolve(r)},setNetworkStatusListener:function(e){H=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)),H=null}},K=x(),Y=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)}}},z={setItem:Y("setStorageSync"),getItem:Y("getStorageSync"),removeItem:Y("removeStorageSync"),clear:Y("clearStorageSync")},j=null,W=function(e){var t=e.isConnected,n=e.networkType;j({status:t,type:n})};var X={tag:"wechat",httpReq:function(e){var i=e.method||t.GET,a=e.timeout||n,s=e.headers,c=e.query,u=e.body,d=o(e.url,c);return new Promise((function(e){wx.request({url:d,method:i,header:s,timeout:a,data:u,success:function(t){e({data:t.data,status:t.statusCode})},fail:function(){e({status:r.RC_HTTP_REQ_FAIL})}})}))},localStorage:z,sessionStorage:z,useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:K,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(t){wx.getNetworkType({success:function(e){var n=e.networkType;t(n)},fail:function(){t(e.UNKONWN)}})}))},setNetworkStatusListener:function(e){j=e,wx.onNetworkStatusChange(W)},removeNetworkStatusListener:function(){wx.offNetworkStatusChange(W),j=null}},Q=x(),$=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{if("setStorageSync"===e)return my[e]({key:t[0],data:JSON.parse(t[1])});if("clearStorageSync"===e)return my[e]();if("removeStorageSync"===e)return my[e]({key:t[0]});var o=my[e]({key:t[0]}).data;return o?JSON.stringify(o):o}catch(e){}}},ee={setItem:$("setStorageSync"),getItem:$("getStorageSync"),removeItem:$("removeStorageSync"),clear:$("clearStorageSync")},te=null,ne=function(e){var t=e.isConnected,n=e.networkType;te({status:t,type:n})};var oe={tag:"alipay",httpReq:function(e){var i=e.method||t.GET,a=e.timeout||n,s=e.headers,c=e.query,u=e.body,d=o(e.url,c),l=e.dataType||"json";return new Promise((function(e){my.request({url:d,method:i,headers:s,timeout:a,data:u,dataType:l,success:function(t){e({data:t.data,status:t.status})},fail:function(){e({status:r.RC_HTTP_REQ_FAIL})}})}))},localStorage:ee,sessionStorage:ee,useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:Q,createWebSocket:function(e){var t=my.connectSocket({url:e,multiple:!0});return{id:Date.now(),onClose:function(e){t.onSocketClose(e)},onError:function(e){t.onSocketError((function(t){e(t.errMsg)}))},onMessage:function(e){t.onSocketMessage((function(t){t.data.isBuffer?e(my.base64ToArrayBuffer(t.data.data)):e(t.data.data)}))},onOpen:function(e){t.onSocketOpen(e)},send:function(e){t.sendSocketMessage({data:my.arrayBufferToBase64(e),isBuffer:!0})},close:function(){t.closeSocket()}}},getNetworkType:function(){return new Promise((function(t){my.getNetworkType({success:function(e){var n=e.networkType;t(n)},fail:function(){t(e.UNKONWN)}})}))},setNetworkStatusListener:function(e){te=e,my.onNetworkStatusChange(ne)},removeNetworkStatusListener:function(){my.offNetworkStatusChange(ne),te=null}},re=x(),ie=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){}}},ae={setItem:ie("setStorageSync"),getItem:ie("getStorageSync"),removeItem:ie("removeStorageSync"),clear:ie("clearStorageSync")},se=null,ce=function(e){var t=e.isConnected,n=e.networkType;se({status:t,type:n})};var ue={tag:"toutiao",useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:re,localStorage:ae,sessionStorage:ae,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:r.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(t){tt.getNetworkType({success:function(e){var n=e.networkType;t(n)},fail:function(){t(e.UNKONWN)}})}))},setNetworkStatusListener:function(e){se=e,tt.onNetworkStatusChange(ce)},removeNetworkStatusListener:function(){tt.offNetworkStatusChange(ce),se=null}},de=x(),le=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){}}},fe={setItem:le("setStorageSync"),getItem:le("getStorageSync"),removeItem:le("removeStorageSync"),clear:le("clearStorageSync")},ge=null,ve=function(e){var t=e.isConnected,n=e.networkType;ge({status:t,type:n})};var he={tag:"baidu",useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:de,localStorage:fe,sessionStorage:fe,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:r.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 V(this,void 0,void 0,(function(){return k(this,(function(t){return[2,new Promise((function(t){swan.getNetworkType({success:function(e){var n=e.networkType;t(n)},fail:function(){t(e.UNKONWN)}})}))]}))}))},setNetworkStatusListener:function(e){ge=e,swan.onNetworkStatusChange(ve)},removeNetworkStatusListener:function(){swan.offNetworkStatusChange(ve),ge=null}},Ie=x(),Re=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)}}},me={setItem:Re("setStorageSync"),getItem:Re("getStorageSync"),removeItem:Re("removeStorageSync"),clear:Re("clearStorageSync")},Ee=null,Se=function(e){var t=e.isConnected,n=e.networkType;Ee({status:t,type:n})};var Te={tag:"jingdong",httpReq:function(e){var i=e.method||t.GET,a=e.timeout||n,s=e.headers,c=e.query,u=e.body,d=o(e.url,c);return new Promise((function(e){jd.request({url:d,method:i,headers:s,timeout:a,data:u,success:function(t){e({data:t.data,status:t.statusCode})},fail:function(){e({status:r.RC_HTTP_REQ_FAIL})}})}))},localStorage:me,sessionStorage:me,useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:Ie,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(t){jd.getNetworkType({success:function(e){var n=e.networkType;t(n)},fail:function(){t(e.UNKONWN)}})}))},setNetworkStatusListener:function(e){Ee=e,jd.onNetworkStatusChange(Se)},removeNetworkStatusListener:function(){jd.offNetworkStatusChange(Se),Ee=null}},pe=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)}}},Oe={setItem:pe("setStorageSync"),getItem:pe("getStorageSync"),removeItem:pe("removeStorageSync"),clear:pe("clearStorageSync")},Ne=null,_e=function(e){var t=e.isConnected,n=e.networkType;Ne({status:t,type:n})};var Ce,Ae={tag:"uniapp",httpReq:function(e){var i=e.method||t.GET,a=e.timeout||n,s=e.headers,c=e.query,u=e.body,d=o(e.url,c);return new Promise((function(e){uni.request({url:d,method:i,header:s,timeout:a,data:u,success:function(t){e({data:t.data,status:t.statusCode})},fail:function(){e({status:r.RC_HTTP_REQ_FAIL})}})}))},localStorage:Oe,sessionStorage:Oe,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(t){uni.getNetworkType({success:function(e){var n=e.networkType;t(n)},fail:function(){t(e.UNKONWN)}})}))},setNetworkStatusListener:function(e){Ne=e,uni.onNetworkStatusChange(_e)},removeNetworkStatusListener:function(){uni.offNetworkStatusChange(_e),Ne=null}},Ue=function(e){return e&&e.request&&e.getSystemInfo},ye="undefined"!=typeof uni&&Ue(uni)?function(){switch(process.env.VUE_APP_PLATFORM){case"app-plus":return Ae;case"mp-jd":return Te;case"mp-baidu":return he;case"mp-toutiao":return ue;case"mp-alipay":return oe;case"mp-weixin":return X;default:return J}}():"undefined"!=typeof jd&&Ue(jd)?Te:"undefined"!=typeof my&&Ue(my)?oe:"undefined"!=typeof tt&&Ue(tt)?ue:"undefined"!=typeof swan&&Ue(swan)?he:"undefined"!=typeof wx&&Ue(wx)?X:J;function Me(e){var t=e.conversationType,n=e.channelId,o=e.messageType,r=e.content,c=e.senderUserId,u=e.targetId,d=e.sentTime,l=e.receivedTime,f=e.messageUId,g=e.messageDirection,v=e.isPersited,h=e.isCounted,I=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=i.UNREAD);var M={messageType:o,channelId:n||"",content:r,senderUserId:c,targetId:u,conversationType:t,sentTime:d,receivedTime:l,messageUId:f,messageDirection:g,isPersited:v,isCounted:h,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!==a.ULTRA_GROUP&&(M.isOffLineMessage=I),t===a.ULTRA_GROUP&&s(U)&&(M.channelType=U),M}function Pe(e){var t=e.conversationType,n=e.targetId,o=e.latestMessage,r=e.unreadMessageCount,i=e.hasMentioned,s=e.mentionedInfo,c=e.lastUnreadTime,u=e.notificationStatus,d=e.notificationLevel,l=e.isTop,f=e.channelId,g=e.unreadMentionedCount,v=e.matchCount,h=e.unreadMentionedMeCount,I={conversationType:t,targetId:n,latestMessage:o&&Me(o),unreadMessageCount:r,hasMentioned:i,mentionedInfo:i?{type:null==s?void 0:s.type,userIdList:null==s?void 0:s.userIdList}:void 0,lastUnreadTime:c,notificationStatus:u,notificationLevel:d,isTop:l,channelId:f,unreadMentionedCount:g,matchCount:v,unreadMentionedMeCount:h};return I.conversationType===a.ULTRA_GROUP&&(I.firstUnreadMessage=e.firstUnreadMessage,I.channelType=e.channelType),I}function Le(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"}(Ce||(Ce={}));var we=new c,Be={connection:function(e,t){switch(e){case u.CONNECTED:we.emit(Ce.CONNECTED);break;case u.CONNECTING:we.emit(Ce.CONNECTING);break;case u.SUSPENDED:we.emit(Ce.SUSPEND,t);break;case u.DISCONNECTED:we.emit(Ce.DISCONNECT,t)}},batchMessage:function(e){we.emit(Ce.MESSAGES,{messages:e.map((function(e){return Me(e)}))})},typingState:function(e){we.emit(Ce.TYPING_STATUS,{status:e})},readReceiptReceived:function(e,t,n){we.emit(Ce.READ_RECEIPT_RECEIVED,{conversation:e,messageUId:t,sentTime:n})},messageReceiptRequest:function(e,t,n){we.emit(Ce.MESSAGE_RECEIPT_REQUEST,{conversation:e,messageUId:t,senderUserId:n})},messageReceiptResponse:function(e,t,n){we.emit(Ce.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?Me(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===a.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})}));we.emit(Ce.CONVERSATION,{conversationList:t})},chatroomState:function(e){we.emit(Ce.CHATROOM,e)},expansion:function(e){we.emit(Ce.EXPANSION,e)},pullFinished:function(){we.emit(Ce.PULL_OFFLINE_MESSAGE_FINISHED)},tag:function(){we.emit(Ce.TAG)},conversationTagChanged:function(){we.emit(Ce.CONVERSATION_TAG)},messageBlocked:function(e){we.emit(Ce.MESSAGE_BLOCKED,e)},messageDelivered:function(e){we.emit(Ce.PRIVATE_MESSAGE_DELIVERED,e)},groupMessageDeliveredStatus:function(e){we.emit(Ce.GROUP_MESSAGE_DELIVERED,e)},ultraGroupEnable:function(e){we.emit(Ce.ULTRA_GROUP_ENABLE,e.map((function(e){return Pe(e)})))},operateStatus:function(e){we.emit(Ce.OPERATE_STATUS,e)},ultraGroupMessageExpansionUpdated:function(e){we.emit(Ce.ULTRA_GROUP_MESSAGE_EXPANSION_UPDATED,e.map((function(e){return Me(e)})))},ultraGroupMessageModified:function(e){we.emit(Ce.ULTRA_GROUP_MESSAGE_MODIFIED,e.map((function(e){return Me(e)})))},ultraGroupMessageRecalled:function(e){we.emit(Ce.ULTRA_GROUP_MESSAGE_RECALLED,e.map((function(e){return Me(e)})))},ultraGroupChannelChangeType:function(e){we.emit(Ce.ULTRA_GROUP_CHANNEL_TYPE_CHANGE,e)},ultraGroupChannelUserKicked:function(e){we.emit(Ce.ULTRA_GROUP_CHANNEL_USER_KICKED,e)},ultraGroupChannelDelete:function(e){we.emit(Ce.ULTRA_GROUP_CHANNEL_DELETE,e)},userGroupStatus:function(e){we.emit(Ce.USER_GROUP_STATUS,e)}};function be(e){return e>999?999:e}d.add("imlib-next","5.7.10");var De=null,Ge=null,Ve=null;function ke(){return V(this,void 0,void 0,(function(){return k(this,(function(e){switch(e.label){case 0:return De?(Ve.info(I.A_DESTROY_O),[4,h.destroy()]):[2];case 1:return e.sent(),Ge=null,De=null,Ve=null,[2]}}))}))}function xe(e){if(!De)throw new Error("Not initialized yet!");return e(De,Ve,Ge)}function Fe(e){return De?e(De,Ve,Ge):Promise.resolve({code:r.BIZ_ERROR_CLIENT_NOT_INIT})}function Ze(e,t,n){we.on(e,t,n)}function He(e,t,n){we.once(e,t,n)}function qe(e,t,n){we.off(e,t,n)}function Je(e){we.removeAll(e)}function Ke(){we.clear()}function Ye(e){!function(e){var t,n=e.appkey,o=e.navigators;De?Ve.warn(I.A_INIT_REPEAT_O):(l("options.appkey",e.appkey,f.STRING,!0),l("options.navigators",e.navigators,(function(e){return g(e)&&(0===e.length||e.every(v))})),Ge=e,De=h.init((null===(t=e.__runtimeCreator__)||void 0===t?void 0:t.call(e))||ye,{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}),(Ve=De.createLogger("RC-IM","IM")).setOutputLevel(e.logOutputLevel),Ve.info(I.A_INIT_O,JSON.stringify({appkey:n,navigators:o,version:"5.7.10",commit:"8733f13c4f051f4e58aedf9b86db72639c36ecbb"})),De.assignWatcher(Be),R.init(Ve))}(e)}function ze(){return V(this,void 0,void 0,(function(){return k(this,(function(e){return De?(Ke(),[2,ke()]):[2]}))}))}function je(){return xe((function(e){return e.getConnectionStatus()}))}function We(){return xe((function(e){return e.getServerTime()}))}function Xe(){return xe((function(e){return e.getCurrentUserId()}))}function Qe(e,t){d.add(e,t)}function $e(){return xe((function(e){return e.getDeviceId()}))}function et(e,t){return xe((function(n){return n.install(e,t)}))}var nt={TIMEOUT:{code:-1,msg:"Network timeout"},SDK_INTERNAL_ERROR:{code:-2,msg:"SDK internal error"},PARAMETER_ERROR:{code:-3,msg:"Please check the parameters, the {param} expected a value of {expect} but received {current}"},REJECTED_BY_BLACKLIST:{code:405,msg:"Blacklisted by the other party"},SEND_TOO_FAST:{code:20604,msg:"Sending messages too quickly"},NOT_IN_GROUP:{code:22406,msg:"Not in group"},ULTRA_GROUP_USER_NOT_IN_PRIVATE_CHANNEL:{code:r.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:r.NOT_SUPPORT,msg:"The method is not supported in a browser!"}},ot={};for(var rt in nt){var it=nt[rt].code;ot[it]=rt}function at(e,t){return V(this,void 0,void 0,(function(){var n=this;return k(this,(function(o){return[2,Fe((function(o,i){return V(n,void 0,void 0,(function(){var n,a,s;return k(this,(function(c){switch(c.label){case 0:return m("token",e,f.STRING,!0)&&m("reconnectKickEnable",t,f.BOOLEAN)?(n=i.createTraceId(),i.info(I.A_CONNECT_T,JSON.stringify({token:e,reconnectKickEnable:t}),n),[4,o.connect(e,!!t,n)]):[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}];case 1:return a=c.sent(),s=a.code===r.SUCCESS?"info":"warn",i[s](I.A_CONNECT_R,JSON.stringify({code:a.code,userId:a.userId}),n),a.code===r.SUCCESS?[2,{code:a.code,data:{userId:a.userId}}]:[2,{code:a.code,msg:ot[a.code]}]}}))}))}))]}))}))}function st(e){return R.info(I.A_DISCONNECT_O,{}),xe((function(t){return t.disconnect(e)}))}function ct(e,t){return V(this,void 0,void 0,(function(){var n=this;return k(this,(function(o){return m("options.count",null==e?void 0:e.count,f.NUMBER)&&m("options.startTime",null==e?void 0:e.startTime,f.NUMBER)&&m("options.order",null==e?void 0:e.order,f.NUMBER)&&m("channelId",t,f.CHANNEL_ID)?[2,Fe((function(o,i){return V(n,void 0,void 0,(function(){var n,a,s;return k(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===r.SUCCESS&&s?[2,{code:0,data:s.map((function(e){return Pe(e)}))}]:(i.warn(I.O,"get conversation list fail ->".concat(a,":").concat(ot[a])),[2,{code:a,msg:ot[a]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function ut(e){return V(this,void 0,void 0,(function(){var t=this;return k(this,(function(n){return m("options",e,f.CONVERSATION,!0)?[2,Fe((function(n,o){return V(t,void 0,void 0,(function(){var t,i,a;return k(this,(function(s){switch(s.label){case 0:return[4,n.getConversation(e.conversationType,e.targetId,e.channelId||"")];case 1:return t=s.sent(),i=t.code,a=t.data,i!==r.SUCCESS?(o.warn(I.O,"getConversation ->code:".concat(i,", targetId:").concat(e.targetId)),[2,{code:i,msg:ot[i]}]):[2,{code:i,data:a?Pe(a):null}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function dt(e){return V(this,void 0,void 0,(function(){var t=this;return k(this,(function(n){return m("options",e,f.CONVERSATION,!0)?[2,Fe((function(n,o){return V(t,void 0,void 0,(function(){var t,i;return k(this,(function(a){switch(a.label){case 0:return[4,n.removeConversation(e.conversationType,e.targetId,e.channelId)];case 1:return t=a.sent(),i="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),o.debug(I.O,"destroy conversation ->".concat(i)),t!==r.SUCCESS?(o.warn(I.O,"destroy conversation fail ->".concat(t,":").concat(ot[t],",").concat(i)),[2,{code:t,msg:ot[t]}]):[2,{code:t}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function lt(e){return V(this,void 0,void 0,(function(){var t=this;return k(this,(function(n){return m("options",e,f.CONVERSATION,!0)?[2,Fe((function(n,o){return V(t,void 0,void 0,(function(){var t,i,a,s;return k(this,(function(c){switch(c.label){case 0:return[4,n.getConversationMessageDraft(e.conversationType,e.targetId,e.channelId)];case 1:return t=c.sent(),i=t.code,a=t.data,s="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),o.debug(I.O,"get draft ->".concat(s)),i===r.SUCCESS?[2,{code:i,data:a||""}]:(o.warn(I.O,"get draft fail ->".concat(i,":").concat(ot[i],",").concat(s)),[2,{code:i,msg:ot[i]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function ft(e,t){return V(this,void 0,void 0,(function(){var n=this;return k(this,(function(o){return m("options",e,f.CONVERSATION,!0)&&m("draft",t,f.STRING,!0)?[2,Fe((function(o,i){return V(n,void 0,void 0,(function(){var n,a;return k(this,(function(s){switch(s.label){case 0:return n="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),i.debug(I.O,"set draft ->".concat(n)),[4,o.saveConversationMessageDraft(e.conversationType,e.targetId,t,e.channelId)];case 1:return(a=s.sent())===r.SUCCESS?[2,{code:a}]:(i.warn(I.O,"set draft fail ->".concat(a,":").concat(ot[a],",").concat(n)),[2,{code:a,msg:ot[a]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function gt(e){return V(this,void 0,void 0,(function(){var t=this;return k(this,(function(n){return m("options",e,f.CONVERSATION,!0)?[2,Fe((function(n,o){return V(t,void 0,void 0,(function(){var t,i;return k(this,(function(a){switch(a.label){case 0:return t="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),o.debug(I.O,"delete draft ->".concat(t)),[4,n.clearConversationMessageDraft(e.conversationType,e.targetId,e.channelId)];case 1:return(i=a.sent())===r.SUCCESS?[2,{code:i}]:(o.warn(I.O,"delete draft fail ->".concat(i,":").concat(ot[i],",").concat(t)),[2,{code:i,msg:ot[i]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function vt(e,t){return V(this,void 0,void 0,(function(){var n=this;return k(this,(function(o){return m("includeMuted",e,f.BOOLEAN,!1)&&m("conversationTypes",t,f.ARRAY,!1)&&!(null==t?void 0:t.some((function(e){return!m("conversationType",e,E)})))?[2,Fe((function(o,i){return V(n,void 0,void 0,(function(){var n,a,s;return k(this,(function(c){switch(c.label){case 0:return i.debug(I.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===r.SUCCESS?[2,{code:a,data:s}]:(i.warn(I.O,"getTotalUnreadCount fail ->".concat(a,":").concat(ot[a])),[2,{code:a,msg:ot[a]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function ht(e,t){return V(this,void 0,void 0,(function(){var n=this;return k(this,(function(o){return!m("conversationTypes",e,f.ARRAY,!0)||!m("levels",t,f.ARRAY,!0)||e.some((function(e){return!m("conversationType",e,E)}))||t.some((function(e){return!m("level",e,S)}))?[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,Fe((function(o,i){return V(n,void 0,void 0,(function(){var n,a,s;return k(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===r.SUCCESS?[2,{code:a,data:s}]:(i.warn(I.O,"getTotalUnreadCountByLevels fail ->".concat(a,":").concat(ot[a])),[2,{code:a,msg:ot[a]}])}}))}))}))]}))}))}function It(e,t){return V(this,void 0,void 0,(function(){var n=this;return k(this,(function(o){return!m("conversationTypes",e,f.ARRAY,!0)||!m("levels",t,f.ARRAY,!0)||e.some((function(e){return!m("conversationType",e,E)}))||t.some((function(e){return!m("level",e,S)}))?[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,Fe((function(o,i){return V(n,void 0,void 0,(function(){var n,a,s;return k(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===r.SUCCESS?[2,{code:a,data:s}]:(i.warn(I.O,"getTotalUnreadMentionedCountByLevels fail ->".concat(a,":").concat(ot[a])),[2,{code:a,msg:ot[a]}])}}))}))}))]}))}))}function Rt(e){return V(this,void 0,void 0,(function(){var t=this;return k(this,(function(n){return m("options",e,f.CONVERSATION,!0)?[2,Fe((function(n,o){return V(t,void 0,void 0,(function(){var t,i,a,s;return k(this,(function(c){switch(c.label){case 0:return[4,n.getUnreadCount(e.conversationType,e.targetId,e.channelId)];case 1:return t=c.sent(),i=t.code,a=t.data,s="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),o.debug(I.O,"get unreadCount ->".concat(s)),i===r.SUCCESS?[2,{code:i,data:a}]:(o.warn(I.O,"get unreadCount fail ->".concat(i,":").concat(ot[i],",").concat(s)),[2,{code:i,msg:ot[i]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function mt(e){return V(this,void 0,void 0,(function(){var t=this;return k(this,(function(n){return m("options",e,f.CONVERSATION,!0)?[2,Fe((function(n,o){return V(t,void 0,void 0,(function(){var t,i;return k(this,(function(a){switch(a.label){case 0:return[4,n.clearUnreadCount(e.conversationType,e.targetId,e.channelId)];case 1:return t=a.sent(),i="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),o.debug(I.O,"clear unreadMsgNum ->".concat(i)),t!==r.SUCCESS?(o.warn(I.O,"clear unreadMsgNum fail ->".concat(t,":").concat(ot[t],",").concat(i)),[2,{code:t,msg:ot[t]}]):[2,{code:t}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Et(){return V(this,void 0,void 0,(function(){var e=this;return k(this,(function(t){return[2,Fe((function(t,n){return V(e,void 0,void 0,(function(){return k(this,(function(e){switch(e.label){case 0:return[4,t.clearAllUnreadCount()];case 1:return[2,{code:e.sent()}]}}))}))}))]}))}))}nt.ROAMING_SERVICE_UNAVAILABLE.code;var St=function(e,t,n){void 0===n&&(n="");var o="conversationType:".concat(t.conversationType,",targetId:").concat(t.targetId);return e.debug(I.O,"".concat(n," -> ").concat(o)),o},Tt=function(e,t,n,o){return void 0===o&&(o=""),V(void 0,void 0,void 0,(function(){var i,a;return k(this,(function(s){switch(s.label){case 0:return i=St(e,t,o),[4,n()];case 1:return(a=s.sent())!==r.SUCCESS?(e.warn(I.O,"".concat(o," fail -> ").concat(a," : ").concat(ot[a]," , ").concat(i)),[2,{code:a,msg:ot[a]}]):[2,{code:a}]}}))}))};function pt(e,t){return V(this,void 0,void 0,(function(){return k(this,(function(n){return m("notificationLevel",t,(function(e){return void 0!==T[e]}),!0)&&m("options",e,f.CONVERSATION,!0)?[2,Fe((function(n,o){return Tt(o,e,(function(){return n.setConversationNotificationLevel(e.conversationType,e.targetId,t,e.channelId)}),"setConversationNotificationLevel")}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Ot(e,t){return V(this,void 0,void 0,(function(){return k(this,(function(n){return m("notificationStatus",t,(function(e){return 1===e||2===e}),!0)&&m("options",e,f.CONVERSATION,!0)?[2,Fe((function(n,o){return Tt(o,e,(function(){return n.setConversationStatus(e.conversationType,e.targetId,void 0,t,e.channelId)}),"setConversationNotificationStatus")}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Nt(e){return V(this,void 0,void 0,(function(){var t=this;return k(this,(function(n){return m("options",e,f.CONVERSATION,!0)?[2,Fe((function(n,o){return V(t,void 0,void 0,(function(){var t,i,a,s;return k(this,(function(c){switch(c.label){case 0:return t=St(o,e,"getConversationNotificationLevel"),[4,n.getConversationNotificationLevel(e.conversationType,e.targetId,e.channelId)];case 1:return i=c.sent(),a=i.code,s=i.data,a===r.SUCCESS?[2,{code:a,data:s}]:(o.warn(I.O,"getConversationNotificationLevel fail -> ".concat(a," : ").concat(ot[a]," , ").concat(t)),[2,{code:a,msg:ot[a]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function _t(e){return V(this,void 0,void 0,(function(){var t=this;return k(this,(function(n){return m("options",e,f.CONVERSATION,!0)?[2,Fe((function(n,o){return V(t,void 0,void 0,(function(){var t,i,a;return k(this,(function(s){switch(s.label){case 0:return o.info(I.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(),i=t.code,a=t.data,i===r.SUCCESS?[2,{code:i,data:a}]:(o.warn(I.O,"getConversationNotificationStatus ->code:".concat(i,",targetId:").concat(e.targetId)),[2,{code:i,msg:ot[i]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Ct(){return V(this,void 0,void 0,(function(){return k(this,(function(e){return[2,Fe((function(e){return e.getBlockConversationList()}))]}))}))}function At(e,t){return void 0===t&&(t=!0),V(this,void 0,void 0,(function(){var n=this;return k(this,(function(o){return m("options",e,f.CONVERSATION,!0)&&m("isTop",t,f.BOOLEAN)?[2,Fe((function(o,i){return V(n,void 0,void 0,(function(){var n,a;return k(this,(function(s){switch(s.label){case 0:return n="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),i.debug(I.O,"set conversation status ->".concat(n)),[4,o.setConversationStatus(e.conversationType,e.targetId,t,void 0,e.channelId)];case 1:return(a=s.sent())!==r.SUCCESS?(i.warn(I.O,"set conversation status fail ->".concat(a,":").concat(ot[a],",").concat(n)),[2,{code:a,msg:ot[a]}]):[2,{code:a}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Ut(e,t){return V(this,void 0,void 0,(function(){var n=this;return k(this,(function(o){return m("conversationTypes",e,f.ARRAY)&&!(null==e?void 0:e.some((function(e){return!m("conversationType",e,E)})))&&m("channelId",t,f.CHANNEL_ID)?[2,Fe((function(o,i){return V(n,void 0,void 0,(function(){var n,a,s;return k(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===r.SUCCESS&&s?[2,{code:0,data:s.map((function(e){return Pe(e)}))}]:(i.warn(I.A_GET_TOP_CONVERSATION_LIST_E,"".concat(a,":").concat(ot[a])),[2,{code:a,msg:ot[a]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function yt(e){return V(this,void 0,void 0,(function(){var t=this;return k(this,(function(n){return!m("conversationTypes",e,f.ARRAY)||(null==e?void 0:e.some((function(e){return!m("conversationType",e,p)})))?[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,Fe((function(n,o){return V(t,void 0,void 0,(function(){var t,o,i;return k(this,(function(a){switch(a.label){case 0:return[4,n.getUnreadConversationList(e)];case 1:return t=a.sent(),o=t.code,i=t.data,o===r.SUCCESS&&i?[2,{code:0,data:i.map((function(e){return Pe(e)}))}]:[2,{code:o,msg:ot[o]}]}}))}))}))]}))}))}function Mt(e){return V(this,void 0,void 0,(function(){return k(this,(function(t){return m("options",e,f.CONVERSATION,!0)?[2,Fe((function(t,n){return n.debug(I.O,"getUnreadMentionedCount".concat(e.targetId,",channelId:").concat(e.channelId)),t.getUnreadMentionedCount(e)}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Pt(){return V(this,void 0,void 0,(function(){return k(this,(function(e){return[2,Fe((function(e,t){return t.debug(I.O,"getAllUnreadMentionedCount"),e.getAllUnreadMentionedCount()}))]}))}))}function Lt(){return V(this,void 0,void 0,(function(){return k(this,(function(e){return[2,Fe((function(e){return e.getAllConversationState()}))]}))}))}function wt(e){return void 0===e&&(e={}),V(this,void 0,void 0,(function(){var t=this;return k(this,(function(n){return m("options.targetId",e.targetId,f.STRING,!1)&&m("options.channelType",e.channelType,(function(e){return void 0!==O[e]}),!1)?[2,Fe((function(n,o){return V(t,void 0,void 0,(function(){var t,i,a;return k(this,(function(s){switch(s.label){case 0:return[4,n.getUltraGroupList(e)];case 1:return t=s.sent(),i=t.code,a=t.data,i===r.SUCCESS?[2,{code:r.SUCCESS,data:a}]:(o.warn(I.O,"get ultragroup ->".concat(i,":").concat(ot[i])),[2,{code:i,msg:ot[i]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Bt(){return V(this,void 0,void 0,(function(){var e=this;return k(this,(function(t){return[2,Fe((function(t,n){return V(e,void 0,void 0,(function(){var e,o,i;return k(this,(function(a){switch(a.label){case 0:return[4,t.getBlockUltraGroupList()];case 1:return e=a.sent(),o=e.code,i=e.data,o===r.SUCCESS?[2,{code:r.SUCCESS,data:i}]:(n.warn(I.O,"get block ultragroup ->".concat(o,":").concat(ot[o])),[2,{code:o,msg:ot[o]}])}}))}))}))]}))}))}function bt(e){return V(this,void 0,void 0,(function(){var t=this;return k(this,(function(n){return m("options",e,f.CONVERSATION,!0)?[2,Fe((function(n,o){return V(t,void 0,void 0,(function(){var t;return k(this,(function(i){switch(i.label){case 0:return[4,n.sendUltraGroupTypingStatus(e)];case 1:return(t=i.sent().code)===r.SUCCESS?[2,{code:r.SUCCESS}]:(o.warn(I.O,"send ultraGroup OperateStatus ->".concat(t,":").concat(ot[t])),[2,{code:t,msg:ot[t]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Dt(e,t){return V(this,void 0,void 0,(function(){var n=this;return k(this,(function(o){return m("options",e,f.CONVERSATION,!0)&&m("msgs",t,f.ARRAY,!0)?[2,Fe((function(o,i){return V(n,void 0,void 0,(function(){var n,a,s,c,u,d,l,f,g,v;return k(this,(function(h){switch(h.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=h.sent(),l=d.code,f=d.data,l===r.SUCCESS){for(v in g={},f)g[v]=f[v]?Me(f[v]):void 0;return[2,{code:r.SUCCESS,data:g}]}return i.warn(I.O,"get UltraGroup MessageList by messageUId ->".concat(l,":").concat(ot[l])),[2,{code:l,msg:ot[l]}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Gt(e,t){return V(this,void 0,void 0,(function(){var n=this;return k(this,(function(o){return m("expansion",e,f.OBJECT,!0)&&m("message",t,f.OBJECT,!0)?[2,Fe((function(o,i){return V(n,void 0,void 0,(function(){var n,a,s,c,u,d,l,f,g;return k(this,(function(v){switch(v.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),i.debug(I.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(g=v.sent().code)===r.SUCCESS?[2,{code:r.SUCCESS}]:(i.warn(I.O,"update expansion for ultragroup message ->".concat(g,":").concat(ot[g])),[2,{code:g,msg:ot[g]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Vt(e,t){return V(this,void 0,void 0,(function(){var n=this;return k(this,(function(o){return m("expansion",e,f.ARRAY,!0)&&m("message",t,f.OBJECT,!0)?[2,Fe((function(o,i){return V(n,void 0,void 0,(function(){var n,a,s,c,u,d,l,f,g;return k(this,(function(v){switch(v.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),i.debug(I.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(g=v.sent().code)===r.SUCCESS?[2,{code:r.SUCCESS}]:(i.warn(I.O,"remove expansion for ultraGroup message ->".concat(g,":").concat(ot[g])),[2,{code:g,msg:ot[g]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function kt(e){return V(this,void 0,void 0,(function(){var t=this;return k(this,(function(n){return m("message",e,f.OBJECT,!0)?[2,Fe((function(n,o){return V(t,void 0,void 0,(function(){var t,i,a,s,c,u,d,l,f;return k(this,(function(g){switch(g.label){case 0:return t=e.conversationType,i=e.targetId,a=e.messageUId,s=e.sentTime,c=e.canIncludeExpansion,u=e.channelId,d="conversationType:".concat(t,",targetId:").concat(i,",channelId:").concat(u,",messageUId:").concat(a),o.debug(I.O,"remove all expansion for ultraGroup message ->".concat(d)),l={targetId:i,channelId:u,conversationType:t,sendTime:s,canIncludeExpansion:c,messageUId:a,removeAll:!0},[4,n.expandUltraMessage(l)];case 1:return(f=g.sent().code)===r.SUCCESS?[2,{code:r.SUCCESS}]:(o.warn(I.O,"remove all expansion for ultraGroup message ->".concat(f,":").concat(ot[f])),[2,{code:f,msg:ot[f]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function xt(e,t){return V(this,void 0,void 0,(function(){var n=this;return k(this,(function(o){return m("content",e,f.OBJECT,!0)&&m("message",t,f.OBJECT,!0)?[2,Fe((function(o,i){return V(n,void 0,void 0,(function(){var n,a,s,c,u,d,l,f,g,v;return k(this,(function(h){switch(h.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),i.debug(I.O,"update ultragroup message expansion ->".concat(f)),g={targetId:a,channelId:l,conversationType:n,fromUserId:c,sendTime:u,canIncludeExpansion:d,messageUId:s,content:e},[4,o.modifyMessage(g)];case 1:return(v=h.sent().code)===r.SUCCESS?[2,{code:r.SUCCESS}]:(i.warn(I.O,"modify ultraGroup message ->".concat(v,":").concat(ot[v])),[2,{code:v,msg:ot[v]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Ft(e,t){return V(this,void 0,void 0,(function(){var n=this;return k(this,(function(o){return m("targetId",e,f.STRING,!0)&&m("notificationLevels",t,f.ARRAY)&&!(null==t?void 0:t.some((function(e){return!m("notificationLevel",e,S)})))?[2,Fe((function(o,i){return V(n,void 0,void 0,(function(){var n,a,s;return k(this,(function(c){switch(c.label){case 0:return i.debug(I.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===r.SUCCESS?[2,{code:r.SUCCESS,data:s}]:(i.warn(I.O,"get UltraGroup unreadMentionedCount by targetId error ->".concat(a,":").concat(ot[a])),[2,{code:a,msg:ot[a]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Zt(e){return V(this,void 0,void 0,(function(){var t=this;return k(this,(function(n){return m("options.targetId",e.targetId,f.STRING,!0)&&m("options.channelId",e.channelId,f.CHANNEL_ID)?[2,Fe((function(n,o){return V(t,void 0,void 0,(function(){var t,i,a,s,c;return k(this,(function(u){switch(u.label){case 0:return t="getUltraGroupDefaultNotificationLevel",i="targetId: ".concat(e.targetId,", channelId: ").concat(e.channelId),o.debug(I.O,"".concat(t," -> ").concat(i)),[4,n.getUltraGroupDefaultNotificationLevel(e.targetId,e.channelId)];case 1:return a=u.sent(),s=a.code,c=a.data,s===r.SUCCESS?[2,{code:s,data:c}]:(o.warn(I.O,"".concat(t," fail -> ").concat(s," : ").concat(ot[s]," , ").concat(i)),[2,{code:s,msg:ot[s]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Ht(e,t){return V(this,void 0,void 0,(function(){var n=this;return k(this,(function(o){return e.channelId=e.channelId||"",m("options.targetId",e.targetId,f.STRING,!0)&&m("options.channelId",e.channelId,f.CHANNEL_ID,!0)&&m("notificationLevel",t,(function(e){return void 0!==T[e]}),!0)?[2,Fe((function(o,i){return V(n,void 0,void 0,(function(){var n,a,s;return k(this,(function(c){switch(c.label){case 0:return n="setUltraGroupDefaultNotificationLevel",a="targetId: ".concat(e.targetId,", channelId: ").concat(e.channelId),i.debug(I.O,"".concat(n," -> ").concat(a)),[4,o.setUltraGroupDefaultNotificationLevel(e.targetId,t,e.channelId)];case 1:return(s=c.sent().code)===r.SUCCESS?[2,{code:s}]:(i.warn(I.O,"".concat(n," fail -> ").concat(s," : ").concat(ot[s]," , ").concat(a)),[2,{code:s,msg:ot[s]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function qt(e,t){return V(this,void 0,void 0,(function(){var n=this;return k(this,(function(o){return m("targetId",e,f.STRING,!0)&&m("notificationLevels",t,f.ARRAY)&&!(null==t?void 0:t.some((function(e){return!m("notificationLevel",e,S)})))?[2,Fe((function(o,r){return V(n,void 0,void 0,(function(){var n,i,a,s,c;return k(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(I.O,"".concat(n," -> ").concat(c)),[2,{code:a,data:s}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Jt(){return V(this,void 0,void 0,(function(){var e=this;return k(this,(function(t){return[2,Fe((function(t,n){return V(e,void 0,void 0,(function(){var e,o,i,a;return k(this,(function(s){switch(s.label){case 0:return e="getAllUltraGroupUnreadCount",[4,t.getAllUltraGroupUnreadCount()];case 1:return o=s.sent(),i=o.code,a=o.data,n.debug(I.O,e),i===r.SUCCESS?[2,{code:i,data:a}]:(n.warn(I.O,"".concat(e," fail ->").concat(i,": ").concat(ot[i])),[2,{code:i,msg:ot[i]}])}}))}))}))]}))}))}function Kt(){return V(this,void 0,void 0,(function(){var e=this;return k(this,(function(t){return[2,Fe((function(t,n){return V(e,void 0,void 0,(function(){var e,o,i,a;return k(this,(function(s){switch(s.label){case 0:return e="getAllUltraGroupUnreadMentionedCount",!0,[4,t.getAllUltraGroupUnreadCount(true)];case 1:return o=s.sent(),i=o.code,a=o.data,n.debug(I.O,e),i===r.SUCCESS?[2,{code:i,data:a}]:(n.warn(I.O,"".concat(e," fail ->").concat(i,": ").concat(ot[i])),[2,{code:i,msg:ot[i]}])}}))}))}))]}))}))}function Yt(e){return V(this,void 0,void 0,(function(){var t=this;return k(this,(function(n){return e.channelId=e.channelId||"",m("options.targetId",e.targetId,f.STRING,!0)&&m("options.channelId",e.channelId,f.CHANNEL_ID,!0)&&m("options.sentTime",e.sentTime,f.NUMBER,!0)&&m("options.count",e.count,(function(e){return s(e)&&e>0&&e<=50}),!0)?[2,Fe((function(n,o){return V(t,void 0,void 0,(function(){var t,i,a,s,c,u,d,l;return k(this,(function(f){switch(f.label){case 0:return t=e.targetId,i=e.channelId,a=e.sentTime,s=e.count,c={targetId:t,channelId:i,sentTime:a,count:s},[4,n.getUltraGroupUnreadMentionedMessages(c)];case 1:return u=f.sent(),d=u.code,l=u.data,d===r.SUCCESS?[2,{code:d,data:l}]:(o.warn(I.O,"getUltraGroupUnreadMentionedMessages fail ->".concat(d,": ").concat(ot[d])),[2,{code:d,msg:ot[d]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function zt(e){return V(this,void 0,void 0,(function(){var t=this;return k(this,(function(n){return m("conversation.targetId",e.targetId,f.STRING,!0)&&m("conversation.channelId",e.channelId,f.CHANNEL_ID,!0)?[2,Fe((function(n){return V(t,void 0,void 0,(function(){var t,o,i,a,s,c;return k(this,(function(u){switch(u.label){case 0:return t=e.targetId,o=e.channelId,i={targetId:t,channelId:o},[4,n.getUltraGroupFirstUnreadMessageTimestamp(i)];case 1:return a=u.sent(),s=a.code,c=a.data,s===r.SUCCESS?[2,{code:s,data:c}]:[2,{code:s,msg:ot[s]}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function jt(e){return V(this,void 0,void 0,(function(){var t,n=this;return k(this,(function(o){return m("targetIds",e,f.ARRAY,!0)&&m("targetIds.length",e,(function(e){return e.length>0&&e.length<20}))&&!e.some((function(e){return!m("targetId",e,f.STRING)}))?(t=e.filter((function(t,n){return e.indexOf(t)===n})),[2,Fe((function(e){return V(n,void 0,void 0,(function(){var n,o,i;return k(this,(function(a){switch(a.label){case 0:return[4,e.getUltraGroupUnreadInfoList(t)];case 1:return n=a.sent(),o=n.code,i=n.data,o===r.SUCCESS?[2,{code:o,data:i}]:[2,{code:o,msg:ot[o]}]}}))}))}))]):[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}var Wt=function(e){return!!(m("options.key",e.key,f.STRING,!0)&&m("options.value",e.value,f.STRING,!0)&&m("options.isAutoDelete",e.isAutoDelete,f.BOOLEAN)&&m("options.isSendNotification",e.isSendNotification,f.BOOLEAN)&&m("options.notificationExtra",e.notificationExtra,f.STRING))},Xt=function(e){return e.entries.every((function(e){return m("entry.key",e.key,f.STRING,!0)&&m("entry.value",e.value,f.STRING,!0)}))&&m("options.isAutoDelete",e.isAutoDelete,f.BOOLEAN)&&m("options.notificationExtra",e.notificationExtra,f.STRING)&&m("options.isForce",e.isForce,f.BOOLEAN)},Qt=function(e){return m("options.key",e.key,f.STRING,!0)&&m("options.isSendNotification",e.isSendNotification,f.BOOLEAN)&&m("options.notificationExtra",e.notificationExtra,f.STRING)},$t=function(e){return e.entries.every((function(e){return m("key",e,f.STRING,!0)}))&&m("options.notificationExtra",e.notificationExtra,f.STRING)};function en(e,t){return V(this,void 0,void 0,(function(){var n=this;return k(this,(function(o){return m("targetId",e,f.STRING,!0)&&m("options.count",t.count,f.NUMBER,!0)?[2,Fe((function(o,i){return V(n,void 0,void 0,(function(){var n,a,s;return k(this,(function(c){switch(c.label){case 0:return n=i.createTraceId(),i.info(I.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===r.SUCCESS?"info":"warn",i[s](I.A_JOIN_CHATROOM_R,JSON.stringify({code:a,timestamp:(new Date).getTime()}),n),a!==r.SUCCESS?[2,{code:a,msg:ot[a]}]:[2,{code:a}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function tn(e,t){return V(this,void 0,void 0,(function(){var n=this;return k(this,(function(o){return m("targetId",e,f.STRING,!0)&&m("options.count",t.count,f.NUMBER,!0)?[2,Fe((function(o,i){return V(n,void 0,void 0,(function(){var n,a,s;return k(this,(function(c){switch(c.label){case 0:return n=i.createTraceId(),i.info(I.A_JOIN_CHATROOM_T,JSON.stringify({chatroomId:e,count:t.count,joinExist:!0}),n),[4,o.joinExistChatroom(e,t.count,n)];case 1:return a=c.sent(),s=a===r.SUCCESS?"info":"warn",i[s](I.A_JOIN_CHATROOM_R,JSON.stringify({code:a,timestamp:(new Date).getTime()}),n),a!==r.SUCCESS?[2,{code:a,msg:ot[a]}]:[2,{code:a}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function nn(e){return V(this,void 0,void 0,(function(){var t=this;return k(this,(function(n){return m("targetId",e,f.STRING,!0)?[2,Fe((function(n,o){return V(t,void 0,void 0,(function(){var t,i,a;return k(this,(function(s){switch(s.label){case 0:return t=o.createTraceId(),o.info(I.A_QUIT_CHATROOM_T,JSON.stringify({chatroomId:e}),t),[4,n.quitChatroom(e)];case 1:return i=s.sent(),a=i===r.SUCCESS?"info":"warn",o[a](I.A_QUIT_CHATROOM_R,JSON.stringify({code:i}),t),i!==r.SUCCESS?[2,{code:i,msg:ot[i]}]:[2,{code:i}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function on(e,t){return V(this,void 0,void 0,(function(){var n=this;return k(this,(function(o){return m("targetId",e,f.STRING,!0)&&m("options.count",t.count,f.NUMBER)&&m("options.order",t.order,(function(e){return[0,1,2].includes(e)}))?[2,Fe((function(o,i){return V(n,void 0,void 0,(function(){var n,a,s,c;return k(this,(function(u){switch(u.label){case 0:return n="id:".concat(e),i.debug(I.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===r.SUCCESS&&c?[2,{code:s,data:c}]:(i.warn(I.O,"get chatroom info fail ->code+:".concat(ot[s],",").concat(n)),[2,{code:s,msg:ot[s]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function rn(e,t){return V(this,void 0,void 0,(function(){var n=this;return k(this,(function(o){return m("targetId",e,f.STRING,!0)&&Wt(t)?[2,Fe((function(o,i){return V(n,void 0,void 0,(function(){var n,a;return k(this,(function(s){switch(s.label){case 0:return n="id:".concat(e),i.debug(I.O,"set chatroom entry->".concat(n)),[4,o.setChatroomEntry(e,t)];case 1:return(a=s.sent())!==r.SUCCESS?(i.warn(I.O,"set chatroom entry fail ->code+:".concat(ot[a],",").concat(n)),[2,{code:a,msg:ot[a]}]):[2,{code:a}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function an(e,t){return V(this,void 0,void 0,(function(){var n=this;return k(this,(function(o){return m("targetId",e,f.STRING,!0)&&Xt(t)?t.entries.length>10?[2,nt.CHATROOM_KV_STORE_OUT_LIMIT]:[2,Fe((function(o,i){return V(n,void 0,void 0,(function(){var n,a,s,c;return k(this,(function(u){switch(u.label){case 0:return n="id:".concat(e),i.debug(I.O,"set chatroom entry->".concat(n)),[4,o.setChatroomEntries(e,t)];case 1:return a=u.sent(),s=a.code,c=a.data,s!==r.SUCCESS?(i.warn(I.O,"set chatroom entry fail ->code+:".concat(ot[s],",").concat(n)),[2,{code:s,msg:ot[s],data:c}]):[2,{code:s}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function sn(e,t){return V(this,void 0,void 0,(function(){var n=this;return k(this,(function(o){return m("targetId",e,f.STRING,!0)&&Wt(t)?[2,Fe((function(o,i){return V(n,void 0,void 0,(function(){var n,a;return k(this,(function(s){switch(s.label){case 0:return n="id:".concat(e),i.debug(I.O,"force set chatroom entry ->".concat(n)),[4,o.forceSetChatroomEntry(e,t)];case 1:return(a=s.sent())!==r.SUCCESS?(i.warn(I.O,"force set chatroom entry fail ->code+:".concat(ot[a],",").concat(n)),[2,{code:a,msg:ot[a]}]):[2,{code:a}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function cn(e,t){return V(this,void 0,void 0,(function(){var n=this;return k(this,(function(o){return m("targetId",e,f.STRING,!0)&&Qt(t)?[2,Fe((function(o,i){return V(n,void 0,void 0,(function(){var n,a;return k(this,(function(s){switch(s.label){case 0:return n="id:".concat(e),i.debug(I.O,"remove chatroom entry->".concat(n)),[4,o.removeChatroomEntry(e,t)];case 1:return(a=s.sent())!==r.SUCCESS?(i.warn(I.O,"remove chatroom entry fail ->code+:".concat(ot[a],",").concat(n)),[2,{code:a,msg:ot[a]}]):[2,{code:a}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function un(e,t){return V(this,void 0,void 0,(function(){var n=this;return k(this,(function(o){return m("targetId",e,f.STRING,!0)&&$t(t)?[2,Fe((function(o,i){return V(n,void 0,void 0,(function(){var n,a,s,c,u;return k(this,(function(d){switch(d.label){case 0:return n="id:".concat(e),i.info(I.O,"remove chatroom entry->".concat(n)),(a=G({},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!==r.SUCCESS?(i.warn(I.O,"remove chatroom entry fail ->code+:".concat(ot[c],",").concat(n)),[2,{code:c,msg:ot[c],data:u}]):[2,{code:c}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function dn(e,t){return V(this,void 0,void 0,(function(){var n=this;return k(this,(function(o){return m("targetId",e,f.STRING,!0)&&Qt(t)?[2,Fe((function(o,i){return V(n,void 0,void 0,(function(){var n,a;return k(this,(function(s){switch(s.label){case 0:return n="id:".concat(e),i.info(I.O,"force remove chatroom entry ->".concat(n)),[4,o.forceRemoveChatroomEntry(e,t)];case 1:return(a=s.sent())!==r.SUCCESS?(i.warn(I.O,"force remove chatroom entry fail ->code+:".concat(ot[a],",").concat(n)),[2,{code:a,msg:ot[a]}]):[2,{code:a}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function ln(e,t){return V(this,void 0,void 0,(function(){var n=this;return k(this,(function(o){return m("targetId",e,f.STRING,!0)&&m("key",t,(function(e){return N(e)&&/[\w+=-]+/.test(e)&&e.length<=128}),!0)?[2,Fe((function(o,i){return V(n,void 0,void 0,(function(){var n,a,s,c;return k(this,(function(u){switch(u.label){case 0:return n="id:".concat(e),i.debug(I.O,"get chatroom entry->".concat(n)),[4,o.getChatroomEntry(e,t)];case 1:return a=u.sent(),s=a.code,c=a.data,s===r.SUCCESS&&c?[2,{code:s,data:c}]:(i.warn(I.O,"get chatroom entry fail ->code+:".concat(ot[s],",").concat(n)),[2,{code:s,msg:ot[s]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function fn(e){return V(this,void 0,void 0,(function(){var t=this;return k(this,(function(n){return m("targetId",e,f.STRING,!0)?[2,Fe((function(n,o){return V(t,void 0,void 0,(function(){var t,i,a,s;return k(this,(function(c){switch(c.label){case 0:return t="id:".concat(e),o.debug(I.O,"get all chatroom entries->".concat(t)),[4,n.getAllChatroomEntries(e)];case 1:return i=c.sent(),a=i.code,s=i.data,a===r.SUCCESS&&s?[2,{code:a,data:s}]:(o.warn(I.O,"get all chatroom entries fail ->code+:".concat(ot[a],",").concat(t)),[2,{code:a,msg:ot[a]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function gn(e,t){return V(this,void 0,void 0,(function(){var n=this;return k(this,(function(o){return m("targetId",e,f.STRING,!0)&&m("options.timestamp",t.timestamp,f.NUMBER)&&m("options.count",t.count,f.NUMBER)&&m("options.count",t.count,(function(e){var t=e>0&&e<=100;return t||null===console||void 0===console||console.error('"options.count" is invalid, It should be greater than 0 and less than 100'),t}))&&m("options.order",t.order,(function(e){return 0===e||1===e}))?[2,Fe((function(o,i){return V(n,void 0,void 0,(function(){var n,a,s,c,u;return k(this,(function(d){switch(d.label){case 0:return n="id:".concat(e),i.debug(I.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===r.SUCCESS&&c?(u=c.list.map((function(e){return Me(e)})),[2,{code:s,data:{list:u,hasMore:!!c.hasMore}}]):(i.warn(I.O,"get chatroom history message fail ->code+:".concat(ot[s],",").concat(n)),[2,{code:s,msg:ot[s]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function vn(e){return V(this,void 0,void 0,(function(){var t=this;return k(this,(function(n){return m("option.chatRoomId",e.chatRoomId,f.STRING,!0)&&m("option.rtcRoomId",e.rtcRoomId,f.STRING,!0)?[2,Fe((function(n){return V(t,void 0,void 0,(function(){var t;return k(this,(function(o){switch(o.label){case 0:return[4,n.bindRTCRoomForChatroom(e)];case 1:return[2,{code:t=o.sent(),msg:ot[t]}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function hn(e){return V(this,void 0,void 0,(function(){var t=this;return k(this,(function(n){return m("userId",e,f.STRING,!0)?[2,Fe((function(n,o){return V(t,void 0,void 0,(function(){return k(this,(function(t){switch(t.label){case 0:return o.info(I.O,"addToBlacklist -> userId: ".concat(e)),[4,n.addToBlacklist(e)];case 1:return[2,{code:t.sent()}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function In(e){return V(this,void 0,void 0,(function(){var t=this;return k(this,(function(n){return m("userId",e,f.STRING,!0)?[2,Fe((function(n,o){return V(t,void 0,void 0,(function(){return k(this,(function(t){switch(t.label){case 0:return o.info(I.O,"removeFromBlacklist -> userId: ".concat(e)),[4,n.removeFromBlacklist(e)];case 1:return[2,{code:t.sent()}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Rn(){return V(this,void 0,void 0,(function(){var e=this;return k(this,(function(t){return[2,Fe((function(t,n){return V(e,void 0,void 0,(function(){var e,o,i;return k(this,(function(a){switch(a.label){case 0:return n.info(I.O,"getBlacklist -> "),[4,t.getBlacklist()];case 1:return e=a.sent(),o=e.code,i=e.data,o===r.SUCCESS&&i?[2,{code:o,data:i}]:(n.warn(I.O,"getBlacklist fail -> code: ".concat(o)),[2,{code:o}])}}))}))}))]}))}))}function mn(e){return V(this,void 0,void 0,(function(){var t=this;return k(this,(function(n){return m("userId",e,f.STRING,!0)?[2,Fe((function(n,o){return V(t,void 0,void 0,(function(){var t,i,a;return k(this,(function(s){switch(s.label){case 0:return o.info(I.O,"getBlacklistStatus -> userId: ".concat(e)),[4,n.getBlacklistStatus(e)];case 1:return t=s.sent(),i=t.code,a=t.data,i===r.SUCCESS?[2,{code:i,data:0===a}]:(o.warn(I.O,"getBlacklistStatus fail -> code: ".concat(i,", userId: ").concat(e)),[2,{code:i}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}var En=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 Sn(e,t,n){void 0===t&&(t=!0),void 0===n&&(n=!0);return function(o){return new En(e,o,t,n)}}var Tn,pn=Sn("RC:ImgMsg"),On=Sn("RC:HQVCMsg"),Nn=Sn("RC:SightMsg"),_n=Sn("RC:TxtMsg"),Cn=Sn("RC:CombineMsg"),An=Sn("RC:FileMsg"),Un=Sn("RC:GIFMsg"),yn=Sn("RC:VcMsg"),Mn=Sn("RC:LBSMsg"),Pn=Sn("RC:ReferenceMsg"),Ln=Sn("RC:ImgTextMsg");!function(e){e.ALIYUN="aliyun",e.S3="s3",e.STC="stc",e.MINIO="minio",e.QINIU="qiniu",e.BAIDU="baidu",e.RCX="rcx"}(Tn||(Tn={}));var wn,Bn,bn=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>_?Promise.resolve({code:r.UPLOAD_FAIL,msg:"the file size is over 5GB!"}):e.file.size>C&&this.isSupportMultipart?this.multipartUpload(e):this.commonUpload(e)},e}(),Dn=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return D(t,e),t.prototype.commonUpload=function(e){return V(this,void 0,void 0,(function(){var t,n,o,i,a,s,c;return k(this,(function(u){switch(u.label){case 0:return t=e.file,n=e.onProgress,o=e.fileType,[4,this._getFileToken(o,t.name)];case 1:return i=u.sent(),a={},(s=new FormData).set("token",i.token),s.set("key",i.fileName),s.set("file",t),[4,ye.httpReq({url:/http/.test(this._url)?this._url:"https://".concat(this._url),headers:a,onProgress:function(e){return null==n?void 0:n(e.loaded,e.total)},method:"POST",body:s,timeout:0})];case 2:return 200===(c=u.sent().status)||204===c?[2,{code:r.SUCCESS,data:{uniqueName:i.fileName,uploadMethod:A.QINIU}}]:[2,{code:r.UPLOAD_FAIL,msg:c.toString()}]}}))}))},t.prototype.multipartUpload=function(e){return V(this,void 0,void 0,(function(){return k(this,(function(e){throw new Error("Method not implemented.")}))}))},t}(bn),Gn=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return D(t,e),t.prototype.commonUpload=function(e){return V(this,void 0,void 0,(function(){var t,n,o,i,a,s,c;return k(this,(function(u){switch(u.label){case 0:return t=e.file,n=e.onProgress,o=e.fileType,[4,this._getFileToken(o)];case 1:return i=u.sent(),a="https://".concat(i.ossBucketName,".").concat(this._url),(s=new FormData).set("token",i.token),s.set("OSSAccessKeyId",i.osskeyId),s.set("policy",i.ossPolicy),s.set("Signature",i.ossSign),s.set("success_action_status","200"),s.set("key",i.fileName),s.set("file",t),[4,ye.httpReq({url:a,onProgress:function(e){return null==n?void 0:n(e.loaded,e.total)},method:"POST",body:s,timeout:0})];case 2:return 200===(c=u.sent().status)||204===c?[2,{code:r.SUCCESS,data:{uniqueName:i.fileName,uploadMethod:A.ALI}}]:[2,{code:r.UPLOAD_FAIL,msg:c.toString()}]}}))}))},t.prototype.multipartUpload=function(e){throw new Error("Method not implemented.")},t}(bn),Vn=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return D(t,e),t.prototype.commonUpload=function(e){return V(this,void 0,void 0,(function(){var t,n,o,i,a,s,c,u,d;return k(this,(function(l){switch(l.label){case 0:return t=e.file,n=e.onProgress,o=e.fileType,i=e.contentDisposition,[4,this._getFileToken(o<=U.FILE?o:U.FILE)];case 1:return a=l.sent(),s=i||("text/html"===t.type?"inline":"attachment"),c={authorization:a.bosToken,"x-bce-date":a.bosDate,"Content-Disposition":"".concat(s,"; filename=").concat(encodeURIComponent(t.name),";")},u=(/http/.test(this._url)?this._url:"https://".concat(this._url))+a.path,[4,ye.httpReq({url:u,headers:c,onProgress:function(e){return null==n?void 0:n(e.loaded,e.total)},method:"POST",body:t,timeout:0})];case 2:return 200===(d=l.sent().status)||204===d?[2,{code:r.SUCCESS,data:{uniqueName:a.fileName,downloadUrl:u}}]:[2,{code:r.UPLOAD_FAIL,msg:d.toString()}]}}))}))},t.prototype.multipartUpload=function(e){throw new Error("Method not implemented.")},t}(bn),kn=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return D(t,e),t.prototype.commonUpload=function(e){return V(this,void 0,void 0,(function(){var t,n,o,i,a,s,c,u,d,l;return k(this,(function(f){switch(f.label){case 0:return t=e.file,n=e.onProgress,o=e.fileType,i=e.contentDisposition,[4,this._getFileToken(o,t.name)];case 1:return a=f.sent(),s={},c="https://".concat(a.s3BucketName,".").concat(this._url),u=new FormData,i?u.set("Content-Disposition",i):u.set("Content-Disposition","text/html"===t.type?"inline;":"attachment;"),u.set("Content-Type",t.type),u.set("x-amz-credential",a.s3Credential),u.set("x-amz-algorithm",a.s3Algorithm),u.set("x-amz-date",a.s3Date),u.set("policy",a.s3Policy),u.set("x-amz-signature",a.s3Signature),u.set("key",a.fileName),u.set("file",t),[4,ye.httpReq({url:c,headers:s,onProgress:function(e){return null==n?void 0:n(e.loaded,e.total)},method:"POST",body:u,timeout:0})];case 2:return d=f.sent(),l=d.status,d.data,200===l||204===l?[2,{code:r.SUCCESS,data:{uniqueName:a.fileName,uploadMethod:A.AWS}}]:[2,{code:r.UPLOAD_FAIL,msg:l.toString()}]}}))}))},t.prototype.multipartUpload=function(e){throw new Error("Method not implemented.")},t}(bn),xn=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.isSupportMultipart=!0,t}return D(t,e),t.prototype.commonUpload=function(e){return V(this,void 0,void 0,(function(){var t,n,o,i,a,s,c;return k(this,(function(u){switch(u.label){case 0:return t=e.file,n=e.onProgress,o=e.fileType,[4,this._getFileToken(o)];case 1:return i=u.sent(),a="https://".concat(this._url,"/").concat(i.minioBucketName,"/").concat(i.fileName),s=this.getBaseHeaders(t,i,e),[4,ye.httpReq({url:a,headers:s,onProgress:function(e){return null==n?void 0:n(e.loaded,e.total)},method:"PUT",body:t,timeout:0})];case 2:return 200===(c=u.sent().status)||204===c?[2,{code:r.SUCCESS,data:{uniqueName:i.fileName,uploadMethod:A.MINIO}}]:[2,{code:r.UPLOAD_FAIL}]}}))}))},t.prototype.multipartUpload=function(e){var t;return V(this,void 0,void 0,(function(){var n,o,i,a,s,c,u,d,l,f,g,v,h,I,R,m,E;return k(this,(function(S){switch(S.label){case 0:return n=e.file,e.onProgress,o=e.fileType,[4,this._getFileToken(o,n.name,"POST","uploads")];case 1:return i=S.sent(),a="https://".concat(this._url,"/").concat(i.stcBucketName,"/").concat(i.fileName),s=this.getBaseHeaders(n,i,e),[4,ye.httpReq({url:"".concat(a,"?uploads"),headers:s,method:"POST"})];case 2:return c=S.sent(),u=c.status,d=c.data,l=null===(t=null==d?void 0:d.match(/(?:<UploadId>)(\S*?)(?:<\/UploadId>)/))||void 0===t?void 0:t[1],200!==u&&204!==u||!l?[2,{code:r.UPLOAD_FAIL,msg:"start upload fail"}]:(f=[],[4,this.requestUploadPart(a,n,l,i.fileName,e,f)]);case 3:return g=S.sent(),v=g.code,h=g.msg,v!==r.SUCCESS?[2,{code:v,msg:h}]:[4,this._getFileToken(o,i.fileName,"POST","uploadId=".concat(l))];case 4:return I=S.sent(),R=f.map((function(e,t){return"<Part><PartNumber>".concat(t+1,"</PartNumber><ETag>").concat(e,"</ETag></Part>")})).join(""),R="<CompleteMultipartUpload xmlns='http://s3.amazonaws.com/doc/2006-03-01/'>".concat(R,"</CompleteMultipartUpload>"),m=this.getBaseHeaders(n,I,e),[4,ye.httpReq({url:"".concat(a,"?uploadId=").concat(l),headers:m,method:"POST",body:R})];case 5:return 200===(E=S.sent().status)||204===E?[2,{code:r.SUCCESS,data:{uniqueName:i.fileName,uploadMethod:A.STC}}]:[2,{code:r.UPLOAD_FAIL,msg:"end upload fail"}]}}))}))},t.prototype.requestUploadPart=function(e,t,n,o,i,a,s,c){return void 0===s&&(s=1),void 0===c&&(c=0),V(this,void 0,void 0,(function(){var u,d,l,f,g,v,h,I,R;return k(this,(function(m){switch(m.label){case 0:return c>=5?[2,{code:r.UPLOAD_FAIL,msg:"Upload retry times exceeded 5. Procedure"}]:(u=(s-1)*C,d=Math.min(C,t.size-u),l="partNumber=".concat(s,"&uploadId=").concat(n),[4,this._getFileToken(i.fileType,o,"PUT",l)]);case 1:return f=m.sent(),g=t.slice(u,s*C),v=this.getBaseHeaders(t,f,i),[4,ye.httpReq({url:"".concat(e,"?").concat(l),headers:v,method:"PUT",body:g,onProgress:function(e){var n;return null===(n=null==i?void 0:i.onProgress)||void 0===n?void 0:n.call(i,u+e.loaded,t.size)},timeout:0})];case 2:return h=m.sent(),I=h.status,h.data,R=h.xhr,200===I||204===I?(a.push((null==R?void 0:R.getResponseHeader("ETag"))||""),u+d<t.size?[2,this.requestUploadPart(e,t,n,o,i,a,s+1,0)]:[2,{code:r.SUCCESS}]):[2,this.requestUploadPart(e,t,n,o,i,a,s,c+1)]}}))}))},t.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"}},t}(bn),Fn=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.isSupportMultipart=!0,t}return D(t,e),t.prototype.commonUpload=function(e){return V(this,void 0,void 0,(function(){var t,n,o,i,a,s,c;return k(this,(function(u){switch(u.label){case 0:return t=e.file,n=e.onProgress,o=e.fileType,[4,this._getFileToken(o)];case 1:return i=u.sent(),a="https://".concat(this._url,"/").concat(i.minioBucketName,"/").concat(i.fileName),s=this.getBaseHeaders(t,i,e),[4,ye.httpReq({url:a,headers:s,onProgress:function(e){return null==n?void 0:n(e.loaded,e.total)},method:"PUT",body:t,timeout:0})];case 2:return 200===(c=u.sent().status)||204===c?[2,{code:r.SUCCESS,data:{uniqueName:i.fileName,uploadMethod:A.MINIO}}]:[2,{code:r.UPLOAD_FAIL,msg:c.toString()}]}}))}))},t.prototype.multipartUpload=function(e){var t;return V(this,void 0,void 0,(function(){var n,o,i,a,s,c,u,d,l,f,g,v,h,I,R,m,E;return k(this,(function(S){switch(S.label){case 0:return n=e.file,o=e.fileType,[4,this._getFileToken(o,n.name,"POST","uploads")];case 1:return i=S.sent(),a="https://".concat(this._url,"/").concat(i.minioBucketName,"/").concat(i.fileName),s=this.getBaseHeaders(n,i,e),[4,ye.httpReq({url:"".concat(a,"?uploads"),headers:s,method:"POST"})];case 2:return c=S.sent(),u=c.status,d=c.data,l=null===(t=null==d?void 0:d.match(/(?:<UploadId>)(\S*?)(?:<\/UploadId>)/))||void 0===t?void 0:t[1],200!==u&&204!==u||!l?[2,{code:r.UPLOAD_FAIL,msg:"start upload fail"}]:(f=[],[4,this.requestUploadPart(a,n,l,i.fileName,e,f)]);case 3:return g=S.sent(),v=g.code,h=g.msg,v!==r.SUCCESS?[2,{code:v,msg:h}]:[4,this._getFileToken(o,i.fileName,"POST","uploadId=".concat(l))];case 4:return I=S.sent(),R=f.map((function(e,t){return"<Part><PartNumber>".concat(t+1,"</PartNumber><ETag>").concat(e,"</ETag></Part>")})).join(""),R="<CompleteMultipartUpload xmlns='http://s3.amazonaws.com/doc/2006-03-01/'>".concat(R,"</CompleteMultipartUpload>"),m=this.getBaseHeaders(n,I,e),[4,ye.httpReq({url:"".concat(a,"?uploadId=").concat(l),headers:m,method:"POST",body:R,timeout:0})];case 5:return 200===(E=S.sent().status)||204===E?[2,{code:r.SUCCESS,data:{uniqueName:i.fileName,uploadMethod:A.MINIO}}]:[2,{code:r.UPLOAD_FAIL,msg:"end upload fail"}]}}))}))},t.prototype.requestUploadPart=function(e,t,n,o,i,a,s,c){return void 0===s&&(s=1),void 0===c&&(c=0),V(this,void 0,void 0,(function(){var u,d,l,f,g,v,h,I,R;return k(this,(function(m){switch(m.label){case 0:return c>=5?[2,{code:r.UPLOAD_FAIL,msg:"Upload retry times exceeded 5. Procedure"}]:(u=(s-1)*C,d=Math.min(C,t.size-u),l="partNumber=".concat(s,"&uploadId=").concat(n),[4,this._getFileToken(i.fileType,o,"PUT",l)]);case 1:return f=m.sent(),g=t.slice(u,s*C),v=this.getBaseHeaders(t,f,i),[4,ye.httpReq({url:"".concat(e,"?").concat(l),headers:v,method:"PUT",body:g,timeout:0,onProgress:function(e){var n;return null===(n=null==i?void 0:i.onProgress)||void 0===n?void 0:n.call(i,u+e.loaded,t.size)}})];case 2:return h=m.sent(),I=h.status,R=h.xhr,200===I||204===I?(a.push((null==R?void 0:R.getResponseHeader("ETag"))||""),u+d<t.size?[2,this.requestUploadPart(e,t,n,o,i,a,s+1,0)]:[2,{code:r.SUCCESS}]):[2,this.requestUploadPart(e,t,n,o,i,a,s,c+1)]}}))}))},t.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"}},t}(bn),Zn=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.isSupportMultipart=!0,t}return D(t,e),t.prototype.commonUpload=function(e){return V(this,void 0,void 0,(function(){var t,n,o,i,a,s,c,u,d,l,f;return k(this,(function(g){switch(g.label){case 0:return t=e.file,n=e.onProgress,o=e.fileType,[4,this._getFileToken(o,t.name)];case 1:return i=g.sent(),a={},(s=new FormData).set("token",i.token),s.set("key",i.fileName),s.set("file",t),c=/http/.test(this._url)?this._url:"https://".concat(this._url),[4,ye.httpReq({url:c,headers:a,onProgress:function(e){return null==n?void 0:n(e.loaded,e.total)},method:"POST",body:s,timeout:0})];case 2:return u=g.sent(),d=u.status,l=u.data,200!==d&&204!==d||!l?[2,{code:r.UPLOAD_FAIL,msg:d.toString()}]:(f=JSON.parse(l),[2,{code:r.SUCCESS,data:{uniqueName:f.rc_url.file_name,downloadUrl:"".concat(c,"/").concat(f.rc_url.path)}}])}}))}))},t.prototype.multipartUpload=function(e){return V(this,void 0,void 0,(function(){var t,n,o,r,i;return k(this,(function(a){switch(a.label){case 0:return t=e.file,n=e.onProgress,o=e.fileType,r=y(),[4,this._getFileToken(o,t.name)];case 1:return i=a.sent().token,[2,this._requestUploadPart(r,t,i,n)]}}))}))},t.prototype._requestUploadPart=function(e,t,n,o,i){return void 0===i&&(i=0),V(this,void 0,void 0,(function(){var a,s,c,u,d,l,f,g,v,h;return k(this,(function(I){switch(I.label){case 0:return a=Math.min(C,t.size-i),s=e+t.name.substring(t.name.lastIndexOf(".")),c={Range:"bytes=".concat(i,"-").concat(i+a),"X-File-TransactionId":s,"X-File-Total-Size":t.size.toString()},u=t.slice(i,i+a),(d=new FormData).set("file",u,t.name),d.set("key",s),d.set("name",s),d.set("token",n),l=/http/.test(this._url)?this._url:"https://".concat(this._url),[4,ye.httpReq({url:l,headers:c,onProgress:function(e){return null==o?void 0:o(i+e.loaded,t.size)},method:"POST",body:d,timeout:0})];case 1:return f=I.sent(),g=f.status,v=f.data,200===g||204===g?i+a<t.size?[2,this._requestUploadPart(e,t,n,o,i+a)]:(h=JSON.parse(v),[2,{code:r.SUCCESS,data:{uniqueName:h.rc_url.file_name,downloadUrl:"".concat(l,"/").concat(h.rc_url.path)}}]):[2,{code:r.UPLOAD_FAIL,msg:g.toString()}]}}))}))},t}(bn);function Hn(e,t){return V(this,void 0,void 0,(function(){var n,o,i,a,s,c,u,d,l,f,g,v,h,I,R,m,E,S,T,p,O,N,_,C;return k(this,(function(A){switch(A.label){case 0:return n=t.getFileToken,o=t.serverType,i=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:Tn.RCX,url:n,p:"1"}];if(e){return JSON.parse(e).map((function(e){var t={type:Tn.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:Tn.QINIU,url:o,p:"1"});r&&i.push({type:Tn.BAIDU,url:r,p:"2"});return i}(a,0,i,s,c),0===f.length?[2,Promise.resolve({code:r.BIZ_ERROR_INVALID_PARAMETER,msg:"uploadUrlList is empty"})]:[4,Yn(f,e,n,o)];case 1:return g=A.sent(),v=g.code,h=g.data,I=g.msg,v===r.SUCCESS&&h?[4,qn(e,t,h)]:[2,{code:v,msg:I}];case 2:return R=A.sent(),m={downloadUrl:R,uniqueName:(null==h?void 0:h.uniqueName)||"",name:u.name,size:u.size,type:u.type},d!==U.AUDIO?[3,5]:[4,u.arrayBuffer()];case 3:return[4,Jn(A.sent())];case 4:return E=A.sent(),S=E.duration,T=E.length,C=G(G({},m),{duration:S,length:T}),[2,{code:v,data:C}];case 5:return d!==U.IMAGE?[3,7]:[4,zn(u,l)];case 6:return p=A.sent(),O=p.thumbnail,N=p.width,_=p.height,C=G(G({},m),{thumbnail:O,width:N,height:_}),[2,{code:v,data:C}];case 7:return[2,{code:v,data:m}]}}))}))}function qn(e,t,n){return V(this,void 0,void 0,(function(){var o,r,i,a,s,c,u;return k(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 Jn(e){return Bn=Bn||new AudioContext,new Promise((function(t,n){Bn.decodeAudioData(e,(function(e){t({duration:e.duration,length:e.length})}),n)}))}var Kn=((wn={})[Tn.QINIU]=Dn,wn[Tn.ALIYUN]=Gn,wn[Tn.BAIDU]=Vn,wn[Tn.S3]=kn,wn[Tn.STC]=xn,wn[Tn.MINIO]=Fn,wn[Tn.RCX]=Zn,wn);function Yn(e,t,n,o,i){return void 0===i&&(i=[]),V(this,void 0,void 0,(function(){var a,s,c,u,d;return k(this,(function(l){switch(l.label){case 0:return 0===e.length?[2,Promise.resolve({code:r.UPLOAD_FAIL,msg:"Failed to upload all channels, msg: ".concat(JSON.stringify(i))})]:(a=e.shift(),[4,new Kn[a.type](a.url,n,o).upload(t)]);case 1:return s=l.sent(),c=s.code,u=s.data,d=s.msg,c!==r.SUCCESS?(i.push({type:a.type,url:a.url,code:c,msg:d}),[2,Yn(e,t,n,o,i)]):[2,{code:c,data:u}]}}))}))}function zn(e,t){return new Promise((function(n,o){var r=document.createElement("canvas"),i=r.getContext("2d"),a=new Image;a.onload=function(o){var s=t||{},c=s.maxHeight,u=void 0===c?160:c,d=s.maxWidth,l=void 0===d?160:d,f=s.quality,g=void 0===f?.7:f,v=s.scale,h=void 0===v?1:v,I=jn(a.width,a.height,{maxHeight:u,maxWidth:l,scale:h});r.width=Math.min(I.w,l),r.height=Math.min(I.h,u),i.drawImage(a,I.x,I.y,I.w,I.h);var R=r.toDataURL("string"==typeof e?"image/jpg":e.type,g);R=R.replace(/data:image\/[^;]+;base64,/,""),n({thumbnail:R,width:I.w,height:I.h})},a.src=(window.URL||window.webkitURL).createObjectURL(e)}))}var jn=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 Wn(e,t,n,o){return Fe((function(i){return new Promise((function(a){i.getFileToken(e,t,n,o).then((function(e){a({code:r.SUCCESS,data:e})})).catch((function(e){a({code:e,msg:ot[e]})}))}))}))}function Xn(e,t,n,o,i){return m("fileType",e,M,!0)&&m("filename",t,f.STRING)&&m("saveName",n,f.STRING)&&m("serverType",i,f.NUMBER)?Fe((function(a){return new Promise((function(s){a.getFileUrl(e,t,n,o,i).then((function(e){s({code:r.SUCCESS,data:e})})).catch((function(e){s({code:e})}))}))})):Promise.resolve({code:r.BIZ_ERROR_INVALID_PARAMETER})}function Qn(e,t,n){return V(this,void 0,void 0,(function(){var o=this;return k(this,(function(s){return[2,Fe((function(s,c){return V(o,void 0,void 0,(function(){var o,u,d,l,g,v,h,R,E,S,T,p;return k(this,(function(O){switch(O.label){case 0:return n=n||{},t instanceof En==!1?(c.warn(I.O,"send message fail -> message parameter is not an instance of BaseMessage"),[2,nt.ILLGAL_PARAMS]):m("conversation",e,f.OBJECT,!0)?(o=e.conversationType,u=e.targetId,d=e.channelId,m("conversation.targetId",u,f.STRING,!0)&&m("conversation.conversationType",o,f.NUMBER,!0)&&m("conversation.channelId",d,f.CHANNEL_ID)&&m("options.isStatusMessage",null==n?void 0:n.isStatusMessage,f.BOOLEAN)&&m("options.disableNotification",null==n?void 0:n.disableNotification,f.BOOLEAN)&&m("options.pushContent",null==n?void 0:n.pushContent,f.STRING)&&m("options.pushData",null==n?void 0:n.pushData,f.STRING)&&m("options.isMentioned",null==n?void 0:n.isMentioned,f.BOOLEAN)&&m("options.mentionedType",null==n?void 0:n.mentionedType,f.NUMBER)&&m("options.mentionedUserIdList",null==n?void 0:n.mentionedUserIdList,f.ARRAY)&&m("options.directionalUserIdList",null==n?void 0:n.directionalUserIdList,f.ARRAY)&&m("options.isVoipPush",null==n?void 0:n.isVoipPush,f.BOOLEAN)&&m("options.canIncludeExpansion",null==n?void 0:n.canIncludeExpansion,f.BOOLEAN)&&m("options.expansion",null==n?void 0:n.expansion,f.OBJECT)&&m("options.pushConfig",null==n?void 0:n.pushConfig,f.OBJECT)&&m("options.messageId",null==n?void 0:n.messageId,f.NUMBER)?(l="conversationType:".concat(o,",targetId:").concat(u),c.debug(I.O,"send message ->".concat(l)),g=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,g=e.expansion,v=e.isFilerWhiteBlacklist,h=e.pushConfig,I=e.messageId,R=n.channelId;return G({isStatusMessage:o,disableNotification:r,pushContent:i,pushData:a,isMentioned:s,mentionedType:c,mentionedUserIdList:u,directionalUserIdList:d,isVoipPush:l,canIncludeExpansion:f,expansion:g,isFilerWhiteBlacklist:v,pushConfig:h,channelId:R||"",messageId:I},t)}(n,t,e),v={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:s.getCurrentUserId(),messageUId:"",messageDirection:L.SEND,receivedTime:0,isStatusMessage:!!n.isStatusMessage,receivedStatus:i.UNREAD,isOffLineMessage:!1,pushConfig:null==n?void 0:n.pushConfig,sentStatus:w.SENDING},o!==a.ULTRA_GROUP&&(v.isOffLineMessage=!1),h=c.createTraceId(),R=function(e){v.messageId=e;try{(null==n?void 0:n.onSendBefore)&&n.onSendBefore(Me(v))}catch(e){c.error(I.O,'Callback method "onSendBefore" execution error.\n'.concat(null==e?void 0:e.stack),h)}},c.info(I.A_SEND_MSG_T,JSON.stringify({messageType:t.messageType,conversationType:o,targetId:u,channelId:d}),h),[4,s.sendMessage(o,u,g,R,h)]):[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]):[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}];case 1:return E=O.sent(),S=E.code,T=E.data,S===r.SUCCESS?(c.info(I.A_SEND_MSG_R,JSON.stringify({code:S,messageUId:T.messageUId,messageId:T.messageId}),h),p=Me(T),[2,{code:S,data:p}]):(c.warn(I.A_SEND_MSG_R,"send message fail ->".concat(S,":").concat(ot[S],",").concat(l)),v.sentTime=(null==T?void 0:T.sentTime)||0,v.sentStatus=null==T?void 0:T.sentStatus,[2,{code:S,msg:ot[S],data:Me(v)}])}}))}))}))]}))}))}function $n(e,t,n){return Qn(e,new _n(t),n)}function eo(e,t){return function(n,o,i,a){if(!m("sendOptions.contentDisposition",null==a?void 0:a.contentDisposition,(function(e){return["inline","attachment"].includes(e)})))return Promise.resolve({code:r.BIZ_ERROR_INVALID_PARAMETER});var s={contentDisposition:null==a?void 0:a.contentDisposition};if(a&&"thumbnailConfig"in a){var c=null==a?void 0:a.thumbnailConfig;if(!(m("sendOptions.maxHeight",null==c?void 0:c.maxHeight,f.NUMBER)&&m("sendOptions.maxWidth",null==c?void 0:c.maxWidth,f.NUMBER)&&m("sendOptions.quality",null==c?void 0:c.quality,f.NUMBER)&&m("sendOptions.scale",null==c?void 0:c.scale,f.NUMBER)))return Promise.resolve({code:r.BIZ_ERROR_INVALID_PARAMETER});s.thumbnailConfig=c}return Fe((function(c,u,d){return new Promise((function(c){var d,l=u.createTraceId();u.info(I.L_MEDIA_UPLOAD_T,JSON.stringify({filesize:o.file.size,type:e}),l),(d={file:o.file,fileType:e,onProgress:function(e,t){var n;null===(n=null==i?void 0:i.onProgress)||void 0===n||n.call(i,Math.floor(e/t*100))},contentDisposition:s.contentDisposition,thumbnailConfig:s.thumbnailConfig},Fe((function(e,t,n){return new Promise((function(t){var o=e.getNaviInfoFromCache();Hn(d,{getFileToken:e.getFileToken.bind(e),getFileUrl:e.getFileUrl.bind(e),customDomain:n.uploadDomain||"",serverType:null==o?void 0:o.type,ossConfig:null==o?void 0:o.ossConfig,uploadServer:null==o?void 0:o.uploadServer,bosAddr:null==o?void 0:o.bosAddr}).then((function(e){t(e)}))}))}))).then((function(e){var s,d=e.code,f=e.data,g=e.msg;if(d===r.SUCCESS&&f){var v=(null===(s=null==i?void 0:i.onComplete)||void 0===s?void 0:s.call(i,G({url:f.downloadUrl},f)))||t(f,o);return u.info(I.L_MEDIA_UPLOAD_R,JSON.stringify({downurl:f.downloadUrl,code:r.SUCCESS}),l),void Qn(n,v,a).then(c)}c({code:d,msg:g})}))}))}))}}var to=eo(U.FILE,(function(e,t){return new An({name:e.name,size:t.file.size,type:(n=e.name,o=n.match(/\.(\w+)$/),o?o[1]:"bin"),fileUrl:e.downloadUrl,user:t.user,extra:t.extra});var n,o})),no=eo(U.IMAGE,(function(e,t){return new pn({content:e.thumbnail,imageUri:e.downloadUrl,user:t.user,extra:t.extra})})),oo=eo(U.IMAGE,(function(e,t){return new Un({gifDataSize:e.size,remoteUrl:e.downloadUrl,width:e.width,height:e.height,user:t.user,extra:t.extra})})),ro=eo(U.AUDIO,(function(e,t){return new On({remoteUrl:e.downloadUrl,duration:e.duration,type:e.type,user:t.user,extra:t.extra})})),io=eo(U.SIGHT,(function(e,t){return new Nn({sightUrl:e.downloadUrl,content:t.thumbnail,duration:t.duration,size:t.file.size||e.size,name:t.name||e.name,user:t.user,extra:t.extra})}));function ao(e,t){return V(this,void 0,void 0,(function(){var n=this;return k(this,(function(o){return m("options.timestamp",null==t?void 0:t.timestamp,f.NUMBER)&&m("options.count",null==t?void 0:t.count,f.NUMBER)&&(P()||m("options.count",null==t?void 0:t.count,(function(e){var t=e>0&&e<=100;return t||null===console||void 0===console||console.error('"options.count" is invalid, It should be greater than 0 and less than 100'),t})))&&m("options.order",null==t?void 0:t.order,(function(e){return 0===e||1===e}))&&m("conversation",e,f.CONVERSATION,!0)?[2,Fe((function(o,i){return V(n,void 0,void 0,(function(){var n,a,s,c,u;return k(this,(function(d){switch(d.label){case 0:return n=i.createTraceId(),i.info(I.A_GET_HISTORY_MSG_T,JSON.stringify({targetId:e.targetId,conversationType:e.conversationType,channelId:e.channelId,timestamp:null==t?void 0:t.timestamp,count:null==t?void 0:t.count}),n),[4,o.getHistoryMessage(e.conversationType,e.targetId,null==t?void 0:t.timestamp,null==t?void 0:t.count,null==t?void 0:t.order,null==e?void 0:e.channelId,"",n)];case 1:return a=d.sent(),s=a.code,c=a.data,s===r.SUCCESS&&c?(u=c.list.map((function(e){return Me(e)})),i.info(I.A_GET_HISTORY_MSG_R,JSON.stringify({code:s,messageLength:u.length}),n),[2,{code:s,data:{list:u,hasMore:c.hasMore}}]):(i.warn(I.A_GET_HISTORY_MSG_R,JSON.stringify({code:s,messageUIds:""}),n),[2,{code:s,msg:ot[s]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function so(e,t){return V(this,void 0,void 0,(function(){var n=this;return k(this,(function(o){return m("options.timestamp",null==t?void 0:t.timestamp,f.NUMBER)&&m("options.count",null==t?void 0:t.count,f.NUMBER)&&m("options.count",null==t?void 0:t.count,(function(e){var t=e>0&&e<=100;return t||null===console||void 0===console||console.error("options.count is invalid, It should be greater than 0 and less than 100"),t}))&&m("options.order",null==t?void 0:t.order,(function(e){return 0===e||1===e}))&&m("conversation",e,f.CONVERSATION,!0)?[2,Fe((function(o,i){return V(n,void 0,void 0,(function(){var n,a,s,c,u;return k(this,(function(d){switch(d.label){case 0:return n="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),i.debug(I.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===r.SUCCESS&&c?(u=c.list.map((function(e){return Me(e)})),[2,{code:s,data:{list:u,hasMore:c.hasMore}}]):(i.warn(I.O,"get history message fail ->".concat(s,":").concat(ot[s],",").concat(n)),[2,{code:s,msg:ot[s]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function co(e,t,n,o){return V(this,void 0,void 0,(function(){var i=this;return k(this,(function(s){return m("targetId",e,f.STRING,!0)&&m("messageUId",t,f.STRING,!0)&&m("timestamp",n,f.NUMBER,!0)&&m("channelId",o,f.CHANNEL_ID)?[2,Fe((function(r){return V(i,void 0,void 0,(function(){var r,i,s,c,u;return k(this,(function(d){switch(d.label){case 0:return r={targetId:e,conversationType:a.PRIVATE,channelId:o},i=new En("RC:ReadNtf",{messageUId:t,lastMessageSendTime:n,type:1}),[4,Qn(r,i)];case 1:return s=d.sent(),c=s.code,u=s.msg,0===c?[2,{code:c}]:[2,{code:c,msg:u}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function uo(e,t,n){return V(this,void 0,void 0,(function(){var o=this;return k(this,(function(i){return m("messageUId",t,f.STRING,!0)&&m("targetId",e,f.STRING,!0)&&m("channelId",n,f.CHANNEL_ID)?[2,Fe((function(r,i){return V(o,void 0,void 0,(function(){var o,r,s,c,u;return k(this,(function(d){switch(d.label){case 0:return o="messageUId:".concat(t,",targetId:").concat(e),i.debug(I.O,"send read receipt message ->".concat(o)),r=new En("RC:RRReqMsg",{messageUId:t}),[4,Qn({targetId:e,conversationType:a.GROUP,channelId:n},r)];case 1:return s=d.sent(),c=s.code,u=s.msg,0===c?[2,{code:c}]:[2,{code:c,msg:u}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function lo(e,t,n){return V(this,void 0,void 0,(function(){return k(this,(function(e){throw new Error("This method is deprecated, please use method sendReadReceiptResponseV2.")}))}))}function fo(e,t,n){return V(this,void 0,void 0,(function(){var o=this;return k(this,(function(i){return m("targetId",e,f.STRING,!0)&&m("messageList",t,f.OBJECT,!0)&&m("channelId",n,f.CHANNEL_ID)&&!Object.keys(t).some((function(e){return!m(e,t[e],f.ARRAY)}))?[2,Fe((function(i,s){return V(o,void 0,void 0,(function(){var o,c,u,d,l,f;return k(this,(function(g){switch(g.label){case 0:return o={targetId:e,conversationType:a.GROUP,channelId:n},u=i.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,i.sendReadReceiptMessage(e,d,n)]:(s.warn(I.O,"Error in parameter messageList."),[2,{code:r.PARAMETER_ERROR}]));case 1:return c=g.sent(),[3,4];case 2:return l=new En("RC:RRRspMsg",{receiptMessageDic:t}),[4,Qn(o,l)];case 3:c=g.sent(),g.label=4;case 4:return(f=c.code)===r.SUCCESS?[2,{code:f}]:(s.warn(I.O,"send read receipt message fail ->".concat(f,":").concat(ot[f])),[2,{code:f,msg:ot[f]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function go(e,t){return V(this,void 0,void 0,(function(){var n,o,i,a;return k(this,(function(s){switch(s.label){case 0:return m("conversation",e,f.CONVERSATION,!0)&&m("lastMessageSendTime",t,f.NUMBER,!0)?(n=new En("RC:SRSMsg",{lastMessageSendTime:t}),[4,Qn(e,n)]):[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}];case 1:return o=s.sent(),i=o.code,a=o.msg,0===i?[2,{code:i}]:[2,{code:i,msg:a}]}}))}))}function vo(e,t){return V(this,void 0,void 0,(function(){var n=this;return k(this,(function(o){return m("conversation",e,f.CONVERSATION,!0)&&m("options.messageUId",t.messageUId,f.STRING,!0)&&m("options.sentTime",t.sentTime,f.NUMBER,!0)&&m("options.disableNotification",null==t?void 0:t.disableNotification,f.BOOLEAN)&&m("options.pushConfig",null==t?void 0:t.pushConfig,f.OBJECT)?[2,Fe((function(o,i){return V(n,void 0,void 0,(function(){var n,a,s,c,u;return k(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),i.debug(I.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===r.SUCCESS&&u?[2,{code:c,data:Me(u)}]:c===r.SUCCESS?[2,{code:c}]:(i.warn(I.O,"recall message fail ->".concat(c,":").concat(ot[c],",").concat(a)),[2,{code:c,msg:ot[c]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function ho(e,t){return V(this,void 0,void 0,(function(){var n=this;return k(this,(function(o){return m("conversation",e,f.CONVERSATION,!0)&&m("options",t,(function(e){return g(e)&&e.length}),!0)&&!t.some((function(e){return!m("options.messageUId",e.messageUId,f.STRING,!0)||!m("options.sentTime",e.sentTime,f.NUMBER,!0)||!m("options.messageDirection",e.messageDirection,(function(e){return 1===e||2===e}),!0)}))?[2,Fe((function(o,i){return V(n,void 0,void 0,(function(){var n,a;return k(this,(function(s){switch(s.label){case 0:return n="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),i.debug(I.O,"delete messages ->".concat(n)),[4,o.deleteRemoteMessage(e.conversationType,e.targetId,t,e.channelId)];case 1:return(a=s.sent())!==r.SUCCESS?(i.warn(I.O,"delete message fail ->".concat(a,":").concat(ot[a],",").concat(n)),[2,{code:a,msg:ot[a]}]):[2,{code:r.SUCCESS}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Io(e,t){return V(this,void 0,void 0,(function(){var n=this;return k(this,(function(o){return m("conversation",e,f.CONVERSATION,!0)&&m("timestamp",t,f.NUMBER,!0)?[2,Fe((function(o,i){return V(n,void 0,void 0,(function(){var n,a;return k(this,(function(s){switch(s.label){case 0:return n="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),i.debug(I.O,"clear message ->".concat(n)),[4,o.deleteRemoteMessageByTimestamp(e.conversationType,e.targetId,t,e.channelId)];case 1:return(a=s.sent())!==r.SUCCESS?(i.warn(I.O,"clear message ->".concat(a,":").concat(ot[a],",").concat(n)),[2,{code:a,msg:ot[a]}]):[2,{code:r.SUCCESS}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Ro(e,t){return V(this,void 0,void 0,(function(){var n=this;return k(this,(function(o){return m("expansion",e,f.OBJECT,!0)&&m("message",t,f.OBJECT,!0)&&m("message.conversationType",t.conversationType,f.NUMBER,!0)&&m("message.targetId",t.targetId,f.STRING,!0)&&m("message.channelId",t.channelId,f.CHANNEL_ID)&&m("message.messageUId",t.messageUId,f.STRING,!0)&&m("message.expansion",t.expansion,f.OBJECT)&&m("message.canIncludeExpansion",t.canIncludeExpansion,f.BOOLEAN,!0)?[2,Fe((function(o,i){return V(n,void 0,void 0,(function(){var n,a,s,c,u,d,l,f;return k(this,(function(g){switch(g.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),i.debug(I.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=g.sent().code)!==r.SUCCESS?(i.warn(I.O,"update message expansion fail ->".concat(f,":").concat(ot[f],",").concat(l)),[2,{code:f,msg:ot[f]}]):[2,{code:f}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function mo(e,t){return V(this,void 0,void 0,(function(){var n=this;return k(this,(function(o){return m("keys",e,f.ARRAY,!0)&&m("message",t,f.OBJECT,!0)&&m("message.conversationType",t.conversationType,f.NUMBER,!0)&&m("message.targetId",t.targetId,f.STRING,!0)&&m("message.channelId",t.channelId,f.CHANNEL_ID)&&m("message.messageUId",t.messageUId,f.STRING,!0)&&m("message.canIncludeExpansion",t.canIncludeExpansion,f.BOOLEAN,!0)?[2,Fe((function(o,i){return V(n,void 0,void 0,(function(){var n,a,s,c,u,d,l;return k(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),i.debug(I.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)!==r.SUCCESS?(i.warn(I.O,"remove message expansion fail ->".concat(l,":").concat(ot[l],",").concat(d)),[2,{code:l,msg:ot[l]}]):[2,{code:l}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Eo(e,t){return V(this,void 0,void 0,(function(){var n=this;return k(this,(function(o){return m("conversation",e,f.CONVERSATION,!0)&&m("typingContentType",t,f.STRING,!0)?[2,Fe((function(o,i){return V(n,void 0,void 0,(function(){var n,a,s,c,u,d;return k(this,(function(l){switch(l.label){case 0:return n={messageType:"RC:TypSts",content:{typingContentType:t},isStatusMessage:!0,channelId:e.channelId},a=i.createTraceId(),i.info(I.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===r.SUCCESS?"info":"warn",i[d](I.A_SEND_MSG_R,JSON.stringify({code:c,messageUId:u?u.messageUId:"",messageId:u?u.messageId:""}),a),c===r.SUCCESS?[2,{code:c,data:Me(u)}]:[2,{code:c,msg:ot[c]}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function So(e,t,n){return V(this,void 0,void 0,(function(){var o=this;return k(this,(function(i){return m("messageUId",t,f.STRING,!0)&&m("targetId",e,f.STRING,!0)&&m("channelId",n,f.CHANNEL_ID)?[2,Fe((function(i,a){return V(o,void 0,void 0,(function(){var o,s,c,u;return k(this,(function(d){switch(d.label){case 0:return o="messageUId:".concat(t,",targetId:").concat(e),a.debug(I.O,"get message reader ->".concat(o)),[4,i.getMessageReader(e,t,n)];case 1:return s=d.sent(),c=s.code,u=s.data,c===r.SUCCESS?[2,{code:c,data:u}]:(a.warn(I.O,"get message reader fail ->".concat(c,":").concat(ot[c],",").concat(o)),[2,{code:c,msg:ot[c]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function To(e,t,n,o,r){return xe((function(i,a){return l("messageType",e,f.STRING,!0),l("isPersited",t,f.BOOLEAN,!0),l("isCounted",n,f.BOOLEAN,!0),l("isStatusMessage",r,f.BOOLEAN,!1),l("searchProps",o,f.ARRAY),a.info(I.A_REGTYP_O,JSON.stringify({messageType:e,isCounted:n,isStatusMessage:r,isPersited:t})),i.registerMessageType(e,t,n,o,r),Sn(e,t,n)}))}function po(e){return V(this,void 0,void 0,(function(){var t=this;return k(this,(function(n){return P()?m("conversation",e,f.CONVERSATION,!0)?[2,Fe((function(n,o){return V(t,void 0,void 0,(function(){var t,i,a,s;return k(this,(function(c){switch(c.label){case 0:return[4,n.getFirstUnreadMessage(e.conversationType,e.targetId,e.channelId)];case 1:return t=c.sent(),i=t.code,a=t.data,i===r.SUCCESS?(s=a&&Me(a)||null,[2,{code:i,data:s}]):(o.warn(I.O,"insertMessage ->code:".concat(i,",targetId:").concat(e.targetId)),[2,{code:i,msg:ot[i]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:ot[r.NOT_SUPPORT]}]}))}))}function Oo(e,t,n){return void 0===n&&(n={}),V(this,void 0,void 0,(function(){var o=this;return k(this,(function(i){return Le("RongIMLib.insertMessage","RongIMLib.ElectronExtension.insertMessage"),P()?m("conversation",e,f.CONVERSATION,!0)&&m("message",t,f.OBJECT,!0)&&m("options",n,f.OBJECT)&&m("options.isUnread",null==n?void 0:n.isUnread,f.BOOLEAN)&&m("options.searchContent",null==n?void 0:n.searchContent,f.STRING)&&m("content.senderUserId",t.senderUserId,f.STRING,!0)&&m("content.messageType",t.messageType,f.STRING,!0)&&m("content.content",t.content,f.OBJECT,!0)&&m("content.messageDirection",t.messageDirection,f.NUMBER,!0)&&m("content.canIncludeExpansion",t.canIncludeExpansion,f.BOOLEAN)&&m("content.expansion",t.expansion,f.OBJECT)&&m("content.disableNotification",t.disableNotification,f.BOOLEAN)&&m("content.sentTime",t.sentTime,f.NUMBER)&&m("content.sentStatus",t.sentStatus,f.NUMBER)?[2,Fe((function(i,a){return V(o,void 0,void 0,(function(){var o,s,c,u,d,l,f,g,v,h,R,m,E,S,T,p;return k(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,g=t.disableNotification,v=t.sentTime,h=t.sentStatus,a.info(I.O,"insertMessage ->targetId:".concat(e.targetId,",conversationType:").concat(e.conversationType)),R=n.isUnread,m=n.searchContent,E={senderUserId:o,messageType:s,content:c,messageDirection:u,sentTime:v,sentStatus:h,searchContent:m,isUnread:R,messageUId:d,disableNotification:g,canIncludeExpansion:l,expansionMsg:JSON.stringify(f),channelId:e.channelId||""},[4,i.insertMessage(e.conversationType,e.targetId,E)];case 1:return S=O.sent(),T=S.code,p=S.data,T===r.SUCCESS?[2,{code:T,data:Me(p)}]:(a.warn(I.O,"insertMessage ->code:".concat(T,",targetId:").concat(e.targetId)),[2,{code:T,msg:ot[T]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:ot[r.NOT_SUPPORT]}]}))}))}function No(e){return V(this,void 0,void 0,(function(){var t=this;return k(this,(function(n){return P()?m("messageId",e,(function(e){return s(e)||N(e)}),!0)?[2,Fe((function(n,o){return V(t,void 0,void 0,(function(){var t,i,a;return k(this,(function(s){switch(s.label){case 0:return[4,n.getMessage(e)];case 1:return t=s.sent(),i=t.code,a=t.data,i===r.SUCCESS?[2,{code:i,data:Me(a)}]:(o.warn(I.O,"getMessage ->code:".concat(i,",messageId:").concat(e)),[2,{code:i,msg:ot[i]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:ot[r.NOT_SUPPORT]}]}))}))}function _o(e){if(!P())return{code:r.NOT_SUPPORT,msg:ot[r.NOT_SUPPORT]};var t,n=e.conversationType,o=e.targetId,i=e.channelId;return m("conversation",e,f.CONVERSATION,!0)?(t=function(e){var t=e.getUnreadMentionedMessages(n,o,i),a=[];return t&&t.length&&t.forEach((function(e){return a.push(Me(e))})),{code:r.SUCCESS,data:a}},De?t(De,Ve,Ge):{code:r.BIZ_ERROR_CLIENT_NOT_INIT}):{code:r.BIZ_ERROR_INVALID_PARAMETER}}function Co(e,t,n,o){return V(this,void 0,void 0,(function(){var i=this;return k(this,(function(a){return Le("RongIMLib.searchMessages","RongIMLib.ElectronExtension.searchMessages"),P()?m("conversation",e,f.CONVERSATION,!0)&&m("keyword",t,f.STRING,!0)&&m("timestamp",n,f.NUMBER)&&m("count",o,f.NUMBER)?[2,Fe((function(a,s){return V(i,void 0,void 0,(function(){var i,c,u,d;return k(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 i=l.sent(),c=i.code,u=i.data,c===r.SUCCESS?(d=[],(null==u?void 0:u.messages)&&u.messages.length&&u.messages.forEach((function(e){return d.push(Me(e))})),[2,{code:c,data:{messages:d,count:null==u?void 0:u.count}}]):(s.warn(I.O,"searchMessages ->code:".concat(c,",targetId:").concat(e.targetId)),[2,{code:c,msg:ot[c]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:ot[r.NOT_SUPPORT]}]}))}))}function Ao(e,t,n){return V(this,void 0,void 0,(function(){var o,i,a,s=this;return k(this,(function(c){return Le("RongIMLib.deleteLocalMessagesByTimestamp","RongIMLib.ElectronExtension.deleteMessagesByTimestamp"),P()?(o=e.conversationType,i=e.targetId,a=e.channelId,m("conversationType",o,f.NUMBER,!0)&&m("targetId",i,f.STRING,!0)&&m("timestamp",t,f.NUMBER,!0)&&m("cleanSpace",n,f.BOOLEAN)?[2,Fe((function(c,u){return V(s,void 0,void 0,(function(){var s;return k(this,(function(d){switch(d.label){case 0:return[4,c.deleteMessagesByTimestamp(o,i,t,n,a)];case 1:return s=d.sent(),u.debug(I.A_DELETE_MESSAGES_S,JSON.stringify({code:s,conversationType:o,targetId:i,channelId:a,timestamp:t})),s===r.SUCCESS?[2,{code:s}]:(u.warn(I.O,"deleteLocalMessagesByTimestamp ->code:".concat(s,",targetId:").concat(e.targetId)),[2,{code:s,msg:ot[s]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]):[2,{code:r.NOT_SUPPORT,msg:ot[r.NOT_SUPPORT]}]}))}))}function Uo(e){return V(this,void 0,void 0,(function(){var t=this;return k(this,(function(n){return Le("RongIMLib.clearMessages","RongIMLib.ElectronExtension.clearMessages"),P()?[2,Fe((function(n,o){return V(t,void 0,void 0,(function(){var t,i,a,s;return k(this,(function(c){switch(c.label){case 0:return t=e.conversationType,i=e.targetId,a=e.channelId,o.info(I.O,"clearMessages ->targetId:".concat(i,",conversationType:").concat(t)),[4,n.clearMessages(t,i,a)];case 1:return(s=c.sent())===r.SUCCESS?[2,{code:s}]:(o.warn(I.O,"clearMessages ->code:".concat(s,",targetId:").concat(i)),[2,{code:s,msg:ot[s]}])}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:ot[r.NOT_SUPPORT]}]}))}))}function yo(e,t,n,o){return V(this,void 0,void 0,(function(){var i=this;return k(this,(function(a){return Le("RongIMLib.searchConversationByContent","RongIMLib.ElectronExtension.searchConversationByContent"),P()?[2,Fe((function(a,s){return V(i,void 0,void 0,(function(){var i,c,u;return k(this,(function(d){switch(d.label){case 0:return s.info(I.O,"searchConversationByContent ->keyword:".concat(e)),[4,a.searchConversationByContent(e,n,o,t)];case 1:return i=d.sent(),c=i.code,u=i.data,c===r.SUCCESS?[2,{code:c,data:u}]:(s.warn(I.O,"searchConversationByContent ->code:".concat(c,",keyword:").concat(e)),[2,{code:c,msg:ot[c]}])}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:ot[r.NOT_SUPPORT]}]}))}))}function Mo(e,t){return V(this,void 0,void 0,(function(){var n=this;return k(this,(function(o){return P()?m("conversation",e,f.CONVERSATION,!0)&&m("timestamp",t,f.NUMBER)?[2,Fe((function(o,i){return V(n,void 0,void 0,(function(){var n,a,s,c;return k(this,(function(u){switch(u.label){case 0:return n=e.conversationType,a=e.targetId,s=e.channelId,i.info(I.O,"clearUnreadCountByTimestamp ->targetId:".concat(a,",conversationType:").concat(n)),[4,o.clearUnreadCountByTimestamp(n,a,t,s)];case 1:return(c=u.sent())===r.SUCCESS?[2,{code:c}]:(i.warn(I.O,"clearUnreadCountByTimestamp ->code:".concat(c,",targetId:").concat(a)),[2,{code:c,msg:ot[c]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:ot[r.NOT_SUPPORT]}]}))}))}function Po(e,t){return V(this,void 0,void 0,(function(){var n=this;return k(this,(function(o){return Le("RongIMLib.setMessageReceivedStatus","RongIMLib.ElectronExtension.setMessageReceivedStatus"),P()?m("messageId",e,f.NUMBER,!0)&&m("receivedStatus",t,f.NUMBER,!0)?[2,Fe((function(o,i){return V(n,void 0,void 0,(function(){var n;return k(this,(function(a){switch(a.label){case 0:return i.info(I.O,"setMessageReceivedStatus ->messageId:".concat(e,",receivedStatus:").concat(t)),[4,o.setMessageReceivedStatus(e,t)];case 1:return(n=a.sent())===r.SUCCESS?[2,{code:n}]:(i.warn(I.O,"setMessageReceivedStatus ->code:".concat(n,",messageId:").concat(e)),[2,{code:n,msg:ot[n]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:ot[r.NOT_SUPPORT]}]}))}))}function Lo(e){return V(this,void 0,void 0,(function(){var t=this;return k(this,(function(n){return m("tag.tagId",e.tagId,f.STRING,!0)&&m("tag.tagId",e.tagId,(function(e){return e.length<=10}))&&m("tag.tagName",e.tagName,(function(e){return e.length<=15}))&&m("tag.tagName",e.tagName,f.STRING,!0)?[2,Fe((function(n,o){return V(t,void 0,void 0,(function(){var t;return k(this,(function(i){switch(i.label){case 0:return o.info(I.O,"createTag ->tagId:".concat(e.tagId,",tagName:").concat(e.tagName)),[4,n.createTag(e)];case 1:return(t=i.sent().code)===r.SUCCESS?[2,{code:t}]:(o.warn(I.O,"createTag ->code:".concat(t,",tagId:").concat(e.tagId)),[2,{code:t,msg:ot[t]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function wo(e){return V(this,void 0,void 0,(function(){var t=this;return k(this,(function(n){return m("tagId",e,f.STRING,!0)?[2,Fe((function(n,o){return V(t,void 0,void 0,(function(){var t;return k(this,(function(i){switch(i.label){case 0:return o.info(I.O,"removeTag ->tagId:".concat(e)),[4,n.removeTag(e)];case 1:return(t=i.sent().code)===r.SUCCESS?[2,{code:t}]:(o.warn(I.O,"removeTag ->code:".concat(t,",tagId:").concat(e)),[2,{code:t,msg:ot[t]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Bo(e){return V(this,void 0,void 0,(function(){var t=this;return k(this,(function(n){return m("tag.tagId",e.tagId,f.STRING,!0)&&m("tag.tagName",e.tagName,f.STRING,!0)&&m("tag.tagName",e.tagName,(function(e){return e.length<=15}))?[2,Fe((function(n,o){return V(t,void 0,void 0,(function(){var t;return k(this,(function(i){switch(i.label){case 0:return o.info(I.O,"updateTag ->tagId:".concat(e.tagId,",tagName:").concat(e.tagName)),[4,n.updateTag(e)];case 1:return(t=i.sent().code)===r.SUCCESS?[2,{code:t}]:(o.warn(I.O,"updateTag ->code:".concat(t,",tagId:").concat(e.tagId)),[2,{code:t,msg:ot[t]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function bo(){return V(this,void 0,void 0,(function(){var e=this;return k(this,(function(t){return[2,Fe((function(t,n){return V(e,void 0,void 0,(function(){var e,o,i;return k(this,(function(a){switch(a.label){case 0:return[4,t.getTagList()];case 1:return e=a.sent(),o=e.code,i=e.data,n.warn(I.O,"getTagList ->code:".concat(o)),[2,{code:r.SUCCESS,data:i}]}}))}))}))]}))}))}function Do(e){return V(this,void 0,void 0,(function(){var t=this;return k(this,(function(n){return m("conversation",e,f.CONVERSATION,!0)?[2,Fe((function(n,o){return V(t,void 0,void 0,(function(){var t,i,a;return k(this,(function(s){switch(s.label){case 0:return o.info(I.O,"getTagsForConversation ->targetId:".concat(e.targetId,",conversationType:").concat(e.conversationType)),[4,n.getTagsForConversation(e)];case 1:return t=s.sent(),i=t.code,a=t.data,i===r.SUCCESS?[2,{code:i,data:a}]:[2,{code:i,msg:ot[i]}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Go(e,t){return V(this,void 0,void 0,(function(){var n=this;return k(this,(function(o){return m("tagId",e,f.STRING,!0)&&m("conversations",t,f.ARRAY,!0)&&!t.some((function(e){return!m("conversation",e,f.CONVERSATION,!0)}))?[2,Fe((function(o,i){return V(n,void 0,void 0,(function(){var n;return k(this,(function(a){switch(a.label){case 0:return i.info(I.O,"addTagForConversations ->tagId:".concat(e)),[4,o.addTagForConversations(e,t)];case 1:return(n=a.sent().code)===r.SUCCESS?[2,{code:n}]:(i.warn(I.O,"addTagForConversations ->code:".concat(n,",tagId:").concat(e)),[2,{code:n,msg:ot[n]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Vo(e,t){return V(this,void 0,void 0,(function(){var n=this;return k(this,(function(o){return m("tagId",e,f.STRING,!0)&&m("conversations",t,f.ARRAY,!0)&&!t.some((function(e){return!m("conversation",e,f.CONVERSATION,!0)}))?[2,Fe((function(o,i){return V(n,void 0,void 0,(function(){var n;return k(this,(function(a){switch(a.label){case 0:return i.info(I.O,"removeTagForConversations ->tagId:".concat(e)),[4,o.removeTagForConversations(e,t)];case 1:return(n=a.sent().code)===r.SUCCESS?[2,{code:n}]:(i.warn(I.O,"removeTagForConversations ->code:".concat(n,",tagId:").concat(e)),[2,{code:n,msg:ot[n]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function ko(e,t){return V(this,void 0,void 0,(function(){var n=this;return k(this,(function(o){return m("conversation",e,f.CONVERSATION,!0)&&m("tagIds",t,f.ARRAY,!0)&&!t.some((function(e){return!m("tagId",e,f.STRING,!0)}))?[2,Fe((function(o,i){return V(n,void 0,void 0,(function(){var n;return k(this,(function(a){switch(a.label){case 0:return i.info(I.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)===r.SUCCESS?[2,{code:n}]:(i.warn(I.O,"removeTagsForConversation ->code:".concat(n,",tagIds:").concat(t)),[2,{code:n,msg:ot[n]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function xo(e,t){return V(this,void 0,void 0,(function(){var n=this;return k(this,(function(o){return m("tagId",e,f.STRING,!0)&&m("conversations",t,f.ARRAY,!0)&&!t.some((function(e){return!m("conversation",e,f.CONVERSATION,!0)}))?[2,Fe((function(o,i){return V(n,void 0,void 0,(function(){var n;return k(this,(function(a){switch(a.label){case 0:return i.info(I.O,"removeTagForConversations ->tagId:".concat(e)),[4,o.removeTagForConversations(e,t)];case 1:return(n=a.sent().code)===r.SUCCESS?[2,{code:n}]:(i.warn(I.O,"removeTagForConversations ->code:".concat(n,",tagId:").concat(e)),[2,{code:n,msg:ot[n]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Fo(e,t,n){return V(this,void 0,void 0,(function(){var o=this;return k(this,(function(i){return m("tagId",e,f.STRING,!0)&&m("count",t,f.NUMBER,!0)&&m("startTime",n,f.NUMBER,!0)?[2,Fe((function(i,a){return V(o,void 0,void 0,(function(){var o,s,c;return k(this,(function(u){switch(u.label){case 0:return a.info(I.O,"getConversationListByTag ->tagId:".concat(e)),[4,i.getConversationListByTag(e,n,t)];case 1:return o=u.sent(),s=o.code,c=o.data,s===r.SUCCESS?[2,{code:s,data:null==c?void 0:c.map((function(e){return function(e){return G(G({},Pe(e)),{isTopInTag:e.isTopInTag})}(e)}))}]:(a.warn(I.O,"getConversationListByTag ->code:".concat(s,",tagId:").concat(e)),[2,{code:s,msg:ot[s]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Zo(e,t){return V(this,void 0,void 0,(function(){var n=this;return k(this,(function(o){return m("tagId",e,f.STRING,!0)&&m("containMuted",t,f.BOOLEAN,!0)?[2,Fe((function(o,r){return V(n,void 0,void 0,(function(){var n,i,a;return k(this,(function(s){switch(s.label){case 0:return r.info(I.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:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Ho(e,t,n){return V(this,void 0,void 0,(function(){var o=this;return k(this,(function(i){return m("tagId",e,f.STRING,!0)&&m("conversation",t,f.CONVERSATION,!0)&&m("status.isTop",n,f.BOOLEAN,!0)?[2,Fe((function(i,a){return V(o,void 0,void 0,(function(){var o;return k(this,(function(s){switch(s.label){case 0:return a.info(I.O,"setConversationStatusInTag ->tagId:".concat(e,",targetId:").concat(t.targetId,",conversationType").concat(t.conversationType)),[4,i.setConversationStatusInTag(e,t,{isTop:n})];case 1:return(o=s.sent().code)===r.SUCCESS?[2,{code:o}]:(a.warn(I.O,"setConversationStatusInTag ->code:".concat(o,",tagId:").concat(e)),[2,{code:o,msg:ot[o]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}eo(U.COMBINE_HTML,(function(e,t){return new Cn({remoteUrl:e.downloadUrl,nameList:t.nameList,summaryList:t.summaryList,conversationType:t.conversationType,user:t.user,extra:t.extra})}));var qo={COMET:"comet",WEBSOCKET:"websocket"},Jo={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 Ko=Object.freeze({__proto__:null,getAllConversationList:function(e){return V(this,void 0,void 0,(function(){var t=this;return k(this,(function(n){return P()?m("channelId",e,f.CHANNEL_ID)?[2,Fe((function(n,o){return V(t,void 0,void 0,(function(){var t,i,a,s;return k(this,(function(c){switch(c.label){case 0:return o.info(I.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 i=t.code,a=t.data,i===r.SUCCESS&&a?(s=a.map((function(e){return Pe(e)})),[2,{code:i,data:s}]):(o.warn(I.O,"getAllConversationList fail -> code: ".concat(i," channelId: ").concat(e)),[2,{code:i,msg:ot[i]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:ot[r.NOT_SUPPORT]}]}))}))},getConversationList:function(e,t,n){return V(this,void 0,void 0,(function(){var o=this;return k(this,(function(i){return P()?m("startTime",e,f.NUMBER,!0)&&m("count",t,f.NUMBER,!0)&&m("channelId",n,f.CHANNEL_ID)?[2,Fe((function(i,a){return V(o,void 0,void 0,(function(){var o,s,c,u,d,l;return k(this,(function(f){switch(f.label){case 0:return o="startTime: ".concat(e,", count: ").concat(t,", channelId: ").concat(n),a.info(I.O,"getConversationList -> ".concat(o)),B(n)?[4,i.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,i.getConversationsByPage(c,e,t,n)];case 3:s=f.sent(),f.label=4;case 4:return u=s.code,d=s.data,u===r.SUCCESS&&d?(l=d.map((function(e){return Pe(e)})),[2,{code:u,data:l}]):(a.warn(I.O,"getConversationList fail -> code: ".concat(u," ").concat(o)),[2,{code:u,msg:ot[u]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:ot[r.NOT_SUPPORT]}]}))}))},searchConversationByContent:function e(t,n,o){return V(this,void 0,void 0,(function(){var i=this;return k(this,(function(a){return P()?m("keyword",t,f.STRING,!0)&&m("messageTypes",n,f.ARRAY,!0)&&m("channelId",o,f.CHANNEL_ID)&&!n.some((function(e){return!m("messageType",e,f.STRING,!0)}))?[2,Fe((function(a,s){return V(i,void 0,void 0,(function(){var i,c,u,d,l;return k(this,(function(f){switch(f.label){case 0:return i="keyword: ".concat(t,", messageTypes: ").concat(JSON.stringify(n),", channelId: ").concat(o),s.info(I.O,"searchConversationByContent -> ".concat(e)),B(o)?[4,a.searchConversationByContentWithAllChannel(t,n)]:[3,2];case 1:return c=f.sent(),[3,4];case 2:return[4,a.searchConversationByContent(t,n,o)];case 3:c=f.sent(),f.label=4;case 4:return u=c.code,d=c.data,u===r.SUCCESS&&d?(l=d.map((function(e){return Pe(e)})),[2,{code:u,data:l}]):(s.warn(I.O,"searchConversationByContent fail -> code: ".concat(u," ").concat(i)),[2,{code:u,msg:ot[u]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:ot[r.NOT_SUPPORT]}]}))}))},searchMessages:function(e,t,n,o){return V(this,void 0,void 0,(function(){var i=this;return k(this,(function(a){return P()?m("conversation",e,f.CONVERSATION,!0)&&m("keyword",t,f.STRING,!0)&&m("startTime",n,f.NUMBER,!0)&&m("count",o,f.NUMBER,!0)?[2,Fe((function(a,s){return V(i,void 0,void 0,(function(){var i,c,u,d,l,f,g,v,h,R;return k(this,(function(m){switch(m.label){case 0:return i="conversation: ".concat(JSON.stringify(e),", keyword: ").concat(t,", timestamp: ").concat(n,", count: ").concat(o),s.info(I.O,"searchMessages -> ".concat(i)),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,g=l.data,f===r.SUCCESS&&g?(v=g.messages,h=g.count,R=v.map((function(e){return Me(e)})),[2,{code:f,data:{messages:R,count:h}}]):(s.warn(I.O,"searchMessages fail -> code: ".concat(f," ").concat(i)),[2,{code:f,msg:ot[f]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:ot[r.NOT_SUPPORT]}]}))}))},searchMessageInTimeRange:function(e,t){return V(this,void 0,void 0,(function(){var n=this;return k(this,(function(o){return P()?m("conversation",e,f.CONVERSATION,!0)&&m("option",t,f.OBJECT,!0)&&m("option.keyword",t.keyword,f.STRING,!0)&&m("option.startTime",t.startTime,f.NUMBER,!0)&&m("option.endTime",t.endTime,f.NUMBER,!0)&&m("option.offset",t.offset,f.NUMBER)&&m("option.limit",t.limit,f.NUMBER)?[2,Fe((function(o,i){return V(n,void 0,void 0,(function(){var n,a,s,c,u,d,l,f,g,v,h;return k(this,(function(R){switch(R.label){case 0:return n="conversation: ".concat(JSON.stringify(e),", option: ").concat(JSON.stringify(t)),i.info(I.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 g=R.sent(),v=g.code,h=g.data,v===r.SUCCESS&&h?[2,{code:v,data:{messages:h.messages.map((function(e){return Me(e)}))}}]:(i.warn(I.O,"searchMessageInTimeRange fail -> code: ".concat(v,", ").concat(n)),[2,{code:v}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:ot[r.NOT_SUPPORT]}]}))}))},searchMessagesByUser:function(e,t,n,o){return V(this,void 0,void 0,(function(){var i=this;return k(this,(function(a){return P()?m("conversation",e,f.CONVERSATION,!0)&&m("userId",t,f.STRING,!0)&&m("startTime",n,f.NUMBER,!0)&&m("count",o,f.NUMBER,!0)?[2,Fe((function(a,s){return V(i,void 0,void 0,(function(){var i,c,u,d,l,f,g;return k(this,(function(v){switch(v.label){case 0:return i="conversation: ".concat(JSON.stringify(e),", keyword: ").concat(t,", timestamp: ").concat(n,", count: ").concat(o),s.info(I.A_SEARCH_MESSAGE_BY_USER_T,"searchMessagesByUser -> ".concat(i)),c=e.conversationType,u=e.targetId,d=e.channelId,[4,a.searchMessagesByUser(c,u,t,n,o,d)];case 1:return l=v.sent(),f=l.code,g=l.data,f===r.SUCCESS&&g?[2,{code:f,data:{messages:g.messages.map((function(e){return Me(e)}))}}]:(s.warn(I.A_SEARCH_MESSAGE_BY_USER_R,"searchMessagesByUser fail -> code: ".concat(f,", ").concat(i)),[2,{code:f}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:ot[r.NOT_SUPPORT]}]}))}))},getHistoryMessagesByMessageTypes:function(e,t){return V(this,void 0,void 0,(function(){var n=this;return k(this,(function(o){return P()?m("conversation",e,f.CONVERSATION,!0)&&m("option",t,f.OBJECT,!0)&&m("option.count",t.count,f.NUMBER)&&m("options.count",t.count,(function(e){var t=e>0&&e<=100;return t||null===console||void 0===console||console.error("option.count is invalid, It should be greater than 0 and less than 100"),t}))&&m("option.timestamp",t.timestamp,f.NUMBER)&&m("option.order",t.order,(function(e){return[0,1].includes(e)}))&&m("option.messageTypes",t.messageTypes,f.ARRAY,!0)&&!t.messageTypes.some((function(e){return!m("option.messageType",e,f.STRING,!0)}))?[2,Fe((function(o,i){return V(n,void 0,void 0,(function(){var n,a,s,c,u,d,l,f,g,v,h,R,m,E,S;return k(this,(function(T){switch(T.label){case 0:return n=t.count,a=t.timestamp,s=t.order,c=t.messageTypes,u="conversation: ".concat(JSON.stringify(e),", option: ").concat(JSON.stringify(t)),i.info(I.O,"getHistoryMessagesByMessageTypes -> ".concat(u)),d=e.conversationType,l=e.targetId,f=e.channelId,n||(n=20),a||(a=0),s||(s=0),f||(f=""),[4,o.getHistoryMessagesByObjectNames(d,l,a,n,c,s,f)];case 1:return g=T.sent(),v=g.code,h=g.data,v===r.SUCCESS?(m=(R=h).list,E=R.hasMore,S=m.map((function(e){return Me(e)})),[2,{code:v,data:{messages:S,hasMore:E,list:S}}]):(i.warn(I.O,"getHistoryMessagesByMessageTypes fail -> code: ".concat(v," ").concat(u)),[2,{code:v,msg:ot[v]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:ot[r.NOT_SUPPORT]}]}))}))},setMessageStatusToRead:function(e,t){return V(this,void 0,void 0,(function(){var n=this;return k(this,(function(o){return P()?m("conversation",e,f.CONVERSATION,!0)&&m("timestamp",t,f.NUMBER,!0)?[2,Fe((function(o,r){return V(n,void 0,void 0,(function(){var n,i,a,s;return k(this,(function(c){switch(c.label){case 0:return n="conversation: ".concat(JSON.stringify(e),", timestamp: ").concat(t),r.info(I.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:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:ot[r.NOT_SUPPORT]}]}))}))},setMessageReceivedStatus:function(e,t){return V(this,void 0,void 0,(function(){var n=this;return k(this,(function(o){return P()?m("messageId",e,f.NUMBER,!0)&&m("receivedStatus",t,(function(e){return!B(i[e])}),!0)?[2,Fe((function(o,r){return V(n,void 0,void 0,(function(){return k(this,(function(n){switch(n.label){case 0:return r.info(I.O,"setMessageReceivedStatus -> messageId: ".concat(e,", receivedStatus: ").concat(t)),[4,o.setMessageReceivedStatus(e,t)];case 1:return[2,{code:n.sent()}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:ot[r.NOT_SUPPORT]}]}))}))},setMessageSentStatus:function(e,t){return V(this,void 0,void 0,(function(){var n=this;return k(this,(function(o){return P()?m("messageId",e,f.NUMBER,!0)&&m("sentStatus",t,(function(e){return!B(w[e])}),!0)?[2,Fe((function(o,r){return V(n,void 0,void 0,(function(){return k(this,(function(n){switch(n.label){case 0:return r.info(I.O,"setMessageSentStatus ->messageId: ".concat(e,", sentStatus: ").concat(t)),[4,o.setMessageSentStatus(e,t)];case 1:return[2,{code:n.sent()}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:ot[r.NOT_SUPPORT]}]}))}))},setMessageContent:function(e,t,n){return void 0===n&&(n=""),V(this,void 0,void 0,(function(){var o=this;return k(this,(function(i){return P()?m("messageId",e,f.NUMBER,!0)&&m("content",t,f.OBJECT,!0)&&m("messageType",n,f.ONLY_STRING,!0)?[2,Fe((function(r,i){return V(o,void 0,void 0,(function(){return k(this,(function(o){switch(o.label){case 0:return i.info(I.O,"setMessageSentStatus ->messageId: ".concat(e,", messageType: ").concat(n)),[4,r.setMessageContent(e,t,n)];case 1:return[2,{code:o.sent()}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:ot[r.NOT_SUPPORT]}]}))}))},deleteMessages:function(e){return V(this,void 0,void 0,(function(){var t=this;return k(this,(function(n){return P()?!m("messageIds",e,f.ARRAY,!0)||e.some((function(e){return!m("messageId",e,f.NUMBER,!0)}))?[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,Fe((function(n,o){return V(t,void 0,void 0,(function(){return k(this,(function(t){switch(t.label){case 0:return o.info(I.O,"deleteMessages ->messageIds: ".concat(JSON.stringify(e))),[4,n.deleteMessages(e)];case 1:return[2,{code:t.sent()}]}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:ot[r.NOT_SUPPORT]}]}))}))},clearMessages:function(e){return V(this,void 0,void 0,(function(){var t=this;return k(this,(function(n){return P()?[2,Fe((function(n,o){return V(t,void 0,void 0,(function(){var t,r,i;return k(this,(function(a){switch(a.label){case 0:return t=e.conversationType,r=e.targetId,i=e.channelId,o.info(I.O,"clearMessages ->targetId:".concat(r,",conversationType:").concat(t)),[4,n.clearMessages(t,r,i)];case 1:return[2,{code:a.sent()}]}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:ot[r.NOT_SUPPORT]}]}))}))},deleteMessagesByTimestamp:function(e,t,n){return V(this,void 0,void 0,(function(){var o,i,a,s=this;return k(this,(function(c){return P()?(o=e.conversationType,i=e.targetId,a=e.channelId,m("conversationType",o,f.NUMBER,!0)&&m("targetId",i,f.STRING,!0)&&m("timestamp",t,f.NUMBER,!0)&&m("cleanSpace",n,f.BOOLEAN)?[2,Fe((function(e,r){return V(s,void 0,void 0,(function(){return k(this,(function(r){switch(r.label){case 0:return[4,e.deleteMessagesByTimestamp(o,i,t,n,a)];case 1:return[2,{code:r.sent()}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]):[2,{code:r.NOT_SUPPORT,msg:ot[r.NOT_SUPPORT]}]}))}))},insertMessage:function(e,t,n){return void 0===n&&(n={}),V(this,void 0,void 0,(function(){var o=this;return k(this,(function(i){return P()?m("conversation",e,f.CONVERSATION,!0)&&m("message",t,f.OBJECT,!0)&&m("options",n,f.OBJECT)&&m("options.isUnread",null==n?void 0:n.isUnread,f.BOOLEAN)&&m("options.searchContent",null==n?void 0:n.searchContent,f.STRING)&&(t instanceof En||m("message.senderUserId",t.senderUserId,f.STRING,!0)&&m("message.messageType",t.messageType,f.STRING,!0)&&m("message.content",t.content,f.OBJECT,!0)&&m("message.messageDirection",t.messageDirection,f.NUMBER,!0)&&m("message.canIncludeExpansion",t.canIncludeExpansion,f.BOOLEAN)&&m("message.expansion",t.expansion,f.OBJECT)&&m("message.disableNotification",t.disableNotification,f.BOOLEAN)&&m("message.sentTime",t.sentTime,f.NUMBER)&&m("message.sentStatus",t.sentStatus,f.NUMBER))?[2,Fe((function(i,a){return V(o,void 0,void 0,(function(){var o,s,c,u,d,l,f,g,v,h,R,m,E,S,T;return k(this,(function(p){switch(p.label){case 0:return o="",s=1,l=!1,g=t.messageType,v=t.content,t instanceof En||(o=t.senderUserId,s=t.messageDirection,l=t.canIncludeExpansion,f=t.expansion,d=t.disableNotification,c=t.sentTime,u=t.sentStatus),a.info(I.O,"insertMessage ->targetId:".concat(e.targetId,",conversationType:").concat(e.conversationType)),h=n.isUnread,R=n.searchContent,m={senderUserId:o,messageType:g,content:v,messageDirection:s,sentTime:c,sentStatus:u,searchContent:R,isUnread:h,messageUId:"",disableNotification:d,canIncludeExpansion:l,expansionMsg:JSON.stringify(f),channelId:e.channelId||""},[4,i.insertMessage(e.conversationType,e.targetId,m)];case 1:return E=p.sent(),S=E.code,T=E.data,S===r.SUCCESS?[2,{code:S,data:Me(T)}]:(a.warn(I.O,"insertMessage ->code:".concat(S,",targetId:").concat(e.targetId)),[2,{code:S,msg:ot[S]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:ot[r.NOT_SUPPORT]}]}))}))},batchInsertMessage:function(e,t){var n,o;return V(this,void 0,void 0,(function(){var i,s=this;return k(this,(function(c){if(!P())return[2,{code:r.NOT_SUPPORT,msg:ot[r.NOT_SUPPORT]}];if(!m("messages",e,(function(e){return g(e)&&!(e.length<=0||e.length>=500)}),!0)||!m("checkDuplicate",t,f.BOOLEAN))return[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}];for(i in e)if(!(m("message",e[i],f.OBJECT,!0)&&m("message.conversationType",e[i].conversationType,(function(e){return[a.PRIVATE,a.DISCUSSION,a.GROUP,a.CUSTOMER_SERVICE,a.SYSTEM,a.APP_PUBLIC_SERVICE,a.PUBLIC_SERVICE].includes(e)}),!0)&&m("message.targetId",e[i].targetId,f.STRING,!0)&&m("message.senderUserId",e[i].senderUserId,f.STRING,!0)&&m("message.messageType",e[i].messageType,f.STRING,!0)&&m("message.content",e[i].content,f.OBJECT,!0)&&m("message.messageDirection",e[i].messageDirection,f.NUMBER,!0)&&m("message.canIncludeExpansion",e[i].canIncludeExpansion,f.BOOLEAN)&&m("message.expansion",e[i].expansion,f.OBJECT)&&m("message.disableNotification",e[i].disableNotification,f.BOOLEAN)&&m("message.sentTime",e[i].sentTime,f.NUMBER)&&m("message.sentStatus",e[i].sentStatus,f.NUMBER)&&m("options.isUnread",null===(n=e[i])||void 0===n?void 0:n.isUnread,f.BOOLEAN)&&m("options.searchContent",null===(o=e[i])||void 0===o?void 0:o.searchContent,f.STRING)))return[2,{code:r.BIZ_ERROR_INVALID_PARAMETER,msg:String(i)}];return[2,Fe((function(n){return V(s,void 0,void 0,(function(){var o,i,a;return k(this,(function(s){switch(s.label){case 0:return[4,n.batchInsertMessage(e,t)];case 1:return o=s.sent(),i=o.code,a=o.data,i===r.SUCCESS?[2,{code:i,data:a}]:[2,{code:i,msg:ot[i]}]}}))}))}))]}))}))},getMessageCount:function(e){return V(this,void 0,void 0,(function(){var t=this;return k(this,(function(n){return P()?[2,Fe((function(n){return V(t,void 0,void 0,(function(){var t,o,r,i,a,s;return k(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:r.NOT_SUPPORT,msg:ot[r.NOT_SUPPORT]}]}))}))},getPrivateMessageDeliverTime:function(e){return V(this,void 0,void 0,(function(){var t=this;return k(this,(function(n){return P()?m("messageUId",e,f.STRING,!0)?[2,Fe((function(n,o){return V(t,void 0,void 0,(function(){var t,i,a;return k(this,(function(s){switch(s.label){case 0:return[4,n.getPrivateMessageDeliverTime(e)];case 1:return t=s.sent(),i=t.code,a=t.data,i===r.SUCCESS?[2,{code:i,data:a}]:(o.warn(I.A_GET_PRIVATE_MESSAGE_DELIVER_TIME_E,"code:".concat(i,",messageUId:").concat(e)),[2,{code:i,msg:ot[i]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:ot[r.NOT_SUPPORT]}]}))}))},getGroupMessageDeliverList:function(e,t){return V(this,void 0,void 0,(function(){var n=this;return k(this,(function(o){return P()?m("targetId",e,f.STRING,!0)&&m("messageUId",t,f.STRING,!0)?[2,Fe((function(o,i){return V(n,void 0,void 0,(function(){var n,a,s;return k(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===r.SUCCESS?[2,{code:a,data:s}]:(i.warn(I.A_GET_GROUP_MESSAGE_DELIVER_LIST_E,"code:".concat(a,", targetId:").concat(e," messageUId:").concat(t)),[2,{code:a,msg:ot[a]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:ot[r.NOT_SUPPORT]}]}))}))},setCheckDuplicateMessage:function(e){return V(this,void 0,void 0,(function(){var t=this;return k(this,(function(n){return P()?m("enableCheck",e,f.BOOLEAN)?[2,Fe((function(n){return V(t,void 0,void 0,(function(){return k(this,(function(t){switch(t.label){case 0:return[4,n.setCheckDuplicateMessage(e)];case 1:return[2,{code:t.sent().code}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:ot[r.NOT_SUPPORT]}]}))}))},clearLocalData:function(){return V(this,void 0,void 0,(function(){var e=this;return k(this,(function(t){return P()?[2,Fe((function(t,n){return V(e,void 0,void 0,(function(){var e,o,r;return k(this,(function(i){switch(i.label){case 0:return n.info(I.O,"clearLocalData ->"),[4,t.clearData()];case 1:return e=i.sent(),o=e.code,r=e.data,[2,{code:o,data:r}]}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:ot[r.NOT_SUPPORT]}]}))}))}}),Yo=function(e,t,n){this.type=e,this.userIdList=t,this.mentionedContent=n};function zo(e){return V(this,void 0,void 0,(function(){var t=this;return k(this,(function(n){return!e||m("proxy.socksHost",e.socksHost,f.STRING,!0)&&m("proxy.socksPort",e.socksPort,f.NUMBER,!0)?[2,Fe((function(n,o){return V(t,void 0,void 0,(function(){var t;return k(this,(function(i){switch(i.label){case 0:return o.info(I.O,"setProxy: ->".concat(e)),[4,n.setProxy(e)];case 1:return(t=i.sent().code)===r.SUCCESS?[2,{code:t}]:(o.warn(I.O,"setProxy ->code:".concat(t)),[2,{code:t,msg:ot[t]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function jo(){return V(this,void 0,void 0,(function(){var e=this;return k(this,(function(t){return[2,Fe((function(t,n){return V(e,void 0,void 0,(function(){var e,o,i;return k(this,(function(a){switch(a.label){case 0:return[4,t.getProxy()];case 1:return e=a.sent(),o=e.code,i=e.data,o===r.SUCCESS?[2,{code:o,data:i}]:(n.warn(I.O,"getProxy ->code:".concat(o)),[2,{code:o,msg:ot[o]}])}}))}))}))]}))}))}function Wo(e,t){return V(this,void 0,void 0,(function(){var n=this;return k(this,(function(o){return!e||m("proxy.socksHost",e.socksHost,f.STRING,!0)&&m("proxy.socksPort",e.socksPort,f.NUMBER,!0)?[2,Fe((function(o,i){return V(n,void 0,void 0,(function(){var n,a,s;return k(this,(function(c){switch(c.label){case 0:return i.info(I.O,"testProxy: ->".concat(e)),[4,o.testProxy(e,t)];case 1:return n=c.sent(),a=n.status,s=n.data,a===r.SUCCESS?[2,{code:a,msg:s}]:(i.warn(I.O,"testProxy ->code:".concat(a)),[2,{code:a,msg:ot[a]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}export{En as BaseMessage,Cn as CombineMessage,qo as ConnectType,Ce as Events,An as FileMessage,Un as GIFMessage,On as HQVoiceMessage,pn as ImageMessage,Mn as LocationMessage,Yo as MentionedInfoBody,Jo as MessageType,Pn as ReferenceMessage,Ln as RichContentMessage,Nn as SightMessage,_n as TextMessage,yn as VoiceMessage,Qe as __addSDKVersion,Go as addConversationsToTag,Ze as addEventListener,Lo as addTag,hn as addToBlacklist,vn as bindRTCRoomForChatroom,Et as clearAllMessagesUnreadStatus,Ke as clearEventListeners,Io as clearHistoryMessages,Uo as clearMessages,mt as clearMessagesUnreadStatus,gt as clearTextMessageDraft,Mo as clearUnreadCountByTimestamp,at as connect,Ao as deleteLocalMessagesByTimestamp,ho as deleteMessages,ze as destroy,st as disconnect,Ko as electronExtension,dn as forceRemoveChatRoomEntry,sn as forceSetChatRoomEntry,fn as getAllChatRoomEntries,Lt as getAllConversationState,Jt as getAllUltraGroupUnreadCount,Kt as getAllUltraGroupUnreadMentionedCount,Pt as getAllUnreadMentionedCount,Rn as getBlacklist,mn as getBlacklistStatus,Bt as getBlockUltraGroupList,Ct as getBlockedConversationList,ln as getChatRoomEntry,on as getChatRoomInfo,gn as getChatroomHistoryMessages,je as getConnectionStatus,ut as getConversation,ct as getConversationList,Nt as getConversationNotificationLevel,_t as getConversationNotificationStatus,Fo as getConversationsFromTagByPage,Xe as getCurrentUserId,$e as getDeviceId,Wn as getFileToken,Xn as getFileUrl,po as getFirstUnreadMessage,ao as getHistoryMessages,No as getMessage,So as getMessageReader,jo as getProxy,so as getRemoteHistoryMessages,We as getServerTime,bo as getTags,Do as getTagsFromConversation,lt as getTextMessageDraft,Ut as getTopConversationList,vt as getTotalUnreadCount,ht as getTotalUnreadCountByLevels,It as getTotalUnreadMentionedCountByLevels,Zt as getUltraGroupDefaultNotificationLevel,zt as getUltraGroupFirstUnreadMessageTimestamp,wt as getUltraGroupList,Dt as getUltraGroupMessageListByMessageUId,qt as getUltraGroupUnreadCountByTargetId,jt as getUltraGroupUnreadInfoList,Ft as getUltraGroupUnreadMentionedCountByTargetId,Yt as getUltraGroupUnreadMentionedMessages,yt as getUnreadConversationList,Rt as getUnreadCount,Zo as getUnreadCountByTag,Mt as getUnreadMentionedCount,_o as getUnreadMentionedMessages,Ye as init,Oo as insertMessage,et as installPlugin,en as joinChatRoom,tn as joinExistChatRoom,xt as modifyMessage,He as onceEventListener,nn as quitChatRoom,vo as recallMessage,To as registerMessageType,kt as removeAllExpansionForUltraGroupMessage,un as removeChatRoomEntries,cn as removeChatRoomEntry,dt as removeConversation,Vo as removeConversationsFromTag,qe as removeEventListener,Je as removeEventListeners,Vt as removeExpansionForUltraGroupMessage,In as removeFromBlacklist,mo as removeMessageExpansionForKey,wo as removeTag,xo as removeTagFromConversations,ko as removeTagsFromConversation,ft as saveTextMessageDraft,yo as searchConversationByContent,Co as searchMessages,to as sendFileMessage,oo as sendGIFMessage,ro as sendHQVoiceMessage,no as sendImageMessage,Qn as sendMessage,co as sendReadReceiptMessage,uo as sendReadReceiptRequest,lo as sendReadReceiptResponse,fo as sendReadReceiptResponseV2,io as sendSightMessage,go as sendSyncReadStatusMessage,$n as sendTextMessage,Eo as sendTypingStatusMessage,bt as sendUltraGroupTypingStatus,an as setChatRoomEntries,rn as setChatRoomEntry,pt as setConversationNotificationLevel,Ot as setConversationNotificationStatus,At as setConversationToTop,Ho as setConversationToTopInTag,Po as setMessageReceivedStatus,zo as setProxy,Ht as setUltraGroupDefaultNotificationLevel,Wo as testProxy,Gt as updateExpansionForUltraGroupMessage,Ro as updateMessageExpansion,Bo as updateTag};