@rongcloud/imlib-next 5.7.9 → 5.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.d.ts +24 -7
- package/index.esm.js +1 -1
- package/index.js +1 -1
- package/package.json +2 -2
package/index.esm.js
CHANGED
|
@@ -1 +1 @@
|
|
|
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 f,AssertRules as l,isArray as g,isHttpUrl as v,APIContext as I,LogTagId as h,logger as R,validate as m,isValidConversationType as E,isValidNotificationLevel as S,NotificationLevel as p,isTypeInConversationList as T,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 w}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 L=function(){return L=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},L.apply(this,arguments)};function B(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 D(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 b=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))},G=b(),k=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 x=null,V=function(e){return B(void 0,void 0,void 0,(function(){var t;return D(this,(function(n){switch(n.label){case 0:return[4,H.getNetworkType()];case 1:return t=n.sent(),x({status:"online"===e.type,type:"online"===e.type?t:"none"}),[2]}}))}))};var H={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(e){var t=k(),n="[object XDomainRequest]"===Object.prototype.toString.call(t);if(t.open(r,u),a&&t.setRequestHeader)for(var o in a)t.setRequestHeader(o,a[o]);if(n){t.timeout=i,t.onload=function(){e({data:t.responseText,status:t.status||200})},t.onerror=function(){e({status:t.status})},t.ontimeout=function(){e({status:t.status})};var s="object"==typeof c?JSON.stringify(c):c;t.send(s)}else t.onreadystatechange=function(){4===t.readyState&&e({data:t.responseText,status:t.status})},t.onerror=function(){e({status:t.status})},setTimeout((function(){t.abort(),e({status:t.status})}),i),t.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,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){x=e,window.addEventListener("offline",V),window.addEventListener("online",V)},removeNetworkStatusListener:function(){window.removeEventListener("offline",V),window.removeEventListener("online",V),x=null}},F=b(),Z=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return wx[e].apply(wx,t)}catch(e){null===console||void 0===console||console.error(e)}}},q={setItem:Z("setStorageSync"),getItem:Z("getStorageSync"),removeItem:Z("removeStorageSync"),clear:Z("clearStorageSync")},J=null,z=function(e){var t=e.isConnected,n=e.networkType;J({status:t,type:n})};var K={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:q,sessionStorage:q,useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:F,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(z)},removeNetworkStatusListener:function(){wx.offNetworkStatusChange(z),J=null}},Y=b(),j=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){}}},W={setItem:j("setStorageSync"),getItem:j("getStorageSync"),removeItem:j("removeStorageSync"),clear:j("clearStorageSync")},X=null,Q=function(e){var t=e.isConnected,n=e.networkType;X({status:t,type:n})};var $={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),f=e.dataType||"json";return new Promise((function(e){my.request({url:d,method:i,headers:s,timeout:a,data:u,dataType:f,success:function(t){e({data:t.data,status:t.status})},fail:function(){e({status:r.RC_HTTP_REQ_FAIL})}})}))},localStorage:W,sessionStorage:W,useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:Y,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){X=e,my.onNetworkStatusChange(Q)},removeNetworkStatusListener:function(){my.offNetworkStatusChange(Q),X=null}},ee=b(),te=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){}}},ne={setItem:te("setStorageSync"),getItem:te("getStorageSync"),removeItem:te("removeStorageSync"),clear:te("clearStorageSync")},oe=null,re=function(e){var t=e.isConnected,n=e.networkType;oe({status:t,type:n})};var ie={tag:"toutiao",useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:ee,localStorage:ne,sessionStorage:ne,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){oe=e,tt.onNetworkStatusChange(re)},removeNetworkStatusListener:function(){tt.offNetworkStatusChange(re),oe=null}},ae=b(),se=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){}}},ce={setItem:se("setStorageSync"),getItem:se("getStorageSync"),removeItem:se("removeStorageSync"),clear:se("clearStorageSync")},ue=null,de=function(e){var t=e.isConnected,n=e.networkType;ue({status:t,type:n})};var fe={tag:"baidu",useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:ae,localStorage:ce,sessionStorage:ce,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 B(this,void 0,void 0,(function(){return D(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){ue=e,swan.onNetworkStatusChange(de)},removeNetworkStatusListener:function(){swan.offNetworkStatusChange(de),ue=null}},le=b(),ge=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)}}},ve={setItem:ge("setStorageSync"),getItem:ge("getStorageSync"),removeItem:ge("removeStorageSync"),clear:ge("clearStorageSync")},Ie=null,he=function(e){var t=e.isConnected,n=e.networkType;Ie({status:t,type:n})};var Re={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:ve,sessionStorage:ve,useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:le,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){Ie=e,jd.onNetworkStatusChange(he)},removeNetworkStatusListener:function(){jd.offNetworkStatusChange(he),Ie=null}},me=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)}}},Ee={setItem:me("setStorageSync"),getItem:me("getStorageSync"),removeItem:me("removeStorageSync"),clear:me("clearStorageSync")},Se=null,pe=function(e){var t=e.isConnected,n=e.networkType;Se({status:t,type:n})};var Te,Oe={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:Ee,sessionStorage:Ee,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){Se=e,uni.onNetworkStatusChange(pe)},removeNetworkStatusListener:function(){uni.offNetworkStatusChange(pe),Se=null}},Ne=function(e){return e&&e.request&&e.getSystemInfo},_e="undefined"!=typeof uni&&Ne(uni)?function(){switch(process.env.VUE_APP_PLATFORM){case"app-plus":return Oe;case"mp-jd":return Re;case"mp-baidu":return fe;case"mp-toutiao":return ie;case"mp-alipay":return $;case"mp-weixin":return K;default:return H}}():"undefined"!=typeof jd&&Ne(jd)?Re:"undefined"!=typeof my&&Ne(my)?$:"undefined"!=typeof tt&&Ne(tt)?ie:"undefined"!=typeof swan&&Ne(swan)?fe:"undefined"!=typeof wx&&Ne(wx)?K:H;function Ce(e){var t=e.conversationType,n=e.channelId,o=e.messageType,r=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,h=e.isOffLineMessage,R=e.canIncludeExpansion,m=e.expansion,E=e.receivedStatus,S=e.disableNotification,p=e.isMentioned,T=e.isStatusMessage,O=e.readReceiptInfo,N=e.pushConfig,_=e.messageId,C=e.isInterrupt,A=e.isModifyMessage,y=e.channelType,M=e.sentStatus;E||(E=i.UNREAD);var U={messageType:o,channelId:n||"",content:r,senderUserId:c,targetId:u,conversationType:t,sentTime:d,receivedTime:f,messageUId:l,messageDirection:g,isPersited:v,isCounted:I,isMentioned:p,disableNotification:S,isStatusMessage:T,canIncludeExpansion:R,expansion:m,receivedStatus:E,readReceiptInfo:O,pushConfig:N,messageId:_,isInterrupt:C,isModifyMessage:A,sentStatus:M};return t!==a.ULTRA_GROUP&&(U.isOffLineMessage=h),t===a.ULTRA_GROUP&&s(y)&&(U.channelType=y),U}function Ae(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,f=e.isTop,l=e.channelId,g=e.unreadMentionedCount,v=e.matchCount,I=e.unreadMentionedMeCount,h={conversationType:t,targetId:n,latestMessage:o&&Ce(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:f,channelId:l,unreadMentionedCount:g,matchCount:v,unreadMentionedMeCount:I};return h.conversationType===a.ULTRA_GROUP&&(h.firstUnreadMessage=e.firstUnreadMessage,h.channelType=e.channelType),h}function ye(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"}(Te||(Te={}));var Me=new c,Ue={connection:function(e,t){switch(e){case u.CONNECTED:Me.emit(Te.CONNECTED);break;case u.CONNECTING:Me.emit(Te.CONNECTING);break;case u.SUSPENDED:Me.emit(Te.SUSPEND,t);break;case u.DISCONNECTED:Me.emit(Te.DISCONNECT,t)}},batchMessage:function(e){Me.emit(Te.MESSAGES,{messages:e.map((function(e){return Ce(e)}))})},typingState:function(e){Me.emit(Te.TYPING_STATUS,{status:e})},readReceiptReceived:function(e,t,n){Me.emit(Te.READ_RECEIPT_RECEIVED,{conversation:e,messageUId:t,sentTime:n})},messageReceiptRequest:function(e,t,n){Me.emit(Te.MESSAGE_RECEIPT_REQUEST,{conversation:e,messageUId:t,senderUserId:n})},messageReceiptResponse:function(e,t,n){Me.emit(Te.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?Ce(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=Pe(e.unreadMessageCount||0),n.unreadMentionedCount=Pe(e.unreadMentionedCount||0),n.unreadMentionedMeCount=Pe(e.unreadMentionedMeCount||0),{conversation:n}):(n.hasMentioned=e.hasMentioned,n.mentionedInfo=e.mentionedInfo,n.isTop=e.isTop,{conversation:n,updatedItems:e.updatedItems})}));Me.emit(Te.CONVERSATION,{conversationList:t})},chatroomState:function(e){Me.emit(Te.CHATROOM,e)},expansion:function(e){Me.emit(Te.EXPANSION,e)},pullFinished:function(){Me.emit(Te.PULL_OFFLINE_MESSAGE_FINISHED)},tag:function(){Me.emit(Te.TAG)},conversationTagChanged:function(){Me.emit(Te.CONVERSATION_TAG)},messageBlocked:function(e){Me.emit(Te.MESSAGE_BLOCKED,e)},messageDelivered:function(e){Me.emit(Te.PRIVATE_MESSAGE_DELIVERED,e)},groupMessageDeliveredStatus:function(e){Me.emit(Te.GROUP_MESSAGE_DELIVERED,e)},ultraGroupEnable:function(e){Me.emit(Te.ULTRA_GROUP_ENABLE,e.map((function(e){return Ae(e)})))},operateStatus:function(e){Me.emit(Te.OPERATE_STATUS,e)},ultraGroupMessageExpansionUpdated:function(e){Me.emit(Te.ULTRA_GROUP_MESSAGE_EXPANSION_UPDATED,e.map((function(e){return Ce(e)})))},ultraGroupMessageModified:function(e){Me.emit(Te.ULTRA_GROUP_MESSAGE_MODIFIED,e.map((function(e){return Ce(e)})))},ultraGroupMessageRecalled:function(e){Me.emit(Te.ULTRA_GROUP_MESSAGE_RECALLED,e.map((function(e){return Ce(e)})))},ultraGroupChannelChangeType:function(e){Me.emit(Te.ULTRA_GROUP_CHANNEL_TYPE_CHANGE,e)},ultraGroupChannelUserKicked:function(e){Me.emit(Te.ULTRA_GROUP_CHANNEL_USER_KICKED,e)},ultraGroupChannelDelete:function(e){Me.emit(Te.ULTRA_GROUP_CHANNEL_DELETE,e)},userGroupStatus:function(e){Me.emit(Te.USER_GROUP_STATUS,e)}};function Pe(e){return e>999?999:e}d.add("imlib-next","5.7.9");var we=null,Le=null,Be=null;function De(){return B(this,void 0,void 0,(function(){return D(this,(function(e){switch(e.label){case 0:return we?(Be.info(h.A_DESTROY_O),[4,I.destroy()]):[2];case 1:return e.sent(),Le=null,we=null,Be=null,[2]}}))}))}function be(e){if(!we)throw new Error("Not initialized yet!");return e(we,Be,Le)}function Ge(e){return we?e(we,Be,Le):Promise.resolve({code:r.BIZ_ERROR_CLIENT_NOT_INIT})}function ke(e,t,n){Me.on(e,t,n)}function xe(e,t,n){Me.once(e,t,n)}function Ve(e,t,n){Me.off(e,t,n)}function He(e){Me.removeAll(e)}function Fe(){Me.clear()}function Ze(e){!function(e){var t,n=e.appkey,o=e.navigators;we?Be.warn(h.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))})),Le=e,we=I.init((null===(t=e.__runtimeCreator__)||void 0===t?void 0:t.call(e))||_e,{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}),(Be=we.createLogger("RC-IM","IM")).setOutputLevel(e.logOutputLevel),Be.info(h.A_INIT_O,JSON.stringify({appkey:n,navigators:o,version:"5.7.9",commit:"c429b5ad576697400ce20f472ec7631c27c18cab"})),we.assignWatcher(Ue),R.init(Be))}(e)}function qe(){return B(this,void 0,void 0,(function(){return D(this,(function(e){return we?(Fe(),[2,De()]):[2]}))}))}function Je(){return be((function(e){return e.getConnectionStatus()}))}function ze(){return be((function(e){return e.getServerTime()}))}function Ke(){return be((function(e){return e.getCurrentUserId()}))}function Ye(e,t){d.add(e,t)}function je(){return be((function(e){return e.getDeviceId()}))}function We(e,t){return be((function(n){return n.install(e,t)}))}var Xe={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!"}},Qe={};for(var $e in Xe){var et=Xe[$e].code;Qe[et]=$e}function nt(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return[2,Ge((function(o,i){return B(n,void 0,void 0,(function(){var n,a,s;return D(this,(function(c){switch(c.label){case 0:return m("token",e,l.STRING,!0)&&m("reconnectKickEnable",t,l.BOOLEAN)?(n=i.createTraceId(),i.info(h.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](h.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:Qe[a.code]}]}}))}))}))]}))}))}function ot(e){return R.info(h.A_DISCONNECT_O,{}),be((function(t){return t.disconnect(e)}))}function rt(e,t){return B(this,void 0,void 0,(function(){var n=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",t,l.CHANNEL_ID)?[2,Ge((function(o,i){return B(n,void 0,void 0,(function(){var n,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,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 Ae(e)}))}]:(i.warn(h.O,"get conversation list fail ->".concat(a,":").concat(Qe[a])),[2,{code:a,msg:Qe[a]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function it(e){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(n){return m("options",e,l.CONVERSATION,!0)?[2,Ge((function(n,o){return B(t,void 0,void 0,(function(){var t,i,a;return D(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(h.O,"getConversation ->code:".concat(i,", targetId:").concat(e.targetId)),[2,{code:i,msg:Qe[i]}]):[2,{code:i,data:a?Ae(a):null}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function at(e){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(n){return m("options",e,l.CONVERSATION,!0)?[2,Ge((function(n,o){return B(t,void 0,void 0,(function(){var t,i;return D(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(h.O,"destroy conversation ->".concat(i)),t!==r.SUCCESS?(o.warn(h.O,"destroy conversation fail ->".concat(t,":").concat(Qe[t],",").concat(i)),[2,{code:t,msg:Qe[t]}]):[2,{code:t}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function st(e){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(n){return m("options",e,l.CONVERSATION,!0)?[2,Ge((function(n,o){return B(t,void 0,void 0,(function(){var t,i,a,s;return D(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(h.O,"get draft ->".concat(s)),i===r.SUCCESS?[2,{code:i,data:a||""}]:(o.warn(h.O,"get draft fail ->".concat(i,":").concat(Qe[i],",").concat(s)),[2,{code:i,msg:Qe[i]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function ct(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return m("options",e,l.CONVERSATION,!0)&&m("draft",t,l.STRING,!0)?[2,Ge((function(o,i){return B(n,void 0,void 0,(function(){var n,a;return D(this,(function(s){switch(s.label){case 0:return n="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),i.debug(h.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(h.O,"set draft fail ->".concat(a,":").concat(Qe[a],",").concat(n)),[2,{code:a,msg:Qe[a]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function ut(e){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(n){return m("options",e,l.CONVERSATION,!0)?[2,Ge((function(n,o){return B(t,void 0,void 0,(function(){var t,i;return D(this,(function(a){switch(a.label){case 0:return t="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),o.debug(h.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(h.O,"delete draft fail ->".concat(i,":").concat(Qe[i],",").concat(t)),[2,{code:i,msg:Qe[i]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function dt(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return m("includeMuted",e,l.BOOLEAN,!1)&&m("conversationTypes",t,l.ARRAY,!1)&&!(null==t?void 0:t.some((function(e){return!m("conversationType",e,E)})))?[2,Ge((function(o,i){return B(n,void 0,void 0,(function(){var n,a,s;return D(this,(function(c){switch(c.label){case 0:return i.debug(h.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(h.O,"getTotalUnreadCount fail ->".concat(a,":").concat(Qe[a])),[2,{code:a,msg:Qe[a]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function ft(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return!m("conversationTypes",e,l.ARRAY,!0)||!m("levels",t,l.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,Ge((function(o,i){return B(n,void 0,void 0,(function(){var n,a,s;return D(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(h.O,"getTotalUnreadCountByLevels fail ->".concat(a,":").concat(Qe[a])),[2,{code:a,msg:Qe[a]}])}}))}))}))]}))}))}function lt(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return!m("conversationTypes",e,l.ARRAY,!0)||!m("levels",t,l.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,Ge((function(o,i){return B(n,void 0,void 0,(function(){var n,a,s;return D(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(h.O,"getTotalUnreadMentionedCountByLevels fail ->".concat(a,":").concat(Qe[a])),[2,{code:a,msg:Qe[a]}])}}))}))}))]}))}))}function gt(e){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(n){return m("options",e,l.CONVERSATION,!0)?[2,Ge((function(n,o){return B(t,void 0,void 0,(function(){var t,i,a,s;return D(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(h.O,"get unreadCount ->".concat(s)),i===r.SUCCESS?[2,{code:i,data:a}]:(o.warn(h.O,"get unreadCount fail ->".concat(i,":").concat(Qe[i],",").concat(s)),[2,{code:i,msg:Qe[i]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function vt(e){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(n){return m("options",e,l.CONVERSATION,!0)?[2,Ge((function(n,o){return B(t,void 0,void 0,(function(){var t,i;return D(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(h.O,"clear unreadMsgNum ->".concat(i)),t!==r.SUCCESS?(o.warn(h.O,"clear unreadMsgNum fail ->".concat(t,":").concat(Qe[t],",").concat(i)),[2,{code:t,msg:Qe[t]}]):[2,{code:t}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function It(){return B(this,void 0,void 0,(function(){var e=this;return D(this,(function(t){return[2,Ge((function(t,n){return B(e,void 0,void 0,(function(){return D(this,(function(e){switch(e.label){case 0:return[4,t.clearAllUnreadCount()];case 1:return[2,{code:e.sent()}]}}))}))}))]}))}))}Xe.ROAMING_SERVICE_UNAVAILABLE.code;var ht=function(e,t,n){void 0===n&&(n="");var o="conversationType:".concat(t.conversationType,",targetId:").concat(t.targetId);return e.debug(h.O,"".concat(n," -> ").concat(o)),o},Rt=function(e,t,n,o){return void 0===o&&(o=""),B(void 0,void 0,void 0,(function(){var i,a;return D(this,(function(s){switch(s.label){case 0:return i=ht(e,t,o),[4,n()];case 1:return(a=s.sent())!==r.SUCCESS?(e.warn(h.O,"".concat(o," fail -> ").concat(a," : ").concat(Qe[a]," , ").concat(i)),[2,{code:a,msg:Qe[a]}]):[2,{code:a}]}}))}))};function mt(e,t){return B(this,void 0,void 0,(function(){return D(this,(function(n){return m("notificationLevel",t,(function(e){return void 0!==p[e]}),!0)&&m("options",e,l.CONVERSATION,!0)?[2,Ge((function(n,o){return Rt(o,e,(function(){return n.setConversationNotificationLevel(e.conversationType,e.targetId,t,e.channelId)}),"setConversationNotificationLevel")}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Et(e,t){return B(this,void 0,void 0,(function(){return D(this,(function(n){return m("notificationStatus",t,(function(e){return 1===e||2===e}),!0)&&m("options",e,l.CONVERSATION,!0)?[2,Ge((function(n,o){return Rt(o,e,(function(){return n.setConversationStatus(e.conversationType,e.targetId,void 0,t,e.channelId)}),"setConversationNotificationStatus")}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function St(e){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(n){return m("options",e,l.CONVERSATION,!0)?[2,Ge((function(n,o){return B(t,void 0,void 0,(function(){var t,i,a,s;return D(this,(function(c){switch(c.label){case 0:return t=ht(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(h.O,"getConversationNotificationLevel fail -> ".concat(a," : ").concat(Qe[a]," , ").concat(t)),[2,{code:a,msg:Qe[a]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function pt(e){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(n){return m("options",e,l.CONVERSATION,!0)?[2,Ge((function(n,o){return B(t,void 0,void 0,(function(){var t,i,a;return D(this,(function(s){switch(s.label){case 0:return o.info(h.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(h.O,"getConversationNotificationStatus ->code:".concat(i,",targetId:").concat(e.targetId)),[2,{code:i,msg:Qe[i]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Tt(){return B(this,void 0,void 0,(function(){return D(this,(function(e){return[2,Ge((function(e){return e.getBlockConversationList()}))]}))}))}function Ot(e,t){return void 0===t&&(t=!0),B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return m("options",e,l.CONVERSATION,!0)&&m("isTop",t,l.BOOLEAN)?[2,Ge((function(o,i){return B(n,void 0,void 0,(function(){var n,a;return D(this,(function(s){switch(s.label){case 0:return n="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),i.debug(h.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(h.O,"set conversation status fail ->".concat(a,":").concat(Qe[a],",").concat(n)),[2,{code:a,msg:Qe[a]}]):[2,{code:a}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Nt(e,t){return B(this,void 0,void 0,(function(){var n=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",t,l.CHANNEL_ID)?[2,Ge((function(o,i){return B(n,void 0,void 0,(function(){var n,a,s;return D(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 Ae(e)}))}]:(i.warn(h.A_GET_TOP_CONVERSATION_LIST_E,"".concat(a,":").concat(Qe[a])),[2,{code:a,msg:Qe[a]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function _t(e){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(n){return!m("conversationTypes",e,l.ARRAY)||(null==e?void 0:e.some((function(e){return!m("conversationType",e,T)})))?[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,Ge((function(n,o){return B(t,void 0,void 0,(function(){var t,o,i;return D(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 Ae(e)}))}]:[2,{code:o,msg:Qe[o]}]}}))}))}))]}))}))}function Ct(e){return B(this,void 0,void 0,(function(){return D(this,(function(t){return m("options",e,l.CONVERSATION,!0)?[2,Ge((function(t,n){return n.debug(h.O,"getUnreadMentionedCount".concat(e.targetId,",channelId:").concat(e.channelId)),t.getUnreadMentionedCount(e)}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function At(){return B(this,void 0,void 0,(function(){return D(this,(function(e){return[2,Ge((function(e,t){return t.debug(h.O,"getAllUnreadMentionedCount"),e.getAllUnreadMentionedCount()}))]}))}))}function yt(){return B(this,void 0,void 0,(function(){return D(this,(function(e){return[2,Ge((function(e){return e.getAllConversationState()}))]}))}))}function Mt(e){return void 0===e&&(e={}),B(this,void 0,void 0,(function(){var t=this;return D(this,(function(n){return m("options.targetId",e.targetId,l.STRING,!1)&&m("options.channelType",e.channelType,(function(e){return void 0!==O[e]}),!1)?[2,Ge((function(n,o){return B(t,void 0,void 0,(function(){var t,i,a;return D(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(h.O,"get ultragroup ->".concat(i,":").concat(Qe[i])),[2,{code:i,msg:Qe[i]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Ut(){return B(this,void 0,void 0,(function(){var e=this;return D(this,(function(t){return[2,Ge((function(t,n){return B(e,void 0,void 0,(function(){var e,o,i;return D(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(h.O,"get block ultragroup ->".concat(o,":").concat(Qe[o])),[2,{code:o,msg:Qe[o]}])}}))}))}))]}))}))}function Pt(e){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(n){return m("options",e,l.CONVERSATION,!0)?[2,Ge((function(n,o){return B(t,void 0,void 0,(function(){var t;return D(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(h.O,"send ultraGroup OperateStatus ->".concat(t,":").concat(Qe[t])),[2,{code:t,msg:Qe[t]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function wt(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return m("options",e,l.CONVERSATION,!0)&&m("msgs",t,l.ARRAY,!0)?[2,Ge((function(o,i){return B(n,void 0,void 0,(function(){var n,a,s,c,u,d,f,l,g,v;return D(this,(function(I){switch(I.label){case 0:return n=e.targetId,a=e.conversationType,s=e.channelId,c=[],t.forEach((function(e){var t=e.sendTime,n=e.messageUId;c.push({sendTime:t,messageUId:n,channelId:s})})),u={targetId:n,conversationType:a,messages:c},[4,o.getUltraGroupMessageListByMessageUId(u)];case 1:if(d=I.sent(),f=d.code,l=d.data,f===r.SUCCESS){for(v in g={},l)g[v]=l[v]?Ce(l[v]):void 0;return[2,{code:r.SUCCESS,data:g}]}return i.warn(h.O,"get UltraGroup MessageList by messageUId ->".concat(f,":").concat(Qe[f])),[2,{code:f,msg:Qe[f]}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Lt(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return m("expansion",e,l.OBJECT,!0)&&m("message",t,l.OBJECT,!0)?[2,Ge((function(o,i){return B(n,void 0,void 0,(function(){var n,a,s,c,u,d,f,l,g;return D(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,f="conversationType:".concat(n,",targetId:").concat(a,",channelId:").concat(d,",messageUId:").concat(s),i.debug(h.O,"update expansion for ultragroup message ->".concat(f)),l={targetId:a,channelId:d,conversationType:n,sendTime:c,canIncludeExpansion:u,messageUId:s,expansion:e},[4,o.expandUltraMessage(l)];case 1:return(g=v.sent().code)===r.SUCCESS?[2,{code:r.SUCCESS}]:(i.warn(h.O,"update expansion for ultragroup message ->".concat(g,":").concat(Qe[g])),[2,{code:g,msg:Qe[g]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Bt(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return m("expansion",e,l.ARRAY,!0)&&m("message",t,l.OBJECT,!0)?[2,Ge((function(o,i){return B(n,void 0,void 0,(function(){var n,a,s,c,u,d,f,l,g;return D(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,f="conversationType:".concat(n,",targetId:").concat(a,",channelId:").concat(d,",messageUId:").concat(s),i.debug(h.O,"remove expansion for ultragroup message ->".concat(f)),l={targetId:a,channelId:d,conversationType:n,sendTime:c,canIncludeExpansion:u,messageUId:s,keys:e},[4,o.expandUltraMessage(l)];case 1:return(g=v.sent().code)===r.SUCCESS?[2,{code:r.SUCCESS}]:(i.warn(h.O,"remove expansion for ultraGroup message ->".concat(g,":").concat(Qe[g])),[2,{code:g,msg:Qe[g]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Dt(e){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(n){return m("message",e,l.OBJECT,!0)?[2,Ge((function(n,o){return B(t,void 0,void 0,(function(){var t,i,a,s,c,u,d,f,l;return D(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(h.O,"remove all expansion for ultraGroup message ->".concat(d)),f={targetId:i,channelId:u,conversationType:t,sendTime:s,canIncludeExpansion:c,messageUId:a,removeAll:!0},[4,n.expandUltraMessage(f)];case 1:return(l=g.sent().code)===r.SUCCESS?[2,{code:r.SUCCESS}]:(o.warn(h.O,"remove all expansion for ultraGroup message ->".concat(l,":").concat(Qe[l])),[2,{code:l,msg:Qe[l]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function bt(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return m("content",e,l.OBJECT,!0)&&m("message",t,l.OBJECT,!0)?[2,Ge((function(o,i){return B(n,void 0,void 0,(function(){var n,a,s,c,u,d,f,l,g,v;return D(this,(function(I){switch(I.label){case 0:return n=t.conversationType,a=t.targetId,s=t.messageUId,c=t.senderUserId,u=t.sentTime,d=t.canIncludeExpansion,f=t.channelId,l="conversationType:".concat(n,",targetId:").concat(a,",channelId:").concat(f,",messageUId:").concat(s),i.debug(h.O,"update ultragroup message expansion ->".concat(l)),g={targetId:a,channelId:f,conversationType:n,fromUserId:c,sendTime:u,canIncludeExpansion:d,messageUId:s,content:e},[4,o.modifyMessage(g)];case 1:return(v=I.sent().code)===r.SUCCESS?[2,{code:r.SUCCESS}]:(i.warn(h.O,"modify ultraGroup message ->".concat(v,":").concat(Qe[v])),[2,{code:v,msg:Qe[v]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Gt(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return m("targetId",e,l.STRING,!0)&&m("notificationLevels",t,l.ARRAY)&&!(null==t?void 0:t.some((function(e){return!m("notificationLevel",e,S)})))?[2,Ge((function(o,i){return B(n,void 0,void 0,(function(){var n,a,s;return D(this,(function(c){switch(c.label){case 0:return i.debug(h.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(h.O,"get UltraGroup unreadMentionedCount by targetId error ->".concat(a,":").concat(Qe[a])),[2,{code:a,msg:Qe[a]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function kt(e){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(n){return m("options.targetId",e.targetId,l.STRING,!0)&&m("options.channelId",e.channelId,l.CHANNEL_ID)?[2,Ge((function(n,o){return B(t,void 0,void 0,(function(){var t,i,a,s,c;return D(this,(function(u){switch(u.label){case 0:return t="getUltraGroupDefaultNotificationLevel",i="targetId: ".concat(e.targetId,", channelId: ").concat(e.channelId),o.debug(h.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(h.O,"".concat(t," fail -> ").concat(s," : ").concat(Qe[s]," , ").concat(i)),[2,{code:s,msg:Qe[s]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function xt(e,t){return B(this,void 0,void 0,(function(){var n=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",t,(function(e){return void 0!==p[e]}),!0)?[2,Ge((function(o,i){return B(n,void 0,void 0,(function(){var n,a,s;return D(this,(function(c){switch(c.label){case 0:return n="setUltraGroupDefaultNotificationLevel",a="targetId: ".concat(e.targetId,", channelId: ").concat(e.channelId),i.debug(h.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(h.O,"".concat(n," fail -> ").concat(s," : ").concat(Qe[s]," , ").concat(a)),[2,{code:s,msg:Qe[s]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Vt(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return m("targetId",e,l.STRING,!0)&&m("notificationLevels",t,l.ARRAY)&&!(null==t?void 0:t.some((function(e){return!m("notificationLevel",e,S)})))?[2,Ge((function(o,r){return B(n,void 0,void 0,(function(){var n,i,a,s,c;return D(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(h.O,"".concat(n," -> ").concat(c)),[2,{code:a,data:s}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Ht(){return B(this,void 0,void 0,(function(){var e=this;return D(this,(function(t){return[2,Ge((function(t,n){return B(e,void 0,void 0,(function(){var e,o,i,a;return D(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(h.O,e),i===r.SUCCESS?[2,{code:i,data:a}]:(n.warn(h.O,"".concat(e," fail ->").concat(i,": ").concat(Qe[i])),[2,{code:i,msg:Qe[i]}])}}))}))}))]}))}))}function Ft(){return B(this,void 0,void 0,(function(){var e=this;return D(this,(function(t){return[2,Ge((function(t,n){return B(e,void 0,void 0,(function(){var e,o,i,a;return D(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(h.O,e),i===r.SUCCESS?[2,{code:i,data:a}]:(n.warn(h.O,"".concat(e," fail ->").concat(i,": ").concat(Qe[i])),[2,{code:i,msg:Qe[i]}])}}))}))}))]}))}))}function Zt(e){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(n){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,Ge((function(n,o){return B(t,void 0,void 0,(function(){var t,i,a,s,c,u,d,f;return D(this,(function(l){switch(l.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=l.sent(),d=u.code,f=u.data,d===r.SUCCESS?[2,{code:d,data:f}]:(o.warn(h.O,"getUltraGroupUnreadMentionedMessages fail ->".concat(d,": ").concat(Qe[d])),[2,{code:d,msg:Qe[d]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function qt(e){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(n){return m("conversation.targetId",e.targetId,l.STRING,!0)&&m("conversation.channelId",e.channelId,l.CHANNEL_ID,!0)?[2,Ge((function(n){return B(t,void 0,void 0,(function(){var t,o,i,a,s,c;return D(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:Qe[s]}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}var Jt=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))},zt=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)},Kt=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)},Yt=function(e){return e.entries.every((function(e){return m("key",e,l.STRING,!0)}))&&m("options.notificationExtra",e.notificationExtra,l.STRING)};function jt(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return m("targetId",e,l.STRING,!0)&&m("options.count",t.count,l.NUMBER,!0)?[2,Ge((function(o,i){return B(n,void 0,void 0,(function(){var n,a,s;return D(this,(function(c){switch(c.label){case 0:return n=i.createTraceId(),i.info(h.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](h.A_JOIN_CHATROOM_R,JSON.stringify({code:a,timestamp:(new Date).getTime()}),n),a!==r.SUCCESS?[2,{code:a,msg:Qe[a]}]:[2,{code:a}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Wt(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return m("targetId",e,l.STRING,!0)&&m("options.count",t.count,l.NUMBER,!0)?[2,Ge((function(o,i){return B(n,void 0,void 0,(function(){var n,a,s;return D(this,(function(c){switch(c.label){case 0:return n=i.createTraceId(),i.info(h.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](h.A_JOIN_CHATROOM_R,JSON.stringify({code:a,timestamp:(new Date).getTime()}),n),a!==r.SUCCESS?[2,{code:a,msg:Qe[a]}]:[2,{code:a}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Xt(e){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(n){return m("targetId",e,l.STRING,!0)?[2,Ge((function(n,o){return B(t,void 0,void 0,(function(){var t,i,a;return D(this,(function(s){switch(s.label){case 0:return t=o.createTraceId(),o.info(h.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](h.A_QUIT_CHATROOM_R,JSON.stringify({code:i}),t),i!==r.SUCCESS?[2,{code:i,msg:Qe[i]}]:[2,{code:i}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Qt(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return m("targetId",e,l.STRING,!0)&&m("options.count",t.count,l.NUMBER)&&m("options.order",t.order,(function(e){return[0,1,2].includes(e)}))?[2,Ge((function(o,i){return B(n,void 0,void 0,(function(){var n,a,s,c;return D(this,(function(u){switch(u.label){case 0:return n="id:".concat(e),i.debug(h.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(h.O,"get chatroom info fail ->code+:".concat(Qe[s],",").concat(n)),[2,{code:s,msg:Qe[s]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function $t(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return m("targetId",e,l.STRING,!0)&&Jt(t)?[2,Ge((function(o,i){return B(n,void 0,void 0,(function(){var n,a;return D(this,(function(s){switch(s.label){case 0:return n="id:".concat(e),i.debug(h.O,"set chatroom entry->".concat(n)),[4,o.setChatroomEntry(e,t)];case 1:return(a=s.sent())!==r.SUCCESS?(i.warn(h.O,"set chatroom entry fail ->code+:".concat(Qe[a],",").concat(n)),[2,{code:a,msg:Qe[a]}]):[2,{code:a}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function en(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return m("targetId",e,l.STRING,!0)&&zt(t)?t.entries.length>10?[2,Xe.CHATROOM_KV_STORE_OUT_LIMIT]:[2,Ge((function(o,i){return B(n,void 0,void 0,(function(){var n,a,s,c;return D(this,(function(u){switch(u.label){case 0:return n="id:".concat(e),i.debug(h.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(h.O,"set chatroom entry fail ->code+:".concat(Qe[s],",").concat(n)),[2,{code:s,msg:Qe[s],data:c}]):[2,{code:s}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function tn(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return m("targetId",e,l.STRING,!0)&&Jt(t)?[2,Ge((function(o,i){return B(n,void 0,void 0,(function(){var n,a;return D(this,(function(s){switch(s.label){case 0:return n="id:".concat(e),i.debug(h.O,"force set chatroom entry ->".concat(n)),[4,o.forceSetChatroomEntry(e,t)];case 1:return(a=s.sent())!==r.SUCCESS?(i.warn(h.O,"force set chatroom entry fail ->code+:".concat(Qe[a],",").concat(n)),[2,{code:a,msg:Qe[a]}]):[2,{code:a}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function nn(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return m("targetId",e,l.STRING,!0)&&Kt(t)?[2,Ge((function(o,i){return B(n,void 0,void 0,(function(){var n,a;return D(this,(function(s){switch(s.label){case 0:return n="id:".concat(e),i.debug(h.O,"remove chatroom entry->".concat(n)),[4,o.removeChatroomEntry(e,t)];case 1:return(a=s.sent())!==r.SUCCESS?(i.warn(h.O,"remove chatroom entry fail ->code+:".concat(Qe[a],",").concat(n)),[2,{code:a,msg:Qe[a]}]):[2,{code:a}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function on(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return m("targetId",e,l.STRING,!0)&&Yt(t)?[2,Ge((function(o,i){return B(n,void 0,void 0,(function(){var n,a,s,c,u;return D(this,(function(d){switch(d.label){case 0:return n="id:".concat(e),i.info(h.O,"remove chatroom entry->".concat(n)),(a=L({},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(h.O,"remove chatroom entry fail ->code+:".concat(Qe[c],",").concat(n)),[2,{code:c,msg:Qe[c],data:u}]):[2,{code:c}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function rn(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return m("targetId",e,l.STRING,!0)&&Kt(t)?[2,Ge((function(o,i){return B(n,void 0,void 0,(function(){var n,a;return D(this,(function(s){switch(s.label){case 0:return n="id:".concat(e),i.info(h.O,"force remove chatroom entry ->".concat(n)),[4,o.forceRemoveChatroomEntry(e,t)];case 1:return(a=s.sent())!==r.SUCCESS?(i.warn(h.O,"force remove chatroom entry fail ->code+:".concat(Qe[a],",").concat(n)),[2,{code:a,msg:Qe[a]}]):[2,{code:a}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function an(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return m("targetId",e,l.STRING,!0)&&m("key",t,(function(e){return N(e)&&/[\w+=-]+/.test(e)&&e.length<=128}),!0)?[2,Ge((function(o,i){return B(n,void 0,void 0,(function(){var n,a,s,c;return D(this,(function(u){switch(u.label){case 0:return n="id:".concat(e),i.debug(h.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(h.O,"get chatroom entry fail ->code+:".concat(Qe[s],",").concat(n)),[2,{code:s,msg:Qe[s]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function sn(e){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(n){return m("targetId",e,l.STRING,!0)?[2,Ge((function(n,o){return B(t,void 0,void 0,(function(){var t,i,a,s;return D(this,(function(c){switch(c.label){case 0:return t="id:".concat(e),o.debug(h.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(h.O,"get all chatroom entries fail ->code+:".concat(Qe[a],",").concat(t)),[2,{code:a,msg:Qe[a]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function cn(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return m("targetId",e,l.STRING,!0)&&m("options.timestamp",t.timestamp,l.NUMBER)&&m("options.count",t.count,l.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,Ge((function(o,i){return B(n,void 0,void 0,(function(){var n,a,s,c,u;return D(this,(function(d){switch(d.label){case 0:return n="id:".concat(e),i.debug(h.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 Ce(e)})),[2,{code:s,data:{list:u,hasMore:!!c.hasMore}}]):(i.warn(h.O,"get chatroom history message fail ->code+:".concat(Qe[s],",").concat(n)),[2,{code:s,msg:Qe[s]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function un(e){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(n){return m("option.chatRoomId",e.chatRoomId,l.STRING,!0)&&m("option.rtcRoomId",e.rtcRoomId,l.STRING,!0)?[2,Ge((function(n){return B(t,void 0,void 0,(function(){var t;return D(this,(function(o){switch(o.label){case 0:return[4,n.bindRTCRoomForChatroom(e)];case 1:return[2,{code:t=o.sent(),msg:Qe[t]}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function dn(e){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(n){return m("userId",e,l.STRING,!0)?[2,Ge((function(n,o){return B(t,void 0,void 0,(function(){return D(this,(function(t){switch(t.label){case 0:return o.info(h.O,"addToBlacklist -> userId: ".concat(e)),[4,n.addToBlacklist(e)];case 1:return[2,{code:t.sent()}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function fn(e){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(n){return m("userId",e,l.STRING,!0)?[2,Ge((function(n,o){return B(t,void 0,void 0,(function(){return D(this,(function(t){switch(t.label){case 0:return o.info(h.O,"removeFromBlacklist -> userId: ".concat(e)),[4,n.removeFromBlacklist(e)];case 1:return[2,{code:t.sent()}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function ln(){return B(this,void 0,void 0,(function(){var e=this;return D(this,(function(t){return[2,Ge((function(t,n){return B(e,void 0,void 0,(function(){var e,o,i;return D(this,(function(a){switch(a.label){case 0:return n.info(h.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(h.O,"getBlacklist fail -> code: ".concat(o)),[2,{code:o}])}}))}))}))]}))}))}function gn(e){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(n){return m("userId",e,l.STRING,!0)?[2,Ge((function(n,o){return B(t,void 0,void 0,(function(){var t,i,a;return D(this,(function(s){switch(s.label){case 0:return o.info(h.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(h.O,"getBlacklistStatus fail -> code: ".concat(i,", userId: ").concat(e)),[2,{code:i}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}var vn=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 In(e,t,n){void 0===t&&(t=!0),void 0===n&&(n=!0);return function(o){return new vn(e,o,t,n)}}var hn,Rn,mn=In("RC:ImgMsg"),En=In("RC:HQVCMsg"),Sn=In("RC:SightMsg"),pn=In("RC:TxtMsg"),Tn=In("RC:CombineMsg"),On=In("RC:FileMsg"),Nn=In("RC:GIFMsg"),_n=In("RC:VcMsg"),Cn=In("RC:LBSMsg"),An=In("RC:ReferenceMsg"),yn=In("RC:ImgTextMsg"),Mn={qiniu:function(e,t,n,o){be((function(r){var i=r.getNaviInfoFromCache();if(1===(null==i?void 0:i.type)&&t.chunk_size&&o.size>t.chunk_size){var a=C();a+=o.name.substr(o.name.lastIndexOf(".")),o.uniqueName=a,kn(o,t,n)}else Gn(e,t,n,o)}))},baidu:function(e,t,n,o){if(o.size>Pn.BOS_CHUNCK_SIZE)throw new Error("the file size is over 5GB!");var r=t||{};t=t||Rn;var i=new XMLHttpRequest,a=Bn();if(!r.uploadHost.bos&&!r.bosUploadPath)return;var s=a+Un[0][1]+r.bosUploadPath;Un.shift();var c=r.bosHeader||{},u={filename:t.uniqueValue||o.uniqueName,name:o.name,downloadUrl:s,isBosRes:!0};i.upload&&t.support_options&&(i.upload.onprogress=function(e){n.onProgress(e.loaded,e.total,!0)});i.onreadystatechange=function(){if(4===i.readyState)if(JSON.parse(i.responseText||"{}").filename=t.uniqueValue,200===i.status){n.onCompleted(u,!0)}else Un.length?Mn[Un[0][0]](e,t,n,o):n.onError("upload fail")},i.open(t.method,s,!0),i.setRequestHeader("authorization",c.bosToken),i.setRequestHeader("x-bce-date",c.bosDate),i.send(o)},aliyun:function(e,t,n,o){if(o.size>Pn.BOS_CHUNCK_SIZE)throw new Error("the file size is over 5GB!");var r=new FormData;r.set("file",e.get("file")),r.set("key",e.get("key")),r.set("token",e.get("token"));var i=Un[0][1];Un.shift(),e=e||hn,t=(t=t||{})||Rn;var a=new XMLHttpRequest,s=Bn(),c="".concat(s+t.ossBucketName,".").concat(i);a.upload&&t.support_options&&(a.upload.onprogress=function(e){n.onProgress(e.loaded,e.total)});a.onreadystatechange=function(){if(4===a.readyState){var e=JSON.parse(a.responseText||"{}");e.name=t.uniqueValue,e.filename=t.uploadFileName,e.uploadMethod=_?_.ALI:"",200===a.status?n.onCompleted(e):Un.length?Mn[Un[0][0]](r,t,n,o):n.onError("upload fail")}},a.open(t.method,c,!0),console.log("ali:url",c);var u=t.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",t.uploadFileName),e.delete("file"),e.append("file",o),a.send(e)},s3:function(e,t,n,o){var r=new FormData,i=new XMLHttpRequest,a=Bn(),s=t.contentDisposition,c=Un[0][1],u="".concat(a+t.s3BucketName,".").concat(c);console.log("uploadS3:url",u),Un.shift(),i.upload&&t.support_options&&(i.upload.onprogress=function(e){n.onProgress(e.loaded,e.total)});i.onreadystatechange=function(){if(4===i.readyState){var r=JSON.parse(i.responseText||"{}");if(r.name=t.uniqueValue,r.filename=t.uploadFileName,r.uploadMethod=_.AWS,200===i.status||204===i.status)n.onCompleted(r);else if(Un.length){var a=new FormData;a.set("file",e.get("file")),a.set("key",e.get("key")),a.set("token",e.get("token")),Mn[Un[0][0]](a,t,n,o)}else n.onError("upload fail")}},i.open(t.method,u,!0);var d=t?t.s3Header:{},f=o&&o.type;s?r.set("Content-Disposition","".concat(s,";")):r.set("Content-Disposition","text/html"===f?"inline;":"attachment;");r.set("Content-Type",f),r.set("x-amz-credential",d.s3Credential),r.set("x-amz-algorithm",d.s3Algorithm),r.set("x-amz-date",d.s3Date),r.set("policy",d.s3Policy),r.set("x-amz-signature",d.s3Signature),r.set("key",t.uploadFileName),r.set("file",o),i.send(r)},stc:xn,minio:xn},Un=[],Pn={BOS_CHUNCK_SIZE:5368709120},wn="http://",Ln="https://";function Bn(){var e=Ln;return"http:"!==location.protocol&&"file:"!==location.protocol||(e=wn),e}var Dn,bn=(Dn="RC-upload-",{get:function(e){e=Dn+e;var t=localStorage.getItem(e);if(t)return null!==(t=JSON.parse(t||"{}"))&&t.type&&t.data?t.data:null},set:function(e,t){var n=localStorage;e=Dn+e,t={data:t,type:typeof t,updateTime:Date.now()},n.setItem(e,JSON.stringify(t))},remove:function(e){e=Dn+e,localStorage.removeItem(e)}});function Gn(e,t,n,o){var r=Ln+t.uploadHost.qiniu,i=(/http/.test(Un[0][1])?"":Bn())+Un[0][1]||r;t.isChunk||Un.shift();var a=new XMLHttpRequest;a.upload&&t.support_options&&(a.upload.onprogress=function(e){n.onProgress(e.loaded,e.total)}),a.onreadystatechange=function(){if(4===a.readyState){var r=JSON.parse(a.responseText||"{}");r.filename=t.uniqueValue,r.uploadMethod=_?_.QINIU:"",200===a.status||204===a.status?n.onCompleted(r):Un.length?Mn[Un[0][0]](e,t,n,o):n.onError("upload fail")}},a.open(t.method,i,!0),n.onOpen(a),t.stream&&a.setRequestHeader("authorization","UpToken ".concat(t.multi_parmas.token)),function(e,t){for(var n in e)t(n,e[n])}(t.headers,(function(e,t){a.setRequestHeader(e,t)})),a.send(e)}function kn(e,t,n,o){var r=0,i=o||C(),a=bn.get(i);a&&(e.uniqueName=a.sessionId,r=a.offset);var s=Math.min(t.chunk_size,e.size-r),c=e.slice(r,r+s),u=e.uniqueName;t.multi_parmas.name=u,t.filesize=e.size;var d="bytes=".concat(r,"-").concat(r+s);t.headers={Range:d,"X-File-TransactionId":u,"X-File-Total-Size":e.size},t.isChunk=!0,c.name=e.name,c=function(e,t,n){var o=new FormData;for(var r in t.unique_key&&o.append(t.unique_key,n),o.append(t.file_data_name,e,e.name),t.multi_parmas){var i=t.multi_parmas[r];o.append(r,i)}return o}(c,t,e.uniqueName),Gn(c,t,{onCompleted:function(o){r+=s;var a=e.uniqueName;bn.set(i,{offset:r,sessionId:a}),r<e.size?kn(e,t,n,i):(r=0,bn.remove(i),n.onCompleted(o))},onError:function(e){console.error(e),n.onError(e)},onProgress:function(e,o){var i=e+r;n.onProgress(i,t.filesize)},onOpen:function(e){n.onOpen(e)}},e)}function xn(e,t,n,o,r){var i=new XMLHttpRequest,a=t.contentDisposition,s=Un[0][1],c=r===_.STC?t.stcBucketName:t.minioBucketName,u="https://".concat(s,"/").concat(c,"/").concat(t.uploadFileName);Un.shift(),i.upload&&t.support_options&&(i.upload.onprogress=function(e){n.onProgress(e.loaded,e.total)}),i.onreadystatechange=function(){if(4===i.readyState){var a=JSON.parse(i.responseText||"{}");if(a.name=t.uniqueValue,a.filename=t.uploadFileName,a.uploadMethod=r,200===i.status||204===i.status)n.onCompleted(a);else if(Un.length){var s=new FormData;s.set("file",e.get("file")),s.set("key",e.get("key")),s.set("token",e.get("token")),Mn[Un[0][0]](s,t,n,o)}else n.onError("upload fail")}},i.open("PUT",u,!0);var d=t.stcHeader.stcAuthorization,f=t.stcHeader.stcContentSha256,l=t.stcHeader.stcDate;r===_.MINIO&&(d=t.minioHeader.minioAuthorization,f=t.minioHeader.minioContentSha256,l=t.minioHeader.minioDate),i.setRequestHeader("Content-Type",o.type),a?i.setRequestHeader("Content-Disposition","".concat(a,";")):i.setRequestHeader("Content-Disposition","text/html"===o.type?"inline;":"attachment;"),i.setRequestHeader("Authorization",d),i.setRequestHeader("x-amz-content-sha256",f),i.setRequestHeader("x-amz-date",l),i.send(o)}function Vn(e,t,n,o,r,i){var a,s,c=t&&t.type||"text/plain",u=c.indexOf("image")>-1?1:4,d=n.contentDisposition,f=Math.ceil(t.size/n.stc_chunk_size),l=r===_.STC?n.stcBucketName:n.minioBucketName,g="uploads";e.getFileToken(u,t.name,"POST",g).then((function(e){a=e.fileName,s="https://".concat(i,"/").concat(l,"/").concat(a),console.log("uploadStcMultipart:url",s);var n=new XMLHttpRequest;n.open("POST","".concat(s,"?").concat(g),!0),d?n.setRequestHeader("Content-Disposition","".concat(d,";")):n.setRequestHeader("Content-Disposition","text/html"===t.type?"inline;":"attachment;");var u=e.stcAuthorization,v=e.stcContentSha256,I=e.stcDate;r===_.MINIO&&(u=e.minioAuthorization,v=e.minioContentSha256,I=e.minioDate),n.setRequestHeader("Authorization",u),n.setRequestHeader("x-amz-content-sha256",v),n.setRequestHeader("x-amz-date",I),n.setRequestHeader("Content-Type",c),n.send(),n.onreadystatechange=function(){if(4===n.readyState){var e=n.response.match(/(?:<UploadId>)(\S*?)(?:<\/UploadId>)/);console.log("uploadId",e),200===n.status||204===n.status?function(e){for(var t=[],n=1;n<=f;n++)t.push(R(e,n));h(e,t)}(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 h(n,i){i&&Array.isArray(i)&&0!==i.length&&Promise.all(i).then((function(){var i="uploadId=".concat(n);if(I.size===f)e.getFileToken(u,a,"POST",i).then((function(e){console.log("onSuccess",e),console.log("onSuccess:uploadId",n);var u=e.stcAuthorization,d=e.stcContentSha256,f=e.stcDate;r===_.MINIO&&(u=e.minioAuthorization,d=e.minioContentSha256,f=e.minioDate);var l=new XMLHttpRequest;l.open("POST","".concat(s,"?").concat(i),!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,t){return e-t}));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:t.name,filename:a,uploadMethod:r};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(R(n,m))}h(n,d)}}),(function(e){console.error(e),o.onError("uploadStcMultipart: chunkFiles upload failed and those will reupload");for(var t=[],r=0,i=v;r<i.length;r++){var a=i[r];t.push(R(n,a))}h(n,t)}))}function R(o,i){return new Promise((function(d,f){var l="partNumber=".concat(i,"&uploadId=").concat(o);e.getFileToken(u,a,"PUT",l).then((function(e){console.log("signature ".concat(i," onSuccess"),e);var o=t&&t.slice((i-1)*n.stc_chunk_size,i*n.stc_chunk_size);console.log("fileChunk:size",o.size);var a=e.stcAuthorization,u=e.stcContentSha256,g=e.stcDate;r===_.MINIO&&(a=e.minioAuthorization,u=e.minioContentSha256,g=e.minioDate);var h=new XMLHttpRequest;h.open("PUT","".concat(s,"?").concat(l),!0),h.setRequestHeader("Authorization",a),h.setRequestHeader("x-amz-content-sha256",u),h.setRequestHeader("x-amz-date",g),h.setRequestHeader("Content-Type",c),h.send(o),h.onreadystatechange=function(){if(4===h.readyState)if(200===h.status||204===h.status){var e=h.getResponseHeader("etag");console.log("etag:".concat(i),e),I.set(i,e),d(e)}else v.includes(i)||v.push(i),f(i)}}),(function(e){console.log("getETags: Signature verification failure"),v.includes(i)||v.push(i),f(i)}))}))}}var Hn={form:function(e,t){var n=new FormData;if(t.unique_key){var o=e.name.substr(e.name.lastIndexOf(".")),r=Fn()+o;n.append(t.unique_key,r),t.uniqueValue=r}return n.append(t.file_data_name,e),Zn(t.multi_parmas,(function(e,t){n.append(e,t)})),n},json:function(e,t){var n={};if(t.unique_key){var o=e.name.substr(e.name.lastIndexOf(".")),r=Fn()+o;n[t.unique_key]=r,t.uniqueValue=r}return n[t.file_data_name]=e,Zn(t.multi_parmas,(function(e,t){n[e]=t})),JSON.stringify(n)},data:function(e,t){return e}};function Fn(){var e=(new Date).getTime();return"xxxxxx4xxxyxxxxxxx".replace(/[xy]/g,(function(t){var n=(e+16*Math.random())%16|0;return e=Math.floor(e/16),("x"===t?n:3&n|8).toString(16)}))}function Zn(e,t){for(var n in e)t(n,e[n])}var qn,Jn=0,zn=function(){function e(e){this.options=function(e){var t={domain:"",method:"POST",file_data_name:"file",unique_key:"key",base64_size:4194304,chunk_size:4194304,bos_chunk_size:4294967296,stc_chunk_size:10485760,headers:{},multi_parmas:{},query:{},support_options:!0,data:Hn.form,genUId:Fn};if(!e||!e.domain)throw new Error("domain is null");for(var n in e)t[n]=e[n];return t}(e)}return e.prototype.setOptions=function(e){var t=this;Zn(e,(function(e,n){t.options[e]=n}))},e.prototype.upload=function(e,t,n,o){if(n){var r=this;!function(e,t,n,o,r){hn=n,Rn=o,Un=[];var i,a,s=e.getNaviInfoFromCache();if(1===(null==s?void 0:s.type)&&t.uploadDomain&&!o.ossConfig)Un=[["qiniu",t.uploadDomain]];else if(o.ossConfig){var c,u,d,f=JSON.parse(o.ossConfig),l="",g=[];f.forEach((function(e){var t=Number(e.p)-1;for(var n in e)"aliyun"===n&&(l=e[n]),"s3"===n&&(c=e[n]),"stc"===n&&(u=e[n]),"minio"===n&&(d=e[n]),"p"!==n&&(g[t]=[n,e[n]])})),g.forEach((function(e){e&&Un.push(e)})),f.length!==Un.length&&(Un=[["qiniu",o.domain],["baidu",o.uploadHost.bos],["aliyun",l],["s3",c],["stc",u],["minio",d]])}else Un=[["qiniu",o.domain],["baidu",o.uploadHost.bos]];if(o.ossConfig){var v=o&&JSON.parse(o.ossConfig);Array.isArray(v)||(v=[]),i=v.find((function(e){return Object.keys(e).includes("stc")})),a=v.find((function(e){return Object.keys(e).includes("minio")}))}if(i&&1===parseInt(i.p,10)&&n.size>=4194304)Vn(e,n,o,r,_.STC,i.stc);else if(a&&1===parseInt(a.p,10)&&n.size>=4194304)Vn(e,n,o,r,_.MINIO,a.minio);else{var I=o.data(n,o);Mn[Un[0][0]](I,o,r,n,_.MINIO)}}(e,t,n,this.options,{onProgress:function(e,t,n){(qn=e,n)?qn=Jn+e/t*(t-Jn):Jn=qn;o.onProgress(qn,t)},onCompleted:function(e){o.onCompleted(e)},onError:function(e){o.onError(e)},onOpen:function(e){r.xhr=e}})}else o.onError("upload file is null.")},e.prototype.cancel=function(){var e;null===(e=this.xhr)||void 0===e||e.abort()},e}();var Kn,Yn,jn={init:function(e){return new zn(e)},dataType:Hn,resize:function(e,t,n){var o=document.createElement("canvas"),r=new FileReader;r.readAsDataURL(e),r.onload=function(e){var r=e.target.result,i=new Image;i.src=r;var a=i.width,s=i.height,c=function(e,t){var n=1,o=e.width,r=t.maxWidth||0;r>0&&o>r&&(n=r/o);var i=e.height,a=t.maxHeight||0;if(a>0&&i>a){var s=a/i;n=Math.min(n,s)}var c=t.maxSize||0,u=Math.ceil(e.size/1e3);if(u>c){var d=c/u;n=Math.min(n,d)}return n}({width:a,height:s,size:e.total},t),u=r;c<1&&(u=function(e,t,n){o.width=t,o.height=n;var r=o.getContext("2d");return r.drawImage(e,0,0,t,n),o.toDataURL("image/jpg")}(i,a*c,s*c)),n(u)}},Upload:zn},Wn=function(e,t,n){var o=document.createElement("canvas"),r=o.getContext("2d"),i=new Image,a="string"==typeof e;i.onload=function(a){var s=function(e,t,n){var o,r,i,a=e<t,s=0,c=0;return(a?t/e:e/t)>n.scale?(a?(r=100,c=((i=t/(o=e/100))-n.maxHeight)/2):(i=100,s=((r=e/(o=t/100))-n.maxWidth)/2),{w:r,h:i,x:-s,y:-c}):(a?(o=t/n.maxHeight,i=n.maxHeight,r=e/o):(o=e/n.maxWidth,r=n.maxWidth,i=t/o),{w:r,h:i,x:-s,y:-c})}(i.width,i.height,t);o.width=s.w>t.maxWidth?t.maxWidth:s.w,o.height=s.h>t.maxHeight?t.maxHeight:s.h,r.drawImage(i,s.x,s.y,s.w,s.h);var c=o.toDataURL("string"==typeof e?"image/jpg":e.type,t.quality);c=c.replace(/data:image\/[^;]+;base64,/,""),n(c)},i.src=a?"data:image/jpg;base64,".concat(e):function(e){var t=window.URL||window.webkitURL;return t?t.createObjectURL(e):""}(e)},Xn=function(e,t){var n=e.file,o=e.compress;Wn(n,o,t)},Qn=function(e,t){if(e.getToken)e.getToken((function(n,o){o=o||{},e.multi_parmas=e.multi_parmas||{},e.multi_parmas.token=n,e.uploadHost=e.uploadHost||{},e.uploadHost.bos=o.bos,e.ossConfig=o.ossConfig,e.bosHeader=e.bosHeader||{},e.bosHeader.bosDate=o.bosDate,e.bosHeader.bosToken=o.bosToken,e.bosUploadPath=o.path,e.aliHeader={},e.aliHeader.osskeyId=o.osskeyId,e.aliHeader.ossPolicy=o.ossPolicy,e.aliHeader.ossSign=o.ossSign,e.ossBucketName=o.ossBucketName,e.uploadFileName=o.fileName,e.s3Header={},e.s3Header.s3Credential=o.s3Credential,e.s3Header.s3Algorithm=o.s3Algorithm,e.s3Header.s3Date=o.s3Date,e.s3Header.s3Policy=o.s3Policy,e.s3Header.s3Signature=o.s3Signature,e.s3BucketName=o.s3BucketName,e.stcHeader={},e.stcHeader.stcAuthorization=o.stcAuthorization,e.stcHeader.stcContentSha256=o.stcContentSha256,e.stcHeader.stcDate=o.stcDate,e.stcBucketName=o.stcBucketName,e.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(n));var r=jn.init(e);t(r)}));else{e.headers=e.headers||{},e.base64&&(e.headers["Content-type"]="application/octet-stream");var n=jn.init(e);t(n)}},$n=function(e,t,n,o,r){o.upload(e,t,n.file,{onError:function(e){r.onError(e)},onProgress:function(e,t){r.onProgress(e,t)},onCompleted:function(e){e.filename=e.filename||e.hash;var t=n.compressThumbnail||Xn;n.compress?t(n,(function(t){e.thumbnail=t,r.onCompleted(e)})):r.onCompleted(e)}})},eo=function(){function e(e){this.instance=e}return e.prototype.upload=function(e,t,n,o){$n(e,t,{file:n},this.instance,o)},e.prototype.cancel=function(){this.instance.cancel()},e}(),to=function(){function e(e,t){this.instance=e,this.cfg=t}return e.prototype.upload=function(e,t,n,o){var r={file:n,compress:this.cfg};$n(e,t,r,this.instance,o)},e.prototype.cancel=function(){this.instance.cancel()},e}(),no={initFile:function(e,t){Qn(e,(function(e){var n=new eo(e);t(n)}))},initImage:function(e,t){Qn(e,(function(n){var o,r,i,a,s={maxHeight:(null===(o=e.thumbnailConfig)||void 0===o?void 0:o.maxHeight)||160,maxWidth:(null===(r=e.thumbnailConfig)||void 0===r?void 0:r.maxWidth)||160,quality:(null===(i=e.thumbnailConfig)||void 0===i?void 0:i.quality)||.5,scale:(null===(a=e.thumbnailConfig)||void 0===a?void 0:a.scale)||2.4},c=new to(n,s);t(c)}))},dataType:jn.dataType};function oo(e,t,n,o,r,i,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(!Yn&&(Yn="upload.qiniup.com",u&&u.ossConfig))try{var d=JSON.parse(u.ossConfig).find((function(e){return void 0!==e.qiniu}));d&&(Yn=d.qiniu)}catch(e){}var f=L({domain:Yn,getToken:function(t){e.getFileToken(c,o.name).then((function(e){t(e.token,e)})).catch((function(e){r.onFail(e)}))}},i),l=no.initFile;c===y.IMAGE&&(l=no.initImage),l(f,(function(t){t.upload(e,n,o,{onProgress:function(e,t){var n,o=Math.floor(e/t*100);null===(n=r.onProgress)||void 0===n||n.call(r,o)},onCompleted:function(e){return B(s,void 0,void 0,(function(){return D(this,(function(t){return 1!==(null==u?void 0:u.type)||(null==u?void 0:u.ossConfig)?(function(e,t,n,o,r){so(t,o.filename,o.name,o,o.uploadMethod).then((function(i){if(0===i.code){var a=i.data;a.type=n.type,a.name=o.name||o.filename,e!==y.AUDIO?(t===y.IMAGE&&(a.thumbnail=o.thumbnail,a.width=o.w,a.height=o.h,a.size=o.size),r.onSuccess(a)):ro(n).then((function(e){r.onSuccess(L(L({},a),e))}))}else r.onFail(i)})).catch((function(e){r.onFail(e)}))}(a,c,o,e,r),[2]):(function(e,t,n,o,r,i){var a={type:o.type,name:r.rc_url.file_name,downloadUrl:e.uploadDomain+r.rc_url.path};if(t===y.AUDIO)return void ro(o).then((function(e){i.onSuccess(L(L({},a),e))}));t===y.IMAGE&&(a.thumbnail=r.thumbnail,a.width=r.w,a.height=r.h,a.size=r.size);i.onSuccess(a)}(n,a,0,o,e,r),[2])}))}))},onError:function(e){r.onFail(e)}})}))}function ro(e){return new Promise((function(t){if("function"!=typeof e.arrayBuffer){var n=new FileReader;n.onload=function(){n.result?io(n.result).then((function(e){t(e)}),(function(){t({})})):t({})},n.onerror=function(){t({duration:0})},n.readAsArrayBuffer(e)}else e.arrayBuffer().then(io).then((function(e){t(e)}))}))}function io(e){return Kn=Kn||new AudioContext,new Promise((function(t,n){Kn.decodeAudioData(e,(function(e){t({duration:e.duration,length:e.length})}),n)}))}function ao(e,t,n,o){return Ge((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:Qe[e]})}))}))}))}function so(e,t,n,o,i){return m("fileType",e,A,!0)&&m("filename",t,l.STRING)&&m("saveName",n,l.STRING)&&m("serverType",i,l.NUMBER)?Ge((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 co(e,t,n){return B(this,void 0,void 0,(function(){var o=this;return D(this,(function(s){return[2,Ge((function(s,c){return B(o,void 0,void 0,(function(){var o,u,d,f,g,v,I,R,E,S,p,T;return D(this,(function(O){switch(O.label){case 0:return n=n||{},t instanceof vn==!1?(c.warn(h.O,"send message fail -> message parameter is not an instance of BaseMessage"),[2,Xe.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==n?void 0:n.isStatusMessage,l.BOOLEAN)&&m("options.disableNotification",null==n?void 0:n.disableNotification,l.BOOLEAN)&&m("options.pushContent",null==n?void 0:n.pushContent,l.STRING)&&m("options.pushData",null==n?void 0:n.pushData,l.STRING)&&m("options.isMentioned",null==n?void 0:n.isMentioned,l.BOOLEAN)&&m("options.mentionedType",null==n?void 0:n.mentionedType,l.NUMBER)&&m("options.mentionedUserIdList",null==n?void 0:n.mentionedUserIdList,l.ARRAY)&&m("options.directionalUserIdList",null==n?void 0:n.directionalUserIdList,l.ARRAY)&&m("options.isVoipPush",null==n?void 0:n.isVoipPush,l.BOOLEAN)&&m("options.canIncludeExpansion",null==n?void 0:n.canIncludeExpansion,l.BOOLEAN)&&m("options.expansion",null==n?void 0:n.expansion,l.OBJECT)&&m("options.pushConfig",null==n?void 0:n.pushConfig,l.OBJECT)&&m("options.messageId",null==n?void 0:n.messageId,l.NUMBER)?(f="conversationType:".concat(o,",targetId:").concat(u),c.debug(h.O,"send message ->".concat(f)),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,f=e.isVoipPush,l=e.canIncludeExpansion,g=e.expansion,v=e.isFilerWhiteBlacklist,I=e.pushConfig,h=e.messageId,R=n.channelId;return L({isStatusMessage:o,disableNotification:r,pushContent:i,pushData:a,isMentioned:s,mentionedType:c,mentionedUserIdList:u,directionalUserIdList:d,isVoipPush:f,canIncludeExpansion:l,expansion:g,isFilerWhiteBlacklist:v,pushConfig:I,channelId:R||"",messageId:h},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:U.SEND,receivedTime:0,isStatusMessage:!!n.isStatusMessage,receivedStatus:i.UNREAD,isOffLineMessage:!1,pushConfig:null==n?void 0:n.pushConfig,sentStatus:P.SENDING},o!==a.ULTRA_GROUP&&(v.isOffLineMessage=!1),I=c.createTraceId(),R=function(e){v.messageId=e;try{(null==n?void 0:n.onSendBefore)&&n.onSendBefore(Ce(v))}catch(e){c.error(h.O,'Callback method "onSendBefore" execution error.\n'.concat(null==e?void 0:e.stack),I)}},c.info(h.A_SEND_MSG_T,JSON.stringify({messageType:t.messageType,conversationType:o,targetId:u,channelId:d}),I),[4,s.sendMessage(o,u,g,R,I)]):[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]):[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}];case 1:return E=O.sent(),S=E.code,p=E.data,S===r.SUCCESS?(c.info(h.A_SEND_MSG_R,JSON.stringify({code:S,messageUId:p.messageUId,messageId:p.messageId}),I),T=Ce(p),[2,{code:S,data:T}]):(c.warn(h.A_SEND_MSG_R,"send message fail ->".concat(S,":").concat(Qe[S],",").concat(f)),v.sentTime=(null==p?void 0:p.sentTime)||0,v.sentStatus=null==p?void 0:p.sentStatus,[2,{code:S,msg:Qe[S],data:Ce(v)}])}}))}))}))]}))}))}function uo(e,t,n){return co(e,new pn(t),n)}function fo(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,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:r.BIZ_ERROR_INVALID_PARAMETER});s.thumbnailConfig=c}return Ge((function(c,u,d){return new Promise((function(f){var l=u.createTraceId();u.info(h.L_MEDIA_UPLOAD_T,JSON.stringify({filesize:o.file.size,type:e}),l),oo(c,0,d,o.file,{onProgress:null==i?void 0:i.onProgress,onSuccess:function(e){var s,c=(null===(s=null==i?void 0:i.onComplete)||void 0===s?void 0:s.call(i,L({url:e.downloadUrl},e)))||t(e,o);e&&e.downloadUrl&&u.info(h.L_MEDIA_UPLOAD_R,JSON.stringify({downurl:e.downloadUrl,code:r.SUCCESS}),l),co(n,c,a).then(f)},onFail:function(e){u.warn(h.L_MEDIA_UPLOAD_R,JSON.stringify({code:r.UPLOAD_FILE_FAILED}),l),f({code:r.UPLOAD_FILE_FAILED,msg:e||r[r.UPLOAD_FILE_FAILED]})}},s,e)}))}))}}var lo=fo(y.FILE,(function(e,t){return new On({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})),go=fo(y.IMAGE,(function(e,t){return new mn({content:e.thumbnail,imageUri:e.downloadUrl,user:t.user,extra:t.extra})})),vo=fo(y.IMAGE,(function(e,t){return new Nn({gifDataSize:e.size,remoteUrl:e.downloadUrl,width:e.width,height:e.height,user:t.user,extra:t.extra})})),Io=fo(y.AUDIO,(function(e,t){return new En({remoteUrl:e.downloadUrl,duration:e.duration,type:e.type,user:t.user,extra:t.extra})})),ho=fo(y.SIGHT,(function(e,t){return new Sn({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 Ro(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return m("options.timestamp",null==t?void 0:t.timestamp,l.NUMBER)&&m("options.count",null==t?void 0:t.count,l.NUMBER)&&(M()||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,l.CONVERSATION,!0)?[2,Ge((function(o,i){return B(n,void 0,void 0,(function(){var n,a,s,c,u;return D(this,(function(d){switch(d.label){case 0:return n=i.createTraceId(),i.info(h.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 Ce(e)})),i.info(h.A_GET_HISTORY_MSG_R,JSON.stringify({code:s,messageLength:u.length}),n),[2,{code:s,data:{list:u,hasMore:c.hasMore}}]):(i.warn(h.A_GET_HISTORY_MSG_R,JSON.stringify({code:s,messageUIds:""}),n),[2,{code:s,msg:Qe[s]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function mo(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return m("options.timestamp",null==t?void 0:t.timestamp,l.NUMBER)&&m("options.count",null==t?void 0:t.count,l.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,l.CONVERSATION,!0)?[2,Ge((function(o,i){return B(n,void 0,void 0,(function(){var n,a,s,c,u;return D(this,(function(d){switch(d.label){case 0:return n="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),i.debug(h.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 Ce(e)})),[2,{code:s,data:{list:u,hasMore:c.hasMore}}]):(i.warn(h.O,"get history message fail ->".concat(s,":").concat(Qe[s],",").concat(n)),[2,{code:s,msg:Qe[s]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Eo(e,t,n,o){return B(this,void 0,void 0,(function(){var i=this;return D(this,(function(s){return m("targetId",e,l.STRING,!0)&&m("messageUId",t,l.STRING,!0)&&m("timestamp",n,l.NUMBER,!0)&&m("channelId",o,l.CHANNEL_ID)?[2,Ge((function(r){return B(i,void 0,void 0,(function(){var r,i,s,c,u;return D(this,(function(d){switch(d.label){case 0:return r={targetId:e,conversationType:a.PRIVATE,channelId:o},i=new vn("RC:ReadNtf",{messageUId:t,lastMessageSendTime:n,type:1}),[4,co(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 So(e,t,n){return B(this,void 0,void 0,(function(){var o=this;return D(this,(function(i){return m("messageUId",t,l.STRING,!0)&&m("targetId",e,l.STRING,!0)&&m("channelId",n,l.CHANNEL_ID)?[2,Ge((function(r,i){return B(o,void 0,void 0,(function(){var o,r,s,c,u;return D(this,(function(d){switch(d.label){case 0:return o="messageUId:".concat(t,",targetId:").concat(e),i.debug(h.O,"send read receipt message ->".concat(o)),r=new vn("RC:RRReqMsg",{messageUId:t}),[4,co({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 po(e,t,n){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 To(e,t,n){return B(this,void 0,void 0,(function(){var o=this;return D(this,(function(i){return m("targetId",e,l.STRING,!0)&&m("messageList",t,l.OBJECT,!0)&&m("channelId",n,l.CHANNEL_ID)&&!Object.keys(t).some((function(e){return!m(e,t[e],l.ARRAY)}))?[2,Ge((function(i,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: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(h.O,"Error in parameter messageList."),[2,{code:r.PARAMETER_ERROR}]));case 1:return c=g.sent(),[3,4];case 2:return f=new vn("RC:RRRspMsg",{receiptMessageDic:t}),[4,co(o,f)];case 3:c=g.sent(),g.label=4;case 4:return(l=c.code)===r.SUCCESS?[2,{code:l}]:(s.warn(h.O,"send read receipt message fail ->".concat(l,":").concat(Qe[l])),[2,{code:l,msg:Qe[l]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Oo(e,t){return B(this,void 0,void 0,(function(){var n,o,i,a;return D(this,(function(s){switch(s.label){case 0:return m("conversation",e,l.CONVERSATION,!0)&&m("lastMessageSendTime",t,l.NUMBER,!0)?(n=new vn("RC:SRSMsg",{lastMessageSendTime:t}),[4,co(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 No(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return m("conversation",e,l.CONVERSATION,!0)&&m("options.messageUId",t.messageUId,l.STRING,!0)&&m("options.sentTime",t.sentTime,l.NUMBER,!0)&&m("options.disableNotification",null==t?void 0:t.disableNotification,l.BOOLEAN)&&m("options.pushConfig",null==t?void 0:t.pushConfig,l.OBJECT)?[2,Ge((function(o,i){return B(n,void 0,void 0,(function(){var n,a,s,c,u;return D(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(h.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:Ce(u)}]:c===r.SUCCESS?[2,{code:c}]:(i.warn(h.O,"recall message fail ->".concat(c,":").concat(Qe[c],",").concat(a)),[2,{code:c,msg:Qe[c]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function _o(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return m("conversation",e,l.CONVERSATION,!0)&&m("options",t,(function(e){return g(e)&&e.length}),!0)&&!t.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,Ge((function(o,i){return B(n,void 0,void 0,(function(){var n,a;return D(this,(function(s){switch(s.label){case 0:return n="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),i.debug(h.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(h.O,"delete message fail ->".concat(a,":").concat(Qe[a],",").concat(n)),[2,{code:a,msg:Qe[a]}]):[2,{code:r.SUCCESS}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Co(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return m("conversation",e,l.CONVERSATION,!0)&&m("timestamp",t,l.NUMBER,!0)?[2,Ge((function(o,i){return B(n,void 0,void 0,(function(){var n,a;return D(this,(function(s){switch(s.label){case 0:return n="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),i.debug(h.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(h.O,"clear message ->".concat(a,":").concat(Qe[a],",").concat(n)),[2,{code:a,msg:Qe[a]}]):[2,{code:r.SUCCESS}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Ao(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return m("expansion",e,l.OBJECT,!0)&&m("message",t,l.OBJECT,!0)&&m("message.conversationType",t.conversationType,l.NUMBER,!0)&&m("message.targetId",t.targetId,l.STRING,!0)&&m("message.channelId",t.channelId,l.CHANNEL_ID)&&m("message.messageUId",t.messageUId,l.STRING,!0)&&m("message.expansion",t.expansion,l.OBJECT)&&m("message.canIncludeExpansion",t.canIncludeExpansion,l.BOOLEAN,!0)?[2,Ge((function(o,i){return B(n,void 0,void 0,(function(){var n,a,s,c,u,d,f,l;return D(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,f="conversationType:".concat(n,",targetId:").concat(a,",messageUId:").concat(s),i.debug(h.O,"update message expansion ->".concat(f)),[4,o.sendExpansionMessage({conversationType:n,targetId:a,messageUId:s,expansion:e,canIncludeExpansion:c,originExpansion:u,channelId:d})];case 1:return(l=g.sent().code)!==r.SUCCESS?(i.warn(h.O,"update message expansion fail ->".concat(l,":").concat(Qe[l],",").concat(f)),[2,{code:l,msg:Qe[l]}]):[2,{code:l}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function yo(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return m("keys",e,l.ARRAY,!0)&&m("message",t,l.OBJECT,!0)&&m("message.conversationType",t.conversationType,l.NUMBER,!0)&&m("message.targetId",t.targetId,l.STRING,!0)&&m("message.channelId",t.channelId,l.CHANNEL_ID)&&m("message.messageUId",t.messageUId,l.STRING,!0)&&m("message.canIncludeExpansion",t.canIncludeExpansion,l.BOOLEAN,!0)?[2,Ge((function(o,i){return B(n,void 0,void 0,(function(){var n,a,s,c,u,d,f;return D(this,(function(l){switch(l.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(h.O,"remove message expansion ->".concat(d)),[4,o.sendExpansionMessage({conversationType:n,targetId:a,messageUId:s,canIncludeExpansion:c,keys:e,channelId:u})];case 1:return(f=l.sent().code)!==r.SUCCESS?(i.warn(h.O,"remove message expansion fail ->".concat(f,":").concat(Qe[f],",").concat(d)),[2,{code:f,msg:Qe[f]}]):[2,{code:f}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Mo(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return m("conversation",e,l.CONVERSATION,!0)&&m("typingContentType",t,l.STRING,!0)?[2,Ge((function(o,i){return B(n,void 0,void 0,(function(){var n,a,s,c,u,d;return D(this,(function(f){switch(f.label){case 0:return n={messageType:"RC:TypSts",content:{typingContentType:t},isStatusMessage:!0,channelId:e.channelId},a=i.createTraceId(),i.info(h.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=f.sent(),c=s.code,u=s.data,d=c===r.SUCCESS?"info":"warn",i[d](h.A_SEND_MSG_R,JSON.stringify({code:c,messageUId:u?u.messageUId:"",messageId:u?u.messageId:""}),a),c===r.SUCCESS?[2,{code:c,data:Ce(u)}]:[2,{code:c,msg:Qe[c]}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Uo(e,t,n){return B(this,void 0,void 0,(function(){var o=this;return D(this,(function(i){return m("messageUId",t,l.STRING,!0)&&m("targetId",e,l.STRING,!0)&&m("channelId",n,l.CHANNEL_ID)?[2,Ge((function(i,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(t,",targetId:").concat(e),a.debug(h.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(h.O,"get message reader fail ->".concat(c,":").concat(Qe[c],",").concat(o)),[2,{code:c,msg:Qe[c]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Po(e,t,n,o,r){return be((function(i,a){return f("messageType",e,l.STRING,!0),f("isPersited",t,l.BOOLEAN,!0),f("isCounted",n,l.BOOLEAN,!0),f("isStatusMessage",r,l.BOOLEAN,!1),f("searchProps",o,l.ARRAY),a.info(h.A_REGTYP_O,JSON.stringify({messageType:e,isCounted:n,isStatusMessage:r,isPersited:t})),i.registerMessageType(e,t,n,o,r),In(e,t,n)}))}function wo(e){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(n){return M()?m("conversation",e,l.CONVERSATION,!0)?[2,Ge((function(n,o){return B(t,void 0,void 0,(function(){var t,i,a,s;return D(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&&Ce(a)||null,[2,{code:i,data:s}]):(o.warn(h.O,"insertMessage ->code:".concat(i,",targetId:").concat(e.targetId)),[2,{code:i,msg:Qe[i]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:Qe[r.NOT_SUPPORT]}]}))}))}function Lo(e,t,n){return void 0===n&&(n={}),B(this,void 0,void 0,(function(){var o=this;return D(this,(function(i){return ye("RongIMLib.insertMessage","RongIMLib.ElectronExtension.insertMessage"),M()?m("conversation",e,l.CONVERSATION,!0)&&m("message",t,l.OBJECT,!0)&&m("options",n,l.OBJECT)&&m("options.isUnread",null==n?void 0:n.isUnread,l.BOOLEAN)&&m("options.searchContent",null==n?void 0:n.searchContent,l.STRING)&&m("content.senderUserId",t.senderUserId,l.STRING,!0)&&m("content.messageType",t.messageType,l.STRING,!0)&&m("content.content",t.content,l.OBJECT,!0)&&m("content.messageDirection",t.messageDirection,l.NUMBER,!0)&&m("content.canIncludeExpansion",t.canIncludeExpansion,l.BOOLEAN)&&m("content.expansion",t.expansion,l.OBJECT)&&m("content.disableNotification",t.disableNotification,l.BOOLEAN)&&m("content.sentTime",t.sentTime,l.NUMBER)&&m("content.sentStatus",t.sentStatus,l.NUMBER)?[2,Ge((function(i,a){return B(o,void 0,void 0,(function(){var o,s,c,u,d,f,l,g,v,I,R,m,E,S,p,T;return D(this,(function(O){switch(O.label){case 0:return o=t.senderUserId,s=t.messageType,c=t.content,u=t.messageDirection,d=t.messageUId,f=t.canIncludeExpansion,l=t.expansion,g=t.disableNotification,v=t.sentTime,I=t.sentStatus,a.info(h.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:I,searchContent:m,isUnread:R,messageUId:d,disableNotification:g,canIncludeExpansion:f,expansionMsg:JSON.stringify(l),channelId:e.channelId||""},[4,i.insertMessage(e.conversationType,e.targetId,E)];case 1:return S=O.sent(),p=S.code,T=S.data,p===r.SUCCESS?[2,{code:p,data:Ce(T)}]:(a.warn(h.O,"insertMessage ->code:".concat(p,",targetId:").concat(e.targetId)),[2,{code:p,msg:Qe[p]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:Qe[r.NOT_SUPPORT]}]}))}))}function Bo(e){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(n){return M()?m("messageId",e,(function(e){return s(e)||N(e)}),!0)?[2,Ge((function(n,o){return B(t,void 0,void 0,(function(){var t,i,a;return D(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:Ce(a)}]:(o.warn(h.O,"getMessage ->code:".concat(i,",messageId:").concat(e)),[2,{code:i,msg:Qe[i]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:Qe[r.NOT_SUPPORT]}]}))}))}function Do(e){if(!M())return{code:r.NOT_SUPPORT,msg:Qe[r.NOT_SUPPORT]};var t,n=e.conversationType,o=e.targetId,i=e.channelId;return m("conversation",e,l.CONVERSATION,!0)?(t=function(e){var t=e.getUnreadMentionedMessages(n,o,i),a=[];return t&&t.length&&t.forEach((function(e){return a.push(Ce(e))})),{code:r.SUCCESS,data:a}},we?t(we,Be,Le):{code:r.BIZ_ERROR_CLIENT_NOT_INIT}):{code:r.BIZ_ERROR_INVALID_PARAMETER}}function bo(e,t,n,o){return B(this,void 0,void 0,(function(){var i=this;return D(this,(function(a){return ye("RongIMLib.searchMessages","RongIMLib.ElectronExtension.searchMessages"),M()?m("conversation",e,l.CONVERSATION,!0)&&m("keyword",t,l.STRING,!0)&&m("timestamp",n,l.NUMBER)&&m("count",o,l.NUMBER)?[2,Ge((function(a,s){return B(i,void 0,void 0,(function(){var i,c,u,d;return D(this,(function(f){switch(f.label){case 0:return 1,[4,a.searchMessageByContent(e.conversationType,e.targetId,t,n,o,1,e.channelId)];case 1:return i=f.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(Ce(e))})),[2,{code:c,data:{messages:d,count:null==u?void 0:u.count}}]):(s.warn(h.O,"searchMessages ->code:".concat(c,",targetId:").concat(e.targetId)),[2,{code:c,msg:Qe[c]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:Qe[r.NOT_SUPPORT]}]}))}))}function Go(e,t,n){return B(this,void 0,void 0,(function(){var o,i,a,s=this;return D(this,(function(c){return ye("RongIMLib.deleteLocalMessagesByTimestamp","RongIMLib.ElectronExtension.deleteMessagesByTimestamp"),M()?(o=e.conversationType,i=e.targetId,a=e.channelId,m("conversationType",o,l.NUMBER,!0)&&m("targetId",i,l.STRING,!0)&&m("timestamp",t,l.NUMBER,!0)&&m("cleanSpace",n,l.BOOLEAN)?[2,Ge((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,i,t,n,a)];case 1:return s=d.sent(),u.debug(h.A_DELETE_MESSAGES_S,JSON.stringify({code:s,conversationType:o,targetId:i,channelId:a,timestamp:t})),s===r.SUCCESS?[2,{code:s}]:(u.warn(h.O,"deleteLocalMessagesByTimestamp ->code:".concat(s,",targetId:").concat(e.targetId)),[2,{code:s,msg:Qe[s]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]):[2,{code:r.NOT_SUPPORT,msg:Qe[r.NOT_SUPPORT]}]}))}))}function ko(e){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(n){return ye("RongIMLib.clearMessages","RongIMLib.ElectronExtension.clearMessages"),M()?[2,Ge((function(n,o){return B(t,void 0,void 0,(function(){var t,i,a,s;return D(this,(function(c){switch(c.label){case 0:return t=e.conversationType,i=e.targetId,a=e.channelId,o.info(h.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(h.O,"clearMessages ->code:".concat(s,",targetId:").concat(i)),[2,{code:s,msg:Qe[s]}])}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:Qe[r.NOT_SUPPORT]}]}))}))}function xo(e,t,n,o){return B(this,void 0,void 0,(function(){var i=this;return D(this,(function(a){return ye("RongIMLib.searchConversationByContent","RongIMLib.ElectronExtension.searchConversationByContent"),M()?[2,Ge((function(a,s){return B(i,void 0,void 0,(function(){var i,c,u;return D(this,(function(d){switch(d.label){case 0:return s.info(h.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(h.O,"searchConversationByContent ->code:".concat(c,",keyword:").concat(e)),[2,{code:c,msg:Qe[c]}])}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:Qe[r.NOT_SUPPORT]}]}))}))}function Vo(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return M()?m("conversation",e,l.CONVERSATION,!0)&&m("timestamp",t,l.NUMBER)?[2,Ge((function(o,i){return B(n,void 0,void 0,(function(){var n,a,s,c;return D(this,(function(u){switch(u.label){case 0:return n=e.conversationType,a=e.targetId,s=e.channelId,i.info(h.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(h.O,"clearUnreadCountByTimestamp ->code:".concat(c,",targetId:").concat(a)),[2,{code:c,msg:Qe[c]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:Qe[r.NOT_SUPPORT]}]}))}))}function Ho(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return ye("RongIMLib.setMessageReceivedStatus","RongIMLib.ElectronExtension.setMessageReceivedStatus"),M()?m("messageId",e,l.NUMBER,!0)&&m("receivedStatus",t,l.NUMBER,!0)?[2,Ge((function(o,i){return B(n,void 0,void 0,(function(){var n;return D(this,(function(a){switch(a.label){case 0:return i.info(h.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(h.O,"setMessageReceivedStatus ->code:".concat(n,",messageId:").concat(e)),[2,{code:n,msg:Qe[n]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:Qe[r.NOT_SUPPORT]}]}))}))}function Fo(e){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(n){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,Ge((function(n,o){return B(t,void 0,void 0,(function(){var t;return D(this,(function(i){switch(i.label){case 0:return o.info(h.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(h.O,"createTag ->code:".concat(t,",tagId:").concat(e.tagId)),[2,{code:t,msg:Qe[t]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Zo(e){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(n){return m("tagId",e,l.STRING,!0)?[2,Ge((function(n,o){return B(t,void 0,void 0,(function(){var t;return D(this,(function(i){switch(i.label){case 0:return o.info(h.O,"removeTag ->tagId:".concat(e)),[4,n.removeTag(e)];case 1:return(t=i.sent().code)===r.SUCCESS?[2,{code:t}]:(o.warn(h.O,"removeTag ->code:".concat(t,",tagId:").concat(e)),[2,{code:t,msg:Qe[t]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function qo(e){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(n){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,Ge((function(n,o){return B(t,void 0,void 0,(function(){var t;return D(this,(function(i){switch(i.label){case 0:return o.info(h.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(h.O,"updateTag ->code:".concat(t,",tagId:").concat(e.tagId)),[2,{code:t,msg:Qe[t]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Jo(){return B(this,void 0,void 0,(function(){var e=this;return D(this,(function(t){return[2,Ge((function(t,n){return B(e,void 0,void 0,(function(){var e,o,i;return D(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(h.O,"getTagList ->code:".concat(o)),[2,{code:r.SUCCESS,data:i}]}}))}))}))]}))}))}function zo(e){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(n){return m("conversation",e,l.CONVERSATION,!0)?[2,Ge((function(n,o){return B(t,void 0,void 0,(function(){var t,i,a;return D(this,(function(s){switch(s.label){case 0:return o.info(h.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:Qe[i]}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Ko(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return m("tagId",e,l.STRING,!0)&&m("conversations",t,l.ARRAY,!0)&&!t.some((function(e){return!m("conversation",e,l.CONVERSATION,!0)}))?[2,Ge((function(o,i){return B(n,void 0,void 0,(function(){var n;return D(this,(function(a){switch(a.label){case 0:return i.info(h.O,"addTagForConversations ->tagId:".concat(e)),[4,o.addTagForConversations(e,t)];case 1:return(n=a.sent().code)===r.SUCCESS?[2,{code:n}]:(i.warn(h.O,"addTagForConversations ->code:".concat(n,",tagId:").concat(e)),[2,{code:n,msg:Qe[n]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Yo(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return m("tagId",e,l.STRING,!0)&&m("conversations",t,l.ARRAY,!0)&&!t.some((function(e){return!m("conversation",e,l.CONVERSATION,!0)}))?[2,Ge((function(o,i){return B(n,void 0,void 0,(function(){var n;return D(this,(function(a){switch(a.label){case 0:return i.info(h.O,"removeTagForConversations ->tagId:".concat(e)),[4,o.removeTagForConversations(e,t)];case 1:return(n=a.sent().code)===r.SUCCESS?[2,{code:n}]:(i.warn(h.O,"removeTagForConversations ->code:".concat(n,",tagId:").concat(e)),[2,{code:n,msg:Qe[n]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function jo(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return m("conversation",e,l.CONVERSATION,!0)&&m("tagIds",t,l.ARRAY,!0)&&!t.some((function(e){return!m("tagId",e,l.STRING,!0)}))?[2,Ge((function(o,i){return B(n,void 0,void 0,(function(){var n;return D(this,(function(a){switch(a.label){case 0:return i.info(h.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(h.O,"removeTagsForConversation ->code:".concat(n,",tagIds:").concat(t)),[2,{code:n,msg:Qe[n]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Wo(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return m("tagId",e,l.STRING,!0)&&m("conversations",t,l.ARRAY,!0)&&!t.some((function(e){return!m("conversation",e,l.CONVERSATION,!0)}))?[2,Ge((function(o,i){return B(n,void 0,void 0,(function(){var n;return D(this,(function(a){switch(a.label){case 0:return i.info(h.O,"removeTagForConversations ->tagId:".concat(e)),[4,o.removeTagForConversations(e,t)];case 1:return(n=a.sent().code)===r.SUCCESS?[2,{code:n}]:(i.warn(h.O,"removeTagForConversations ->code:".concat(n,",tagId:").concat(e)),[2,{code:n,msg:Qe[n]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Xo(e,t,n){return B(this,void 0,void 0,(function(){var o=this;return D(this,(function(i){return m("tagId",e,l.STRING,!0)&&m("count",t,l.NUMBER,!0)&&m("startTime",n,l.NUMBER,!0)?[2,Ge((function(i,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(h.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 L(L({},Ae(e)),{isTopInTag:e.isTopInTag})}(e)}))}]:(a.warn(h.O,"getConversationListByTag ->code:".concat(s,",tagId:").concat(e)),[2,{code:s,msg:Qe[s]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Qo(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return m("tagId",e,l.STRING,!0)&&m("containMuted",t,l.BOOLEAN,!0)?[2,Ge((function(o,r){return B(n,void 0,void 0,(function(){var n,i,a;return D(this,(function(s){switch(s.label){case 0:return r.info(h.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 $o(e,t,n){return B(this,void 0,void 0,(function(){var o=this;return D(this,(function(i){return m("tagId",e,l.STRING,!0)&&m("conversation",t,l.CONVERSATION,!0)&&m("status.isTop",n,l.BOOLEAN,!0)?[2,Ge((function(i,a){return B(o,void 0,void 0,(function(){var o;return D(this,(function(s){switch(s.label){case 0:return a.info(h.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(h.O,"setConversationStatusInTag ->code:".concat(o,",tagId:").concat(e)),[2,{code:o,msg:Qe[o]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}fo(y.COMBINE_HTML,(function(e,t){return new Tn({remoteUrl:e.downloadUrl,nameList:t.nameList,summaryList:t.summaryList,conversationType:t.conversationType,user:t.user,extra:t.extra})}));var er={COMET:"comet",WEBSOCKET:"websocket"},tr={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 nr=Object.freeze({__proto__:null,getAllConversationList:function(e){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(n){return M()?m("channelId",e,l.CHANNEL_ID)?[2,Ge((function(n,o){return B(t,void 0,void 0,(function(){var t,i,a,s;return D(this,(function(c){switch(c.label){case 0:return o.info(h.O,"getAllConversationList -> channelId: ".concat(e)),w(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 Ae(e)})),[2,{code:i,data:s}]):(o.warn(h.O,"getAllConversationList fail -> code: ".concat(i," channelId: ").concat(e)),[2,{code:i,msg:Qe[i]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:Qe[r.NOT_SUPPORT]}]}))}))},getConversationList:function(e,t,n){return B(this,void 0,void 0,(function(){var o=this;return D(this,(function(i){return M()?m("startTime",e,l.NUMBER,!0)&&m("count",t,l.NUMBER,!0)&&m("channelId",n,l.CHANNEL_ID)?[2,Ge((function(i,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(t,", channelId: ").concat(n),a.info(h.O,"getConversationList -> ".concat(o)),w(n)?[4,i.getConversationListWithAllChannelByPage(e,t)]:[3,2];case 1:return s=l.sent(),[3,4];case 2:return c=[1,2,3,5,6,7,8],[4,i.getConversationsByPage(c,e,t,n)];case 3:s=l.sent(),l.label=4;case 4:return u=s.code,d=s.data,u===r.SUCCESS&&d?(f=d.map((function(e){return Ae(e)})),[2,{code:u,data:f}]):(a.warn(h.O,"getConversationList fail -> code: ".concat(u," ").concat(o)),[2,{code:u,msg:Qe[u]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:Qe[r.NOT_SUPPORT]}]}))}))},searchConversationByContent:function e(t,n,o){return B(this,void 0,void 0,(function(){var i=this;return D(this,(function(a){return M()?m("keyword",t,l.STRING,!0)&&m("messageTypes",n,l.ARRAY,!0)&&m("channelId",o,l.CHANNEL_ID)&&!n.some((function(e){return!m("messageType",e,l.STRING,!0)}))?[2,Ge((function(a,s){return B(i,void 0,void 0,(function(){var i,c,u,d,f;return D(this,(function(l){switch(l.label){case 0:return i="keyword: ".concat(t,", messageTypes: ").concat(JSON.stringify(n),", channelId: ").concat(o),s.info(h.O,"searchConversationByContent -> ".concat(e)),w(o)?[4,a.searchConversationByContentWithAllChannel(t,n)]:[3,2];case 1:return c=l.sent(),[3,4];case 2:return[4,a.searchConversationByContent(t,n,o)];case 3:c=l.sent(),l.label=4;case 4:return u=c.code,d=c.data,u===r.SUCCESS&&d?(f=d.map((function(e){return Ae(e)})),[2,{code:u,data:f}]):(s.warn(h.O,"searchConversationByContent fail -> code: ".concat(u," ").concat(i)),[2,{code:u,msg:Qe[u]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:Qe[r.NOT_SUPPORT]}]}))}))},searchMessages:function(e,t,n,o){return B(this,void 0,void 0,(function(){var i=this;return D(this,(function(a){return M()?m("conversation",e,l.CONVERSATION,!0)&&m("keyword",t,l.STRING,!0)&&m("startTime",n,l.NUMBER,!0)&&m("count",o,l.NUMBER,!0)?[2,Ge((function(a,s){return B(i,void 0,void 0,(function(){var i,c,u,d,f,l,g,v,I,R;return D(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(h.O,"searchMessages -> ".concat(i)),c=e.targetId,u=e.conversationType,d=e.channelId,w(d)?[4,a.searchMessageByContentWithAllChannel(u,c,t,n,o)]:[3,2];case 1:return f=m.sent(),[3,4];case 2:return 0,[4,a.searchMessageByContent(u,c,t,n,o,0,d)];case 3:f=m.sent(),m.label=4;case 4:return l=f.code,g=f.data,l===r.SUCCESS&&g?(v=g.messages,I=g.count,R=v.map((function(e){return Ce(e)})),[2,{code:l,data:{messages:R,count:I}}]):(s.warn(h.O,"searchMessages fail -> code: ".concat(l," ").concat(i)),[2,{code:l,msg:Qe[l]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:Qe[r.NOT_SUPPORT]}]}))}))},searchMessageInTimeRange:function(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return M()?m("conversation",e,l.CONVERSATION,!0)&&m("option",t,l.OBJECT,!0)&&m("option.keyword",t.keyword,l.STRING,!0)&&m("option.startTime",t.startTime,l.NUMBER,!0)&&m("option.endTime",t.endTime,l.NUMBER,!0)&&m("option.offset",t.offset,l.NUMBER)&&m("option.limit",t.limit,l.NUMBER)?[2,Ge((function(o,i){return B(n,void 0,void 0,(function(){var n,a,s,c,u,d,f,l,g,v,I;return D(this,(function(R){switch(R.label){case 0:return n="conversation: ".concat(JSON.stringify(e),", option: ").concat(JSON.stringify(t)),i.info(h.O,"searchMessageInTimeRange -> ".concat(n)),a=e.conversationType,s=e.targetId,c=t.keyword,u=t.startTime,d=t.endTime,f=t.offset,l=t.limit,f=f||0,l=l||5,[4,o.searchMessageByContentInTimeRangeWithAllChannel(a,s,c,u,d,f,l)];case 1:return g=R.sent(),v=g.code,I=g.data,v===r.SUCCESS&&I?[2,{code:v,data:{messages:I.messages.map((function(e){return Ce(e)}))}}]:(i.warn(h.O,"searchMessageInTimeRange fail -> code: ".concat(v,", ").concat(n)),[2,{code:v}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:Qe[r.NOT_SUPPORT]}]}))}))},getHistoryMessagesByMessageTypes:function(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return M()?m("conversation",e,l.CONVERSATION,!0)&&m("option",t,l.OBJECT,!0)&&m("option.count",t.count,l.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,l.NUMBER)&&m("option.order",t.order,(function(e){return[0,1].includes(e)}))&&m("option.messageTypes",t.messageTypes,l.ARRAY,!0)&&!t.messageTypes.some((function(e){return!m("option.messageType",e,l.STRING,!0)}))?[2,Ge((function(o,i){return B(n,void 0,void 0,(function(){var n,a,s,c,u,d,f,l,g,v,I,R,m,E,S;return D(this,(function(p){switch(p.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(h.O,"getHistoryMessagesByMessageTypes -> ".concat(u)),d=e.conversationType,f=e.targetId,l=e.channelId,n||(n=20),a||(a=0),s||(s=0),l||(l=""),[4,o.getHistoryMessagesByObjectNames(d,f,a,n,c,s,l)];case 1:return g=p.sent(),v=g.code,I=g.data,v===r.SUCCESS?(m=(R=I).list,E=R.hasMore,S=m.map((function(e){return Ce(e)})),[2,{code:v,data:{messages:S,hasMore:E,list:S}}]):(i.warn(h.O,"getHistoryMessagesByMessageTypes fail -> code: ".concat(v," ").concat(u)),[2,{code:v,msg:Qe[v]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:Qe[r.NOT_SUPPORT]}]}))}))},setMessageStatusToRead:function(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return M()?m("conversation",e,l.CONVERSATION,!0)&&m("timestamp",t,l.NUMBER,!0)?[2,Ge((function(o,r){return B(n,void 0,void 0,(function(){var n,i,a,s;return D(this,(function(c){switch(c.label){case 0:return n="conversation: ".concat(JSON.stringify(e),", timestamp: ").concat(t),r.info(h.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:Qe[r.NOT_SUPPORT]}]}))}))},setMessageReceivedStatus:function(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return M()?m("messageId",e,l.NUMBER,!0)&&m("receivedStatus",t,(function(e){return!w(i[e])}),!0)?[2,Ge((function(o,r){return B(n,void 0,void 0,(function(){return D(this,(function(n){switch(n.label){case 0:return r.info(h.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:Qe[r.NOT_SUPPORT]}]}))}))},setMessageSentStatus:function(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return M()?m("messageId",e,l.NUMBER,!0)&&m("sentStatus",t,(function(e){return!w(P[e])}),!0)?[2,Ge((function(o,r){return B(n,void 0,void 0,(function(){return D(this,(function(n){switch(n.label){case 0:return r.info(h.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:Qe[r.NOT_SUPPORT]}]}))}))},setMessageContent:function(e,t,n){return void 0===n&&(n=""),B(this,void 0,void 0,(function(){var o=this;return D(this,(function(i){return M()?m("messageId",e,l.NUMBER,!0)&&m("content",t,l.OBJECT,!0)&&m("messageType",n,l.ONLY_STRING,!0)?[2,Ge((function(r,i){return B(o,void 0,void 0,(function(){return D(this,(function(o){switch(o.label){case 0:return i.info(h.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:Qe[r.NOT_SUPPORT]}]}))}))},deleteMessages:function(e){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(n){return M()?!m("messageIds",e,l.ARRAY,!0)||e.some((function(e){return!m("messageId",e,l.NUMBER,!0)}))?[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,Ge((function(n,o){return B(t,void 0,void 0,(function(){return D(this,(function(t){switch(t.label){case 0:return o.info(h.O,"deleteMessages ->messageIds: ".concat(JSON.stringify(e))),[4,n.deleteMessages(e)];case 1:return[2,{code:t.sent()}]}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:Qe[r.NOT_SUPPORT]}]}))}))},clearMessages:function(e){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(n){return M()?[2,Ge((function(n,o){return B(t,void 0,void 0,(function(){var t,r,i;return D(this,(function(a){switch(a.label){case 0:return t=e.conversationType,r=e.targetId,i=e.channelId,o.info(h.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:Qe[r.NOT_SUPPORT]}]}))}))},deleteMessagesByTimestamp:function(e,t,n){return B(this,void 0,void 0,(function(){var o,i,a,s=this;return D(this,(function(c){return M()?(o=e.conversationType,i=e.targetId,a=e.channelId,m("conversationType",o,l.NUMBER,!0)&&m("targetId",i,l.STRING,!0)&&m("timestamp",t,l.NUMBER,!0)&&m("cleanSpace",n,l.BOOLEAN)?[2,Ge((function(e,r){return B(s,void 0,void 0,(function(){return D(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:Qe[r.NOT_SUPPORT]}]}))}))},insertMessage:function(e,t,n){return void 0===n&&(n={}),B(this,void 0,void 0,(function(){var o=this;return D(this,(function(i){return M()?m("conversation",e,l.CONVERSATION,!0)&&m("message",t,l.OBJECT,!0)&&m("options",n,l.OBJECT)&&m("options.isUnread",null==n?void 0:n.isUnread,l.BOOLEAN)&&m("options.searchContent",null==n?void 0:n.searchContent,l.STRING)&&(t instanceof vn||m("message.senderUserId",t.senderUserId,l.STRING,!0)&&m("message.messageType",t.messageType,l.STRING,!0)&&m("message.content",t.content,l.OBJECT,!0)&&m("message.messageDirection",t.messageDirection,l.NUMBER,!0)&&m("message.canIncludeExpansion",t.canIncludeExpansion,l.BOOLEAN)&&m("message.expansion",t.expansion,l.OBJECT)&&m("message.disableNotification",t.disableNotification,l.BOOLEAN)&&m("message.sentTime",t.sentTime,l.NUMBER)&&m("message.sentStatus",t.sentStatus,l.NUMBER))?[2,Ge((function(i,a){return B(o,void 0,void 0,(function(){var o,s,c,u,d,f,l,g,v,I,R,m,E,S,p;return D(this,(function(T){switch(T.label){case 0:return o="",s=1,f=!1,g=t.messageType,v=t.content,t instanceof vn||(o=t.senderUserId,s=t.messageDirection,f=t.canIncludeExpansion,l=t.expansion,d=t.disableNotification,c=t.sentTime,u=t.sentStatus),a.info(h.O,"insertMessage ->targetId:".concat(e.targetId,",conversationType:").concat(e.conversationType)),I=n.isUnread,R=n.searchContent,m={senderUserId:o,messageType:g,content:v,messageDirection:s,sentTime:c,sentStatus:u,searchContent:R,isUnread:I,messageUId:"",disableNotification:d,canIncludeExpansion:f,expansionMsg:JSON.stringify(l),channelId:e.channelId||""},[4,i.insertMessage(e.conversationType,e.targetId,m)];case 1:return E=T.sent(),S=E.code,p=E.data,S===r.SUCCESS?[2,{code:S,data:Ce(p)}]:(a.warn(h.O,"insertMessage ->code:".concat(S,",targetId:").concat(e.targetId)),[2,{code:S,msg:Qe[S]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:Qe[r.NOT_SUPPORT]}]}))}))},batchInsertMessage:function(e,t){var n,o;return B(this,void 0,void 0,(function(){var i,s=this;return D(this,(function(c){if(!M())return[2,{code:r.NOT_SUPPORT,msg:Qe[r.NOT_SUPPORT]}];if(!m("messages",e,(function(e){return g(e)&&!(e.length<=0||e.length>=500)}),!0)||!m("checkDuplicate",t,l.BOOLEAN))return[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}];for(i in e)if(!(m("message",e[i],l.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,l.STRING,!0)&&m("message.senderUserId",e[i].senderUserId,l.STRING,!0)&&m("message.messageType",e[i].messageType,l.STRING,!0)&&m("message.content",e[i].content,l.OBJECT,!0)&&m("message.messageDirection",e[i].messageDirection,l.NUMBER,!0)&&m("message.canIncludeExpansion",e[i].canIncludeExpansion,l.BOOLEAN)&&m("message.expansion",e[i].expansion,l.OBJECT)&&m("message.disableNotification",e[i].disableNotification,l.BOOLEAN)&&m("message.sentTime",e[i].sentTime,l.NUMBER)&&m("message.sentStatus",e[i].sentStatus,l.NUMBER)&&m("options.isUnread",null===(n=e[i])||void 0===n?void 0:n.isUnread,l.BOOLEAN)&&m("options.searchContent",null===(o=e[i])||void 0===o?void 0:o.searchContent,l.STRING)))return[2,{code:r.BIZ_ERROR_INVALID_PARAMETER,msg:String(i)}];return[2,Ge((function(n){return B(s,void 0,void 0,(function(){var o,i,a;return D(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:Qe[i]}]}}))}))}))]}))}))},getMessageCount:function(e){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(n){return M()?[2,Ge((function(n){return B(t,void 0,void 0,(function(){var t,o,r,i,a,s;return D(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:Qe[r.NOT_SUPPORT]}]}))}))},getPrivateMessageDeliverTime:function(e){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(n){return M()?m("messageUId",e,l.STRING,!0)?[2,Ge((function(n,o){return B(t,void 0,void 0,(function(){var t,i,a;return D(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(h.A_GET_PRIVATE_MESSAGE_DELIVER_TIME_E,"code:".concat(i,",messageUId:").concat(e)),[2,{code:i,msg:Qe[i]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:Qe[r.NOT_SUPPORT]}]}))}))},getGroupMessageDeliverList:function(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return M()?m("targetId",e,l.STRING,!0)&&m("messageUId",t,l.STRING,!0)?[2,Ge((function(o,i){return B(n,void 0,void 0,(function(){var n,a,s;return D(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(h.A_GET_GROUP_MESSAGE_DELIVER_LIST_E,"code:".concat(a,", targetId:").concat(e," messageUId:").concat(t)),[2,{code:a,msg:Qe[a]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:Qe[r.NOT_SUPPORT]}]}))}))},setCheckDuplicateMessage:function(e){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(n){return M()?m("enableCheck",e,l.BOOLEAN)?[2,Ge((function(n){return B(t,void 0,void 0,(function(){return D(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:Qe[r.NOT_SUPPORT]}]}))}))},clearLocalData:function(){return B(this,void 0,void 0,(function(){var e=this;return D(this,(function(t){return M()?[2,Ge((function(t,n){return B(e,void 0,void 0,(function(){var e,o,r;return D(this,(function(i){switch(i.label){case 0:return n.info(h.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:Qe[r.NOT_SUPPORT]}]}))}))}}),or=function(e,t,n){this.type=e,this.userIdList=t,this.mentionedContent=n};function rr(e){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(n){return!e||m("proxy.socksHost",e.socksHost,l.STRING,!0)&&m("proxy.socksPort",e.socksPort,l.NUMBER,!0)?[2,Ge((function(n,o){return B(t,void 0,void 0,(function(){var t;return D(this,(function(i){switch(i.label){case 0:return o.info(h.O,"setProxy: ->".concat(e)),[4,n.setProxy(e)];case 1:return(t=i.sent().code)===r.SUCCESS?[2,{code:t}]:(o.warn(h.O,"setProxy ->code:".concat(t)),[2,{code:t,msg:Qe[t]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function ir(){return B(this,void 0,void 0,(function(){var e=this;return D(this,(function(t){return[2,Ge((function(t,n){return B(e,void 0,void 0,(function(){var e,o,i;return D(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(h.O,"getProxy ->code:".concat(o)),[2,{code:o,msg:Qe[o]}])}}))}))}))]}))}))}function ar(e,t){return B(this,void 0,void 0,(function(){var n=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,Ge((function(o,i){return B(n,void 0,void 0,(function(){var n,a,s;return D(this,(function(c){switch(c.label){case 0:return i.info(h.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(h.O,"testProxy ->code:".concat(a)),[2,{code:a,msg:Qe[a]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}export{vn as BaseMessage,Tn as CombineMessage,er as ConnectType,Te as Events,On as FileMessage,Nn as GIFMessage,En as HQVoiceMessage,mn as ImageMessage,Cn as LocationMessage,or as MentionedInfoBody,tr as MessageType,An as ReferenceMessage,yn as RichContentMessage,Sn as SightMessage,pn as TextMessage,_n as VoiceMessage,Ye as __addSDKVersion,Ko as addConversationsToTag,ke as addEventListener,Fo as addTag,dn as addToBlacklist,un as bindRTCRoomForChatroom,It as clearAllMessagesUnreadStatus,Fe as clearEventListeners,Co as clearHistoryMessages,ko as clearMessages,vt as clearMessagesUnreadStatus,ut as clearTextMessageDraft,Vo as clearUnreadCountByTimestamp,nt as connect,Go as deleteLocalMessagesByTimestamp,_o as deleteMessages,qe as destroy,ot as disconnect,nr as electronExtension,rn as forceRemoveChatRoomEntry,tn as forceSetChatRoomEntry,sn as getAllChatRoomEntries,yt as getAllConversationState,Ht as getAllUltraGroupUnreadCount,Ft as getAllUltraGroupUnreadMentionedCount,At as getAllUnreadMentionedCount,ln as getBlacklist,gn as getBlacklistStatus,Ut as getBlockUltraGroupList,Tt as getBlockedConversationList,an as getChatRoomEntry,Qt as getChatRoomInfo,cn as getChatroomHistoryMessages,Je as getConnectionStatus,it as getConversation,rt as getConversationList,St as getConversationNotificationLevel,pt as getConversationNotificationStatus,Xo as getConversationsFromTagByPage,Ke as getCurrentUserId,je as getDeviceId,ao as getFileToken,so as getFileUrl,wo as getFirstUnreadMessage,Ro as getHistoryMessages,Bo as getMessage,Uo as getMessageReader,ir as getProxy,mo as getRemoteHistoryMessages,ze as getServerTime,Jo as getTags,zo as getTagsFromConversation,st as getTextMessageDraft,Nt as getTopConversationList,dt as getTotalUnreadCount,ft as getTotalUnreadCountByLevels,lt as getTotalUnreadMentionedCountByLevels,kt as getUltraGroupDefaultNotificationLevel,qt as getUltraGroupFirstUnreadMessageTimestamp,Mt as getUltraGroupList,wt as getUltraGroupMessageListByMessageUId,Vt as getUltraGroupUnreadCountByTargetId,Gt as getUltraGroupUnreadMentionedCountByTargetId,Zt as getUltraGroupUnreadMentionedMessages,_t as getUnreadConversationList,gt as getUnreadCount,Qo as getUnreadCountByTag,Ct as getUnreadMentionedCount,Do as getUnreadMentionedMessages,Ze as init,Lo as insertMessage,We as installPlugin,jt as joinChatRoom,Wt as joinExistChatRoom,bt as modifyMessage,xe as onceEventListener,Xt as quitChatRoom,No as recallMessage,Po as registerMessageType,Dt as removeAllExpansionForUltraGroupMessage,on as removeChatRoomEntries,nn as removeChatRoomEntry,at as removeConversation,Yo as removeConversationsFromTag,Ve as removeEventListener,He as removeEventListeners,Bt as removeExpansionForUltraGroupMessage,fn as removeFromBlacklist,yo as removeMessageExpansionForKey,Zo as removeTag,Wo as removeTagFromConversations,jo as removeTagsFromConversation,ct as saveTextMessageDraft,xo as searchConversationByContent,bo as searchMessages,lo as sendFileMessage,vo as sendGIFMessage,Io as sendHQVoiceMessage,go as sendImageMessage,co as sendMessage,Eo as sendReadReceiptMessage,So as sendReadReceiptRequest,po as sendReadReceiptResponse,To as sendReadReceiptResponseV2,ho as sendSightMessage,Oo as sendSyncReadStatusMessage,uo as sendTextMessage,Mo as sendTypingStatusMessage,Pt as sendUltraGroupTypingStatus,en as setChatRoomEntries,$t as setChatRoomEntry,mt as setConversationNotificationLevel,Et as setConversationNotificationStatus,Ot as setConversationToTop,$o as setConversationToTopInTag,Ho as setMessageReceivedStatus,rr as setProxy,xt as setUltraGroupDefaultNotificationLevel,ar as testProxy,Lt as updateExpansionForUltraGroupMessage,Ao as updateMessageExpansion,qo 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 I,LogTagId as R,logger as h,ErrorCodes as E,validate as m,isValidConversationType as T,isValidNotificationLevel as S,NotificationLevel as p,isTypeInConversationList as O,UltraGroupChannelType as N,isString as _,MAX_UPLOAD_FILE_SIZE as C,UPLOAD_FILE_CHUNK_SIZE as A,UploadMethod as U,FileType as y,getUUID as M,isValidFileType as P,usingCppEngine as L,MessageDirection as w,SentStatus as B,isUndefined as D}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 G(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 V=function(){return V=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},V.apply(this,arguments)};function k(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 x(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 F=function(){return!("undefined"==typeof uni||!function(e){for(var t=["request","getSystemInfo"],n=0,o=t.length;n<o;n++)if(!e[t[n]])return!1;return!0}(uni))},H=F(),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 J=null,q=function(e){return k(void 0,void 0,void 0,(function(){var t;return x(this,(function(n){switch(n.label){case 0:return[4,Y.getNetworkType()];case 1:return t=n.sent(),J({status:"online"===e.type,type:t}),[2]}}))}))};var Y={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:H,createWebSocket:function(e,t){var n=new WebSocket(e,t);return n.binaryType="arraybuffer",{id:Date.now(),onClose:function(e){n.onclose=function(t){var n=t.code,o=t.reason;e(n,o)}},onError:function(e){n.onerror=e},onMessage:function(e){n.onmessage=function(t){e(t.data)}},onOpen:function(e){n.onopen=e},send:function(e){n.send(e)},close:function(e,t){n.close()}}},getNetworkType:function(){var 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){J=e,"undefined"!=typeof window&&window&&(window.addEventListener("offline",q),window.addEventListener("online",q))},removeNetworkStatusListener:function(){"undefined"!=typeof window&&window&&(window.removeEventListener("offline",q),window.removeEventListener("online",q)),J=null}},K=F(),z=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return wx[e].apply(wx,t)}catch(e){null===console||void 0===console||console.error(e)}}},j={setItem:z("setStorageSync"),getItem:z("getStorageSync"),removeItem:z("removeStorageSync"),clear:z("clearStorageSync")},X=null,W=function(e){var t=e.isConnected,n=e.networkType;X({status:t,type:n})};var Q={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:j,sessionStorage:j,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){X=e,wx.onNetworkStatusChange(W)},removeNetworkStatusListener:function(){wx.offNetworkStatusChange(W),X=null}},$=F(),ee=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{if("setStorageSync"===e)return my[e]({key:t[0],data:JSON.parse(t[1])});if("clearStorageSync"===e)return my[e]();if("removeStorageSync"===e)return my[e]({key:t[0]});var o=my[e]({key:t[0]}).data;return o?JSON.stringify(o):o}catch(e){}}},te={setItem:ee("setStorageSync"),getItem:ee("getStorageSync"),removeItem:ee("removeStorageSync"),clear:ee("clearStorageSync")},ne=null,oe=function(e){var t=e.isConnected,n=e.networkType;ne({status:t,type:n})};var re={tag:"alipay",httpReq:function(e){var 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:te,sessionStorage:te,useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:$,createWebSocket:function(e){var t=my.connectSocket({url:e,multiple:!0});return{id:Date.now(),onClose:function(e){t.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){ne=e,my.onNetworkStatusChange(oe)},removeNetworkStatusListener:function(){my.offNetworkStatusChange(oe),ne=null}},ie=F(),ae=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return tt[e].apply(tt,t)}catch(e){}}},se={setItem:ae("setStorageSync"),getItem:ae("getStorageSync"),removeItem:ae("removeStorageSync"),clear:ae("clearStorageSync")},ce=null,ue=function(e){var t=e.isConnected,n=e.networkType;ce({status:t,type:n})};var de={tag:"toutiao",useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:ie,localStorage:se,sessionStorage:se,httpReq:function(e){return new Promise((function(t){tt.request({url:e.url,data:e.body,header:e.headers,method:e.method,success:function(e){var n=(null==e?void 0:e.data)||{},o={data:JSON.stringify(n),status:e.statusCode};t(o)},fail:function(e){t({status: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){ce=e,tt.onNetworkStatusChange(ue)},removeNetworkStatusListener:function(){tt.offNetworkStatusChange(ue),ce=null}},le=F(),fe=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return swan[e].apply(swan,t)}catch(e){}}},ge={setItem:fe("setStorageSync"),getItem:fe("getStorageSync"),removeItem:fe("removeStorageSync"),clear:fe("clearStorageSync")},ve=null,Ie=function(e){var t=e.isConnected,n=e.networkType;ve({status:t,type:n})};var Re={tag:"baidu",useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:le,localStorage:ge,sessionStorage:ge,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 k(this,void 0,void 0,(function(){return x(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){ve=e,swan.onNetworkStatusChange(Ie)},removeNetworkStatusListener:function(){swan.offNetworkStatusChange(Ie),ve=null}},he=F(),Ee=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:Ee("setStorageSync"),getItem:Ee("getStorageSync"),removeItem:Ee("removeStorageSync"),clear:Ee("clearStorageSync")},Te=null,Se=function(e){var t=e.isConnected,n=e.networkType;Te({status:t,type:n})};var pe={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:he,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){Te=e,jd.onNetworkStatusChange(Se)},removeNetworkStatusListener:function(){jd.offNetworkStatusChange(Se),Te=null}},Oe=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return uni[e].apply(uni,t)}catch(e){null===console||void 0===console||console.error(e)}}},Ne={setItem:Oe("setStorageSync"),getItem:Oe("getStorageSync"),removeItem:Oe("removeStorageSync"),clear:Oe("clearStorageSync")},_e=null,Ce=function(e){var t=e.isConnected,n=e.networkType;_e({status:t,type:n})};var Ae,Ue={tag:"uniapp",httpReq:function(e){var 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:Ne,sessionStorage:Ne,useNavi:!0,connectPlatform:"",isFromUniapp:!0,createWebSocket:function(e,t){var n={complete:function(){},url:e,protocols:t},o=uni.connectSocket(n);return{id:Date.now(),onClose:function(e){o.onClose((function(t){e(t.code,t.reason)}))},onError:function(e){o.onError((function(t){e(t.errMsg)}))},onMessage:function(e){o.onMessage((function(t){e(t.data)}))},onOpen:function(e){o.onOpen(e)},send:function(e){o.send({data:e})},close:function(e,t){o.close({code:e,reason:t})}}},getNetworkType:function(){return new Promise((function(t){uni.getNetworkType({success:function(e){var n=e.networkType;t(n)},fail:function(){t(e.UNKONWN)}})}))},setNetworkStatusListener:function(e){_e=e,uni.onNetworkStatusChange(Ce)},removeNetworkStatusListener:function(){uni.offNetworkStatusChange(Ce),_e=null}},ye=function(e){return e&&e.request&&e.getSystemInfo},Me="undefined"!=typeof uni&&ye(uni)?function(){switch(process.env.VUE_APP_PLATFORM){case"app-plus":return Ue;case"mp-jd":return pe;case"mp-baidu":return Re;case"mp-toutiao":return de;case"mp-alipay":return re;case"mp-weixin":return Q;default:return Y}}():"undefined"!=typeof jd&&ye(jd)?pe:"undefined"!=typeof my&&ye(my)?re:"undefined"!=typeof tt&&ye(tt)?de:"undefined"!=typeof swan&&ye(swan)?Re:"undefined"!=typeof wx&&ye(wx)?Q:Y;function Pe(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,I=e.isCounted,R=e.isOffLineMessage,h=e.canIncludeExpansion,E=e.expansion,m=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,U=e.channelType,y=e.sentStatus;m||(m=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:I,isMentioned:S,disableNotification:T,isStatusMessage:p,canIncludeExpansion:h,expansion:E,receivedStatus:m,readReceiptInfo:O,pushConfig:N,messageId:_,isInterrupt:C,isModifyMessage:A,sentStatus:y};return t!==a.ULTRA_GROUP&&(M.isOffLineMessage=R),t===a.ULTRA_GROUP&&s(U)&&(M.channelType=U),M}function Le(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,I=e.unreadMentionedMeCount,R={conversationType:t,targetId:n,latestMessage:o&&Pe(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:I};return R.conversationType===a.ULTRA_GROUP&&(R.firstUnreadMessage=e.firstUnreadMessage,R.channelType=e.channelType),R}function we(e,t){null===console||void 0===console||console.warn("Method '".concat(e,"' is deprecated, please use '").concat(t,"' instead"))}!function(e){e.CONNECTING="CONNECTING",e.CONNECTED="CONNECTED",e.DISCONNECT="DISCONNECT",e.SUSPEND="SUSPEND",e.MESSAGES="MESSAGES",e.READ_RECEIPT_RECEIVED="READ_RECEIPT_RECEIVED",e.MESSAGE_RECEIPT_REQUEST="MESSAGE_RECEIPT_REQUEST",e.MESSAGE_RECEIPT_RESPONSE="MESSAGE_RECEIPT_RESPONSE",e.CONVERSATION="CONVERSATION",e.CHATROOM="CHATROOM",e.EXPANSION="EXPANSION",e.PULL_OFFLINE_MESSAGE_FINISHED="PULL_OFFLINE_MESSAGE_FINISHED",e.TAG="TAG",e.CONVERSATION_TAG="CONVERSATION_TAG",e.TYPING_STATUS="TYPING_STATUS",e.MESSAGE_BLOCKED="MESSAGE_BLOCKED",e.ULTRA_GROUP_ENABLE="ULTRA_GROUP_ENABLE",e.OPERATE_STATUS="OPERATE_STATUS",e.ULTRA_GROUP_MESSAGE_EXPANSION_UPDATED="ULTRA_GROUP_MESSAGE_EXPANSION_UPDATED",e.ULTRA_GROUP_MESSAGE_MODIFIED="ULTRA_GROUP_MESSAGE_MODIFIED",e.ULTRA_GROUP_MESSAGE_RECALLED="ULTRA_GROUP_MESSAGE_RECALLED",e.ULTRA_GROUP_CHANNEL_TYPE_CHANGE="ULTRA_GROUP_CHANNEL_TYPE_CHANGE",e.ULTRA_GROUP_CHANNEL_DELETE="ULTRA_GROUP_CHANNEL_DELETE",e.ULTRA_GROUP_CHANNEL_USER_KICKED="ULTRA_GROUP_CHANNEL_USER_KICKED",e.PRIVATE_MESSAGE_DELIVERED="PRIVATE_MESSAGE_DELIVERED",e.GROUP_MESSAGE_DELIVERED="GROUP_MESSAGE_DELIVERED",e.USER_GROUP_STATUS="USER_GROUP_STATUS"}(Ae||(Ae={}));var Be=new c,De={connection:function(e,t){switch(e){case u.CONNECTED:Be.emit(Ae.CONNECTED);break;case u.CONNECTING:Be.emit(Ae.CONNECTING);break;case u.SUSPENDED:Be.emit(Ae.SUSPEND,t);break;case u.DISCONNECTED:Be.emit(Ae.DISCONNECT,t)}},batchMessage:function(e){Be.emit(Ae.MESSAGES,{messages:e.map((function(e){return Pe(e)}))})},typingState:function(e){Be.emit(Ae.TYPING_STATUS,{status:e})},readReceiptReceived:function(e,t,n){Be.emit(Ae.READ_RECEIPT_RECEIVED,{conversation:e,messageUId:t,sentTime:n})},messageReceiptRequest:function(e,t,n){Be.emit(Ae.MESSAGE_RECEIPT_REQUEST,{conversation:e,messageUId:t,senderUserId:n})},messageReceiptResponse:function(e,t,n){Be.emit(Ae.MESSAGE_RECEIPT_RESPONSE,{conversation:e,receivedUserId:t,messageUIdList:n})},conversationState:function(e){var t=e.map((function(e){var t=e.conversationType,n={conversationType:t,latestMessage:e.latestMessage?Pe(e.latestMessage):null,targetId:e.targetId,unreadMessageCount:e.unreadMessageCount,unreadMentionedCount:e.unreadMentionedCount,notificationStatus:e.notificationStatus,notificationLevel:e.notificationLevel,lastUnreadTime:e.lastUnreadTime,channelId:e.channelId};return t===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})}));Be.emit(Ae.CONVERSATION,{conversationList:t})},chatroomState:function(e){Be.emit(Ae.CHATROOM,e)},expansion:function(e){Be.emit(Ae.EXPANSION,e)},pullFinished:function(){Be.emit(Ae.PULL_OFFLINE_MESSAGE_FINISHED)},tag:function(){Be.emit(Ae.TAG)},conversationTagChanged:function(){Be.emit(Ae.CONVERSATION_TAG)},messageBlocked:function(e){Be.emit(Ae.MESSAGE_BLOCKED,e)},messageDelivered:function(e){Be.emit(Ae.PRIVATE_MESSAGE_DELIVERED,e)},groupMessageDeliveredStatus:function(e){Be.emit(Ae.GROUP_MESSAGE_DELIVERED,e)},ultraGroupEnable:function(e){Be.emit(Ae.ULTRA_GROUP_ENABLE,e.map((function(e){return Le(e)})))},operateStatus:function(e){Be.emit(Ae.OPERATE_STATUS,e)},ultraGroupMessageExpansionUpdated:function(e){Be.emit(Ae.ULTRA_GROUP_MESSAGE_EXPANSION_UPDATED,e.map((function(e){return Pe(e)})))},ultraGroupMessageModified:function(e){Be.emit(Ae.ULTRA_GROUP_MESSAGE_MODIFIED,e.map((function(e){return Pe(e)})))},ultraGroupMessageRecalled:function(e){Be.emit(Ae.ULTRA_GROUP_MESSAGE_RECALLED,e.map((function(e){return Pe(e)})))},ultraGroupChannelChangeType:function(e){Be.emit(Ae.ULTRA_GROUP_CHANNEL_TYPE_CHANGE,e)},ultraGroupChannelUserKicked:function(e){Be.emit(Ae.ULTRA_GROUP_CHANNEL_USER_KICKED,e)},ultraGroupChannelDelete:function(e){Be.emit(Ae.ULTRA_GROUP_CHANNEL_DELETE,e)},userGroupStatus:function(e){Be.emit(Ae.USER_GROUP_STATUS,e)}};function be(e){return e>999?999:e}d.add("imlib-next","5.8.0");var Ge=null,Ve=null,ke=null;function xe(){return k(this,void 0,void 0,(function(){return x(this,(function(e){switch(e.label){case 0:return Ge?(ke.info(R.A_DESTROY_O),[4,I.destroy()]):[2];case 1:return e.sent(),Ve=null,Ge=null,ke=null,[2]}}))}))}function Fe(e){if(!Ge)throw new Error("Not initialized yet!");return e(Ge,ke,Ve)}function He(e){return Ge?e(Ge,ke,Ve):Promise.resolve({code:r.BIZ_ERROR_CLIENT_NOT_INIT})}function Ze(e,t,n){Be.on(e,t,n)}function Je(e,t,n){Be.once(e,t,n)}function qe(e,t,n){Be.off(e,t,n)}function Ye(e){Be.removeAll(e)}function Ke(){Be.clear()}function ze(e){!function(e){var t,n=e.appkey,o=e.navigators;Ge?ke.warn(R.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))})),Ve=e,Ge=I.init((null===(t=e.__runtimeCreator__)||void 0===t?void 0:t.call(e))||Me,{appkey:e.appkey,navigators:e.navigators||[],miniCMPProxy:e.customCMP||[],logOutputLevel:e.logOutputLevel,__reportLogLevel:e.__reportLogLevel,httpInMainProcess:!!e.httpInMainProcess,logExpireTime:e.logExpireTime,areaCode:e.areaCode,logServerUrl:e.logServerUrl}),(ke=Ge.createLogger("RC-IM","IM")).setOutputLevel(e.logOutputLevel),ke.info(R.A_INIT_O,JSON.stringify({appkey:n,navigators:o,version:"5.8.0",commit:"99986f10b8ff686903159afcffe9be7d7e8642df"})),Ge.assignWatcher(De),h.init(ke))}(e)}function je(){return k(this,void 0,void 0,(function(){return x(this,(function(e){return Ge?(Ke(),[2,xe()]):[2]}))}))}function Xe(){return Fe((function(e){return e.getConnectionStatus()}))}function We(){return Fe((function(e){return e.getServerTime()}))}function Qe(){return Fe((function(e){return e.getCurrentUserId()}))}function $e(e,t){d.add(e,t)}function et(){return Fe((function(e){return e.getDeviceId()}))}function nt(e,t){return Fe((function(n){return n.install(e,t)}))}var ot={TIMEOUT:{code:-1,msg:"Network timeout"},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:E.REJECTED_BY_BLACKLIST,msg:"Blacklisted by the other party"},MESSAGE_SENT_OVER_FREQUENCY:{code:E.MESSAGE_SENT_OVER_FREQUENCY,msg:"Sending messages too quickly"},NOT_IN_GROUP:{code:E.NOT_IN_GROUP,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:E.FORBIDDEN_IN_GROUP,msg:"Forbbiden from speaking in the group"},NOT_IN_CHATROOM:{code:E.NOT_IN_CHATROOM,msg:"Not in chatRoom"},FORBIDDEN_IN_CHATROOM:{code:E.FORBIDDEN_IN_CHATROOM,msg:"Forbbiden from speaking in the chatRoom"},KICKED_FROM_CHATROOM:{code:E.KICKED_FROM_CHATROOM,msg:"Kicked out and forbbiden from joining the chatRoom"},CHATROOM_NOT_EXIST:{code:E.CHATROOM_NOT_EXIST,msg:"ChatRoom does not exist"},CHATROOM_IS_FULL:{code:E.CHATROOM_IS_FULL,msg:"ChatRoom members exceeded"},CHATROOM_PARAMETER_INVALID:{code:E.CHATROOM_PARAMETER_INVALID,msg:"Invalid chatRoom parameters"},CHATROOM_ROAMING_SERVICE_UNAVAILABLE:{code:E.CHATROOM_ROAMING_SERVICE_UNAVAILABLE,msg:"ChatRoom message roaming service is not open, Please go to the developer to open this service"},RECALLMESSAGE_PARAMETER_INVALID:{code:E.RECALL_MESSAGE_PARAMETER_INVALID,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:E.MESSAGE_BLOCKED_BY_SENSITIVE_WORD,msg:"The sent message contains sensitive words"},REPLACED_SENSITIVE_WORD:{code:E.MESSAGE_SENSITIVE_WORD_REPLACED,msg:"Sensitive words in the message have been replaced"},NOT_CONNECTED:{code:E.CONNECTION_RELEASED,msg:"Please connect successfully first"},NAVIGATION_RESOURCE_ERROR:{code:E.NAVIGATION_RESOURCE_ERROR,msg:"Navigation http request failed"},CMP_REQUEST_ERROR:{code:E.CONNECTION_CREATED_ERROR,msg:"CMP sniff http request failed"},CONN_APPKEY_FAKE:{code:E.IDENTIFIER_REJECTED,msg:"Your appkey is fake"},CONN_MINI_SERVICE_NOT_OPEN:{code:E.SERVER_UNAVAILABLE,msg:"Mini program service is not open, Please go to the developer to open this service"},CONNECTION_ACK_TIMEOUT:{code:E.CONNECTION_ACK_TIMEOUT,msg:"Connection ACK timeout"},CONN_TOKEN_INCORRECT:{code:E.TOKEN_INCORRECT,msg:"Your token is not valid or expired"},CONN_NOT_AUTHRORIZED:{code:E.APP_NOT_AUTHORIZED,msg:"AppKey and Token do not match"},CONN_REDIRECTED:{code:31006,msg:"Connection redirection"},APP_BLOCKED_OR_DELETED:{code:E.APP_BLOCKED_OR_DELETED,msg:"AppKey is banned or deleted"},USER_BLOCKED:{code:E.USER_BLOCKED,msg:"User blocked"},CONN_DOMAIN_INCORRECT:{code:31012,msg:"Connect domain error, Please check the set security domain"},PROTOCOL_MESSAGE_STORAGE_SERVICE_UNAVAILABLE:{code:E.PROTOCOL_MESSAGE_STORAGE_SERVICE_UNAVAILABLE,msg:"Roaming service cloud is not open, Please go to the developer to open this service"},CONNECTION_EXIST:{code:E.CONNECTION_EXIST,msg:"Connection already exists"},CHATROOM_PROPERTY_OVERSIZE:{code:E.CHATROOM_PROPERTY_OVERSIZE,msg:"ChatRoom KV setting exceeds maximum"},CHATROOM_PROPERTY_EXISTED:{code:E.CHATROOM_PROPERTY_EXISTED,msg:"ChatRoom KV already exists"},CHATROOM_KV_STORE_NOT_OPEN:{code:E.CHATROOM_PROPERTY_SERVICE_UNAVAILABLE,msg:"ChatRoom KV storage service is not open, Please go to the developer to open this service"},CHATROOM_PROPERTY_NOT_EXIST:{code:E.CHATROOM_PROPERTY_NOT_EXIST,msg:"ChatRoom key does not exist"},MESSAGE_NOT_EXPANDABLE:{code:E.MESSAGE_NOT_EXPANDABLE,msg:"The message cannot be extended"},SEND_MESSAGE_KV_FAIL:{code:34009,msg:"Sending RC expansion message fail"},EXPANSION_LIMIT_EXCEET:{code:E.MESSAGE_EXPANSION_OVERSIZE,msg:"The message expansion size is beyond the limit"},PROTOCOL_PARAMETER_INVALID:{code:E.PROTOCOL_PARAMETER_INVALID,msg:"Incorrect parameters passed in while calling the interface"},UPLOAD_FILE_FAILED:{code:35020,msg:"File upload failed"},CHATROOM_PROPERTY_NOT_ALL_SET:{code:E.CHATROOM_PROPERTY_NOT_ALL_SET,msg:"Chatroom kv store not all success"},CHATROOM_PROPERTY_BATCH_SET_OVERSIZE:{code:E.CHATROOM_PROPERTY_BATCH_SET_OVERSIZE,msg:"Chatroom kv's length is out of limit"},TAG_ALREADY_EXISTS:{code:E.TAG_ALREADY_EXISTS,msg:"The tag already exists"},TAG_NOT_EXIST:{code:E.TAG_NOT_EXIST,msg:"The tag does not exist"},NOT_SUPPORT:{code:r.NOT_SUPPORT,msg:"The method is not supported in a browser!"}},rt={};for(var it in ot){var at=ot[it].code;rt[at]=it}function st(e,t){return k(this,void 0,void 0,(function(){var n=this;return x(this,(function(o){return[2,He((function(o,i){return k(n,void 0,void 0,(function(){var n,a,s;return x(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(R.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](R.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:rt[a.code]}]}}))}))}))]}))}))}function ct(e){return h.info(R.A_DISCONNECT_O,{}),Fe((function(t){return t.disconnect(e)}))}function ut(e,t){return k(this,void 0,void 0,(function(){var n=this;return x(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,He((function(o,i){return k(n,void 0,void 0,(function(){var n,a,s;return x(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 Le(e)}))}]:(i.warn(R.O,"get conversation list fail ->".concat(a,":").concat(rt[a])),[2,{code:a,msg:rt[a]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function dt(e){return k(this,void 0,void 0,(function(){var t=this;return x(this,(function(n){return m("options",e,f.CONVERSATION,!0)?[2,He((function(n,o){return k(t,void 0,void 0,(function(){var t,i,a;return x(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(R.O,"getConversation ->code:".concat(i,", targetId:").concat(e.targetId)),[2,{code:i,msg:rt[i]}]):[2,{code:i,data:a?Le(a):null}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function lt(e){return k(this,void 0,void 0,(function(){var t=this;return x(this,(function(n){return m("options",e,f.CONVERSATION,!0)?[2,He((function(n,o){return k(t,void 0,void 0,(function(){var t,i;return x(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(R.O,"destroy conversation ->".concat(i)),t!==r.SUCCESS?(o.warn(R.O,"destroy conversation fail ->".concat(t,":").concat(rt[t],",").concat(i)),[2,{code:t,msg:rt[t]}]):[2,{code:t}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function ft(e){return k(this,void 0,void 0,(function(){var t=this;return x(this,(function(n){return m("options",e,f.CONVERSATION,!0)?[2,He((function(n,o){return k(t,void 0,void 0,(function(){var t,i,a,s;return x(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(R.O,"get draft ->".concat(s)),i===r.SUCCESS?[2,{code:i,data:a||""}]:(o.warn(R.O,"get draft fail ->".concat(i,":").concat(rt[i],",").concat(s)),[2,{code:i,msg:rt[i]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function gt(e,t){return k(this,void 0,void 0,(function(){var n=this;return x(this,(function(o){return m("options",e,f.CONVERSATION,!0)&&m("draft",t,f.STRING,!0)?[2,He((function(o,i){return k(n,void 0,void 0,(function(){var n,a;return x(this,(function(s){switch(s.label){case 0:return n="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),i.debug(R.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(R.O,"set draft fail ->".concat(a,":").concat(rt[a],",").concat(n)),[2,{code:a,msg:rt[a]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function vt(e){return k(this,void 0,void 0,(function(){var t=this;return x(this,(function(n){return m("options",e,f.CONVERSATION,!0)?[2,He((function(n,o){return k(t,void 0,void 0,(function(){var t,i;return x(this,(function(a){switch(a.label){case 0:return t="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),o.debug(R.O,"delete draft ->".concat(t)),[4,n.clearConversationMessageDraft(e.conversationType,e.targetId,e.channelId)];case 1:return(i=a.sent())===r.SUCCESS?[2,{code:i}]:(o.warn(R.O,"delete draft fail ->".concat(i,":").concat(rt[i],",").concat(t)),[2,{code:i,msg:rt[i]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function It(e,t){return k(this,void 0,void 0,(function(){var n=this;return x(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,T)})))?[2,He((function(o,i){return k(n,void 0,void 0,(function(){var n,a,s;return x(this,(function(c){switch(c.label){case 0:return i.debug(R.O,"get total unread count -> ConversationType:".concat(JSON.stringify(t)," includeMuted:").concat(e)),[4,o.getTotalUnreadCount("",t,e)];case 1:return n=c.sent(),a=n.code,s=n.data,a===r.SUCCESS?[2,{code:a,data:s}]:(i.warn(R.O,"getTotalUnreadCount fail ->".concat(a,":").concat(rt[a])),[2,{code:a,msg:rt[a]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Rt(e,t){return k(this,void 0,void 0,(function(){var n=this;return x(this,(function(o){return!m("conversationTypes",e,f.ARRAY,!0)||!m("levels",t,f.ARRAY,!0)||e.some((function(e){return!m("conversationType",e,T)}))||t.some((function(e){return!m("level",e,S)}))?[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,He((function(o,i){return k(n,void 0,void 0,(function(){var n,a,s;return x(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(R.O,"getTotalUnreadCountByLevels fail ->".concat(a,":").concat(rt[a])),[2,{code:a,msg:rt[a]}])}}))}))}))]}))}))}function ht(e,t){return k(this,void 0,void 0,(function(){var n=this;return x(this,(function(o){return!m("conversationTypes",e,f.ARRAY,!0)||!m("levels",t,f.ARRAY,!0)||e.some((function(e){return!m("conversationType",e,T)}))||t.some((function(e){return!m("level",e,S)}))?[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,He((function(o,i){return k(n,void 0,void 0,(function(){var n,a,s;return x(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(R.O,"getTotalUnreadMentionedCountByLevels fail ->".concat(a,":").concat(rt[a])),[2,{code:a,msg:rt[a]}])}}))}))}))]}))}))}function Et(e){return k(this,void 0,void 0,(function(){var t=this;return x(this,(function(n){return m("options",e,f.CONVERSATION,!0)?[2,He((function(n,o){return k(t,void 0,void 0,(function(){var t,i,a,s;return x(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(R.O,"get unreadCount ->".concat(s)),i===r.SUCCESS?[2,{code:i,data:a}]:(o.warn(R.O,"get unreadCount fail ->".concat(i,":").concat(rt[i],",").concat(s)),[2,{code:i,msg:rt[i]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function mt(e){return k(this,void 0,void 0,(function(){var t=this;return x(this,(function(n){return m("options",e,f.CONVERSATION,!0)?[2,He((function(n,o){return k(t,void 0,void 0,(function(){var t,i;return x(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(R.O,"clear unreadMsgNum ->".concat(i)),t!==r.SUCCESS?(o.warn(R.O,"clear unreadMsgNum fail ->".concat(t,":").concat(rt[t],",").concat(i)),[2,{code:t,msg:rt[t]}]):[2,{code:t}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Tt(){return k(this,void 0,void 0,(function(){var e=this;return x(this,(function(t){return[2,He((function(t,n){return k(e,void 0,void 0,(function(){return x(this,(function(e){switch(e.label){case 0:return[4,t.clearAllUnreadCount()];case 1:return[2,{code:e.sent()}]}}))}))}))]}))}))}ot.PROTOCOL_MESSAGE_STORAGE_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(R.O,"".concat(n," -> ").concat(o)),o},pt=function(e,t,n,o){return void 0===o&&(o=""),k(void 0,void 0,void 0,(function(){var i,a;return x(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(R.O,"".concat(o," fail -> ").concat(a," : ").concat(rt[a]," , ").concat(i)),[2,{code:a,msg:rt[a]}]):[2,{code:a}]}}))}))};function Ot(e,t){return k(this,void 0,void 0,(function(){return x(this,(function(n){return m("notificationLevel",t,(function(e){return void 0!==p[e]}),!0)&&m("options",e,f.CONVERSATION,!0)?[2,He((function(n,o){return pt(o,e,(function(){return n.setConversationNotificationLevel(e.conversationType,e.targetId,t,e.channelId)}),"setConversationNotificationLevel")}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Nt(e,t){return k(this,void 0,void 0,(function(){return x(this,(function(n){return m("notificationStatus",t,(function(e){return 1===e||2===e}),!0)&&m("options",e,f.CONVERSATION,!0)?[2,He((function(n,o){return pt(o,e,(function(){return n.setConversationStatus(e.conversationType,e.targetId,void 0,t,e.channelId)}),"setConversationNotificationStatus")}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function _t(e){return k(this,void 0,void 0,(function(){var t=this;return x(this,(function(n){return m("options",e,f.CONVERSATION,!0)?[2,He((function(n,o){return k(t,void 0,void 0,(function(){var t,i,a,s;return x(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(R.O,"getConversationNotificationLevel fail -> ".concat(a," : ").concat(rt[a]," , ").concat(t)),[2,{code:a,msg:rt[a]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Ct(e){return k(this,void 0,void 0,(function(){var t=this;return x(this,(function(n){return m("options",e,f.CONVERSATION,!0)?[2,He((function(n,o){return k(t,void 0,void 0,(function(){var t,i,a;return x(this,(function(s){switch(s.label){case 0:return o.info(R.O,"getConversationNotificationStatus ->targetId:".concat(e.targetId,",conversationType:").concat(e.conversationType)),[4,n.getConversationNotificationStatus(e.conversationType,e.targetId,e.channelId)];case 1:return t=s.sent(),i=t.code,a=t.data,i===r.SUCCESS?[2,{code:i,data:a}]:(o.warn(R.O,"getConversationNotificationStatus ->code:".concat(i,",targetId:").concat(e.targetId)),[2,{code:i,msg:rt[i]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function At(){return k(this,void 0,void 0,(function(){return x(this,(function(e){return[2,He((function(e){return e.getBlockConversationList()}))]}))}))}function Ut(e,t){return void 0===t&&(t=!0),k(this,void 0,void 0,(function(){var n=this;return x(this,(function(o){return m("options",e,f.CONVERSATION,!0)&&m("isTop",t,f.BOOLEAN)?[2,He((function(o,i){return k(n,void 0,void 0,(function(){var n,a;return x(this,(function(s){switch(s.label){case 0:return n="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),i.debug(R.O,"set conversation status ->".concat(n)),[4,o.setConversationStatus(e.conversationType,e.targetId,t,void 0,e.channelId)];case 1:return(a=s.sent())!==r.SUCCESS?(i.warn(R.O,"set conversation status fail ->".concat(a,":").concat(rt[a],",").concat(n)),[2,{code:a,msg:rt[a]}]):[2,{code:a}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function yt(e,t){return k(this,void 0,void 0,(function(){var n=this;return x(this,(function(o){return m("conversationTypes",e,f.ARRAY)&&!(null==e?void 0:e.some((function(e){return!m("conversationType",e,T)})))&&m("channelId",t,f.CHANNEL_ID)?[2,He((function(o,i){return k(n,void 0,void 0,(function(){var n,a,s;return x(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 Le(e)}))}]:(i.warn(R.A_GET_TOP_CONVERSATION_LIST_E,"".concat(a,":").concat(rt[a])),[2,{code:a,msg:rt[a]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Mt(e){return k(this,void 0,void 0,(function(){var t=this;return x(this,(function(n){return!m("conversationTypes",e,f.ARRAY)||(null==e?void 0:e.some((function(e){return!m("conversationType",e,O)})))?[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,He((function(n,o){return k(t,void 0,void 0,(function(){var t,o,i;return x(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 Le(e)}))}]:[2,{code:o,msg:rt[o]}]}}))}))}))]}))}))}function Pt(e){return k(this,void 0,void 0,(function(){return x(this,(function(t){return m("options",e,f.CONVERSATION,!0)?[2,He((function(t,n){return n.debug(R.O,"getUnreadMentionedCount".concat(e.targetId,",channelId:").concat(e.channelId)),t.getUnreadMentionedCount(e)}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Lt(){return k(this,void 0,void 0,(function(){return x(this,(function(e){return[2,He((function(e,t){return t.debug(R.O,"getAllUnreadMentionedCount"),e.getAllUnreadMentionedCount()}))]}))}))}function wt(){return k(this,void 0,void 0,(function(){return x(this,(function(e){return[2,He((function(e){return e.getAllConversationState()}))]}))}))}function Bt(e){return void 0===e&&(e={}),k(this,void 0,void 0,(function(){var t=this;return x(this,(function(n){return m("options.targetId",e.targetId,f.STRING,!1)&&m("options.channelType",e.channelType,(function(e){return void 0!==N[e]}),!1)?[2,He((function(n,o){return k(t,void 0,void 0,(function(){var t,i,a;return x(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(R.O,"get ultragroup ->".concat(i,":").concat(rt[i])),[2,{code:i,msg:rt[i]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Dt(){return k(this,void 0,void 0,(function(){var e=this;return x(this,(function(t){return[2,He((function(t,n){return k(e,void 0,void 0,(function(){var e,o,i;return x(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(R.O,"get block ultragroup ->".concat(o,":").concat(rt[o])),[2,{code:o,msg:rt[o]}])}}))}))}))]}))}))}function bt(e){return k(this,void 0,void 0,(function(){var t=this;return x(this,(function(n){return m("options",e,f.CONVERSATION,!0)?[2,He((function(n,o){return k(t,void 0,void 0,(function(){var t;return x(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(R.O,"send ultraGroup OperateStatus ->".concat(t,":").concat(rt[t])),[2,{code:t,msg:rt[t]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Gt(e,t){return k(this,void 0,void 0,(function(){var n=this;return x(this,(function(o){return m("options",e,f.CONVERSATION,!0)&&m("msgs",t,f.ARRAY,!0)?[2,He((function(o,i){return k(n,void 0,void 0,(function(){var n,a,s,c,u,d,l,f,g,v;return x(this,(function(I){switch(I.label){case 0:return n=e.targetId,a=e.conversationType,s=e.channelId,c=[],t.forEach((function(e){var t=e.sendTime,n=e.messageUId;c.push({sendTime:t,messageUId:n,channelId:s})})),u={targetId:n,conversationType:a,messages:c},[4,o.getUltraGroupMessageListByMessageUId(u)];case 1:if(d=I.sent(),l=d.code,f=d.data,l===r.SUCCESS){for(v in g={},f)g[v]=f[v]?Pe(f[v]):void 0;return[2,{code:r.SUCCESS,data:g}]}return i.warn(R.O,"get UltraGroup MessageList by messageUId ->".concat(l,":").concat(rt[l])),[2,{code:l,msg:rt[l]}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Vt(e,t){return k(this,void 0,void 0,(function(){var n=this;return x(this,(function(o){return m("expansion",e,f.OBJECT,!0)&&m("message",t,f.OBJECT,!0)?[2,He((function(o,i){return k(n,void 0,void 0,(function(){var n,a,s,c,u,d,l,f,g;return x(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(R.O,"update expansion for ultragroup message ->".concat(l)),f={targetId:a,channelId:d,conversationType:n,sendTime:c,canIncludeExpansion:u,messageUId:s,expansion:e},[4,o.expandUltraMessage(f)];case 1:return(g=v.sent().code)===r.SUCCESS?[2,{code:r.SUCCESS}]:(i.warn(R.O,"update expansion for ultragroup message ->".concat(g,":").concat(rt[g])),[2,{code:g,msg:rt[g]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function kt(e,t){return k(this,void 0,void 0,(function(){var n=this;return x(this,(function(o){return m("expansion",e,f.ARRAY,!0)&&m("message",t,f.OBJECT,!0)?[2,He((function(o,i){return k(n,void 0,void 0,(function(){var n,a,s,c,u,d,l,f,g;return x(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(R.O,"remove expansion for ultragroup message ->".concat(l)),f={targetId:a,channelId:d,conversationType:n,sendTime:c,canIncludeExpansion:u,messageUId:s,keys:e},[4,o.expandUltraMessage(f)];case 1:return(g=v.sent().code)===r.SUCCESS?[2,{code:r.SUCCESS}]:(i.warn(R.O,"remove expansion for ultraGroup message ->".concat(g,":").concat(rt[g])),[2,{code:g,msg:rt[g]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function xt(e){return k(this,void 0,void 0,(function(){var t=this;return x(this,(function(n){return m("message",e,f.OBJECT,!0)?[2,He((function(n,o){return k(t,void 0,void 0,(function(){var t,i,a,s,c,u,d,l,f;return x(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(R.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(R.O,"remove all expansion for ultraGroup message ->".concat(f,":").concat(rt[f])),[2,{code:f,msg:rt[f]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Ft(e,t){return k(this,void 0,void 0,(function(){var n=this;return x(this,(function(o){return m("content",e,f.OBJECT,!0)&&m("message",t,f.OBJECT,!0)?[2,He((function(o,i){return k(n,void 0,void 0,(function(){var n,a,s,c,u,d,l,f,g,v;return x(this,(function(I){switch(I.label){case 0:return n=t.conversationType,a=t.targetId,s=t.messageUId,c=t.senderUserId,u=t.sentTime,d=t.canIncludeExpansion,l=t.channelId,f="conversationType:".concat(n,",targetId:").concat(a,",channelId:").concat(l,",messageUId:").concat(s),i.debug(R.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=I.sent().code)===r.SUCCESS?[2,{code:r.SUCCESS}]:(i.warn(R.O,"modify ultraGroup message ->".concat(v,":").concat(rt[v])),[2,{code:v,msg:rt[v]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Ht(e,t){return k(this,void 0,void 0,(function(){var n=this;return x(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,He((function(o,i){return k(n,void 0,void 0,(function(){var n,a,s;return x(this,(function(c){switch(c.label){case 0:return i.debug(R.O,"get UltraGroup unreadMentionedCount by targetId: ".concat(e,", notificationLevels: ").concat(JSON.stringify(t))),[4,o.getUltraGroupUnreadMentionedCountByTargetId(e,t)];case 1:return n=c.sent(),a=n.code,s=n.data,a===r.SUCCESS?[2,{code:r.SUCCESS,data:s}]:(i.warn(R.O,"get UltraGroup unreadMentionedCount by targetId error ->".concat(a,":").concat(rt[a])),[2,{code:a,msg:rt[a]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Zt(e){return k(this,void 0,void 0,(function(){var t=this;return x(this,(function(n){return m("options.targetId",e.targetId,f.STRING,!0)&&m("options.channelId",e.channelId,f.CHANNEL_ID)?[2,He((function(n,o){return k(t,void 0,void 0,(function(){var t,i,a,s,c;return x(this,(function(u){switch(u.label){case 0:return t="getUltraGroupDefaultNotificationLevel",i="targetId: ".concat(e.targetId,", channelId: ").concat(e.channelId),o.debug(R.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(R.O,"".concat(t," fail -> ").concat(s," : ").concat(rt[s]," , ").concat(i)),[2,{code:s,msg:rt[s]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Jt(e,t){return k(this,void 0,void 0,(function(){var n=this;return x(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!==p[e]}),!0)?[2,He((function(o,i){return k(n,void 0,void 0,(function(){var n,a,s;return x(this,(function(c){switch(c.label){case 0:return n="setUltraGroupDefaultNotificationLevel",a="targetId: ".concat(e.targetId,", channelId: ").concat(e.channelId),i.debug(R.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(R.O,"".concat(n," fail -> ").concat(s," : ").concat(rt[s]," , ").concat(a)),[2,{code:s,msg:rt[s]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function qt(e,t){return k(this,void 0,void 0,(function(){var n=this;return x(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,He((function(o,r){return k(n,void 0,void 0,(function(){var n,i,a,s,c;return x(this,(function(u){switch(u.label){case 0:return n="getUltraGroupUnreadCountByTargetId",[4,o.getUltraGroupUnreadCountByTargetId(e,t)];case 1:return i=u.sent(),a=i.code,s=i.data,c="targetId: ".concat(e,", levels: ").concat(JSON.stringify(t)),r.debug(R.O,"".concat(n," -> ").concat(c)),[2,{code:a,data:s}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Yt(){return k(this,void 0,void 0,(function(){var e=this;return x(this,(function(t){return[2,He((function(t,n){return k(e,void 0,void 0,(function(){var e,o,i,a;return x(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(R.O,e),i===r.SUCCESS?[2,{code:i,data:a}]:(n.warn(R.O,"".concat(e," fail ->").concat(i,": ").concat(rt[i])),[2,{code:i,msg:rt[i]}])}}))}))}))]}))}))}function Kt(){return k(this,void 0,void 0,(function(){var e=this;return x(this,(function(t){return[2,He((function(t,n){return k(e,void 0,void 0,(function(){var e,o,i,a;return x(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(R.O,e),i===r.SUCCESS?[2,{code:i,data:a}]:(n.warn(R.O,"".concat(e," fail ->").concat(i,": ").concat(rt[i])),[2,{code:i,msg:rt[i]}])}}))}))}))]}))}))}function zt(e){return k(this,void 0,void 0,(function(){var t=this;return x(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,He((function(n,o){return k(t,void 0,void 0,(function(){var t,i,a,s,c,u,d,l;return x(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(R.O,"getUltraGroupUnreadMentionedMessages fail ->".concat(d,": ").concat(rt[d])),[2,{code:d,msg:rt[d]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function jt(e){return k(this,void 0,void 0,(function(){var t=this;return x(this,(function(n){return m("conversation.targetId",e.targetId,f.STRING,!0)&&m("conversation.channelId",e.channelId,f.CHANNEL_ID,!0)?[2,He((function(n){return k(t,void 0,void 0,(function(){var t,o,i,a,s,c;return x(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:rt[s]}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Xt(e){return k(this,void 0,void 0,(function(){var t,n=this;return x(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,He((function(e){return k(n,void 0,void 0,(function(){var n,o,i;return x(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:rt[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))},Qt=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)},$t=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)},en=function(e){return e.entries.every((function(e){return m("key",e,f.STRING,!0)}))&&m("options.notificationExtra",e.notificationExtra,f.STRING)};function tn(e,t){return k(this,void 0,void 0,(function(){var n=this;return x(this,(function(o){return m("targetId",e,f.STRING,!0)&&m("options.count",t.count,f.NUMBER,!0)?[2,He((function(o,i){return k(n,void 0,void 0,(function(){var n,a,s;return x(this,(function(c){switch(c.label){case 0:return n=i.createTraceId(),i.info(R.A_JOIN_CHATROOM_T,JSON.stringify({chatroomId:e,count:t.count,joinExist:!1}),n),[4,o.joinChatroom(e,t.count,n)];case 1:return a=c.sent(),s=a===r.SUCCESS?"info":"warn",i[s](R.A_JOIN_CHATROOM_R,JSON.stringify({code:a,timestamp:(new Date).getTime()}),n),a!==r.SUCCESS?[2,{code:a,msg:rt[a]}]:[2,{code:a}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function nn(e,t){return k(this,void 0,void 0,(function(){var n=this;return x(this,(function(o){return m("targetId",e,f.STRING,!0)&&m("options.count",t.count,f.NUMBER,!0)?[2,He((function(o,i){return k(n,void 0,void 0,(function(){var n,a,s;return x(this,(function(c){switch(c.label){case 0:return n=i.createTraceId(),i.info(R.A_JOIN_CHATROOM_T,JSON.stringify({chatroomId:e,count:t.count,joinExist:!0}),n),[4,o.joinExistChatroom(e,t.count,n)];case 1:return a=c.sent(),s=a===r.SUCCESS?"info":"warn",i[s](R.A_JOIN_CHATROOM_R,JSON.stringify({code:a,timestamp:(new Date).getTime()}),n),a!==r.SUCCESS?[2,{code:a,msg:rt[a]}]:[2,{code:a}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function on(e){return k(this,void 0,void 0,(function(){var t=this;return x(this,(function(n){return m("targetId",e,f.STRING,!0)?[2,He((function(n,o){return k(t,void 0,void 0,(function(){var t,i,a;return x(this,(function(s){switch(s.label){case 0:return t=o.createTraceId(),o.info(R.A_QUIT_CHATROOM_T,JSON.stringify({chatroomId:e}),t),[4,n.quitChatroom(e)];case 1:return i=s.sent(),a=i===r.SUCCESS?"info":"warn",o[a](R.A_QUIT_CHATROOM_R,JSON.stringify({code:i}),t),i!==r.SUCCESS?[2,{code:i,msg:rt[i]}]:[2,{code:i}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function rn(e,t){return k(this,void 0,void 0,(function(){var n=this;return x(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,He((function(o,i){return k(n,void 0,void 0,(function(){var n,a,s,c;return x(this,(function(u){switch(u.label){case 0:return n="id:".concat(e),i.debug(R.O,"get chatroom info ->".concat(n)),[4,o.getChatroomInfo(e,t.count,t.order)];case 1:return a=u.sent(),s=a.code,c=a.data,s===r.SUCCESS&&c?[2,{code:s,data:c}]:(i.warn(R.O,"get chatroom info fail ->code+:".concat(rt[s],",").concat(n)),[2,{code:s,msg:rt[s]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function an(e,t){return k(this,void 0,void 0,(function(){var n=this;return x(this,(function(o){return m("targetId",e,f.STRING,!0)&&Wt(t)?[2,He((function(o,i){return k(n,void 0,void 0,(function(){var n,a;return x(this,(function(s){switch(s.label){case 0:return n="id:".concat(e),i.debug(R.O,"set chatroom entry->".concat(n)),[4,o.setChatroomEntry(e,t)];case 1:return(a=s.sent())!==r.SUCCESS?(i.warn(R.O,"set chatroom entry fail ->code+:".concat(rt[a],",").concat(n)),[2,{code:a,msg:rt[a]}]):[2,{code:a}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function sn(e,t){return k(this,void 0,void 0,(function(){var n=this;return x(this,(function(o){return m("targetId",e,f.STRING,!0)&&Qt(t)?t.entries.length>10?[2,ot.CHATROOM_KV_STORE_OUT_LIMIT]:[2,He((function(o,i){return k(n,void 0,void 0,(function(){var n,a,s,c;return x(this,(function(u){switch(u.label){case 0:return n="id:".concat(e),i.debug(R.O,"set chatroom entry->".concat(n)),[4,o.setChatroomEntries(e,t)];case 1:return a=u.sent(),s=a.code,c=a.data,s!==r.SUCCESS?(i.warn(R.O,"set chatroom entry fail ->code+:".concat(rt[s],",").concat(n)),[2,{code:s,msg:rt[s],data:c}]):[2,{code:s}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function cn(e,t){return k(this,void 0,void 0,(function(){var n=this;return x(this,(function(o){return m("targetId",e,f.STRING,!0)&&Wt(t)?[2,He((function(o,i){return k(n,void 0,void 0,(function(){var n,a;return x(this,(function(s){switch(s.label){case 0:return n="id:".concat(e),i.debug(R.O,"force set chatroom entry ->".concat(n)),[4,o.forceSetChatroomEntry(e,t)];case 1:return(a=s.sent())!==r.SUCCESS?(i.warn(R.O,"force set chatroom entry fail ->code+:".concat(rt[a],",").concat(n)),[2,{code:a,msg:rt[a]}]):[2,{code:a}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function un(e,t){return k(this,void 0,void 0,(function(){var n=this;return x(this,(function(o){return m("targetId",e,f.STRING,!0)&&$t(t)?[2,He((function(o,i){return k(n,void 0,void 0,(function(){var n,a;return x(this,(function(s){switch(s.label){case 0:return n="id:".concat(e),i.debug(R.O,"remove chatroom entry->".concat(n)),[4,o.removeChatroomEntry(e,t)];case 1:return(a=s.sent())!==r.SUCCESS?(i.warn(R.O,"remove chatroom entry fail ->code+:".concat(rt[a],",").concat(n)),[2,{code:a,msg:rt[a]}]):[2,{code:a}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function dn(e,t){return k(this,void 0,void 0,(function(){var n=this;return x(this,(function(o){return m("targetId",e,f.STRING,!0)&&en(t)?[2,He((function(o,i){return k(n,void 0,void 0,(function(){var n,a,s,c,u;return x(this,(function(d){switch(d.label){case 0:return n="id:".concat(e),i.info(R.O,"remove chatroom entry->".concat(n)),(a=V({},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(R.O,"remove chatroom entry fail ->code+:".concat(rt[c],",").concat(n)),[2,{code:c,msg:rt[c],data:u}]):[2,{code:c}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function ln(e,t){return k(this,void 0,void 0,(function(){var n=this;return x(this,(function(o){return m("targetId",e,f.STRING,!0)&&$t(t)?[2,He((function(o,i){return k(n,void 0,void 0,(function(){var n,a;return x(this,(function(s){switch(s.label){case 0:return n="id:".concat(e),i.info(R.O,"force remove chatroom entry ->".concat(n)),[4,o.forceRemoveChatroomEntry(e,t)];case 1:return(a=s.sent())!==r.SUCCESS?(i.warn(R.O,"force remove chatroom entry fail ->code+:".concat(rt[a],",").concat(n)),[2,{code:a,msg:rt[a]}]):[2,{code:a}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function fn(e,t){return k(this,void 0,void 0,(function(){var n=this;return x(this,(function(o){return m("targetId",e,f.STRING,!0)&&m("key",t,(function(e){return _(e)&&/[\w+=-]+/.test(e)&&e.length<=128}),!0)?[2,He((function(o,i){return k(n,void 0,void 0,(function(){var n,a,s,c;return x(this,(function(u){switch(u.label){case 0:return n="id:".concat(e),i.debug(R.O,"get chatroom entry->".concat(n)),[4,o.getChatroomEntry(e,t)];case 1:return a=u.sent(),s=a.code,c=a.data,s===r.SUCCESS&&c?[2,{code:s,data:c}]:(i.warn(R.O,"get chatroom entry fail ->code+:".concat(rt[s],",").concat(n)),[2,{code:s,msg:rt[s]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function gn(e){return k(this,void 0,void 0,(function(){var t=this;return x(this,(function(n){return m("targetId",e,f.STRING,!0)?[2,He((function(n,o){return k(t,void 0,void 0,(function(){var t,i,a,s;return x(this,(function(c){switch(c.label){case 0:return t="id:".concat(e),o.debug(R.O,"get all chatroom entries->".concat(t)),[4,n.getAllChatroomEntries(e)];case 1:return i=c.sent(),a=i.code,s=i.data,a===r.SUCCESS&&s?[2,{code:a,data:s}]:(o.warn(R.O,"get all chatroom entries fail ->code+:".concat(rt[a],",").concat(t)),[2,{code:a,msg:rt[a]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function vn(e,t){return k(this,void 0,void 0,(function(){var n=this;return x(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,He((function(o,i){return k(n,void 0,void 0,(function(){var n,a,s,c,u;return x(this,(function(d){switch(d.label){case 0:return n="id:".concat(e),i.debug(R.O,"get chatroom history message->".concat(n)),[4,o.getChatRoomHistoryMessages(e,t.count,t.order,t.timestamp)];case 1:return a=d.sent(),s=a.code,c=a.data,s===r.SUCCESS&&c?(u=c.list.map((function(e){return Pe(e)})),[2,{code:s,data:{list:u,hasMore:!!c.hasMore}}]):(i.warn(R.O,"get chatroom history message fail ->code+:".concat(rt[s],",").concat(n)),[2,{code:s,msg:rt[s]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function In(e){return k(this,void 0,void 0,(function(){var t=this;return x(this,(function(n){return m("option.chatRoomId",e.chatRoomId,f.STRING,!0)&&m("option.rtcRoomId",e.rtcRoomId,f.STRING,!0)?[2,He((function(n){return k(t,void 0,void 0,(function(){var t;return x(this,(function(o){switch(o.label){case 0:return[4,n.bindRTCRoomForChatroom(e)];case 1:return[2,{code:t=o.sent(),msg:rt[t]}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Rn(e){return k(this,void 0,void 0,(function(){var t=this;return x(this,(function(n){return m("userId",e,f.STRING,!0)?[2,He((function(n,o){return k(t,void 0,void 0,(function(){return x(this,(function(t){switch(t.label){case 0:return o.info(R.O,"addToBlacklist -> userId: ".concat(e)),[4,n.addToBlacklist(e)];case 1:return[2,{code:t.sent()}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function hn(e){return k(this,void 0,void 0,(function(){var t=this;return x(this,(function(n){return m("userId",e,f.STRING,!0)?[2,He((function(n,o){return k(t,void 0,void 0,(function(){return x(this,(function(t){switch(t.label){case 0:return o.info(R.O,"removeFromBlacklist -> userId: ".concat(e)),[4,n.removeFromBlacklist(e)];case 1:return[2,{code:t.sent()}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function En(){return k(this,void 0,void 0,(function(){var e=this;return x(this,(function(t){return[2,He((function(t,n){return k(e,void 0,void 0,(function(){var e,o,i;return x(this,(function(a){switch(a.label){case 0:return n.info(R.O,"getBlacklist -> "),[4,t.getBlacklist()];case 1:return e=a.sent(),o=e.code,i=e.data,o===r.SUCCESS&&i?[2,{code:o,data:i}]:(n.warn(R.O,"getBlacklist fail -> code: ".concat(o)),[2,{code:o}])}}))}))}))]}))}))}function mn(e){return k(this,void 0,void 0,(function(){var t=this;return x(this,(function(n){return m("userId",e,f.STRING,!0)?[2,He((function(n,o){return k(t,void 0,void 0,(function(){var t,i,a;return x(this,(function(s){switch(s.label){case 0:return o.info(R.O,"getBlacklistStatus -> userId: ".concat(e)),[4,n.getBlacklistStatus(e)];case 1:return t=s.sent(),i=t.code,a=t.data,i===r.SUCCESS?[2,{code:i,data:0===a}]:(o.warn(R.O,"getBlacklistStatus fail -> code: ".concat(i,", userId: ").concat(e)),[2,{code:i}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}var Tn=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 Tn(e,o,t,n)}}var pn,On=Sn("RC:ImgMsg"),Nn=Sn("RC:HQVCMsg"),_n=Sn("RC:SightMsg"),Cn=Sn("RC:TxtMsg"),An=Sn("RC:CombineMsg"),Un=Sn("RC:FileMsg"),yn=Sn("RC:GIFMsg"),Mn=Sn("RC:VcMsg"),Pn=Sn("RC:LBSMsg"),Ln=Sn("RC:ReferenceMsg"),wn=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"}(pn||(pn={}));var Bn,Dn,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>C?Promise.resolve({code:r.UPLOAD_FAIL,msg:"the file size is over 5GB!"}):e.file.size>A&&this.isSupportMultipart?this.multipartUpload(e):this.commonUpload(e)},e}(),Gn=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return G(t,e),t.prototype.commonUpload=function(e){return k(this,void 0,void 0,(function(){var t,n,o,i,a,s,c;return x(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,Me.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:U.QINIU}}]:[2,{code:r.UPLOAD_FAIL,msg:c.toString()}]}}))}))},t.prototype.multipartUpload=function(e){return k(this,void 0,void 0,(function(){return x(this,(function(e){throw new Error("Method not implemented.")}))}))},t}(bn),Vn=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return G(t,e),t.prototype.commonUpload=function(e){return k(this,void 0,void 0,(function(){var t,n,o,i,a,s,c;return x(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,Me.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:U.ALI}}]:[2,{code:r.UPLOAD_FAIL,msg:c.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 G(t,e),t.prototype.commonUpload=function(e){return k(this,void 0,void 0,(function(){var t,n,o,i,a,s,c,u,d;return x(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<=y.FILE?o:y.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,Me.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),xn=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return G(t,e),t.prototype.commonUpload=function(e){return k(this,void 0,void 0,(function(){var t,n,o,i,a,s,c,u,d,l;return x(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,Me.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:U.AWS}}]:[2,{code:r.UPLOAD_FAIL,msg:l.toString()}]}}))}))},t.prototype.multipartUpload=function(e){throw new Error("Method not implemented.")},t}(bn),Fn=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.isSupportMultipart=!0,t}return G(t,e),t.prototype.commonUpload=function(e){return k(this,void 0,void 0,(function(){var t,n,o,i,a,s,c;return x(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,Me.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:U.MINIO}}]:[2,{code:r.UPLOAD_FAIL}]}}))}))},t.prototype.multipartUpload=function(e){var t;return k(this,void 0,void 0,(function(){var n,o,i,a,s,c,u,d,l,f,g,v,I,R,h,E,m;return x(this,(function(T){switch(T.label){case 0:return n=e.file,e.onProgress,o=e.fileType,[4,this._getFileToken(o,n.name,"POST","uploads")];case 1:return i=T.sent(),a="https://".concat(this._url,"/").concat(i.stcBucketName,"/").concat(i.fileName),s=this.getBaseHeaders(n,i,e),[4,Me.httpReq({url:"".concat(a,"?uploads"),headers:s,method:"POST"})];case 2:return c=T.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=T.sent(),v=g.code,I=g.msg,v!==r.SUCCESS?[2,{code:v,msg:I}]:[4,this._getFileToken(o,i.fileName,"POST","uploadId=".concat(l))];case 4:return R=T.sent(),h=f.map((function(e,t){return"<Part><PartNumber>".concat(t+1,"</PartNumber><ETag>").concat(e,"</ETag></Part>")})).join(""),h="<CompleteMultipartUpload xmlns='http://s3.amazonaws.com/doc/2006-03-01/'>".concat(h,"</CompleteMultipartUpload>"),E=this.getBaseHeaders(n,R,e),[4,Me.httpReq({url:"".concat(a,"?uploadId=").concat(l),headers:E,method:"POST",body:h})];case 5:return 200===(m=T.sent().status)||204===m?[2,{code:r.SUCCESS,data:{uniqueName:i.fileName,uploadMethod:U.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),k(this,void 0,void 0,(function(){var u,d,l,f,g,v,I,R,h;return x(this,(function(E){switch(E.label){case 0:return c>=5?[2,{code:r.UPLOAD_FAIL,msg:"Upload retry times exceeded 5. Procedure"}]:(u=(s-1)*A,d=Math.min(A,t.size-u),l="partNumber=".concat(s,"&uploadId=").concat(n),[4,this._getFileToken(i.fileType,o,"PUT",l)]);case 1:return f=E.sent(),g=t.slice(u,s*A),v=this.getBaseHeaders(t,f,i),[4,Me.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 I=E.sent(),R=I.status,I.data,h=I.xhr,200===R||204===R?(a.push((null==h?void 0:h.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),Hn=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.isSupportMultipart=!0,t}return G(t,e),t.prototype.commonUpload=function(e){return k(this,void 0,void 0,(function(){var t,n,o,i,a,s,c;return x(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,Me.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:U.MINIO}}]:[2,{code:r.UPLOAD_FAIL,msg:c.toString()}]}}))}))},t.prototype.multipartUpload=function(e){var t;return k(this,void 0,void 0,(function(){var n,o,i,a,s,c,u,d,l,f,g,v,I,R,h,E,m;return x(this,(function(T){switch(T.label){case 0:return n=e.file,o=e.fileType,[4,this._getFileToken(o,n.name,"POST","uploads")];case 1:return i=T.sent(),a="https://".concat(this._url,"/").concat(i.minioBucketName,"/").concat(i.fileName),s=this.getBaseHeaders(n,i,e),[4,Me.httpReq({url:"".concat(a,"?uploads"),headers:s,method:"POST"})];case 2:return c=T.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=T.sent(),v=g.code,I=g.msg,v!==r.SUCCESS?[2,{code:v,msg:I}]:[4,this._getFileToken(o,i.fileName,"POST","uploadId=".concat(l))];case 4:return R=T.sent(),h=f.map((function(e,t){return"<Part><PartNumber>".concat(t+1,"</PartNumber><ETag>").concat(e,"</ETag></Part>")})).join(""),h="<CompleteMultipartUpload xmlns='http://s3.amazonaws.com/doc/2006-03-01/'>".concat(h,"</CompleteMultipartUpload>"),E=this.getBaseHeaders(n,R,e),[4,Me.httpReq({url:"".concat(a,"?uploadId=").concat(l),headers:E,method:"POST",body:h,timeout:0})];case 5:return 200===(m=T.sent().status)||204===m?[2,{code:r.SUCCESS,data:{uniqueName:i.fileName,uploadMethod:U.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),k(this,void 0,void 0,(function(){var u,d,l,f,g,v,I,R,h;return x(this,(function(E){switch(E.label){case 0:return c>=5?[2,{code:r.UPLOAD_FAIL,msg:"Upload retry times exceeded 5. Procedure"}]:(u=(s-1)*A,d=Math.min(A,t.size-u),l="partNumber=".concat(s,"&uploadId=").concat(n),[4,this._getFileToken(i.fileType,o,"PUT",l)]);case 1:return f=E.sent(),g=t.slice(u,s*A),v=this.getBaseHeaders(t,f,i),[4,Me.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 I=E.sent(),R=I.status,h=I.xhr,200===R||204===R?(a.push((null==h?void 0:h.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 G(t,e),t.prototype.commonUpload=function(e){return k(this,void 0,void 0,(function(){var t,n,o,i,a,s,c,u,d,l,f;return x(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,Me.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 k(this,void 0,void 0,(function(){var t,n,o,r,i;return x(this,(function(a){switch(a.label){case 0:return t=e.file,n=e.onProgress,o=e.fileType,r=M(),[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),k(this,void 0,void 0,(function(){var a,s,c,u,d,l,f,g,v,I;return x(this,(function(R){switch(R.label){case 0:return a=Math.min(A,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,Me.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=R.sent(),g=f.status,v=f.data,200===g||204===g?i+a<t.size?[2,this._requestUploadPart(e,t,n,o,i+a)]:(I=JSON.parse(v),[2,{code:r.SUCCESS,data:{uniqueName:I.rc_url.file_name,downloadUrl:"".concat(l,"/").concat(I.rc_url.path)}}]):[2,{code:r.UPLOAD_FAIL,msg:g.toString()}]}}))}))},t}(bn);function Jn(e,t){return k(this,void 0,void 0,(function(){var n,o,i,a,s,c,u,d,l,f,g,v,I,R,h,E,m,T,S,p,O,N,_,C;return x(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:pn.RCX,url:n,p:"1"}];if(e){return JSON.parse(e).map((function(e){var t={type:pn.QINIU,url:"",p:""};return Object.keys(e).forEach((function(n){"p"===n?t.p=e[n]:(t.type=n,t.url=e[n])})),t})).sort((function(e,t){return e.p-t.p}))}var i=[];o&&i.push({type:pn.QINIU,url:o,p:"1"});r&&i.push({type:pn.BAIDU,url:r,p:"2"});return i}(a,0,i,s,c),0===f.length?[2,Promise.resolve({code:r.BIZ_ERROR_INVALID_PARAMETER,msg:"uploadUrlList is empty"})]:[4,zn(f,e,n,o)];case 1:return g=A.sent(),v=g.code,I=g.data,R=g.msg,v===r.SUCCESS&&I?[4,qn(e,t,I)]:[2,{code:v,msg:R}];case 2:return h=A.sent(),E={downloadUrl:h,uniqueName:(null==I?void 0:I.uniqueName)||"",name:u.name,size:u.size,type:u.type},d!==y.AUDIO?[3,5]:[4,u.arrayBuffer()];case 3:return[4,Yn(A.sent())];case 4:return m=A.sent(),T=m.duration,S=m.length,C=V(V({},E),{duration:T,length:S}),[2,{code:v,data:C}];case 5:return d!==y.IMAGE?[3,7]:[4,jn(u,l)];case 6:return p=A.sent(),O=p.thumbnail,N=p.width,_=p.height,C=V(V({},E),{thumbnail:O,width:N,height:_}),[2,{code:v,data:C}];case 7:return[2,{code:v,data:E}]}}))}))}function qn(e,t,n){return k(this,void 0,void 0,(function(){var o,r,i,a,s,c,u;return x(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 Yn(e){return Dn=Dn||new AudioContext,new Promise((function(t,n){Dn.decodeAudioData(e,(function(e){t({duration:e.duration,length:e.length})}),n)}))}var Kn=((Bn={})[pn.QINIU]=Gn,Bn[pn.ALIYUN]=Vn,Bn[pn.BAIDU]=kn,Bn[pn.S3]=xn,Bn[pn.STC]=Fn,Bn[pn.MINIO]=Hn,Bn[pn.RCX]=Zn,Bn);function zn(e,t,n,o,i){return void 0===i&&(i=[]),k(this,void 0,void 0,(function(){var a,s,c,u,d;return x(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,zn(e,t,n,o,i)]):[2,{code:c,data:u}]}}))}))}function jn(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,I=void 0===v?1:v,R=Xn(a.width,a.height,{maxHeight:u,maxWidth:l,scale:I});r.width=Math.min(R.w,l),r.height=Math.min(R.h,u),i.drawImage(a,R.x,R.y,R.w,R.h);var h=r.toDataURL("string"==typeof e?"image/jpg":e.type,g);h=h.replace(/data:image\/[^;]+;base64,/,""),n({thumbnail:h,width:R.w,height:R.h})},a.src=(window.URL||window.webkitURL).createObjectURL(e)}))}var Xn=function(e,t,n){var o,r,i=n.maxHeight,a=void 0===i?160:i,s=n.maxWidth,c=void 0===s?160:s,u=n.scale,d=e<t,l=0,f=0;return(d?t/e:e/t)>(void 0===u?1:u)?(d?(o=100,f=((r=t/(e/100))-a)/2):(r=100,l=((o=e/(t/100))-c)/2),{w:o,h:r,x:-l,y:-f}):(d?(r=a,o=e/(t/a)):(o=c,r=t/(e/c)),{w:o,h:r,x:-l,y:-f})};function Wn(e,t,n,o){return He((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:rt[e]})}))}))}))}function Qn(e,t,n,o,i){return m("fileType",e,P,!0)&&m("filename",t,f.STRING)&&m("saveName",n,f.STRING)&&m("serverType",i,f.NUMBER)?He((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 $n(e,t,n){return k(this,void 0,void 0,(function(){var o=this;return x(this,(function(s){return[2,He((function(s,c){return k(o,void 0,void 0,(function(){var o,u,d,l,g,v,I,h,E,T,S,p;return x(this,(function(O){switch(O.label){case 0:return n=n||{},t instanceof Tn==!1?(c.warn(R.O,"send message fail -> message parameter is not an instance of BaseMessage"),[2,ot.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(R.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,I=e.pushConfig,R=e.messageId,h=n.channelId;return V({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:I,channelId:h||"",messageId:R},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:w.SEND,receivedTime:0,isStatusMessage:!!n.isStatusMessage,receivedStatus:i.UNREAD,isOffLineMessage:!1,pushConfig:null==n?void 0:n.pushConfig,sentStatus:B.SENDING},o!==a.ULTRA_GROUP&&(v.isOffLineMessage=!1),I=c.createTraceId(),h=function(e){v.messageId=e;try{(null==n?void 0:n.onSendBefore)&&n.onSendBefore(Pe(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:t.messageType,conversationType:o,targetId:u,channelId:d}),I),[4,s.sendMessage(o,u,g,h,I)]):[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]):[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}];case 1:return E=O.sent(),T=E.code,S=E.data,T===r.SUCCESS?(c.info(R.A_SEND_MSG_R,JSON.stringify({code:T,messageUId:S.messageUId,messageId:S.messageId}),I),p=Pe(S),[2,{code:T,data:p}]):(c.warn(R.A_SEND_MSG_R,"send message fail ->".concat(T,":").concat(rt[T],",").concat(l)),v.sentTime=(null==S?void 0:S.sentTime)||0,v.sentStatus=null==S?void 0:S.sentStatus,[2,{code:T,msg:rt[T],data:Pe(v)}])}}))}))}))]}))}))}function eo(e,t,n){return $n(e,new Cn(t),n)}function to(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 He((function(c,u,d){return new Promise((function(c){var d,l=u.createTraceId();u.info(R.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},He((function(e,t,n){return new Promise((function(t){var o=e.getNaviInfoFromCache();Jn(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,V({url:f.downloadUrl},f)))||t(f,o);return u.info(R.L_MEDIA_UPLOAD_R,JSON.stringify({downurl:f.downloadUrl,code:r.SUCCESS}),l),void $n(n,v,a).then(c)}c({code:d,msg:g})}))}))}))}}var no=to(y.FILE,(function(e,t){return new Un({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})),oo=to(y.IMAGE,(function(e,t){return new On({content:e.thumbnail,imageUri:e.downloadUrl,user:t.user,extra:t.extra})})),ro=to(y.IMAGE,(function(e,t){return new yn({gifDataSize:e.size,remoteUrl:e.downloadUrl,width:e.width,height:e.height,user:t.user,extra:t.extra})})),io=to(y.AUDIO,(function(e,t){return new Nn({remoteUrl:e.downloadUrl,duration:e.duration,type:e.type,user:t.user,extra:t.extra})})),ao=to(y.SIGHT,(function(e,t){return new _n({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 so(e,t){return k(this,void 0,void 0,(function(){var n=this;return x(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)&&(L()||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,He((function(o,i){return k(n,void 0,void 0,(function(){var n,a,s,c,u;return x(this,(function(d){switch(d.label){case 0:return n=i.createTraceId(),i.info(R.A_GET_HISTORY_MSG_T,JSON.stringify({targetId:e.targetId,conversationType:e.conversationType,channelId:e.channelId,timestamp:null==t?void 0:t.timestamp,count:null==t?void 0:t.count}),n),[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 Pe(e)})),i.info(R.A_GET_HISTORY_MSG_R,JSON.stringify({code:s,messageLength:u.length}),n),[2,{code:s,data:{list:u,hasMore:c.hasMore}}]):(i.warn(R.A_GET_HISTORY_MSG_R,JSON.stringify({code:s,messageUIds:""}),n),[2,{code:s,msg:rt[s]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function co(e,t){return k(this,void 0,void 0,(function(){var n=this;return x(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,He((function(o,i){return k(n,void 0,void 0,(function(){var n,a,s,c,u;return x(this,(function(d){switch(d.label){case 0:return n="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),i.debug(R.O,"get history message ->".concat(n)),[4,o.getRemoteHistoryMessages(e.conversationType,e.targetId,(null==t?void 0:t.timestamp)||0,(null==t?void 0:t.count)||20,(null==t?void 0:t.order)||0,e.channelId||"")];case 1:return a=d.sent(),s=a.code,c=a.data,s===r.SUCCESS&&c?(u=c.list.map((function(e){return Pe(e)})),[2,{code:s,data:{list:u,hasMore:c.hasMore}}]):(i.warn(R.O,"get history message fail ->".concat(s,":").concat(rt[s],",").concat(n)),[2,{code:s,msg:rt[s]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function uo(e,t,n,o){return k(this,void 0,void 0,(function(){var i=this;return x(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,He((function(r){return k(i,void 0,void 0,(function(){var r,i,s,c,u;return x(this,(function(d){switch(d.label){case 0:return r={targetId:e,conversationType:a.PRIVATE,channelId:o},i=new Tn("RC:ReadNtf",{messageUId:t,lastMessageSendTime:n,type:1}),[4,$n(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 lo(e,t,n){return k(this,void 0,void 0,(function(){var o=this;return x(this,(function(i){return m("messageUId",t,f.STRING,!0)&&m("targetId",e,f.STRING,!0)&&m("channelId",n,f.CHANNEL_ID)?[2,He((function(r,i){return k(o,void 0,void 0,(function(){var o,r,s,c,u;return x(this,(function(d){switch(d.label){case 0:return o="messageUId:".concat(t,",targetId:").concat(e),i.debug(R.O,"send read receipt message ->".concat(o)),r=new Tn("RC:RRReqMsg",{messageUId:t}),[4,$n({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 fo(e,t,n){return k(this,void 0,void 0,(function(){return x(this,(function(e){throw new Error("This method is deprecated, please use method sendReadReceiptResponseV2.")}))}))}function go(e,t,n){return k(this,void 0,void 0,(function(){var o=this;return x(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,He((function(i,s){return k(o,void 0,void 0,(function(){var o,c,u,d,l,f;return x(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(R.O,"Error in parameter messageList."),[2,{code:r.PARAMETER_ERROR}]));case 1:return c=g.sent(),[3,4];case 2:return l=new Tn("RC:RRRspMsg",{receiptMessageDic:t}),[4,$n(o,l)];case 3:c=g.sent(),g.label=4;case 4:return(f=c.code)===r.SUCCESS?[2,{code:f}]:(s.warn(R.O,"send read receipt message fail ->".concat(f,":").concat(rt[f])),[2,{code:f,msg:rt[f]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function vo(e,t){return k(this,void 0,void 0,(function(){var n,o,i,a;return x(this,(function(s){switch(s.label){case 0:return m("conversation",e,f.CONVERSATION,!0)&&m("lastMessageSendTime",t,f.NUMBER,!0)?(n=new Tn("RC:SRSMsg",{lastMessageSendTime:t}),[4,$n(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 Io(e,t){return k(this,void 0,void 0,(function(){var n=this;return x(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,He((function(o,i){return k(n,void 0,void 0,(function(){var n,a,s,c,u;return x(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(R.O,"recall message ->".concat(a)),[4,o.recallMessage(e.conversationType,e.targetId,t.messageUId,t.sentTime,n)];case 1:return s=d.sent(),c=s.code,u=s.data,c===r.SUCCESS&&u?[2,{code:c,data:Pe(u)}]:c===r.SUCCESS?[2,{code:c}]:(i.warn(R.O,"recall message fail ->".concat(c,":").concat(rt[c],",").concat(a)),[2,{code:c,msg:rt[c]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Ro(e,t){return k(this,void 0,void 0,(function(){var n=this;return x(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,He((function(o,i){return k(n,void 0,void 0,(function(){var n,a;return x(this,(function(s){switch(s.label){case 0:return n="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),i.debug(R.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(R.O,"delete message fail ->".concat(a,":").concat(rt[a],",").concat(n)),[2,{code:a,msg:rt[a]}]):[2,{code:r.SUCCESS}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function ho(e,t){return k(this,void 0,void 0,(function(){var n=this;return x(this,(function(o){return m("conversation",e,f.CONVERSATION,!0)&&m("timestamp",t,f.NUMBER,!0)?[2,He((function(o,i){return k(n,void 0,void 0,(function(){var n,a;return x(this,(function(s){switch(s.label){case 0:return n="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),i.debug(R.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(R.O,"clear message ->".concat(a,":").concat(rt[a],",").concat(n)),[2,{code:a,msg:rt[a]}]):[2,{code:r.SUCCESS}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Eo(e,t){return k(this,void 0,void 0,(function(){var n=this;return x(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,He((function(o,i){return k(n,void 0,void 0,(function(){var n,a,s,c,u,d,l,f;return x(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(R.O,"update message expansion ->".concat(l)),[4,o.sendExpansionMessage({conversationType:n,targetId:a,messageUId:s,expansion:e,canIncludeExpansion:c,originExpansion:u,channelId:d})];case 1:return(f=g.sent().code)!==r.SUCCESS?(i.warn(R.O,"update message expansion fail ->".concat(f,":").concat(rt[f],",").concat(l)),[2,{code:f,msg:rt[f]}]):[2,{code:f}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function mo(e,t){return k(this,void 0,void 0,(function(){var n=this;return x(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,He((function(o,i){return k(n,void 0,void 0,(function(){var n,a,s,c,u,d,l;return x(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(R.O,"remove message expansion ->".concat(d)),[4,o.sendExpansionMessage({conversationType:n,targetId:a,messageUId:s,canIncludeExpansion:c,keys:e,channelId:u})];case 1:return(l=f.sent().code)!==r.SUCCESS?(i.warn(R.O,"remove message expansion fail ->".concat(l,":").concat(rt[l],",").concat(d)),[2,{code:l,msg:rt[l]}]):[2,{code:l}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function To(e,t){return k(this,void 0,void 0,(function(){var n=this;return x(this,(function(o){return m("conversation",e,f.CONVERSATION,!0)&&m("typingContentType",t,f.STRING,!0)?[2,He((function(o,i){return k(n,void 0,void 0,(function(){var n,a,s,c,u,d;return x(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(R.A_SEND_MSG_T,JSON.stringify({messageType:n.messageType,conversationType:e.conversationType,targetId:e.targetId,channelId:e.channelId}),a),[4,o.sendMessage(e.conversationType,e.targetId,n,void 0,a)];case 1:return s=l.sent(),c=s.code,u=s.data,d=c===r.SUCCESS?"info":"warn",i[d](R.A_SEND_MSG_R,JSON.stringify({code:c,messageUId:u?u.messageUId:"",messageId:u?u.messageId:""}),a),c===r.SUCCESS?[2,{code:c,data:Pe(u)}]:[2,{code:c,msg:rt[c]}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function So(e,t,n){return k(this,void 0,void 0,(function(){var o=this;return x(this,(function(i){return m("messageUId",t,f.STRING,!0)&&m("targetId",e,f.STRING,!0)&&m("channelId",n,f.CHANNEL_ID)?[2,He((function(i,a){return k(o,void 0,void 0,(function(){var o,s,c,u;return x(this,(function(d){switch(d.label){case 0:return o="messageUId:".concat(t,",targetId:").concat(e),a.debug(R.O,"get message reader ->".concat(o)),[4,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(R.O,"get message reader fail ->".concat(c,":").concat(rt[c],",").concat(o)),[2,{code:c,msg:rt[c]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function po(e,t,n,o,r){return Fe((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(R.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 Oo(e){return k(this,void 0,void 0,(function(){var t=this;return x(this,(function(n){return L()?m("conversation",e,f.CONVERSATION,!0)?[2,He((function(n,o){return k(t,void 0,void 0,(function(){var t,i,a,s;return x(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&&Pe(a)||null,[2,{code:i,data:s}]):(o.warn(R.O,"insertMessage ->code:".concat(i,",targetId:").concat(e.targetId)),[2,{code:i,msg:rt[i]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:rt[r.NOT_SUPPORT]}]}))}))}function No(e,t,n){return void 0===n&&(n={}),k(this,void 0,void 0,(function(){var o=this;return x(this,(function(i){return we("RongIMLib.insertMessage","RongIMLib.ElectronExtension.insertMessage"),L()?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,He((function(i,a){return k(o,void 0,void 0,(function(){var o,s,c,u,d,l,f,g,v,I,h,E,m,T,S,p;return x(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,I=t.sentStatus,a.info(R.O,"insertMessage ->targetId:".concat(e.targetId,",conversationType:").concat(e.conversationType)),h=n.isUnread,E=n.searchContent,m={senderUserId:o,messageType:s,content:c,messageDirection:u,sentTime:v,sentStatus:I,searchContent:E,isUnread:h,messageUId:d,disableNotification:g,canIncludeExpansion:l,expansionMsg:JSON.stringify(f),channelId:e.channelId||""},[4,i.insertMessage(e.conversationType,e.targetId,m)];case 1:return T=O.sent(),S=T.code,p=T.data,S===r.SUCCESS?[2,{code:S,data:Pe(p)}]:(a.warn(R.O,"insertMessage ->code:".concat(S,",targetId:").concat(e.targetId)),[2,{code:S,msg:rt[S]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:rt[r.NOT_SUPPORT]}]}))}))}function _o(e){return k(this,void 0,void 0,(function(){var t=this;return x(this,(function(n){return L()?m("messageId",e,(function(e){return s(e)||_(e)}),!0)?[2,He((function(n,o){return k(t,void 0,void 0,(function(){var t,i,a;return x(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:Pe(a)}]:(o.warn(R.O,"getMessage ->code:".concat(i,",messageId:").concat(e)),[2,{code:i,msg:rt[i]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:rt[r.NOT_SUPPORT]}]}))}))}function Co(e){if(!L())return{code:r.NOT_SUPPORT,msg:rt[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(Pe(e))})),{code:r.SUCCESS,data:a}},Ge?t(Ge,ke,Ve):{code:r.BIZ_ERROR_CLIENT_NOT_INIT}):{code:r.BIZ_ERROR_INVALID_PARAMETER}}function Ao(e,t,n,o){return k(this,void 0,void 0,(function(){var i=this;return x(this,(function(a){return we("RongIMLib.searchMessages","RongIMLib.ElectronExtension.searchMessages"),L()?m("conversation",e,f.CONVERSATION,!0)&&m("keyword",t,f.STRING,!0)&&m("timestamp",n,f.NUMBER)&&m("count",o,f.NUMBER)?[2,He((function(a,s){return k(i,void 0,void 0,(function(){var i,c,u,d;return x(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(Pe(e))})),[2,{code:c,data:{messages:d,count:null==u?void 0:u.count}}]):(s.warn(R.O,"searchMessages ->code:".concat(c,",targetId:").concat(e.targetId)),[2,{code:c,msg:rt[c]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:rt[r.NOT_SUPPORT]}]}))}))}function Uo(e,t,n){return k(this,void 0,void 0,(function(){var o,i,a,s=this;return x(this,(function(c){return we("RongIMLib.deleteLocalMessagesByTimestamp","RongIMLib.ElectronExtension.deleteMessagesByTimestamp"),L()?(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,He((function(c,u){return k(s,void 0,void 0,(function(){var s;return x(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(R.A_DELETE_MESSAGES_S,JSON.stringify({code:s,conversationType:o,targetId:i,channelId:a,timestamp:t})),s===r.SUCCESS?[2,{code:s}]:(u.warn(R.O,"deleteLocalMessagesByTimestamp ->code:".concat(s,",targetId:").concat(e.targetId)),[2,{code:s,msg:rt[s]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]):[2,{code:r.NOT_SUPPORT,msg:rt[r.NOT_SUPPORT]}]}))}))}function yo(e){return k(this,void 0,void 0,(function(){var t=this;return x(this,(function(n){return we("RongIMLib.clearMessages","RongIMLib.ElectronExtension.clearMessages"),L()?[2,He((function(n,o){return k(t,void 0,void 0,(function(){var t,i,a,s;return x(this,(function(c){switch(c.label){case 0:return t=e.conversationType,i=e.targetId,a=e.channelId,o.info(R.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(R.O,"clearMessages ->code:".concat(s,",targetId:").concat(i)),[2,{code:s,msg:rt[s]}])}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:rt[r.NOT_SUPPORT]}]}))}))}function Mo(e,t,n,o){return k(this,void 0,void 0,(function(){var i=this;return x(this,(function(a){return we("RongIMLib.searchConversationByContent","RongIMLib.ElectronExtension.searchConversationByContent"),L()?[2,He((function(a,s){return k(i,void 0,void 0,(function(){var i,c,u;return x(this,(function(d){switch(d.label){case 0:return s.info(R.O,"searchConversationByContent ->keyword:".concat(e)),[4,a.searchConversationByContent(e,n,o,t)];case 1:return i=d.sent(),c=i.code,u=i.data,c===r.SUCCESS?[2,{code:c,data:u}]:(s.warn(R.O,"searchConversationByContent ->code:".concat(c,",keyword:").concat(e)),[2,{code:c,msg:rt[c]}])}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:rt[r.NOT_SUPPORT]}]}))}))}function Po(e,t){return k(this,void 0,void 0,(function(){var n=this;return x(this,(function(o){return L()?m("conversation",e,f.CONVERSATION,!0)&&m("timestamp",t,f.NUMBER)?[2,He((function(o,i){return k(n,void 0,void 0,(function(){var n,a,s,c;return x(this,(function(u){switch(u.label){case 0:return n=e.conversationType,a=e.targetId,s=e.channelId,i.info(R.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(R.O,"clearUnreadCountByTimestamp ->code:".concat(c,",targetId:").concat(a)),[2,{code:c,msg:rt[c]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:rt[r.NOT_SUPPORT]}]}))}))}function Lo(e,t){return k(this,void 0,void 0,(function(){var n=this;return x(this,(function(o){return we("RongIMLib.setMessageReceivedStatus","RongIMLib.ElectronExtension.setMessageReceivedStatus"),L()?m("messageId",e,f.NUMBER,!0)&&m("receivedStatus",t,f.NUMBER,!0)?[2,He((function(o,i){return k(n,void 0,void 0,(function(){var n;return x(this,(function(a){switch(a.label){case 0:return i.info(R.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(R.O,"setMessageReceivedStatus ->code:".concat(n,",messageId:").concat(e)),[2,{code:n,msg:rt[n]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:rt[r.NOT_SUPPORT]}]}))}))}function wo(e){return k(this,void 0,void 0,(function(){var t=this;return x(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,He((function(n,o){return k(t,void 0,void 0,(function(){var t;return x(this,(function(i){switch(i.label){case 0:return o.info(R.O,"createTag ->tagId:".concat(e.tagId,",tagName:").concat(e.tagName)),[4,n.createTag(e)];case 1:return(t=i.sent().code)===r.SUCCESS?[2,{code:t}]:(o.warn(R.O,"createTag ->code:".concat(t,",tagId:").concat(e.tagId)),[2,{code:t,msg:rt[t]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Bo(e){return k(this,void 0,void 0,(function(){var t=this;return x(this,(function(n){return m("tagId",e,f.STRING,!0)?[2,He((function(n,o){return k(t,void 0,void 0,(function(){var t;return x(this,(function(i){switch(i.label){case 0:return o.info(R.O,"removeTag ->tagId:".concat(e)),[4,n.removeTag(e)];case 1:return(t=i.sent().code)===r.SUCCESS?[2,{code:t}]:(o.warn(R.O,"removeTag ->code:".concat(t,",tagId:").concat(e)),[2,{code:t,msg:rt[t]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Do(e){return k(this,void 0,void 0,(function(){var t=this;return x(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,He((function(n,o){return k(t,void 0,void 0,(function(){var t;return x(this,(function(i){switch(i.label){case 0:return o.info(R.O,"updateTag ->tagId:".concat(e.tagId,",tagName:").concat(e.tagName)),[4,n.updateTag(e)];case 1:return(t=i.sent().code)===r.SUCCESS?[2,{code:t}]:(o.warn(R.O,"updateTag ->code:".concat(t,",tagId:").concat(e.tagId)),[2,{code:t,msg:rt[t]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function bo(){return k(this,void 0,void 0,(function(){var e=this;return x(this,(function(t){return[2,He((function(t,n){return k(e,void 0,void 0,(function(){var e,o,i;return x(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(R.O,"getTagList ->code:".concat(o)),[2,{code:r.SUCCESS,data:i}]}}))}))}))]}))}))}function Go(e){return k(this,void 0,void 0,(function(){var t=this;return x(this,(function(n){return m("conversation",e,f.CONVERSATION,!0)?[2,He((function(n,o){return k(t,void 0,void 0,(function(){var t,i,a;return x(this,(function(s){switch(s.label){case 0:return o.info(R.O,"getTagsForConversation ->targetId:".concat(e.targetId,",conversationType:").concat(e.conversationType)),[4,n.getTagsForConversation(e)];case 1:return t=s.sent(),i=t.code,a=t.data,i===r.SUCCESS?[2,{code:i,data:a}]:[2,{code:i,msg:rt[i]}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Vo(e,t){return k(this,void 0,void 0,(function(){var n=this;return x(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,He((function(o,i){return k(n,void 0,void 0,(function(){var n;return x(this,(function(a){switch(a.label){case 0:return i.info(R.O,"addTagForConversations ->tagId:".concat(e)),[4,o.addTagForConversations(e,t)];case 1:return(n=a.sent().code)===r.SUCCESS?[2,{code:n}]:(i.warn(R.O,"addTagForConversations ->code:".concat(n,",tagId:").concat(e)),[2,{code:n,msg:rt[n]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function ko(e,t){return k(this,void 0,void 0,(function(){var n=this;return x(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,He((function(o,i){return k(n,void 0,void 0,(function(){var n;return x(this,(function(a){switch(a.label){case 0:return i.info(R.O,"removeTagForConversations ->tagId:".concat(e)),[4,o.removeTagForConversations(e,t)];case 1:return(n=a.sent().code)===r.SUCCESS?[2,{code:n}]:(i.warn(R.O,"removeTagForConversations ->code:".concat(n,",tagId:").concat(e)),[2,{code:n,msg:rt[n]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function xo(e,t){return k(this,void 0,void 0,(function(){var n=this;return x(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,He((function(o,i){return k(n,void 0,void 0,(function(){var n;return x(this,(function(a){switch(a.label){case 0:return i.info(R.O,"removeTagsForConversation ->tagIds:".concat(t,",targetId:").concat(e.targetId,",conversationType:").concat(e.conversationType)),[4,o.removeTagsForConversation(e,t)];case 1:return(n=a.sent().code)===r.SUCCESS?[2,{code:n}]:(i.warn(R.O,"removeTagsForConversation ->code:".concat(n,",tagIds:").concat(t)),[2,{code:n,msg:rt[n]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Fo(e,t){return k(this,void 0,void 0,(function(){var n=this;return x(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,He((function(o,i){return k(n,void 0,void 0,(function(){var n;return x(this,(function(a){switch(a.label){case 0:return i.info(R.O,"removeTagForConversations ->tagId:".concat(e)),[4,o.removeTagForConversations(e,t)];case 1:return(n=a.sent().code)===r.SUCCESS?[2,{code:n}]:(i.warn(R.O,"removeTagForConversations ->code:".concat(n,",tagId:").concat(e)),[2,{code:n,msg:rt[n]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Ho(e,t,n){return k(this,void 0,void 0,(function(){var o=this;return x(this,(function(i){return m("tagId",e,f.STRING,!0)&&m("count",t,f.NUMBER,!0)&&m("startTime",n,f.NUMBER,!0)?[2,He((function(i,a){return k(o,void 0,void 0,(function(){var o,s,c;return x(this,(function(u){switch(u.label){case 0:return a.info(R.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 V(V({},Le(e)),{isTopInTag:e.isTopInTag})}(e)}))}]:(a.warn(R.O,"getConversationListByTag ->code:".concat(s,",tagId:").concat(e)),[2,{code:s,msg:rt[s]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Zo(e,t){return k(this,void 0,void 0,(function(){var n=this;return x(this,(function(o){return m("tagId",e,f.STRING,!0)&&m("containMuted",t,f.BOOLEAN,!0)?[2,He((function(o,r){return k(n,void 0,void 0,(function(){var n,i,a;return x(this,(function(s){switch(s.label){case 0:return r.info(R.O,"getUnreadCountByTag ->tagId:".concat(e)),[4,o.getUnreadCountByTag(e,t)];case 1:return n=s.sent(),i=n.code,a=n.data,[2,{code:i,data:a}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Jo(e,t,n){return k(this,void 0,void 0,(function(){var o=this;return x(this,(function(i){return m("tagId",e,f.STRING,!0)&&m("conversation",t,f.CONVERSATION,!0)&&m("status.isTop",n,f.BOOLEAN,!0)?[2,He((function(i,a){return k(o,void 0,void 0,(function(){var o;return x(this,(function(s){switch(s.label){case 0:return a.info(R.O,"setConversationStatusInTag ->tagId:".concat(e,",targetId:").concat(t.targetId,",conversationType").concat(t.conversationType)),[4,i.setConversationStatusInTag(e,t,{isTop:n})];case 1:return(o=s.sent().code)===r.SUCCESS?[2,{code:o}]:(a.warn(R.O,"setConversationStatusInTag ->code:".concat(o,",tagId:").concat(e)),[2,{code:o,msg:rt[o]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}to(y.COMBINE_HTML,(function(e,t){return new An({remoteUrl:e.downloadUrl,nameList:t.nameList,summaryList:t.summaryList,conversationType:t.conversationType,user:t.user,extra:t.extra})}));var qo={COMET:"comet",WEBSOCKET:"websocket"},Yo={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 k(this,void 0,void 0,(function(){var t=this;return x(this,(function(n){return L()?m("channelId",e,f.CHANNEL_ID)?[2,He((function(n,o){return k(t,void 0,void 0,(function(){var t,i,a,s;return x(this,(function(c){switch(c.label){case 0:return o.info(R.O,"getAllConversationList -> channelId: ".concat(e)),D(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 Le(e)})),[2,{code:i,data:s}]):(o.warn(R.O,"getAllConversationList fail -> code: ".concat(i," channelId: ").concat(e)),[2,{code:i,msg:rt[i]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:rt[r.NOT_SUPPORT]}]}))}))},getConversationList:function(e,t,n){return k(this,void 0,void 0,(function(){var o=this;return x(this,(function(i){return L()?m("startTime",e,f.NUMBER,!0)&&m("count",t,f.NUMBER,!0)&&m("channelId",n,f.CHANNEL_ID)?[2,He((function(i,a){return k(o,void 0,void 0,(function(){var o,s,c,u,d,l;return x(this,(function(f){switch(f.label){case 0:return o="startTime: ".concat(e,", count: ").concat(t,", channelId: ").concat(n),a.info(R.O,"getConversationList -> ".concat(o)),D(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 Le(e)})),[2,{code:u,data:l}]):(a.warn(R.O,"getConversationList fail -> code: ".concat(u," ").concat(o)),[2,{code:u,msg:rt[u]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:rt[r.NOT_SUPPORT]}]}))}))},searchConversationByContent:function(e,t,n){return k(this,void 0,void 0,(function(){var o=this;return x(this,(function(i){return L()?m("keyword",e,f.STRING,!0)&&m("messageTypes",t,f.ARRAY,!0)&&m("channelId",n,f.CHANNEL_ID)&&!t.some((function(e){return!m("messageType",e,f.STRING,!0)}))?[2,He((function(i,a){return k(o,void 0,void 0,(function(){var o,s,c,u,d;return x(this,(function(l){switch(l.label){case 0:return o="keyword: ".concat(e,", messageTypes: ").concat(JSON.stringify(t),", channelId: ").concat(n),a.info(R.O,"searchConversationByContent -> ".concat(o)),D(n)?[4,i.searchConversationByContentWithAllChannel(e,t)]:[3,2];case 1:return s=l.sent(),[3,4];case 2:return[4,i.searchConversationByContent(e,t,n)];case 3:s=l.sent(),l.label=4;case 4:return c=s.code,u=s.data,c===r.SUCCESS&&u?(d=u.map((function(e){return Le(e)})),[2,{code:c,data:d}]):(a.warn(R.O,"searchConversationByContent fail -> code: ".concat(c," ").concat(o)),[2,{code:c,msg:rt[c]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:rt[r.NOT_SUPPORT]}]}))}))},searchMessages:function(e,t,n,o){return k(this,void 0,void 0,(function(){var i=this;return x(this,(function(a){return L()?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,He((function(a,s){return k(i,void 0,void 0,(function(){var i,c,u,d,l,f,g,v,I,h;return x(this,(function(E){switch(E.label){case 0:return i="conversation: ".concat(JSON.stringify(e),", keyword: ").concat(t,", timestamp: ").concat(n,", count: ").concat(o),s.info(R.O,"searchMessages -> ".concat(i)),c=e.targetId,u=e.conversationType,d=e.channelId,D(d)?[4,a.searchMessageByContentWithAllChannel(u,c,t,n,o)]:[3,2];case 1:return l=E.sent(),[3,4];case 2:return 0,[4,a.searchMessageByContent(u,c,t,n,o,0,d)];case 3:l=E.sent(),E.label=4;case 4:return f=l.code,g=l.data,f===r.SUCCESS&&g?(v=g.messages,I=g.count,h=v.map((function(e){return Pe(e)})),[2,{code:f,data:{messages:h,count:I}}]):(s.warn(R.O,"searchMessages fail -> code: ".concat(f," ").concat(i)),[2,{code:f,msg:rt[f]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:rt[r.NOT_SUPPORT]}]}))}))},searchMessageInTimeRange:function(e,t){return k(this,void 0,void 0,(function(){var n=this;return x(this,(function(o){return L()?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,He((function(o,i){return k(n,void 0,void 0,(function(){var n,a,s,c,u,d,l,f,g,v,I;return x(this,(function(h){switch(h.label){case 0:return n="conversation: ".concat(JSON.stringify(e),", option: ").concat(JSON.stringify(t)),i.info(R.O,"searchMessageInTimeRange -> ".concat(n)),a=e.conversationType,s=e.targetId,c=t.keyword,u=t.startTime,d=t.endTime,l=t.offset,f=t.limit,l=l||0,f=f||5,[4,o.searchMessageByContentInTimeRangeWithAllChannel(a,s,c,u,d,l,f)];case 1:return g=h.sent(),v=g.code,I=g.data,v===r.SUCCESS&&I?[2,{code:v,data:{messages:I.messages.map((function(e){return Pe(e)}))}}]:(i.warn(R.O,"searchMessageInTimeRange fail -> code: ".concat(v,", ").concat(n)),[2,{code:v}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:rt[r.NOT_SUPPORT]}]}))}))},searchMessagesByUser:function(e,t,n,o){return k(this,void 0,void 0,(function(){var i=this;return x(this,(function(a){return L()?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,He((function(a,s){return k(i,void 0,void 0,(function(){var i,c,u,d,l,f,g;return x(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(R.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 Pe(e)}))}}]:(s.warn(R.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:rt[r.NOT_SUPPORT]}]}))}))},getHistoryMessagesByMessageTypes:function(e,t){return k(this,void 0,void 0,(function(){var n=this;return x(this,(function(o){return L()?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,He((function(o,i){return k(n,void 0,void 0,(function(){var n,a,s,c,u,d,l,f,g,v,I,h,E,m,T;return x(this,(function(S){switch(S.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(R.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=S.sent(),v=g.code,I=g.data,v===r.SUCCESS?(E=(h=I).list,m=h.hasMore,T=E.map((function(e){return Pe(e)})),[2,{code:v,data:{messages:T,hasMore:m,list:T}}]):(i.warn(R.O,"getHistoryMessagesByMessageTypes fail -> code: ".concat(v," ").concat(u)),[2,{code:v,msg:rt[v]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:rt[r.NOT_SUPPORT]}]}))}))},setMessageStatusToRead:function(e,t){return k(this,void 0,void 0,(function(){var n=this;return x(this,(function(o){return L()?m("conversation",e,f.CONVERSATION,!0)&&m("timestamp",t,f.NUMBER,!0)?[2,He((function(o,r){return k(n,void 0,void 0,(function(){var n,i,a,s;return x(this,(function(c){switch(c.label){case 0:return n="conversation: ".concat(JSON.stringify(e),", timestamp: ").concat(t),r.info(R.O,"updateSentMsgReceiptStatus -> ".concat(n)),i=e.conversationType,a=e.targetId,s=e.channelId,[4,o.setMessageStatusToRead(i,a,t,s)];case 1:return[2,c.sent()]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:rt[r.NOT_SUPPORT]}]}))}))},setMessageReceivedStatus:function(e,t){return k(this,void 0,void 0,(function(){var n=this;return x(this,(function(o){return L()?m("messageId",e,f.NUMBER,!0)&&m("receivedStatus",t,(function(e){return!D(i[e])}),!0)?[2,He((function(o,r){return k(n,void 0,void 0,(function(){return x(this,(function(n){switch(n.label){case 0:return r.info(R.O,"setMessageReceivedStatus -> messageId: ".concat(e,", receivedStatus: ").concat(t)),[4,o.setMessageReceivedStatus(e,t)];case 1:return[2,{code:n.sent()}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:rt[r.NOT_SUPPORT]}]}))}))},setMessageSentStatus:function(e,t){return k(this,void 0,void 0,(function(){var n=this;return x(this,(function(o){return L()?m("messageId",e,f.NUMBER,!0)&&m("sentStatus",t,(function(e){return!D(B[e])}),!0)?[2,He((function(o,r){return k(n,void 0,void 0,(function(){return x(this,(function(n){switch(n.label){case 0:return r.info(R.O,"setMessageSentStatus ->messageId: ".concat(e,", sentStatus: ").concat(t)),[4,o.setMessageSentStatus(e,t)];case 1:return[2,{code:n.sent()}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:rt[r.NOT_SUPPORT]}]}))}))},setMessageContent:function(e,t,n){return void 0===n&&(n=""),k(this,void 0,void 0,(function(){var o=this;return x(this,(function(i){return L()?m("messageId",e,f.NUMBER,!0)&&m("content",t,f.OBJECT,!0)&&m("messageType",n,f.ONLY_STRING,!0)?[2,He((function(r,i){return k(o,void 0,void 0,(function(){return x(this,(function(o){switch(o.label){case 0:return i.info(R.O,"setMessageSentStatus ->messageId: ".concat(e,", messageType: ").concat(n)),[4,r.setMessageContent(e,t,n)];case 1:return[2,{code:o.sent()}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:rt[r.NOT_SUPPORT]}]}))}))},deleteMessages:function(e){return k(this,void 0,void 0,(function(){var t=this;return x(this,(function(n){return L()?!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,He((function(n,o){return k(t,void 0,void 0,(function(){return x(this,(function(t){switch(t.label){case 0:return o.info(R.O,"deleteMessages ->messageIds: ".concat(JSON.stringify(e))),[4,n.deleteMessages(e)];case 1:return[2,{code:t.sent()}]}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:rt[r.NOT_SUPPORT]}]}))}))},clearMessages:function(e){return k(this,void 0,void 0,(function(){var t=this;return x(this,(function(n){return L()?[2,He((function(n,o){return k(t,void 0,void 0,(function(){var t,r,i;return x(this,(function(a){switch(a.label){case 0:return t=e.conversationType,r=e.targetId,i=e.channelId,o.info(R.O,"clearMessages ->targetId:".concat(r,",conversationType:").concat(t)),[4,n.clearMessages(t,r,i)];case 1:return[2,{code:a.sent()}]}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:rt[r.NOT_SUPPORT]}]}))}))},deleteMessagesByTimestamp:function(e,t,n){return k(this,void 0,void 0,(function(){var o,i,a,s=this;return x(this,(function(c){return L()?(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,He((function(e,r){return k(s,void 0,void 0,(function(){return x(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:rt[r.NOT_SUPPORT]}]}))}))},insertMessage:function(e,t,n){return void 0===n&&(n={}),k(this,void 0,void 0,(function(){var o=this;return x(this,(function(i){return L()?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 Tn||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,He((function(i,a){return k(o,void 0,void 0,(function(){var o,s,c,u,d,l,f,g,v,I,h,E,m,T,S;return x(this,(function(p){switch(p.label){case 0:return o="",s=1,l=!1,g=t.messageType,v=t.content,t instanceof Tn||(o=t.senderUserId,s=t.messageDirection,l=t.canIncludeExpansion,f=t.expansion,d=t.disableNotification,c=t.sentTime,u=t.sentStatus),a.info(R.O,"insertMessage ->targetId:".concat(e.targetId,",conversationType:").concat(e.conversationType)),I=n.isUnread,h=n.searchContent,E={senderUserId:o,messageType:g,content:v,messageDirection:s,sentTime:c,sentStatus:u,searchContent:h,isUnread:I,messageUId:"",disableNotification:d,canIncludeExpansion:l,expansionMsg:JSON.stringify(f),channelId:e.channelId||""},[4,i.insertMessage(e.conversationType,e.targetId,E)];case 1:return m=p.sent(),T=m.code,S=m.data,T===r.SUCCESS?[2,{code:T,data:Pe(S)}]:(a.warn(R.O,"insertMessage ->code:".concat(T,",targetId:").concat(e.targetId)),[2,{code:T,msg:rt[T]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:rt[r.NOT_SUPPORT]}]}))}))},batchInsertMessage:function(e,t){var n,o;return k(this,void 0,void 0,(function(){var i,s=this;return x(this,(function(c){if(!L())return[2,{code:r.NOT_SUPPORT,msg:rt[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,He((function(n){return k(s,void 0,void 0,(function(){var o,i,a;return x(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:rt[i]}]}}))}))}))]}))}))},getMessageCount:function(e){return k(this,void 0,void 0,(function(){var t=this;return x(this,(function(n){return L()?[2,He((function(n){return k(t,void 0,void 0,(function(){var t,o,r,i,a,s;return x(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:rt[r.NOT_SUPPORT]}]}))}))},getPrivateMessageDeliverTime:function(e){return k(this,void 0,void 0,(function(){var t=this;return x(this,(function(n){return L()?m("messageUId",e,f.STRING,!0)?[2,He((function(n,o){return k(t,void 0,void 0,(function(){var t,i,a;return x(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(R.A_GET_PRIVATE_MESSAGE_DELIVER_TIME_E,"code:".concat(i,",messageUId:").concat(e)),[2,{code:i,msg:rt[i]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:rt[r.NOT_SUPPORT]}]}))}))},getGroupMessageDeliverList:function(e,t){return k(this,void 0,void 0,(function(){var n=this;return x(this,(function(o){return L()?m("targetId",e,f.STRING,!0)&&m("messageUId",t,f.STRING,!0)?[2,He((function(o,i){return k(n,void 0,void 0,(function(){var n,a,s;return x(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(R.A_GET_GROUP_MESSAGE_DELIVER_LIST_E,"code:".concat(a,", targetId:").concat(e," messageUId:").concat(t)),[2,{code:a,msg:rt[a]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:rt[r.NOT_SUPPORT]}]}))}))},setCheckDuplicateMessage:function(e){return k(this,void 0,void 0,(function(){var t=this;return x(this,(function(n){return L()?m("enableCheck",e,f.BOOLEAN)?[2,He((function(n){return k(t,void 0,void 0,(function(){return x(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:rt[r.NOT_SUPPORT]}]}))}))},clearLocalData:function(){return k(this,void 0,void 0,(function(){var e=this;return x(this,(function(t){return L()?[2,He((function(t,n){return k(e,void 0,void 0,(function(){var e,o,r;return x(this,(function(i){switch(i.label){case 0:return n.info(R.O,"clearLocalData ->"),[4,t.clearData()];case 1:return e=i.sent(),o=e.code,r=e.data,[2,{code:o,data:r}]}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:rt[r.NOT_SUPPORT]}]}))}))}}),zo=function(e,t,n){this.type=e,this.userIdList=t,this.mentionedContent=n};function jo(e){return k(this,void 0,void 0,(function(){var t=this;return x(this,(function(n){return!e||m("proxy.socksHost",e.socksHost,f.STRING,!0)&&m("proxy.socksPort",e.socksPort,f.NUMBER,!0)?[2,He((function(n,o){return k(t,void 0,void 0,(function(){var t;return x(this,(function(i){switch(i.label){case 0:return o.info(R.O,"setProxy: ->".concat(e)),[4,n.setProxy(e)];case 1:return(t=i.sent().code)===r.SUCCESS?[2,{code:t}]:(o.warn(R.O,"setProxy ->code:".concat(t)),[2,{code:t,msg:rt[t]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Xo(){return k(this,void 0,void 0,(function(){var e=this;return x(this,(function(t){return[2,He((function(t,n){return k(e,void 0,void 0,(function(){var e,o,i;return x(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(R.O,"getProxy ->code:".concat(o)),[2,{code:o,msg:rt[o]}])}}))}))}))]}))}))}function Wo(e,t){return k(this,void 0,void 0,(function(){var n=this;return x(this,(function(o){return!e||m("proxy.socksHost",e.socksHost,f.STRING,!0)&&m("proxy.socksPort",e.socksPort,f.NUMBER,!0)?[2,He((function(o,i){return k(n,void 0,void 0,(function(){var n,a,s;return x(this,(function(c){switch(c.label){case 0:return i.info(R.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(R.O,"testProxy ->code:".concat(a)),[2,{code:a,msg:rt[a]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}export{Tn as BaseMessage,An as CombineMessage,qo as ConnectType,Ae as Events,Un as FileMessage,yn as GIFMessage,Nn as HQVoiceMessage,On as ImageMessage,Pn as LocationMessage,zo as MentionedInfoBody,Yo as MessageType,Ln as ReferenceMessage,wn as RichContentMessage,_n as SightMessage,Cn as TextMessage,Mn as VoiceMessage,$e as __addSDKVersion,Vo as addConversationsToTag,Ze as addEventListener,wo as addTag,Rn as addToBlacklist,In as bindRTCRoomForChatroom,Tt as clearAllMessagesUnreadStatus,Ke as clearEventListeners,ho as clearHistoryMessages,yo as clearMessages,mt as clearMessagesUnreadStatus,vt as clearTextMessageDraft,Po as clearUnreadCountByTimestamp,st as connect,Uo as deleteLocalMessagesByTimestamp,Ro as deleteMessages,je as destroy,ct as disconnect,Ko as electronExtension,ln as forceRemoveChatRoomEntry,cn as forceSetChatRoomEntry,gn as getAllChatRoomEntries,wt as getAllConversationState,Yt as getAllUltraGroupUnreadCount,Kt as getAllUltraGroupUnreadMentionedCount,Lt as getAllUnreadMentionedCount,En as getBlacklist,mn as getBlacklistStatus,Dt as getBlockUltraGroupList,At as getBlockedConversationList,fn as getChatRoomEntry,rn as getChatRoomInfo,vn as getChatroomHistoryMessages,Xe as getConnectionStatus,dt as getConversation,ut as getConversationList,_t as getConversationNotificationLevel,Ct as getConversationNotificationStatus,Ho as getConversationsFromTagByPage,Qe as getCurrentUserId,et as getDeviceId,Wn as getFileToken,Qn as getFileUrl,Oo as getFirstUnreadMessage,so as getHistoryMessages,_o as getMessage,So as getMessageReader,Xo as getProxy,co as getRemoteHistoryMessages,We as getServerTime,bo as getTags,Go as getTagsFromConversation,ft as getTextMessageDraft,yt as getTopConversationList,It as getTotalUnreadCount,Rt as getTotalUnreadCountByLevels,ht as getTotalUnreadMentionedCountByLevels,Zt as getUltraGroupDefaultNotificationLevel,jt as getUltraGroupFirstUnreadMessageTimestamp,Bt as getUltraGroupList,Gt as getUltraGroupMessageListByMessageUId,qt as getUltraGroupUnreadCountByTargetId,Xt as getUltraGroupUnreadInfoList,Ht as getUltraGroupUnreadMentionedCountByTargetId,zt as getUltraGroupUnreadMentionedMessages,Mt as getUnreadConversationList,Et as getUnreadCount,Zo as getUnreadCountByTag,Pt as getUnreadMentionedCount,Co as getUnreadMentionedMessages,ze as init,No as insertMessage,nt as installPlugin,tn as joinChatRoom,nn as joinExistChatRoom,Ft as modifyMessage,Je as onceEventListener,on as quitChatRoom,Io as recallMessage,po as registerMessageType,xt as removeAllExpansionForUltraGroupMessage,dn as removeChatRoomEntries,un as removeChatRoomEntry,lt as removeConversation,ko as removeConversationsFromTag,qe as removeEventListener,Ye as removeEventListeners,kt as removeExpansionForUltraGroupMessage,hn as removeFromBlacklist,mo as removeMessageExpansionForKey,Bo as removeTag,Fo as removeTagFromConversations,xo as removeTagsFromConversation,gt as saveTextMessageDraft,Mo as searchConversationByContent,Ao as searchMessages,no as sendFileMessage,ro as sendGIFMessage,io as sendHQVoiceMessage,oo as sendImageMessage,$n as sendMessage,uo as sendReadReceiptMessage,lo as sendReadReceiptRequest,fo as sendReadReceiptResponse,go as sendReadReceiptResponseV2,ao as sendSightMessage,vo as sendSyncReadStatusMessage,eo as sendTextMessage,To as sendTypingStatusMessage,bt as sendUltraGroupTypingStatus,sn as setChatRoomEntries,an as setChatRoomEntry,Ot as setConversationNotificationLevel,Nt as setConversationNotificationStatus,Ut as setConversationToTop,Jo as setConversationToTopInTag,Lo as setMessageReceivedStatus,jo as setProxy,Jt as setUltraGroupDefaultNotificationLevel,Wo as testProxy,Vt as updateExpansionForUltraGroupMessage,Eo as updateMessageExpansion,Do as updateTag};
|