@rongcloud/imlib-next 5.7.6 → 5.7.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.esm.js CHANGED
@@ -1 +1 @@
1
- import{NetworkType as e,HttpMethod as t,HTTP_TIMEOUT as n,appendUrl as o,ErrorCode as i,ReceivedStatus as r,ConversationType as a,isNumber as s,EventEmitter as c,RCConnectionStatus as u,VersionManage as d,assert as f,AssertRules as l,isArray as g,isHttpUrl as v,APIContext as I,LogTagId as R,logger as h,validate as m,isValidConversationType as E,isValidNotificationLevel as S,NotificationLevel as T,isTypeInConversationList as p,UltraGroupChannelType as O,isString as N,UploadMethod as _,getUUID as C,isValidFileType as A,FileType as y,usingCppEngine as M,MessageDirection as U,SentStatus as P,isUndefined as L}from"@rongcloud/engine";export{ChatroomEntryType,ChatroomUserChangeType,ConnectionStatus,ConversationType,ErrorCode,FileType,LogL,LogLevel,MentionedType,MessageBlockSourceType,MessageBlockType,MessageDirection,NotificationLevel,NotificationStatus,OperateStatus,RCConnectionStatus,ReceivedStatus,SentStatus,UltraGroupChannelChangeType,UltraGroupChannelType,UploadMethod}from"@rongcloud/engine";var w=function(){return w=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},w.apply(this,arguments)};function B(e,t,n,o){return new(n||(n=Promise))((function(i,r){function a(e){try{c(o.next(e))}catch(e){r(e)}}function s(e){try{c(o.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(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,i,r,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return r={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;r&&(r=0,s[0]&&(a=0)),a;)try{if(n=1,o&&(i=2&s[0]?o.return:s[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,s[1])).done)return i;switch(o=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,o=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],o=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}}var b=function(){return!("undefined"==typeof uni||!function(e){for(var t=["request","getSystemInfo"],n=0,o=t.length;n<o;n++)if(!e[t[n]])return!1;return!0}(uni))},G=b(),x=function(){var e="undefined"!=typeof XMLHttpRequest&&"withCredentials"in new XMLHttpRequest;return"undefined"!=typeof XMLHttpRequest&&e?new XMLHttpRequest:"undefined"!=typeof XDomainRequest?new XDomainRequest:new ActiveXObject("Microsoft.XMLHTTP")};var V,k={tag:"browser",httpReq:function(e){var i=e.method||t.GET,r=e.timeout||n,a=e.headers,s=e.query,c=e.body,u=o(e.url,s);return new Promise((function(e){var t=x(),n="[object XDomainRequest]"===Object.prototype.toString.call(t);if(t.open(i,u),a&&t.setRequestHeader)for(var o in a)t.setRequestHeader(o,a[o]);if(n){t.timeout=r,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})}),r),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,n=t.type,o=t.effectiveType,i=n||o||e.UNKONWN;return Promise.resolve(i)}},H=b(),F=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return wx[e].apply(wx,t)}catch(e){null===console||void 0===console||console.error(e)}}},Z={setItem:F("setStorageSync"),getItem:F("getStorageSync"),removeItem:F("removeStorageSync"),clear:F("clearStorageSync")},q={tag:"wechat",httpReq:function(e){var r=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:r,header:s,timeout:a,data:u,success:function(t){e({data:t.data,status:t.statusCode})},fail:function(){e({status:i.RC_HTTP_REQ_FAIL})}})}))},localStorage:Z,sessionStorage:Z,useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:H,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)}})}))}},J=b(),z=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){}}},K={setItem:z("setStorageSync"),getItem:z("getStorageSync"),removeItem:z("removeStorageSync"),clear:z("clearStorageSync")},Y={tag:"alipay",httpReq:function(e){var r=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:r,headers:s,timeout:a,data:u,dataType:f,success:function(t){e({data:t.data,status:t.status})},fail:function(){e({status:i.RC_HTTP_REQ_FAIL})}})}))},localStorage:K,sessionStorage:K,useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:J,createWebSocket:function(e){return my.connectSocket({url:e}),{id:Date.now(),onClose:function(e){my.onSocketClose(e)},onError:function(e){my.onSocketError((function(t){e(t.errMsg)}))},onMessage:function(e){my.onSocketMessage((function(t){t.isBuffer?e(my.base64ToArrayBuffer(t.data)):e(t.data)}))},onOpen:function(e){my.onSocketOpen(e)},send:function(e){my.sendSocketMessage({data:my.arrayBufferToBase64(e),isBuffer:!0})},close:function(){my.closeSocket()}}},getNetworkType:function(){return new Promise((function(t){my.getNetworkType({success:function(e){var n=e.networkType;t(n)},fail:function(){t(e.UNKONWN)}})}))}},j=b(),W=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){}}},X={setItem:W("setStorageSync"),getItem:W("getStorageSync"),removeItem:W("removeStorageSync"),clear:W("clearStorageSync")},Q={tag:"toutiao",useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:j,localStorage:X,sessionStorage:X,httpReq:function(e){return new Promise((function(t){tt.request({url:e.url,data:e.body,header:e.headers,method:e.method,success:function(e){var n=(null==e?void 0:e.data)||{},o={data:JSON.stringify(n),status:e.statusCode};t(o)},fail:function(e){t({status:i.RC_HTTP_REQ_FAIL})}})}))},createWebSocket:function(e,t){var n=tt.connectSocket({url:e,protocols:t});return{id:Date.now(),onOpen:function(e){n.onOpen(e)},onClose:function(e){n.onClose((function(t){return e(t.code,t.reason)}))},onError:function(e){n.onError((function(t){return e(t.errMsg)}))},onMessage:function(e){n.onMessage((function(t){return e(t.data)}))},send:function(e){n.send({data:e})},close:function(e,t){n.close({code:e,reason:t})}}},getNetworkType:function(){return new Promise((function(t){tt.getNetworkType({success:function(e){var n=e.networkType;t(n)},fail:function(){t(e.UNKONWN)}})}))}},$=b(),ee=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){}}},te={setItem:ee("setStorageSync"),getItem:ee("getStorageSync"),removeItem:ee("removeStorageSync"),clear:ee("clearStorageSync")},ne={tag:"baidu",useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:$,localStorage:te,sessionStorage:te,httpReq:function(e){return new Promise((function(t,n){swan.request({url:e.url,data:e.body,header:e.headers,method:e.method,success:function(e){var n=(null==e?void 0:e.data)||{},o={data:JSON.stringify(n),status:e.statusCode};t(o)},fail:function(e){t({status:i.RC_HTTP_REQ_FAIL})}})}))},createWebSocket:function(e,t){var n=swan.connectSocket({url:e,protocols:t});return{id:Date.now(),onOpen:function(e){n.onOpen(e)},onClose:function(e){n.onClose((function(t){return e(t.code,t.reason)}))},onError:function(e){n.onError((function(t){return e(t.errMsg)}))},onMessage:function(e){n.onMessage((function(t){return e(t.data)}))},send:function(e){n.send({data:e})},close:function(e,t){n.close({code:e,reason:t})}}},getNetworkType:function(){return 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)}})}))]}))}))}},oe=b(),ie=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)}}},re={setItem:ie("setStorageSync"),getItem:ie("getStorageSync"),removeItem:ie("removeStorageSync"),clear:ie("clearStorageSync")},ae={tag:"jingdong",httpReq:function(e){var r=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:r,headers:s,timeout:a,data:u,success:function(t){e({data:t.data,status:t.statusCode})},fail:function(){e({status:i.RC_HTTP_REQ_FAIL})}})}))},localStorage:re,sessionStorage:re,useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:oe,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)}})}))}},se=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)}}},ce={setItem:se("setStorageSync"),getItem:se("getStorageSync"),removeItem:se("removeStorageSync"),clear:se("clearStorageSync")},ue={tag:"uniapp",httpReq:function(e){var r=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:r,header:s,timeout:a,data:u,success:function(t){e({data:t.data,status:t.statusCode})},fail:function(){e({status:i.RC_HTTP_REQ_FAIL})}})}))},localStorage:ce,sessionStorage:ce,useNavi:!0,connectPlatform:"",isFromUniapp:!0,createWebSocket:function(e,t){var n={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)}})}))}},de=function(e){return e&&e.request&&e.getSystemInfo},fe="undefined"!=typeof uni&&de(uni)?function(){switch(process.env.VUE_APP_PLATFORM){case"app-plus":return ue;case"mp-jd":return ae;case"mp-baidu":return ne;case"mp-toutiao":return Q;case"mp-alipay":return Y;case"mp-weixin":return q;default:return k}}():"undefined"!=typeof jd&&de(jd)?ae:"undefined"!=typeof my&&de(my)?Y:"undefined"!=typeof tt&&de(tt)?Q:"undefined"!=typeof swan&&de(swan)?ne:"undefined"!=typeof wx&&de(wx)?q:k;function le(e){var t=e.conversationType,n=e.channelId,o=e.messageType,i=e.content,c=e.senderUserId,u=e.targetId,d=e.sentTime,f=e.receivedTime,l=e.messageUId,g=e.messageDirection,v=e.isPersited,I=e.isCounted,R=e.isOffLineMessage,h=e.canIncludeExpansion,m=e.expansion,E=e.receivedStatus,S=e.disableNotification,T=e.isMentioned,p=e.isStatusMessage,O=e.readReceiptInfo,N=e.pushConfig,_=e.messageId,C=e.isInterrupt,A=e.isModifyMessage,y=e.channelType,M=e.sentStatus;E||(E=r.UNREAD);var U={messageType:o,channelId:n||"",content:i,senderUserId:c,targetId:u,conversationType:t,sentTime:d,receivedTime:f,messageUId:l,messageDirection:g,isPersited:v,isCounted:I,isMentioned:T,disableNotification:S,isStatusMessage:p,canIncludeExpansion:h,expansion:m,receivedStatus:E,readReceiptInfo:O,pushConfig:N,messageId:_,isInterrupt:C,isModifyMessage:A,sentStatus:M};return t!==a.ULTRA_GROUP&&(U.isOffLineMessage=R),t===a.ULTRA_GROUP&&s(y)&&(U.channelType=y),U}function ge(e){var t=e.conversationType,n=e.targetId,o=e.latestMessage,i=e.unreadMessageCount,r=e.hasMentioned,s=e.mentionedInfo,c=e.lastUnreadTime,u=e.notificationStatus,d=e.notificationLevel,f=e.isTop,l=e.channelId,g=e.unreadMentionedCount,v=e.matchCount,I={conversationType:t,targetId:n,latestMessage:o&&le(o),unreadMessageCount:i,hasMentioned:r,mentionedInfo:r?{type:null==s?void 0:s.type,userIdList:null==s?void 0:s.userIdList}:void 0,lastUnreadTime:c,notificationStatus:u,notificationLevel:d,isTop:f,channelId:l,unreadMentionedCount:g,matchCount:v};return I.conversationType===a.ULTRA_GROUP&&(I.firstUnreadMessage=e.firstUnreadMessage,I.channelType=e.channelType),I}function ve(e,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"}(V||(V={}));var Ie=new c,Re={connection:function(e,t){switch(e){case u.CONNECTED:Ie.emit(V.CONNECTED);break;case u.CONNECTING:Ie.emit(V.CONNECTING);break;case u.SUSPENDED:Ie.emit(V.SUSPEND,t);break;case u.DISCONNECTED:Ie.emit(V.DISCONNECT,t)}},batchMessage:function(e){Ie.emit(V.MESSAGES,{messages:e.map((function(e){return le(e)}))})},typingState:function(e){Ie.emit(V.TYPING_STATUS,{status:e})},readReceiptReceived:function(e,t,n){Ie.emit(V.READ_RECEIPT_RECEIVED,{conversation:e,messageUId:t,sentTime:n})},messageReceiptRequest:function(e,t,n){Ie.emit(V.MESSAGE_RECEIPT_REQUEST,{conversation:e,messageUId:t,senderUserId:n})},messageReceiptResponse:function(e,t,n){Ie.emit(V.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?le(e.latestMessage):null,targetId:e.targetId,unreadMessageCount:e.unreadMessageCount,unreadMentionedCount:e.unreadMentionedCount,notificationStatus:e.notificationStatus,notificationLevel:e.notificationLevel,lastUnreadTime:e.lastUnreadTime,channelId:e.channelId};return t===a.ULTRA_GROUP?(n.versionTime=e.versionTime,{conversation:n}):(n.hasMentioned=e.hasMentioned,n.mentionedInfo=e.mentionedInfo,n.isTop=e.isTop,{conversation:n,updatedItems:e.updatedItems})}));Ie.emit(V.CONVERSATION,{conversationList:t})},chatroomState:function(e){Ie.emit(V.CHATROOM,e)},expansion:function(e){Ie.emit(V.EXPANSION,e)},pullFinished:function(){Ie.emit(V.PULL_OFFLINE_MESSAGE_FINISHED)},tag:function(){Ie.emit(V.TAG)},conversationTagChanged:function(){Ie.emit(V.CONVERSATION_TAG)},messageBlocked:function(e){Ie.emit(V.MESSAGE_BLOCKED,e)},messageDelivered:function(e){Ie.emit(V.PRIVATE_MESSAGE_DELIVERED,e)},groupMessageDeliveredStatus:function(e){Ie.emit(V.GROUP_MESSAGE_DELIVERED,e)},ultraGroupEnable:function(e){Ie.emit(V.ULTRA_GROUP_ENABLE,e.map((function(e){return ge(e)})))},operateStatus:function(e){Ie.emit(V.OPERATE_STATUS,e)},ultraGroupMessageExpansionUpdated:function(e){Ie.emit(V.ULTRA_GROUP_MESSAGE_EXPANSION_UPDATED,e.map((function(e){return le(e)})))},ultraGroupMessageModified:function(e){Ie.emit(V.ULTRA_GROUP_MESSAGE_MODIFIED,e.map((function(e){return le(e)})))},ultraGroupMessageRecalled:function(e){Ie.emit(V.ULTRA_GROUP_MESSAGE_RECALLED,e.map((function(e){return le(e)})))},ultraGroupChannelChangeType:function(e){Ie.emit(V.ULTRA_GROUP_CHANNEL_TYPE_CHANGE,e)},ultraGroupChannelUserKicked:function(e){Ie.emit(V.ULTRA_GROUP_CHANNEL_USER_KICKED,e)},ultraGroupChannelDelete:function(e){Ie.emit(V.ULTRA_GROUP_CHANNEL_DELETE,e)},userGroupStatus:function(e){Ie.emit(V.USER_GROUP_STATUS,e)}};d.add("imlib-next","5.7.6");var he=null,me=null,Ee=null;function Se(){return B(this,void 0,void 0,(function(){return D(this,(function(e){switch(e.label){case 0:return he?(Ee.info(R.A_DESTROY_O),[4,I.destroy()]):[2];case 1:return e.sent(),me=null,he=null,Ee=null,[2]}}))}))}function Te(e){if(!he)throw new Error("Not initialized yet!");return e(he,Ee,me)}function pe(e){return he?e(he,Ee,me):Promise.resolve({code:i.BIZ_ERROR_CLIENT_NOT_INIT})}function Oe(e,t,n){Ie.on(e,t,n)}function Ne(e,t,n){Ie.once(e,t,n)}function _e(e,t,n){Ie.off(e,t,n)}function Ce(e){Ie.removeAll(e)}function Ae(){Ie.clear()}function ye(e){!function(e){var t,n=e.appkey,o=e.navigators;he?Ee.warn(R.A_INIT_REPEAT_O):(f("options.appkey",e.appkey,l.STRING,!0),f("options.navigators",e.navigators,(function(e){return g(e)&&(0===e.length||e.every(v))})),me=e,he=I.init((null===(t=e.__runtimeCreator__)||void 0===t?void 0:t.call(e))||fe,{appkey:e.appkey,navigators:e.navigators||[],miniCMPProxy:e.customCMP||[],logOutputLevel:e.logOutputLevel,__reportLogLevel:e.__reportLogLevel,httpInMainProcess:!!e.httpInMainProcess,logExpireTime:e.logExpireTime}),(Ee=he.createLogger("RC-IM","IM")).setOutputLevel(e.logOutputLevel),Ee.info(R.A_INIT_O,JSON.stringify({appkey:n,navigators:o,version:"5.7.6",commit:"75c24e92f730febbfeaef8ec19daf8f6ffb0f499"})),he.assignWatcher(Re),h.init(Ee))}(e)}function Me(){return B(this,void 0,void 0,(function(){return D(this,(function(e){return he?(Ae(),[2,Se()]):[2]}))}))}function Ue(){return Te((function(e){return e.getConnectionStatus()}))}function Pe(){return Te((function(e){return e.getServerTime()}))}function Le(){return Te((function(e){return e.getCurrentUserId()}))}function we(e,t){d.add(e,t)}function Be(){return Te((function(e){return e.getDeviceId()}))}function De(e,t){return Te((function(n){return n.install(e,t)}))}var be={TIMEOUT:{code:-1,msg:"Network timeout"},SDK_INTERNAL_ERROR:{code:-2,msg:"SDK internal error"},PARAMETER_ERROR:{code:-3,msg:"Please check the parameters, the {param} expected a value of {expect} but received {current}"},REJECTED_BY_BLACKLIST:{code:405,msg:"Blacklisted by the other party"},SEND_TOO_FAST:{code:20604,msg:"Sending messages too quickly"},NOT_IN_GROUP:{code:22406,msg:"Not in group"},ULTRA_GROUP_USER_NOT_IN_PRIVATE_CHANNEL:{code:i.ULTRA_GROUP_USER_NOT_IN_PRIVATE_CHANNEL,msg:"ultra group user not in private channel"},FORBIDDEN_IN_GROUP:{code:22408,msg:"Forbbiden from speaking in the group"},NOT_IN_CHATROOM:{code:23406,msg:"Not in chatRoom"},FORBIDDEN_IN_CHATROOM:{code:23408,msg:"Forbbiden from speaking in the chatRoom"},KICKED_FROM_CHATROOM:{code:23409,msg:"Kicked out and forbbiden from joining the chatRoom"},CHATROOM_NOT_EXIST:{code:23410,msg:"ChatRoom does not exist"},CHATROOM_IS_FULL:{code:23411,msg:"ChatRoom members exceeded"},PARAMETER_INVALID_CHATROOM:{code:23412,msg:"Invalid chatRoom parameters"},ROAMING_SERVICE_UNAVAILABLE_CHATROOM:{code:23414,msg:"ChatRoom message roaming service is not open, Please go to the developer to open this service"},RECALLMESSAGE_PARAMETER_INVALID:{code:25101,msg:"Invalid recall message parameter"},ROAMING_SERVICE_UNAVAILABLE_MESSAGE:{code:25102,msg:"Single group chat roaming service is not open, Please go to the developer to open this service"},PUSHSETTING_PARAMETER_INVALID:{code:26001,msg:"Invalid push parameter"},OPERATION_BLOCKED:{code:20605,msg:"Operation is blocked"},OPERATION_NOT_SUPPORT:{code:20606,msg:"Operation is not supported"},MSG_BLOCKED_SENSITIVE_WORD:{code:21501,msg:"The sent message contains sensitive words"},REPLACED_SENSITIVE_WORD:{code:21502,msg:"Sensitive words in the message have been replaced"},NOT_CONNECTED:{code:30001,msg:"Please connect successfully first"},NAVI_REQUEST_ERROR:{code:30007,msg:"Navigation http request failed"},CMP_REQUEST_ERROR:{code:30010,msg:"CMP sniff http request failed"},CONN_APPKEY_FAKE:{code:31002,msg:"Your appkey is fake"},CONN_MINI_SERVICE_NOT_OPEN:{code:31003,msg:"Mini program service is not open, Please go to the developer to open this service"},CONN_ACK_TIMEOUT:{code:31e3,msg:"Connection ACK timeout"},CONN_TOKEN_INCORRECT:{code:31004,msg:"Your token is not valid or expired"},CONN_NOT_AUTHRORIZED:{code:31005,msg:"AppKey and Token do not match"},CONN_REDIRECTED:{code:31006,msg:"Connection redirection"},CONN_APP_BLOCKED_OR_DELETED:{code:31008,msg:"AppKey is banned or deleted"},CONN_USER_BLOCKED:{code:31009,msg:"User blocked"},CONN_DOMAIN_INCORRECT:{code:31012,msg:"Connect domain error, Please check the set security domain"},ROAMING_SERVICE_UNAVAILABLE:{code:33007,msg:"Roaming service cloud is not open, Please go to the developer to open this service"},RC_CONNECTION_EXIST:{code:34001,msg:"Connection already exists"},CHATROOM_KV_EXCEED:{code:23423,msg:"ChatRoom KV setting exceeds maximum"},CHATROOM_KV_OVERWRITE_INVALID:{code:23424,msg:"ChatRoom KV already exists"},CHATROOM_KV_STORE_NOT_OPEN:{code:23426,msg:"ChatRoom KV storage service is not open, Please go to the developer to open this service"},CHATROOM_KEY_NOT_EXIST:{code:23427,msg:"ChatRoom key does not exist"},MSG_KV_NOT_SUPPORT:{code:34008,msg:"The message cannot be extended"},SEND_MESSAGE_KV_FAIL:{code:34009,msg:"Sending RC expansion message fail"},EXPANSION_LIMIT_EXCEET:{code:34010,msg:"The message expansion size is beyond the limit"},ILLGAL_PARAMS:{code:33003,msg:"Incorrect parameters passed in while calling the interface"},UPLOAD_FILE_FAILED:{code:35020,msg:"File upload failed"},CHATROOM_KV_STORE_NOT_ALL_SUCCESS:{code:23428,msg:"Chatroom kv store not all success"},CHATROOM_KV_STORE_OUT_LIMIT:{code:23429,msg:"Chatroom kv's length is out of limit"},TAG_EXISTS:{code:33101,msg:"The tag already exists"},TAG_NOT_EXIST:{code:33100,msg:"The tag does not exist"},NOT_SUPPORT:{code:i.NOT_SUPPORT,msg:"The method is not supported in a browser!"}},Ge={};for(var xe in be){var Ve=be[xe].code;Ge[Ve]=xe}function ke(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return[2,pe((function(o,r){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=r.createTraceId(),r.info(R.A_CONNECT_T,JSON.stringify({token:e,reconnectKickEnable:t}),n),[4,o.connect(e,!!t,n)]):[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}];case 1:return a=c.sent(),s=a.code===i.SUCCESS?"info":"warn",r[s](R.A_CONNECT_R,JSON.stringify({code:a.code,userId:a.userId}),n),a.code===i.SUCCESS?[2,{code:a.code,data:{userId:a.userId}}]:[2,{code:a.code,msg:Ge[a.code]}]}}))}))}))]}))}))}function He(e){return h.info(R.A_DISCONNECT_O,{}),Te((function(t){return t.disconnect(e)}))}function Fe(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,pe((function(o,r){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===i.SUCCESS&&s?[2,{code:0,data:s.map((function(e){return ge(e)}))}]:(r.warn(R.O,"get conversation list fail ->".concat(a,":").concat(Ge[a])),[2,{code:a,msg:Ge[a]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Ze(e){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(n){return m("options",e,l.CONVERSATION,!0)?[2,pe((function(n,o){return B(t,void 0,void 0,(function(){var t,r,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(),r=t.code,a=t.data,r!==i.SUCCESS?(o.warn(R.O,"getConversation ->code:".concat(r,", targetId:").concat(e.targetId)),[2,{code:r,msg:Ge[r]}]):[2,{code:r,data:a?ge(a):null}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function qe(e){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(n){return m("options",e,l.CONVERSATION,!0)?[2,pe((function(n,o){return B(t,void 0,void 0,(function(){var t,r;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(),r="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),o.debug(R.O,"destroy conversation ->".concat(r)),t!==i.SUCCESS?(o.warn(R.O,"destroy conversation fail ->".concat(t,":").concat(Ge[t],",").concat(r)),[2,{code:t,msg:Ge[t]}]):[2,{code:t}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Je(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,pe((function(n,o){return B(t,void 0,void 0,(function(){var t,r,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(),r=t.code,a=t.data,s="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),o.debug(R.O,"get draft ->".concat(s)),r===i.SUCCESS?[2,{code:r,data:a||""}]:(o.warn(R.O,"get draft fail ->".concat(r,":").concat(Ge[r],",").concat(s)),[2,{code:r,msg:Ge[r]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function ze(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,pe((function(o,r){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),r.debug(R.O,"set draft ->".concat(n)),[4,o.saveConversationMessageDraft(e.conversationType,e.targetId,t,e.channelId)];case 1:return(a=s.sent())===i.SUCCESS?[2,{code:a}]:(r.warn(R.O,"set draft fail ->".concat(a,":").concat(Ge[a],",").concat(n)),[2,{code:a,msg:Ge[a]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Ke(e){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(n){return m("options",e,l.CONVERSATION,!0)?[2,pe((function(n,o){return B(t,void 0,void 0,(function(){var t,r;return D(this,(function(a){switch(a.label){case 0:return t="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),o.debug(R.O,"delete draft ->".concat(t)),[4,n.clearConversationMessageDraft(e.conversationType,e.targetId,e.channelId)];case 1:return(r=a.sent())===i.SUCCESS?[2,{code:r}]:(o.warn(R.O,"delete draft fail ->".concat(r,":").concat(Ge[r],",").concat(t)),[2,{code:r,msg:Ge[r]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Ye(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,pe((function(o,r){return B(n,void 0,void 0,(function(){var n,a,s;return D(this,(function(c){switch(c.label){case 0:return r.debug(R.O,"get total unread count -> ConversationType:".concat(JSON.stringify(t)," includeMuted:").concat(e)),[4,o.getTotalUnreadCount("",t,e)];case 1:return n=c.sent(),a=n.code,s=n.data,a===i.SUCCESS?[2,{code:a,data:s}]:(r.warn(R.O,"getTotalUnreadCount fail ->".concat(a,":").concat(Ge[a])),[2,{code:a,msg:Ge[a]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function je(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:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,pe((function(o,r){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===i.SUCCESS?[2,{code:a,data:s}]:(r.warn(R.O,"getTotalUnreadCountByLevels fail ->".concat(a,":").concat(Ge[a])),[2,{code:a,msg:Ge[a]}])}}))}))}))]}))}))}function We(e,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:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,pe((function(o,r){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===i.SUCCESS?[2,{code:a,data:s}]:(r.warn(R.O,"getTotalUnreadMentionedCountByLevels fail ->".concat(a,":").concat(Ge[a])),[2,{code:a,msg:Ge[a]}])}}))}))}))]}))}))}function Xe(e){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(n){return m("options",e,l.CONVERSATION,!0)?[2,pe((function(n,o){return B(t,void 0,void 0,(function(){var t,r,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(),r=t.code,a=t.data,s="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),o.debug(R.O,"get unreadCount ->".concat(s)),r===i.SUCCESS?[2,{code:r,data:a}]:(o.warn(R.O,"get unreadCount fail ->".concat(r,":").concat(Ge[r],",").concat(s)),[2,{code:r,msg:Ge[r]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Qe(e){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(n){return m("options",e,l.CONVERSATION,!0)?[2,pe((function(n,o){return B(t,void 0,void 0,(function(){var t,r;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(),r="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),o.debug(R.O,"clear unreadMsgNum ->".concat(r)),t!==i.SUCCESS?(o.warn(R.O,"clear unreadMsgNum fail ->".concat(t,":").concat(Ge[t],",").concat(r)),[2,{code:t,msg:Ge[t]}]):[2,{code:t}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function $e(){return B(this,void 0,void 0,(function(){var e=this;return D(this,(function(t){return[2,pe((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()}]}}))}))}))]}))}))}be.ROAMING_SERVICE_UNAVAILABLE.code;var et=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},nt=function(e,t,n,o){return void 0===o&&(o=""),B(void 0,void 0,void 0,(function(){var r,a;return D(this,(function(s){switch(s.label){case 0:return r=et(e,t,o),[4,n()];case 1:return(a=s.sent())!==i.SUCCESS?(e.warn(R.O,"".concat(o," fail -> ").concat(a," : ").concat(Ge[a]," , ").concat(r)),[2,{code:a,msg:Ge[a]}]):[2,{code:a}]}}))}))};function ot(e,t){return B(this,void 0,void 0,(function(){return D(this,(function(n){return m("notificationLevel",t,(function(e){return void 0!==T[e]}),!0)&&m("options",e,l.CONVERSATION,!0)?[2,pe((function(n,o){return nt(o,e,(function(){return n.setConversationNotificationLevel(e.conversationType,e.targetId,t,e.channelId)}),"setConversationNotificationLevel")}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function it(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,pe((function(n,o){return nt(o,e,(function(){return n.setConversationStatus(e.conversationType,e.targetId,void 0,t,e.channelId)}),"setConversationNotificationStatus")}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function rt(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,pe((function(n,o){return B(t,void 0,void 0,(function(){var t,r,a,s;return D(this,(function(c){switch(c.label){case 0:return t=et(o,e,"getConversationNotificationLevel"),[4,n.getConversationNotificationLevel(e.conversationType,e.targetId,e.channelId)];case 1:return r=c.sent(),a=r.code,s=r.data,a===i.SUCCESS?[2,{code:a,data:s}]:(o.warn(R.O,"getConversationNotificationLevel fail -> ".concat(a," : ").concat(Ge[a]," , ").concat(t)),[2,{code:a,msg:Ge[a]}])}}))}))}))]:[2,{code:i.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,pe((function(n,o){return B(t,void 0,void 0,(function(){var t,r,a;return D(this,(function(s){switch(s.label){case 0:return o.info(R.O,"getConversationNotificationStatus ->targetId:".concat(e.targetId,",conversationType:").concat(e.conversationType)),[4,n.getConversationNotificationStatus(e.conversationType,e.targetId,e.channelId)];case 1:return t=s.sent(),r=t.code,a=t.data,r===i.SUCCESS?[2,{code:r,data:a}]:(o.warn(R.O,"getConversationNotificationStatus ->code:".concat(r,",targetId:").concat(e.targetId)),[2,{code:r,msg:Ge[r]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function st(){return B(this,void 0,void 0,(function(){return D(this,(function(e){return[2,pe((function(e){return e.getBlockConversationList()}))]}))}))}function ct(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,pe((function(o,r){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),r.debug(R.O,"set conversation status ->".concat(n)),[4,o.setConversationStatus(e.conversationType,e.targetId,t,void 0,e.channelId)];case 1:return(a=s.sent())!==i.SUCCESS?(r.warn(R.O,"set conversation status fail ->".concat(a,":").concat(Ge[a],",").concat(n)),[2,{code:a,msg:Ge[a]}]):[2,{code:a}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function ut(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,pe((function(o,r){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===i.SUCCESS&&s?[2,{code:0,data:s.map((function(e){return ge(e)}))}]:(r.warn(R.A_GET_TOP_CONVERSATION_LIST_E,"".concat(a,":").concat(Ge[a])),[2,{code:a,msg:Ge[a]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function dt(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,p)})))?[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,pe((function(n,o){return B(t,void 0,void 0,(function(){var t,o,r;return D(this,(function(a){switch(a.label){case 0:return[4,n.getUnreadConversationList(e)];case 1:return t=a.sent(),o=t.code,r=t.data,o===i.SUCCESS&&r?[2,{code:0,data:r.map((function(e){return ge(e)}))}]:[2,{code:o,msg:Ge[o]}]}}))}))}))]}))}))}function ft(e){return B(this,void 0,void 0,(function(){return D(this,(function(t){return m("options",e,l.CONVERSATION,!0)?[2,pe((function(t,n){return n.debug(R.O,"getUnreadMentionedCount".concat(e.targetId,",channelId:").concat(e.channelId)),t.getUnreadMentionedCount(e)}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function lt(){return B(this,void 0,void 0,(function(){return D(this,(function(e){return[2,pe((function(e,t){return t.debug(R.O,"getAllUnreadMentionedCount"),e.getAllUnreadMentionedCount()}))]}))}))}function gt(){return B(this,void 0,void 0,(function(){return D(this,(function(e){return[2,pe((function(e){return e.getAllConversationState()}))]}))}))}function vt(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,pe((function(n,o){return B(t,void 0,void 0,(function(){var t,r,a;return D(this,(function(s){switch(s.label){case 0:return[4,n.getUltraGroupList(e)];case 1:return t=s.sent(),r=t.code,a=t.data,r===i.SUCCESS?[2,{code:i.SUCCESS,data:a}]:(o.warn(R.O,"get ultragroup ->".concat(r,":").concat(Ge[r])),[2,{code:r,msg:Ge[r]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function It(){return B(this,void 0,void 0,(function(){var e=this;return D(this,(function(t){return[2,pe((function(t,n){return B(e,void 0,void 0,(function(){var e,o,r;return D(this,(function(a){switch(a.label){case 0:return[4,t.getBlockUltraGroupList()];case 1:return e=a.sent(),o=e.code,r=e.data,o===i.SUCCESS?[2,{code:i.SUCCESS,data:r}]:(n.warn(R.O,"get block ultragroup ->".concat(o,":").concat(Ge[o])),[2,{code:o,msg:Ge[o]}])}}))}))}))]}))}))}function Rt(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,pe((function(n,o){return B(t,void 0,void 0,(function(){var t;return D(this,(function(r){switch(r.label){case 0:return[4,n.sendUltraGroupTypingStatus(e)];case 1:return(t=r.sent().code)===i.SUCCESS?[2,{code:i.SUCCESS}]:(o.warn(R.O,"send ultraGroup OperateStatus ->".concat(t,":").concat(Ge[t])),[2,{code:t,msg:Ge[t]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function ht(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,pe((function(o,r){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===i.SUCCESS){for(v in g={},l)g[v]=l[v]?le(l[v]):void 0;return[2,{code:i.SUCCESS,data:g}]}return r.warn(R.O,"get UltraGroup MessageList by messageUId ->".concat(f,":").concat(Ge[f])),[2,{code:f,msg:Ge[f]}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function mt(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,pe((function(o,r){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),r.debug(R.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)===i.SUCCESS?[2,{code:i.SUCCESS}]:(r.warn(R.O,"update expansion for ultragroup message ->".concat(g,":").concat(Ge[g])),[2,{code:g,msg:Ge[g]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Et(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,pe((function(o,r){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),r.debug(R.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)===i.SUCCESS?[2,{code:i.SUCCESS}]:(r.warn(R.O,"remove expansion for ultraGroup message ->".concat(g,":").concat(Ge[g])),[2,{code:g,msg:Ge[g]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function St(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,pe((function(n,o){return B(t,void 0,void 0,(function(){var t,r,a,s,c,u,d,f,l;return D(this,(function(g){switch(g.label){case 0:return t=e.conversationType,r=e.targetId,a=e.messageUId,s=e.sentTime,c=e.canIncludeExpansion,u=e.channelId,d="conversationType:".concat(t,",targetId:").concat(r,",channelId:").concat(u,",messageUId:").concat(a),o.debug(R.O,"remove all expansion for ultraGroup message ->".concat(d)),f={targetId:r,channelId:u,conversationType:t,sendTime:s,canIncludeExpansion:c,messageUId:a,removeAll:!0},[4,n.expandUltraMessage(f)];case 1:return(l=g.sent().code)===i.SUCCESS?[2,{code:i.SUCCESS}]:(o.warn(R.O,"remove all expansion for ultraGroup message ->".concat(l,":").concat(Ge[l])),[2,{code:l,msg:Ge[l]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Tt(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,pe((function(o,r){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),r.debug(R.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)===i.SUCCESS?[2,{code:i.SUCCESS}]:(r.warn(R.O,"modify ultraGroup message ->".concat(v,":").concat(Ge[v])),[2,{code:v,msg:Ge[v]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function pt(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,pe((function(o,r){return B(n,void 0,void 0,(function(){var n,a,s;return D(this,(function(c){switch(c.label){case 0:return r.debug(R.O,"get UltraGroup unreadMentionedCount by targetId: ".concat(e,", notificationLevels: ").concat(JSON.stringify(t))),[4,o.getUltraGroupUnreadMentionedCountByTargetId(e,t)];case 1:return n=c.sent(),a=n.code,s=n.data,a===i.SUCCESS?[2,{code:i.SUCCESS,data:s}]:(r.warn(R.O,"get UltraGroup unreadMentionedCount by targetId error ->".concat(a,":").concat(Ge[a])),[2,{code:a,msg:Ge[a]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Ot(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,pe((function(n,o){return B(t,void 0,void 0,(function(){var t,r,a,s,c;return D(this,(function(u){switch(u.label){case 0:return t="getUltraGroupDefaultNotificationLevel",r="targetId: ".concat(e.targetId,", channelId: ").concat(e.channelId),o.debug(R.O,"".concat(t," -> ").concat(r)),[4,n.getUltraGroupDefaultNotificationLevel(e.targetId,e.channelId)];case 1:return a=u.sent(),s=a.code,c=a.data,s===i.SUCCESS?[2,{code:s,data:c}]:(o.warn(R.O,"".concat(t," fail -> ").concat(s," : ").concat(Ge[s]," , ").concat(r)),[2,{code:s,msg:Ge[s]}])}}))}))}))]:[2,{code:i.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 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!==T[e]}),!0)?[2,pe((function(o,r){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),r.debug(R.O,"".concat(n," -> ").concat(a)),[4,o.setUltraGroupDefaultNotificationLevel(e.targetId,t,e.channelId)];case 1:return(s=c.sent().code)===i.SUCCESS?[2,{code:s}]:(r.warn(R.O,"".concat(n," fail -> ").concat(s," : ").concat(Ge[s]," , ").concat(a)),[2,{code:s,msg:Ge[s]}])}}))}))}))]:[2,{code:i.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)&&m("notificationLevels",t,l.ARRAY)&&!(null==t?void 0:t.some((function(e){return!m("notificationLevel",e,S)})))?[2,pe((function(o,r){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="getUltraGroupUnreadCountByTargetId",[4,o.getUltraGroupUnreadCountByTargetId(e,t)];case 1:return a=d.sent(),s=a.code,c=a.data,u="targetId: ".concat(e,", levels: ").concat(JSON.stringify(t)),r.debug(R.O,"".concat(n," -> ").concat(u)),s===i.SUCCESS?[2,{code:s,data:c}]:(r.warn(R.O,"".concat(n," fail -> ").concat(s,": ").concat(Ge[s],", ").concat(u)),[2,{code:s,msg:Ge[s]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Ct(){return B(this,void 0,void 0,(function(){var e=this;return D(this,(function(t){return[2,pe((function(t,n){return B(e,void 0,void 0,(function(){var e,o,r,a;return D(this,(function(s){switch(s.label){case 0:return e="getAllUltraGroupUnreadCount",[4,t.getAllUltraGroupUnreadCount()];case 1:return o=s.sent(),r=o.code,a=o.data,n.debug(R.O,e),r===i.SUCCESS?[2,{code:r,data:a}]:(n.warn(R.O,"".concat(e," fail ->").concat(r,": ").concat(Ge[r])),[2,{code:r,msg:Ge[r]}])}}))}))}))]}))}))}function At(){return B(this,void 0,void 0,(function(){var e=this;return D(this,(function(t){return[2,pe((function(t,n){return B(e,void 0,void 0,(function(){var e,o,r,a;return D(this,(function(s){switch(s.label){case 0:return e="getAllUltraGroupUnreadMentionedCount",!0,[4,t.getAllUltraGroupUnreadCount(true)];case 1:return o=s.sent(),r=o.code,a=o.data,n.debug(R.O,e),r===i.SUCCESS?[2,{code:r,data:a}]:(n.warn(R.O,"".concat(e," fail ->").concat(r,": ").concat(Ge[r])),[2,{code:r,msg:Ge[r]}])}}))}))}))]}))}))}function yt(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,pe((function(n,o){return B(t,void 0,void 0,(function(){var t,r,a,s,c,u,d,f;return D(this,(function(l){switch(l.label){case 0:return t=e.targetId,r=e.channelId,a=e.sentTime,s=e.count,c={targetId:t,channelId:r,sentTime:a,count:s},[4,n.getUltraGroupUnreadMentionedMessages(c)];case 1:return u=l.sent(),d=u.code,f=u.data,d===i.SUCCESS?[2,{code:d,data:f}]:(o.warn(R.O,"getUltraGroupUnreadMentionedMessages fail ->".concat(d,": ").concat(Ge[d])),[2,{code:d,msg:Ge[d]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Mt(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,pe((function(n){return B(t,void 0,void 0,(function(){var t,o,r,a,s,c;return D(this,(function(u){switch(u.label){case 0:return t=e.targetId,o=e.channelId,r={targetId:t,channelId:o},[4,n.getUltraGroupFirstUnreadMessageTimestamp(r)];case 1:return a=u.sent(),s=a.code,c=a.data,s===i.SUCCESS?[2,{code:s,data:c}]:[2,{code:s,msg:Ge[s]}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}var Ut=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))},Pt=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)},Lt=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)},wt=function(e){return e.entries.every((function(e){return m("key",e,l.STRING,!0)}))&&m("options.notificationExtra",e.notificationExtra,l.STRING)};function Bt(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,pe((function(o,r){return B(n,void 0,void 0,(function(){var n,a,s;return D(this,(function(c){switch(c.label){case 0:return n=r.createTraceId(),r.info(R.A_JOIN_CHATROOM_T,JSON.stringify({chatroomId:e,count:t.count,joinExist:!1}),n),[4,o.joinChatroom(e,t.count,n)];case 1:return a=c.sent(),s=a===i.SUCCESS?"info":"warn",r[s](R.A_JOIN_CHATROOM_R,JSON.stringify({code:a,timestamp:(new Date).getTime()}),n),a!==i.SUCCESS?[2,{code:a,msg:Ge[a]}]:[2,{code:a}]}}))}))}))]:[2,{code:i.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("targetId",e,l.STRING,!0)&&m("options.count",t.count,l.NUMBER,!0)?[2,pe((function(o,r){return B(n,void 0,void 0,(function(){var n,a,s;return D(this,(function(c){switch(c.label){case 0:return n=r.createTraceId(),r.info(R.A_JOIN_CHATROOM_T,JSON.stringify({chatroomId:e,count:t.count,joinExist:!0}),n),[4,o.joinExistChatroom(e,t.count,n)];case 1:return a=c.sent(),s=a===i.SUCCESS?"info":"warn",r[s](R.A_JOIN_CHATROOM_R,JSON.stringify({code:a,timestamp:(new Date).getTime()}),n),a!==i.SUCCESS?[2,{code:a,msg:Ge[a]}]:[2,{code:a}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function bt(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,pe((function(n,o){return B(t,void 0,void 0,(function(){var t,r,a;return D(this,(function(s){switch(s.label){case 0:return t=o.createTraceId(),o.info(R.A_QUIT_CHATROOM_T,JSON.stringify({chatroomId:e}),t),[4,n.quitChatroom(e)];case 1:return r=s.sent(),a=r===i.SUCCESS?"info":"warn",o[a](R.A_QUIT_CHATROOM_R,JSON.stringify({code:r}),t),r!==i.SUCCESS?[2,{code:r,msg:Ge[r]}]:[2,{code:r}]}}))}))}))]:[2,{code:i.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("options.count",t.count,l.NUMBER)&&m("options.order",t.order,(function(e){return[0,1,2].includes(e)}))?[2,pe((function(o,r){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),r.debug(R.O,"get chatroom info ->".concat(n)),[4,o.getChatroomInfo(e,t.count,t.order)];case 1:return a=u.sent(),s=a.code,c=a.data,s===i.SUCCESS&&c?[2,{code:s,data:c}]:(r.warn(R.O,"get chatroom info fail ->code+:".concat(Ge[s],",").concat(n)),[2,{code:s,msg:Ge[s]}])}}))}))}))]:[2,{code:i.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 m("targetId",e,l.STRING,!0)&&Ut(t)?[2,pe((function(o,r){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),r.debug(R.O,"set chatroom entry->".concat(n)),[4,o.setChatroomEntry(e,t)];case 1:return(a=s.sent())!==i.SUCCESS?(r.warn(R.O,"set chatroom entry fail ->code+:".concat(Ge[a],",").concat(n)),[2,{code:a,msg:Ge[a]}]):[2,{code:a}]}}))}))}))]:[2,{code:i.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)&&Pt(t)?t.entries.length>10?[2,be.CHATROOM_KV_STORE_OUT_LIMIT]:[2,pe((function(o,r){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),r.debug(R.O,"set chatroom entry->".concat(n)),[4,o.setChatroomEntries(e,t)];case 1:return a=u.sent(),s=a.code,c=a.data,s!==i.SUCCESS?(r.warn(R.O,"set chatroom entry fail ->code+:".concat(Ge[s],",").concat(n)),[2,{code:s,msg:Ge[s],data:c}]):[2,{code:s}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function kt(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)&&Ut(t)?[2,pe((function(o,r){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),r.debug(R.O,"force set chatroom entry ->".concat(n)),[4,o.forceSetChatroomEntry(e,t)];case 1:return(a=s.sent())!==i.SUCCESS?(r.warn(R.O,"force set chatroom entry fail ->code+:".concat(Ge[a],",").concat(n)),[2,{code:a,msg:Ge[a]}]):[2,{code:a}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Ht(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)&&Lt(t)?[2,pe((function(o,r){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),r.debug(R.O,"remove chatroom entry->".concat(n)),[4,o.removeChatroomEntry(e,t)];case 1:return(a=s.sent())!==i.SUCCESS?(r.warn(R.O,"remove chatroom entry fail ->code+:".concat(Ge[a],",").concat(n)),[2,{code:a,msg:Ge[a]}]):[2,{code:a}]}}))}))}))]:[2,{code:i.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("targetId",e,l.STRING,!0)&&wt(t)?[2,pe((function(o,r){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),r.info(R.O,"remove chatroom entry->".concat(n)),(a=w({},t)).entries=t.entries.map((function(e){return{key:e}})),[4,o.removeChatroomEntries(e,a)];case 1:return s=d.sent(),c=s.code,u=s.data,c!==i.SUCCESS?(r.warn(R.O,"remove chatroom entry fail ->code+:".concat(Ge[c],",").concat(n)),[2,{code:c,msg:Ge[c],data:u}]):[2,{code:c}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Zt(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)&&Lt(t)?[2,pe((function(o,r){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),r.info(R.O,"force remove chatroom entry ->".concat(n)),[4,o.forceRemoveChatroomEntry(e,t)];case 1:return(a=s.sent())!==i.SUCCESS?(r.warn(R.O,"force remove chatroom entry fail ->code+:".concat(Ge[a],",").concat(n)),[2,{code:a,msg:Ge[a]}]):[2,{code:a}]}}))}))}))]:[2,{code:i.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("key",t,(function(e){return N(e)&&/[\w+=-]+/.test(e)&&e.length<=128}),!0)?[2,pe((function(o,r){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),r.debug(R.O,"get chatroom entry->".concat(n)),[4,o.getChatroomEntry(e,t)];case 1:return a=u.sent(),s=a.code,c=a.data,s===i.SUCCESS&&c?[2,{code:s,data:c}]:(r.warn(R.O,"get chatroom entry fail ->code+:".concat(Ge[s],",").concat(n)),[2,{code:s,msg:Ge[s]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Jt(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,pe((function(n,o){return B(t,void 0,void 0,(function(){var t,r,a,s;return D(this,(function(c){switch(c.label){case 0:return t="id:".concat(e),o.debug(R.O,"get all chatroom entries->".concat(t)),[4,n.getAllChatroomEntries(e)];case 1:return r=c.sent(),a=r.code,s=r.data,a===i.SUCCESS&&s?[2,{code:a,data:s}]:(o.warn(R.O,"get all chatroom entries fail ->code+:".concat(Ge[a],",").concat(t)),[2,{code:a,msg:Ge[a]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function zt(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,pe((function(o,r){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),r.debug(R.O,"get chatroom history message->".concat(n)),[4,o.getChatRoomHistoryMessages(e,t.count,t.order,t.timestamp)];case 1:return a=d.sent(),s=a.code,c=a.data,s===i.SUCCESS&&c?(u=c.list.map((function(e){return le(e)})),[2,{code:s,data:{list:u,hasMore:!!c.hasMore}}]):(r.warn(R.O,"get chatroom history message fail ->code+:".concat(Ge[s],",").concat(n)),[2,{code:s,msg:Ge[s]}])}}))}))}))]:[2,{code:i.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("option.chatRoomId",e.chatRoomId,l.STRING,!0)&&m("option.rtcRoomId",e.rtcRoomId,l.STRING,!0)?[2,pe((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:Ge[t]}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Yt(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,pe((function(n,o){return B(t,void 0,void 0,(function(){return D(this,(function(t){switch(t.label){case 0:return o.info(R.O,"addToBlacklist -> userId: ".concat(e)),[4,n.addToBlacklist(e)];case 1:return[2,{code:t.sent()}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function jt(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,pe((function(n,o){return B(t,void 0,void 0,(function(){return D(this,(function(t){switch(t.label){case 0:return o.info(R.O,"removeFromBlacklist -> userId: ".concat(e)),[4,n.removeFromBlacklist(e)];case 1:return[2,{code:t.sent()}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Wt(){return B(this,void 0,void 0,(function(){var e=this;return D(this,(function(t){return[2,pe((function(t,n){return B(e,void 0,void 0,(function(){var e,o,r;return D(this,(function(a){switch(a.label){case 0:return n.info(R.O,"getBlacklist -> "),[4,t.getBlacklist()];case 1:return e=a.sent(),o=e.code,r=e.data,o===i.SUCCESS&&r?[2,{code:o,data:r}]:(n.warn(R.O,"getBlacklist fail -> code: ".concat(o)),[2,{code:o}])}}))}))}))]}))}))}function Xt(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,pe((function(n,o){return B(t,void 0,void 0,(function(){var t,r,a;return D(this,(function(s){switch(s.label){case 0:return o.info(R.O,"getBlacklistStatus -> userId: ".concat(e)),[4,n.getBlacklistStatus(e)];case 1:return t=s.sent(),r=t.code,a=t.data,r===i.SUCCESS?[2,{code:r,data:0===a}]:(o.warn(R.O,"getBlacklistStatus fail -> code: ".concat(r,", userId: ").concat(e)),[2,{code:r}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}var Qt=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 $t(e,t,n){void 0===t&&(t=!0),void 0===n&&(n=!0);return function(o){return new Qt(e,o,t,n)}}var en,tn,nn=$t("RC:ImgMsg"),on=$t("RC:HQVCMsg"),rn=$t("RC:SightMsg"),an=$t("RC:TxtMsg"),sn=$t("RC:CombineMsg"),cn=$t("RC:FileMsg"),un=$t("RC:GIFMsg"),dn=$t("RC:VcMsg"),fn=$t("RC:LBSMsg"),ln=$t("RC:ReferenceMsg"),gn=$t("RC:ImgTextMsg"),vn={qiniu:function(e,t,n,o){Te((function(i){var r=i.getNaviInfoFromCache();if(1===(null==r?void 0:r.type)&&t.chunk_size&&o.size>t.chunk_size){var a=C();a+=o.name.substr(o.name.lastIndexOf(".")),o.uniqueName=a,On(o,t,n)}else pn(e,t,n,o)}))},baidu:function(e,t,n,o){if(o.size>Rn.BOS_CHUNCK_SIZE)throw new Error("the file size is over 5GB!");var i=t||{};t=t||tn;var r=new XMLHttpRequest,a=En();if(!i.uploadHost.bos&&!i.bosUploadPath)return;var s=a+In[0][1]+i.bosUploadPath;In.shift();var c=i.bosHeader||{},u={filename:t.uniqueValue||o.uniqueName,name:o.name,downloadUrl:s,isBosRes:!0};r.upload&&t.support_options&&(r.upload.onprogress=function(e){n.onProgress(e.loaded,e.total,!0)});r.onreadystatechange=function(){if(4===r.readyState)if(JSON.parse(r.responseText||"{}").filename=t.uniqueValue,200===r.status){n.onCompleted(u,!0)}else In.length?vn[In[0][0]](e,t,n,o):n.onError("upload fail")},r.open(t.method,s,!0),r.setRequestHeader("authorization",c.bosToken),r.setRequestHeader("x-bce-date",c.bosDate),r.send(o)},aliyun:function(e,t,n,o){if(o.size>Rn.BOS_CHUNCK_SIZE)throw new Error("the file size is over 5GB!");var i=new FormData;i.set("file",e.get("file")),i.set("key",e.get("key")),i.set("token",e.get("token"));var r=In[0][1];In.shift(),e=e||en,t=(t=t||{})||tn;var a=new XMLHttpRequest,s=En(),c="".concat(s+t.ossBucketName,".").concat(r);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):In.length?vn[In[0][0]](i,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 i=new FormData,r=new XMLHttpRequest,a=En(),s=t.contentDisposition,c=In[0][1],u="".concat(a+t.s3BucketName,".").concat(c);console.log("uploadS3:url",u),In.shift(),r.upload&&t.support_options&&(r.upload.onprogress=function(e){n.onProgress(e.loaded,e.total)});r.onreadystatechange=function(){if(4===r.readyState){var i=JSON.parse(r.responseText||"{}");if(i.name=t.uniqueValue,i.filename=t.uploadFileName,i.uploadMethod=_.AWS,200===r.status||204===r.status)n.onCompleted(i);else if(In.length){var a=new FormData;a.set("file",e.get("file")),a.set("key",e.get("key")),a.set("token",e.get("token")),vn[In[0][0]](a,t,n,o)}else n.onError("upload fail")}},r.open(t.method,u,!0);var d=t?t.s3Header:{},f=o&&o.type;s?i.set("Content-Disposition","".concat(s,";")):i.set("Content-Disposition","text/html"===f?"inline;":"attachment;");i.set("Content-Type",f),i.set("x-amz-credential",d.s3Credential),i.set("x-amz-algorithm",d.s3Algorithm),i.set("x-amz-date",d.s3Date),i.set("policy",d.s3Policy),i.set("x-amz-signature",d.s3Signature),i.set("key",t.uploadFileName),i.set("file",o),r.send(i)},stc:Nn,minio:Nn},In=[],Rn={BOS_CHUNCK_SIZE:5368709120},hn="http://",mn="https://";function En(){var e=mn;return"http:"!==location.protocol&&"file:"!==location.protocol||(e=hn),e}var Sn,Tn=(Sn="RC-upload-",{get:function(e){e=Sn+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=Sn+e,t={data:t,type:typeof t,updateTime:Date.now()},n.setItem(e,JSON.stringify(t))},remove:function(e){e=Sn+e,localStorage.removeItem(e)}});function pn(e,t,n,o){var i=mn+t.uploadHost.qiniu,r=(/http/.test(In[0][1])?"":En())+In[0][1]||i;t.isChunk||In.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 i=JSON.parse(a.responseText||"{}");i.filename=t.uniqueValue,i.uploadMethod=_?_.QINIU:"",200===a.status||204===a.status?n.onCompleted(i):In.length?vn[In[0][0]](e,t,n,o):n.onError("upload fail")}},a.open(t.method,r,!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 On(e,t,n,o){var i=0,r=o||C(),a=Tn.get(r);a&&(e.uniqueName=a.sessionId,i=a.offset);var s=Math.min(t.chunk_size,e.size-i),c=e.slice(i,i+s),u=e.uniqueName;t.multi_parmas.name=u,t.filesize=e.size;var d="bytes=".concat(i,"-").concat(i+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 i in t.unique_key&&o.append(t.unique_key,n),o.append(t.file_data_name,e,e.name),t.multi_parmas){var r=t.multi_parmas[i];o.append(i,r)}return o}(c,t,e.uniqueName),pn(c,t,{onCompleted:function(o){i+=s;var a=e.uniqueName;Tn.set(r,{offset:i,sessionId:a}),i<e.size?On(e,t,n,r):(i=0,Tn.remove(r),n.onCompleted(o))},onError:function(e){console.error(e),n.onError(e)},onProgress:function(e,o){var r=e+i;n.onProgress(r,t.filesize)},onOpen:function(e){n.onOpen(e)}},e)}function Nn(e,t,n,o,i){var r=new XMLHttpRequest,a=t.contentDisposition,s=In[0][1],c=i===_.STC?t.stcBucketName:t.minioBucketName,u="https://".concat(s,"/").concat(c,"/").concat(t.uploadFileName);In.shift(),r.upload&&t.support_options&&(r.upload.onprogress=function(e){n.onProgress(e.loaded,e.total)}),r.onreadystatechange=function(){if(4===r.readyState){var a=JSON.parse(r.responseText||"{}");if(a.name=t.uniqueValue,a.filename=t.uploadFileName,a.uploadMethod=i,200===r.status||204===r.status)n.onCompleted(a);else if(In.length){var s=new FormData;s.set("file",e.get("file")),s.set("key",e.get("key")),s.set("token",e.get("token")),vn[In[0][0]](s,t,n,o)}else n.onError("upload fail")}},r.open("PUT",u,!0);var d=t.stcHeader.stcAuthorization,f=t.stcHeader.stcContentSha256,l=t.stcHeader.stcDate;i===_.MINIO&&(d=t.minioHeader.minioAuthorization,f=t.minioHeader.minioContentSha256,l=t.minioHeader.minioDate),r.setRequestHeader("Content-Type",o.type),a?r.setRequestHeader("Content-Disposition","".concat(a,";")):r.setRequestHeader("Content-Disposition","text/html"===o.type?"inline;":"attachment;"),r.setRequestHeader("Authorization",d),r.setRequestHeader("x-amz-content-sha256",f),r.setRequestHeader("x-amz-date",l),r.send(o)}function _n(e,t,n,o,i,r){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=i===_.STC?n.stcBucketName:n.minioBucketName,g="uploads";e.getFileToken(u,t.name,"POST",g).then((function(e){a=e.fileName,s="https://".concat(r,"/").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;i===_.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(h(e,n));R(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 R(n,r){r&&Array.isArray(r)&&0!==r.length&&Promise.all(r).then((function(){var r="uploadId=".concat(n);if(I.size===f)e.getFileToken(u,a,"POST",r).then((function(e){console.log("onSuccess",e),console.log("onSuccess:uploadId",n);var u=e.stcAuthorization,d=e.stcContentSha256,f=e.stcDate;i===_.MINIO&&(u=e.minioAuthorization,d=e.minioContentSha256,f=e.minioDate);var l=new XMLHttpRequest;l.open("POST","".concat(s,"?").concat(r),!0),l.setRequestHeader("Authorization",u),l.setRequestHeader("x-amz-content-sha256",d),l.setRequestHeader("x-amz-date",f),l.setRequestHeader("Content-Type",c);var g="<CompleteMultipartUpload xmlns='http://s3.amazonaws.com/doc/2006-03-01/'>",v=Array.from(I.keys()||[]).sort((function(e,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:i};o.onCompleted(e)}else o.onError("uploadStcMultipart:upload does not end")}}),(function(e){o.onError("uploadStcMultipart:".concat(e))}));else{for(var d=[],l=0,g=v;l<g.length;l++){var m=g[l];d.push(h(n,m))}R(n,d)}}),(function(e){console.error(e),o.onError("uploadStcMultipart: chunkFiles upload failed and those will reupload");for(var t=[],i=0,r=v;i<r.length;i++){var a=r[i];t.push(h(n,a))}R(n,t)}))}function h(o,r){return new Promise((function(d,f){var l="partNumber=".concat(r,"&uploadId=").concat(o);e.getFileToken(u,a,"PUT",l).then((function(e){console.log("signature ".concat(r," onSuccess"),e);var o=t&&t.slice((r-1)*n.stc_chunk_size,r*n.stc_chunk_size);console.log("fileChunk:size",o.size);var a=e.stcAuthorization,u=e.stcContentSha256,g=e.stcDate;i===_.MINIO&&(a=e.minioAuthorization,u=e.minioContentSha256,g=e.minioDate);var R=new XMLHttpRequest;R.open("PUT","".concat(s,"?").concat(l),!0),R.setRequestHeader("Authorization",a),R.setRequestHeader("x-amz-content-sha256",u),R.setRequestHeader("x-amz-date",g),R.setRequestHeader("Content-Type",c),R.send(o),R.onreadystatechange=function(){if(4===R.readyState)if(200===R.status||204===R.status){var e=R.getResponseHeader("etag");console.log("etag:".concat(r),e),I.set(r,e),d(e)}else v.includes(r)||v.push(r),f(r)}}),(function(e){console.log("getETags:签名验证失败"),v.includes(r)||v.push(r),f(r)}))}))}}var Cn={form:function(e,t){var n=new FormData;if(t.unique_key){var o=e.name.substr(e.name.lastIndexOf(".")),i=An()+o;n.append(t.unique_key,i),t.uniqueValue=i}return n.append(t.file_data_name,e),yn(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(".")),i=An()+o;n[t.unique_key]=i,t.uniqueValue=i}return n[t.file_data_name]=e,yn(t.multi_parmas,(function(e,t){n[e]=t})),JSON.stringify(n)},data:function(e,t){return e}};function An(){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 yn(e,t){for(var n in e)t(n,e[n])}var Mn,Un=0,Pn=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:Cn.form,genUId:An};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;yn(e,(function(e,n){t.options[e]=n}))},e.prototype.upload=function(e,t,n,o){if(n){var i=this;!function(e,t,n,o,i){en=n,tn=o,In=[];var r,a,s=e.getNaviInfoFromCache();if(1===(null==s?void 0:s.type)&&t.uploadDomain&&!o.ossConfig)In=[["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&&In.push(e)})),f.length!==In.length&&(In=[["qiniu",o.domain],["baidu",o.uploadHost.bos],["aliyun",l],["s3",c],["stc",u],["minio",d]])}else In=[["qiniu",o.domain],["baidu",o.uploadHost.bos]];if(o.ossConfig){var v=o&&JSON.parse(o.ossConfig);Array.isArray(v)||(v=[]),r=v.find((function(e){return Object.keys(e).includes("stc")})),a=v.find((function(e){return Object.keys(e).includes("minio")}))}if(r&&1===parseInt(r.p,10)&&n.size>=4194304)_n(e,n,o,i,_.STC,r.stc);else if(a&&1===parseInt(a.p,10)&&n.size>=4194304)_n(e,n,o,i,_.MINIO,a.minio);else{var I=o.data(n,o);vn[In[0][0]](I,o,i,n,_.MINIO)}}(e,t,n,this.options,{onProgress:function(e,t,n){(Mn=e,n)?Mn=Un+e/t*(t-Un):Un=Mn;o.onProgress(Mn,t)},onCompleted:function(e){o.onCompleted(e)},onError:function(e){o.onError(e)},onOpen:function(e){i.xhr=e}})}else o.onError("upload file is null.")},e.prototype.cancel=function(){var e;null===(e=this.xhr)||void 0===e||e.abort()},e}();var Ln,wn,Bn={init:function(e){return new Pn(e)},dataType:Cn,resize:function(e,t,n){var o=document.createElement("canvas"),i=new FileReader;i.readAsDataURL(e),i.onload=function(e){var i=e.target.result,r=new Image;r.src=i;var a=r.width,s=r.height,c=function(e,t){var n=1,o=e.width,i=t.maxWidth||0;i>0&&o>i&&(n=i/o);var r=e.height,a=t.maxHeight||0;if(a>0&&r>a){var s=a/r;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=i;c<1&&(u=function(e,t,n){o.width=t,o.height=n;var i=o.getContext("2d");return i.drawImage(e,0,0,t,n),o.toDataURL("image/jpg")}(r,a*c,s*c)),n(u)}},Upload:Pn},Dn=function(e,t,n){var o=document.createElement("canvas"),i=o.getContext("2d"),r=new Image,a="string"==typeof e;r.onload=function(a){var s=function(e,t,n){var o,i,r,a=e<t,s=0,c=0;return(a?t/e:e/t)>n.scale?(a?(i=100,c=((r=t/(o=e/100))-n.maxHeight)/2):(r=100,s=((i=e/(o=t/100))-n.maxWidth)/2),{w:i,h:r,x:-s,y:-c}):(a?(o=t/n.maxHeight,r=n.maxHeight,i=e/o):(o=e/n.maxWidth,i=n.maxWidth,r=t/o),{w:i,h:r,x:-s,y:-c})}(r.width,r.height,t);o.width=s.w>t.maxWidth?t.maxWidth:s.w,o.height=s.h>t.maxHeight?t.maxHeight:s.h,i.drawImage(r,s.x,s.y,s.w,s.h);var c=o.toDataURL("string"==typeof e?"image/jpg":e.type,t.quality);c=c.replace(/data:image\/[^;]+;base64,/,""),n(c)},r.src=a?"data:image/jpg;base64,".concat(e):function(e){var t=window.URL||window.webkitURL;return t?t.createObjectURL(e):""}(e)},bn=function(e,t){var n=e.file,o=e.compress;Dn(n,o,t)},Gn=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 i=Bn.init(e);t(i)}));else{e.headers=e.headers||{},e.base64&&(e.headers["Content-type"]="application/octet-stream");var n=Bn.init(e);t(n)}},xn=function(e,t,n,o,i){o.upload(e,t,n.file,{onError:function(e){i.onError(e)},onProgress:function(e,t){i.onProgress(e,t)},onCompleted:function(e){e.filename=e.filename||e.hash;var t=n.compressThumbnail||bn;n.compress?t(n,(function(t){e.thumbnail=t,i.onCompleted(e)})):i.onCompleted(e)}})},Vn=function(){function e(e){this.instance=e}return e.prototype.upload=function(e,t,n,o){xn(e,t,{file:n},this.instance,o)},e.prototype.cancel=function(){this.instance.cancel()},e}(),kn=function(){function e(e,t){this.instance=e,this.cfg=t}return e.prototype.upload=function(e,t,n,o){var i={file:n,compress:this.cfg};xn(e,t,i,this.instance,o)},e.prototype.cancel=function(){this.instance.cancel()},e}(),Hn={initFile:function(e,t){Gn(e,(function(e){var n=new Vn(e);t(n)}))},initImage:function(e,t){Gn(e,(function(n){var o,i,r,a,s={maxHeight:(null===(o=e.thumbnailConfig)||void 0===o?void 0:o.maxHeight)||160,maxWidth:(null===(i=e.thumbnailConfig)||void 0===i?void 0:i.maxWidth)||160,quality:(null===(r=e.thumbnailConfig)||void 0===r?void 0:r.quality)||.5,scale:(null===(a=e.thumbnailConfig)||void 0===a?void 0:a.scale)||2.4},c=new kn(n,s);t(c)}))},dataType:Bn.dataType};function Fn(e,t,n,o,i,r,a){var s=this;void 0===a&&(a=y.FILE);var c=y.FILE;a===y.IMAGE&&(c=y.IMAGE);var u=e.getNaviInfoFromCache();if(!wn&&(wn="upload.qiniup.com",u&&u.ossConfig))try{var d=JSON.parse(u.ossConfig).find((function(e){return void 0!==e.qiniu}));d&&(wn=d.qiniu)}catch(e){}var f=w({domain:wn,getToken:function(t){e.getFileToken(c,o.name).then((function(e){t(e.token,e)})).catch((function(e){i.onFail(e)}))}},r),l=Hn.initFile;c===y.IMAGE&&(l=Hn.initImage),l(f,(function(t){t.upload(e,n,o,{onProgress:function(e,t){var n,o=Math.floor(e/t*100);null===(n=i.onProgress)||void 0===n||n.call(i,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,i){zn(t,o.filename,o.name,o,o.uploadMethod).then((function(r){if(0===r.code){var a=r.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),i.onSuccess(a)):Zn(n).then((function(e){i.onSuccess(w(w({},a),e))}))}else i.onFail(r)})).catch((function(e){i.onFail(e)}))}(a,c,o,e,i),[2]):(function(e,t,n,o,i,r){var a={type:o.type,name:i.rc_url.file_name,downloadUrl:e.uploadDomain+i.rc_url.path};if(t===y.AUDIO)return void Zn(o).then((function(e){r.onSuccess(w(w({},a),e))}));t===y.IMAGE&&(a.thumbnail=i.thumbnail,a.width=i.w,a.height=i.h,a.size=i.size);r.onSuccess(a)}(n,a,0,o,e,i),[2])}))}))},onError:function(e){i.onFail(e)}})}))}function Zn(e){return new Promise((function(t){if("function"!=typeof e.arrayBuffer){var n=new FileReader;n.onload=function(){n.result?qn(n.result).then((function(e){t(e)}),(function(){t({})})):t({})},n.onerror=function(){t({duration:0})},n.readAsArrayBuffer(e)}else e.arrayBuffer().then(qn).then((function(e){t(e)}))}))}function qn(e){return Ln=Ln||new AudioContext,new Promise((function(t,n){Ln.decodeAudioData(e,(function(e){t({duration:e.duration,length:e.length})}),n)}))}function Jn(e,t,n,o){return pe((function(r){return new Promise((function(a){r.getFileToken(e,t,n,o).then((function(e){a({code:i.SUCCESS,data:e})})).catch((function(e){a({code:e,msg:Ge[e]})}))}))}))}function zn(e,t,n,o,r){return m("fileType",e,A,!0)&&m("filename",t,l.STRING)&&m("saveName",n,l.STRING)&&m("serverType",r,l.NUMBER)?pe((function(a){return new Promise((function(s){a.getFileUrl(e,t,n,o,r).then((function(e){s({code:i.SUCCESS,data:e})})).catch((function(e){s({code:e})}))}))})):Promise.resolve({code:i.BIZ_ERROR_INVALID_PARAMETER})}function Kn(e,t,n){return B(this,void 0,void 0,(function(){var o=this;return D(this,(function(s){return[2,pe((function(s,c){return B(o,void 0,void 0,(function(){var o,u,d,f,g,v,I,h,E,S,T,p;return D(this,(function(O){switch(O.label){case 0:return n=n||{},t instanceof Qt==!1?(c.warn(R.O,"send message fail -> message parameter is not an instance of BaseMessage"),[2,be.ILLGAL_PARAMS]):m("conversation",e,l.OBJECT,!0)?(o=e.conversationType,u=e.targetId,d=e.channelId,m("conversation.targetId",u,l.STRING,!0)&&m("conversation.conversationType",o,l.NUMBER,!0)&&m("conversation.channelId",d,l.CHANNEL_ID)&&m("options.isStatusMessage",null==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(R.O,"send message ->".concat(f)),g=function(e,t,n){var o=e.isStatusMessage,i=e.disableNotification,r=e.pushContent,a=e.pushData,s=e.isMentioned,c=e.mentionedType,u=e.mentionedUserIdList,d=e.directionalUserIdList,f=e.isVoipPush,l=e.canIncludeExpansion,g=e.expansion,v=e.isFilerWhiteBlacklist,I=e.pushConfig,R=e.messageId,h=n.channelId;return w({isStatusMessage:o,disableNotification:i,pushContent:r,pushData:a,isMentioned:s,mentionedType:c,mentionedUserIdList:u,directionalUserIdList:d,isVoipPush:f,canIncludeExpansion:l,expansion:g,isFilerWhiteBlacklist:v,pushConfig:I,channelId:h||"",messageId:R},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:r.UNREAD,isOffLineMessage:!1,pushConfig:null==n?void 0:n.pushConfig,sentStatus:P.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(le(v))}catch(e){c.error(R.O,'Callback method "onSendBefore" execution error.\n'.concat(null==e?void 0:e.stack),I)}},c.info(R.A_SEND_MSG_T,JSON.stringify({messageType:t.messageType,conversationType:o,targetId:u,channelId:d}),I),[4,s.sendMessage(o,u,g,h,I)]):[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]):[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}];case 1:return E=O.sent(),S=E.code,T=E.data,S===i.SUCCESS?(c.info(R.A_SEND_MSG_R,JSON.stringify({code:S,messageUId:T.messageUId,messageId:T.messageId}),I),p=le(T),[2,{code:S,data:p}]):(c.warn(R.A_SEND_MSG_R,"send message fail ->".concat(S,":").concat(Ge[S],",").concat(f)),v.sentTime=(null==T?void 0:T.sentTime)||0,v.sentStatus=null==T?void 0:T.sentStatus,[2,{code:S,msg:Ge[S],data:le(v)}])}}))}))}))]}))}))}function Yn(e,t,n){return Kn(e,new an(t),n)}function jn(e,t){return function(n,o,r,a){if(!m("sendOptions.contentDisposition",null==a?void 0:a.contentDisposition,(function(e){return["inline","attachment"].includes(e)})))return Promise.resolve({code:i.BIZ_ERROR_INVALID_PARAMETER});var s={contentDisposition:null==a?void 0:a.contentDisposition};if(a&&"thumbnailConfig"in a){var c=null==a?void 0:a.thumbnailConfig;if(!(m("sendOptions.maxHeight",null==c?void 0:c.maxHeight,l.NUMBER)&&m("sendOptions.maxWidth",null==c?void 0:c.maxWidth,l.NUMBER)&&m("sendOptions.quality",null==c?void 0:c.quality,l.NUMBER)&&m("sendOptions.scale",null==c?void 0:c.scale,l.NUMBER)))return Promise.resolve({code:i.BIZ_ERROR_INVALID_PARAMETER});s.thumbnailConfig=c}return pe((function(c,u,d){return new Promise((function(f){var l=u.createTraceId();u.info(R.L_MEDIA_UPLOAD_T,JSON.stringify({filesize:o.file.size,type:e}),l),Fn(c,0,d,o.file,{onProgress:null==r?void 0:r.onProgress,onSuccess:function(e){var s,c=(null===(s=null==r?void 0:r.onComplete)||void 0===s?void 0:s.call(r,w({url:e.downloadUrl},e)))||t(e,o);e&&e.downloadUrl&&u.info(R.L_MEDIA_UPLOAD_R,JSON.stringify({downurl:e.downloadUrl,code:i.SUCCESS}),l),Kn(n,c,a).then(f)},onFail:function(e){u.warn(R.L_MEDIA_UPLOAD_R,JSON.stringify({code:i.UPLOAD_FILE_FAILED}),l),f({code:i.UPLOAD_FILE_FAILED,msg:e||i[i.UPLOAD_FILE_FAILED]})}},s,e)}))}))}}var Wn=jn(y.FILE,(function(e,t){return new cn({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})),Xn=jn(y.IMAGE,(function(e,t){return new nn({content:e.thumbnail,imageUri:e.downloadUrl,user:t.user,extra:t.extra})})),Qn=jn(y.IMAGE,(function(e,t){return new un({gifDataSize:e.size,remoteUrl:e.downloadUrl,width:e.width,height:e.height,user:t.user,extra:t.extra})})),$n=jn(y.AUDIO,(function(e,t){return new on({remoteUrl:e.downloadUrl,duration:e.duration,type:e.type,user:t.user,extra:t.extra})})),eo=jn(y.SIGHT,(function(e,t){return new rn({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 to(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,pe((function(o,r){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=r.createTraceId(),r.info(R.A_GET_HISTORY_MSG_T,JSON.stringify({targetId:e.targetId,conversationType:e.conversationType,channelId:e.channelId,timestamp:null==t?void 0:t.timestamp,count:null==t?void 0:t.count}),n),[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===i.SUCCESS&&c?(u=c.list.map((function(e){return le(e)})),r.info(R.A_GET_HISTORY_MSG_R,JSON.stringify({code:s,messageLength:u.length}),n),[2,{code:s,data:{list:u,hasMore:c.hasMore}}]):(r.warn(R.A_GET_HISTORY_MSG_R,JSON.stringify({code:s,messageUIds:""}),n),[2,{code:s,msg:Ge[s]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function no(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,pe((function(o,r){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),r.debug(R.O,"get history message ->".concat(n)),[4,o.getRemoteHistoryMessages(e.conversationType,e.targetId,(null==t?void 0:t.timestamp)||0,(null==t?void 0:t.count)||20,(null==t?void 0:t.order)||0,e.channelId||"")];case 1:return a=d.sent(),s=a.code,c=a.data,s===i.SUCCESS&&c?(u=c.list.map((function(e){return le(e)})),[2,{code:s,data:{list:u,hasMore:c.hasMore}}]):(r.warn(R.O,"get history message fail ->".concat(s,":").concat(Ge[s],",").concat(n)),[2,{code:s,msg:Ge[s]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function oo(e,t,n,o){return B(this,void 0,void 0,(function(){var r=this;return D(this,(function(s){return m("targetId",e,l.STRING,!0)&&m("messageUId",t,l.STRING,!0)&&m("timestamp",n,l.NUMBER,!0)&&m("channelId",o,l.CHANNEL_ID)?[2,pe((function(i){return B(r,void 0,void 0,(function(){var i,r,s,c,u;return D(this,(function(d){switch(d.label){case 0:return i={targetId:e,conversationType:a.PRIVATE,channelId:o},r=new Qt("RC:ReadNtf",{messageUId:t,lastMessageSendTime:n,type:1}),[4,Kn(i,r)];case 1:return s=d.sent(),c=s.code,u=s.msg,0===c?[2,{code:c}]:[2,{code:c,msg:u}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function io(e,t,n){return B(this,void 0,void 0,(function(){var o=this;return D(this,(function(r){return m("messageUId",t,l.STRING,!0)&&m("targetId",e,l.STRING,!0)&&m("channelId",n,l.CHANNEL_ID)?[2,pe((function(i,r){return B(o,void 0,void 0,(function(){var o,i,s,c,u;return D(this,(function(d){switch(d.label){case 0:return o="messageUId:".concat(t,",targetId:").concat(e),r.debug(R.O,"send read receipt message ->".concat(o)),i=new Qt("RC:RRReqMsg",{messageUId:t}),[4,Kn({targetId:e,conversationType:a.GROUP,channelId:n},i)];case 1:return s=d.sent(),c=s.code,u=s.msg,0===c?[2,{code:c}]:[2,{code:c,msg:u}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function ro(e,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 ao(e,t,n){return B(this,void 0,void 0,(function(){var o=this;return D(this,(function(r){return m("targetId",e,l.STRING,!0)&&m("messageList",t,l.OBJECT,!0)&&m("channelId",n,l.CHANNEL_ID)&&!Object.keys(t).some((function(e){return!m(e,t[e],l.ARRAY)}))?[2,pe((function(r,s){return B(o,void 0,void 0,(function(){var o,c,u,d,f,l;return D(this,(function(g){switch(g.label){case 0:return o={targetId:e,conversationType:a.GROUP,channelId:n},u=r.getNaviInfoFromCache(),1!==(null==u?void 0:u.grpRRVer)?[3,2]:(d=[],Object.keys(t).forEach((function(e){t[e].forEach((function(e){-1===d.indexOf(e)&&d.push(e)}))})),d.length?[4,r.sendReadReceiptMessage(e,d,n)]:(s.warn(R.O,"Error in parameter messageList."),[2,{code:i.PARAMETER_ERROR}]));case 1:return c=g.sent(),[3,4];case 2:return f=new Qt("RC:RRRspMsg",{receiptMessageDic:t}),[4,Kn(o,f)];case 3:c=g.sent(),g.label=4;case 4:return(l=c.code)===i.SUCCESS?[2,{code:l}]:(s.warn(R.O,"send read receipt message fail ->".concat(l,":").concat(Ge[l])),[2,{code:l,msg:Ge[l]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function so(e,t){return B(this,void 0,void 0,(function(){var n,o,r,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 Qt("RC:SRSMsg",{lastMessageSendTime:t}),[4,Kn(e,n)]):[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}];case 1:return o=s.sent(),r=o.code,a=o.msg,0===r?[2,{code:r}]:[2,{code:r,msg:a}]}}))}))}function 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("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,pe((function(o,r){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),r.debug(R.O,"recall message ->".concat(a)),[4,o.recallMessage(e.conversationType,e.targetId,t.messageUId,t.sentTime,n)];case 1:return s=d.sent(),c=s.code,u=s.data,c===i.SUCCESS&&u?[2,{code:c,data:le(u)}]:c===i.SUCCESS?[2,{code:c}]:(r.warn(R.O,"recall message fail ->".concat(c,":").concat(Ge[c],",").concat(a)),[2,{code:c,msg:Ge[c]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function uo(e,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,pe((function(o,r){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),r.debug(R.O,"delete messages ->".concat(n)),[4,o.deleteRemoteMessage(e.conversationType,e.targetId,t,e.channelId)];case 1:return(a=s.sent())!==i.SUCCESS?(r.warn(R.O,"delete message fail ->".concat(a,":").concat(Ge[a],",").concat(n)),[2,{code:a,msg:Ge[a]}]):[2,{code:i.SUCCESS}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function fo(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,pe((function(o,r){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),r.debug(R.O,"clear message ->".concat(n)),[4,o.deleteRemoteMessageByTimestamp(e.conversationType,e.targetId,t,e.channelId)];case 1:return(a=s.sent())!==i.SUCCESS?(r.warn(R.O,"clear message ->".concat(a,":").concat(Ge[a],",").concat(n)),[2,{code:a,msg:Ge[a]}]):[2,{code:i.SUCCESS}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function lo(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,pe((function(o,r){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),r.debug(R.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)!==i.SUCCESS?(r.warn(R.O,"update message expansion fail ->".concat(l,":").concat(Ge[l],",").concat(f)),[2,{code:l,msg:Ge[l]}]):[2,{code:l}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function go(e,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,pe((function(o,r){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),r.debug(R.O,"remove message expansion ->".concat(d)),[4,o.sendExpansionMessage({conversationType:n,targetId:a,messageUId:s,canIncludeExpansion:c,keys:e,channelId:u})];case 1:return(f=l.sent().code)!==i.SUCCESS?(r.warn(R.O,"remove message expansion fail ->".concat(f,":").concat(Ge[f],",").concat(d)),[2,{code:f,msg:Ge[f]}]):[2,{code:f}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function vo(e,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,pe((function(o,r){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=r.createTraceId(),r.info(R.A_SEND_MSG_T,JSON.stringify({messageType:n.messageType,conversationType:e.conversationType,targetId:e.targetId,channelId:e.channelId}),a),[4,o.sendMessage(e.conversationType,e.targetId,n,void 0,a)];case 1:return s=f.sent(),c=s.code,u=s.data,d=c===i.SUCCESS?"info":"warn",r[d](R.A_SEND_MSG_R,JSON.stringify({code:c,messageUId:u?u.messageUId:"",messageId:u?u.messageId:""}),a),c===i.SUCCESS?[2,{code:c,data:le(u)}]:[2,{code:c,msg:Ge[c]}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Io(e,t,n){return B(this,void 0,void 0,(function(){var o=this;return D(this,(function(r){return m("messageUId",t,l.STRING,!0)&&m("targetId",e,l.STRING,!0)&&m("channelId",n,l.CHANNEL_ID)?[2,pe((function(r,a){return B(o,void 0,void 0,(function(){var o,s,c,u;return D(this,(function(d){switch(d.label){case 0:return o="messageUId:".concat(t,",targetId:").concat(e),a.debug(R.O,"get message reader ->".concat(o)),[4,r.getMessageReader(e,t,n)];case 1:return s=d.sent(),c=s.code,u=s.data,c===i.SUCCESS?[2,{code:c,data:u}]:(a.warn(R.O,"get message reader fail ->".concat(c,":").concat(Ge[c],",").concat(o)),[2,{code:c,msg:Ge[c]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Ro(e,t,n,o,i){return Te((function(r,a){return f("messageType",e,l.STRING,!0),f("isPersited",t,l.BOOLEAN,!0),f("isCounted",n,l.BOOLEAN,!0),f("isStatusMessage",i,l.BOOLEAN,!1),f("searchProps",o,l.ARRAY),a.info(R.A_REGTYP_O,JSON.stringify({messageType:e,isCounted:n,isStatusMessage:i,isPersited:t})),r.registerMessageType(e,t,n,o,i),$t(e,t,n)}))}function ho(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,pe((function(n,o){return B(t,void 0,void 0,(function(){var t,r,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(),r=t.code,a=t.data,r===i.SUCCESS?(s=a&&le(a)||null,[2,{code:r,data:s}]):(o.warn(R.O,"insertMessage ->code:".concat(r,",targetId:").concat(e.targetId)),[2,{code:r,msg:Ge[r]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:Ge[i.NOT_SUPPORT]}]}))}))}function mo(e,t,n){return void 0===n&&(n={}),B(this,void 0,void 0,(function(){var o=this;return D(this,(function(r){return ve("RongIMLib.insertMessage","RongIMLib.ElectronExtension.insertMessage"),M()?m("conversation",e,l.CONVERSATION,!0)&&m("message",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,pe((function(r,a){return B(o,void 0,void 0,(function(){var o,s,c,u,d,f,l,g,v,I,h,m,E,S,T,p;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(R.O,"insertMessage ->targetId:".concat(e.targetId,",conversationType:").concat(e.conversationType)),h=n.isUnread,m=n.searchContent,E={senderUserId:o,messageType:s,content:c,messageDirection:u,sentTime:v,sentStatus:I,searchContent:m,isUnread:h,messageUId:d,disableNotification:g,canIncludeExpansion:f,expansionMsg:JSON.stringify(l),channelId:e.channelId||""},[4,r.insertMessage(e.conversationType,e.targetId,E)];case 1:return S=O.sent(),T=S.code,p=S.data,T===i.SUCCESS?[2,{code:T,data:le(p)}]:(a.warn(R.O,"insertMessage ->code:".concat(T,",targetId:").concat(e.targetId)),[2,{code:T,msg:Ge[T]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:Ge[i.NOT_SUPPORT]}]}))}))}function Eo(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,pe((function(n,o){return B(t,void 0,void 0,(function(){var t,r,a;return D(this,(function(s){switch(s.label){case 0:return[4,n.getMessage(e)];case 1:return t=s.sent(),r=t.code,a=t.data,r===i.SUCCESS?[2,{code:r,data:le(a)}]:(o.warn(R.O,"getMessage ->code:".concat(r,",messageId:").concat(e)),[2,{code:r,msg:Ge[r]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:Ge[i.NOT_SUPPORT]}]}))}))}function So(e){if(!M())return{code:i.NOT_SUPPORT,msg:Ge[i.NOT_SUPPORT]};var t,n=e.conversationType,o=e.targetId,r=e.channelId;return m("conversation",e,l.CONVERSATION,!0)?(t=function(e){var t=e.getUnreadMentionedMessages(n,o,r),a=[];return t&&t.length&&t.forEach((function(e){return a.push(le(e))})),{code:i.SUCCESS,data:a}},he?t(he,Ee,me):{code:i.BIZ_ERROR_CLIENT_NOT_INIT}):{code:i.BIZ_ERROR_INVALID_PARAMETER}}function To(e,t,n,o){return B(this,void 0,void 0,(function(){var r=this;return D(this,(function(a){return ve("RongIMLib.searchMessages","RongIMLib.ElectronExtension.searchMessages"),M()?m("conversation",e,l.CONVERSATION,!0)&&m("keyword",t,l.STRING,!0)&&m("timestamp",n,l.NUMBER)&&m("count",o,l.NUMBER)?[2,pe((function(a,s){return B(r,void 0,void 0,(function(){var r,c,u,d;return D(this,(function(f){switch(f.label){case 0:return 1,[4,a.searchMessageByContent(e.conversationType,e.targetId,t,n,o,1,e.channelId)];case 1:return r=f.sent(),c=r.code,u=r.data,c===i.SUCCESS?(d=[],(null==u?void 0:u.messages)&&u.messages.length&&u.messages.forEach((function(e){return d.push(le(e))})),[2,{code:c,data:{messages:d,count:null==u?void 0:u.count}}]):(s.warn(R.O,"searchMessages ->code:".concat(c,",targetId:").concat(e.targetId)),[2,{code:c,msg:Ge[c]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:Ge[i.NOT_SUPPORT]}]}))}))}function po(e,t,n){return B(this,void 0,void 0,(function(){var o,r,a,s=this;return D(this,(function(c){return ve("RongIMLib.deleteLocalMessagesByTimestamp","RongIMLib.ElectronExtension.deleteMessagesByTimestamp"),M()?(o=e.conversationType,r=e.targetId,a=e.channelId,m("conversationType",o,l.NUMBER,!0)&&m("targetId",r,l.STRING,!0)&&m("timestamp",t,l.NUMBER,!0)&&m("cleanSpace",n,l.BOOLEAN)?[2,pe((function(c,u){return B(s,void 0,void 0,(function(){var s;return D(this,(function(d){switch(d.label){case 0:return[4,c.deleteMessagesByTimestamp(o,r,t,n,a)];case 1:return s=d.sent(),u.debug(R.A_DELETE_MESSAGES_S,JSON.stringify({code:s,conversationType:o,targetId:r,channelId:a,timestamp:t})),s===i.SUCCESS?[2,{code:s}]:(u.warn(R.O,"deleteLocalMessagesByTimestamp ->code:".concat(s,",targetId:").concat(e.targetId)),[2,{code:s,msg:Ge[s]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]):[2,{code:i.NOT_SUPPORT,msg:Ge[i.NOT_SUPPORT]}]}))}))}function Oo(e){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(n){return ve("RongIMLib.clearMessages","RongIMLib.ElectronExtension.clearMessages"),M()?[2,pe((function(n,o){return B(t,void 0,void 0,(function(){var t,r,a,s;return D(this,(function(c){switch(c.label){case 0:return t=e.conversationType,r=e.targetId,a=e.channelId,o.info(R.O,"clearMessages ->targetId:".concat(r,",conversationType:").concat(t)),[4,n.clearMessages(t,r,a)];case 1:return(s=c.sent())===i.SUCCESS?[2,{code:s}]:(o.warn(R.O,"clearMessages ->code:".concat(s,",targetId:").concat(r)),[2,{code:s,msg:Ge[s]}])}}))}))}))]:[2,{code:i.NOT_SUPPORT,msg:Ge[i.NOT_SUPPORT]}]}))}))}function No(e,t,n,o){return B(this,void 0,void 0,(function(){var r=this;return D(this,(function(a){return ve("RongIMLib.searchConversationByContent","RongIMLib.ElectronExtension.searchConversationByContent"),M()?[2,pe((function(a,s){return B(r,void 0,void 0,(function(){var r,c,u;return D(this,(function(d){switch(d.label){case 0:return s.info(R.O,"searchConversationByContent ->keyword:".concat(e)),[4,a.searchConversationByContent(e,n,o,t)];case 1:return r=d.sent(),c=r.code,u=r.data,c===i.SUCCESS?[2,{code:c,data:u}]:(s.warn(R.O,"searchConversationByContent ->code:".concat(c,",keyword:").concat(e)),[2,{code:c,msg:Ge[c]}])}}))}))}))]:[2,{code:i.NOT_SUPPORT,msg:Ge[i.NOT_SUPPORT]}]}))}))}function _o(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,pe((function(o,r){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,r.info(R.O,"clearUnreadCountByTimestamp ->targetId:".concat(a,",conversationType:").concat(n)),[4,o.clearUnreadCountByTimestamp(n,a,t,s)];case 1:return(c=u.sent())===i.SUCCESS?[2,{code:c}]:(r.warn(R.O,"clearUnreadCountByTimestamp ->code:".concat(c,",targetId:").concat(a)),[2,{code:c,msg:Ge[c]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:Ge[i.NOT_SUPPORT]}]}))}))}function Co(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return ve("RongIMLib.setMessageReceivedStatus","RongIMLib.ElectronExtension.setMessageReceivedStatus"),M()?m("messageId",e,l.NUMBER,!0)&&m("receivedStatus",t,l.NUMBER,!0)?[2,pe((function(o,r){return B(n,void 0,void 0,(function(){var n;return D(this,(function(a){switch(a.label){case 0:return r.info(R.O,"setMessageReceivedStatus ->messageId:".concat(e,",receivedStatus:").concat(t)),[4,o.setMessageReceivedStatus(e,t)];case 1:return(n=a.sent())===i.SUCCESS?[2,{code:n}]:(r.warn(R.O,"setMessageReceivedStatus ->code:".concat(n,",messageId:").concat(e)),[2,{code:n,msg:Ge[n]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:Ge[i.NOT_SUPPORT]}]}))}))}function Ao(e){return B(this,void 0,void 0,(function(){var 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,pe((function(n,o){return B(t,void 0,void 0,(function(){var t;return D(this,(function(r){switch(r.label){case 0:return o.info(R.O,"createTag ->tagId:".concat(e.tagId,",tagName:").concat(e.tagName)),[4,n.createTag(e)];case 1:return(t=r.sent().code)===i.SUCCESS?[2,{code:t}]:(o.warn(R.O,"createTag ->code:".concat(t,",tagId:").concat(e.tagId)),[2,{code:t,msg:Ge[t]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function yo(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,pe((function(n,o){return B(t,void 0,void 0,(function(){var t;return D(this,(function(r){switch(r.label){case 0:return o.info(R.O,"removeTag ->tagId:".concat(e)),[4,n.removeTag(e)];case 1:return(t=r.sent().code)===i.SUCCESS?[2,{code:t}]:(o.warn(R.O,"removeTag ->code:".concat(t,",tagId:").concat(e)),[2,{code:t,msg:Ge[t]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Mo(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,pe((function(n,o){return B(t,void 0,void 0,(function(){var t;return D(this,(function(r){switch(r.label){case 0:return o.info(R.O,"updateTag ->tagId:".concat(e.tagId,",tagName:").concat(e.tagName)),[4,n.updateTag(e)];case 1:return(t=r.sent().code)===i.SUCCESS?[2,{code:t}]:(o.warn(R.O,"updateTag ->code:".concat(t,",tagId:").concat(e.tagId)),[2,{code:t,msg:Ge[t]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Uo(){return B(this,void 0,void 0,(function(){var e=this;return D(this,(function(t){return[2,pe((function(t,n){return B(e,void 0,void 0,(function(){var e,o,r;return D(this,(function(a){switch(a.label){case 0:return[4,t.getTagList()];case 1:return e=a.sent(),o=e.code,r=e.data,o===i.SUCCESS?[2,{code:i.SUCCESS,data:r}]:(n.warn(R.O,"getTagList ->code:".concat(o)),[2,{code:o,msg:Ge[o]}])}}))}))}))]}))}))}function Po(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,pe((function(n,o){return B(t,void 0,void 0,(function(){var t,r,a;return D(this,(function(s){switch(s.label){case 0:return o.info(R.O,"getTagsForConversation ->targetId:".concat(e.targetId,",conversationType:").concat(e.conversationType)),[4,n.getTagsForConversation(e)];case 1:return t=s.sent(),r=t.code,a=t.data,r===i.SUCCESS?[2,{code:r,data:a}]:[2,{code:r,msg:Ge[r]}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Lo(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,pe((function(o,r){return B(n,void 0,void 0,(function(){var n;return D(this,(function(a){switch(a.label){case 0:return r.info(R.O,"addTagForConversations ->tagId:".concat(e)),[4,o.addTagForConversations(e,t)];case 1:return(n=a.sent().code)===i.SUCCESS?[2,{code:n}]:(r.warn(R.O,"addTagForConversations ->code:".concat(n,",tagId:").concat(e)),[2,{code:n,msg:Ge[n]}])}}))}))}))]:[2,{code:i.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,pe((function(o,r){return B(n,void 0,void 0,(function(){var n;return D(this,(function(a){switch(a.label){case 0:return r.info(R.O,"removeTagForConversations ->tagId:".concat(e)),[4,o.removeTagForConversations(e,t)];case 1:return(n=a.sent().code)===i.SUCCESS?[2,{code:n}]:(r.warn(R.O,"removeTagForConversations ->code:".concat(n,",tagId:").concat(e)),[2,{code:n,msg:Ge[n]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Bo(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,pe((function(o,r){return B(n,void 0,void 0,(function(){var n;return D(this,(function(a){switch(a.label){case 0:return r.info(R.O,"removeTagsForConversation ->tagIds:".concat(t,",targetId:").concat(e.targetId,",conversationType:").concat(e.conversationType)),[4,o.removeTagsForConversation(e,t)];case 1:return(n=a.sent().code)===i.SUCCESS?[2,{code:n}]:(r.warn(R.O,"removeTagsForConversation ->code:".concat(n,",tagIds:").concat(t)),[2,{code:n,msg:Ge[n]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Do(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,pe((function(o,r){return B(n,void 0,void 0,(function(){var n;return D(this,(function(a){switch(a.label){case 0:return r.info(R.O,"removeTagForConversations ->tagId:".concat(e)),[4,o.removeTagForConversations(e,t)];case 1:return(n=a.sent().code)===i.SUCCESS?[2,{code:n}]:(r.warn(R.O,"removeTagForConversations ->code:".concat(n,",tagId:").concat(e)),[2,{code:n,msg:Ge[n]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function bo(e,t,n){return B(this,void 0,void 0,(function(){var o=this;return D(this,(function(r){return m("tagId",e,l.STRING,!0)&&m("count",t,l.NUMBER,!0)&&m("startTime",n,l.NUMBER,!0)?[2,pe((function(r,a){return B(o,void 0,void 0,(function(){var o,s,c;return D(this,(function(u){switch(u.label){case 0:return a.info(R.O,"getConversationListByTag ->tagId:".concat(e)),[4,r.getConversationListByTag(e,n,t)];case 1:return o=u.sent(),s=o.code,c=o.data,s===i.SUCCESS?[2,{code:s,data:null==c?void 0:c.map((function(e){return function(e){return w(w({},ge(e)),{isTopInTag:e.isTopInTag})}(e)}))}]:(a.warn(R.O,"getConversationListByTag ->code:".concat(s,",tagId:").concat(e)),[2,{code:s,msg:Ge[s]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Go(e,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,pe((function(o,r){return B(n,void 0,void 0,(function(){var n,a,s;return D(this,(function(c){switch(c.label){case 0:return r.info(R.O,"getUnreadCountByTag ->tagId:".concat(e)),[4,o.getUnreadCountByTag(e,t)];case 1:return n=c.sent(),a=n.code,s=n.data,a===i.SUCCESS?[2,{code:a,data:s}]:(r.warn(R.O,"getUnreadCountByTag ->code:".concat(a,",tagId:").concat(e)),[2,{code:a,msg:Ge[a]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function xo(e,t,n){return B(this,void 0,void 0,(function(){var o=this;return D(this,(function(r){return m("tagId",e,l.STRING,!0)&&m("conversation",t,l.CONVERSATION,!0)&&m("status.isTop",n,l.BOOLEAN,!0)?[2,pe((function(r,a){return B(o,void 0,void 0,(function(){var o;return D(this,(function(s){switch(s.label){case 0:return a.info(R.O,"setConversationStatusInTag ->tagId:".concat(e,",targetId:").concat(t.targetId,",conversationType").concat(t.conversationType)),[4,r.setConversationStatusInTag(e,t,{isTop:n})];case 1:return(o=s.sent().code)===i.SUCCESS?[2,{code:o}]:(a.warn(R.O,"setConversationStatusInTag ->code:".concat(o,",tagId:").concat(e)),[2,{code:o,msg:Ge[o]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}jn(y.COMBINE_HTML,(function(e,t){return new sn({remoteUrl:e.downloadUrl,nameList:t.nameList,summaryList:t.summaryList,conversationType:t.conversationType,user:t.user,extra:t.extra})}));var Vo={COMET:"comet",WEBSOCKET:"websocket"},ko={TEXT:"RC:TxtMsg",VOICE:"RC:VcMsg",HQ_VOICE:"RC:HQVCMsg",IMAGE:"RC:ImgMsg",GIF:"RC:GIFMsg",RICH_CONTENT:"RC:ImgTextMsg",LOCATION:"RC:LBSMsg",FILE:"RC:FileMsg",SIGHT:"RC:SightMsg",COMBINE:"RC:CombineMsg",CHRM_KV_NOTIFY:"RC:chrmKVNotiMsg",LOG_COMMAND:"RC:LogCmdMsg",EXPANSION_NOTIFY:"RC:MsgExMsg",REFERENCE:"RC:ReferenceMsg",RECALL_MESSAGE_TYPE:"RC:RcCmd"};var Ho=Object.freeze({__proto__:null,getAllConversationList:function(e){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(n){return M()?m("channelId",e,l.CHANNEL_ID)?[2,pe((function(n,o){return B(t,void 0,void 0,(function(){var t,r,a,s;return D(this,(function(c){switch(c.label){case 0:return o.info(R.O,"getAllConversationList -> channelId: ".concat(e)),L(e)?[4,n.getConversationListWithAllChannel()]:[3,2];case 1:return t=c.sent(),[3,4];case 2:return[4,n.getConversationList(void 0,void 0,void 0,void 0,e)];case 3:t=c.sent(),c.label=4;case 4:return r=t.code,a=t.data,r===i.SUCCESS&&a?(s=a.map((function(e){return ge(e)})),[2,{code:r,data:s}]):(o.warn(R.O,"getAllConversationList fail -> code: ".concat(r," channelId: ").concat(e)),[2,{code:r,msg:Ge[r]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:Ge[i.NOT_SUPPORT]}]}))}))},getConversationList:function(e,t,n){return B(this,void 0,void 0,(function(){var o=this;return D(this,(function(r){return M()?m("startTime",e,l.NUMBER,!0)&&m("count",t,l.NUMBER,!0)&&m("channelId",n,l.CHANNEL_ID)?[2,pe((function(r,a){return B(o,void 0,void 0,(function(){var o,s,c,u,d,f;return D(this,(function(l){switch(l.label){case 0:return o="startTime: ".concat(e,", count: ").concat(t,", channelId: ").concat(n),a.info(R.O,"getConversationList -> ".concat(o)),L(n)?[4,r.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,r.getConversationsByPage(c,e,t,n)];case 3:s=l.sent(),l.label=4;case 4:return u=s.code,d=s.data,u===i.SUCCESS&&d?(f=d.map((function(e){return ge(e)})),[2,{code:u,data:f}]):(a.warn(R.O,"getConversationList fail -> code: ".concat(u," ").concat(o)),[2,{code:u,msg:Ge[u]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:Ge[i.NOT_SUPPORT]}]}))}))},searchConversationByContent:function e(t,n,o){return B(this,void 0,void 0,(function(){var r=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,pe((function(a,s){return B(r,void 0,void 0,(function(){var r,c,u,d,f;return D(this,(function(l){switch(l.label){case 0:return r="keyword: ".concat(t,", messageTypes: ").concat(JSON.stringify(n),", channelId: ").concat(o),s.info(R.O,"searchConversationByContent -> ".concat(e)),L(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===i.SUCCESS&&d?(f=d.map((function(e){return ge(e)})),[2,{code:u,data:f}]):(s.warn(R.O,"searchConversationByContent fail -> code: ".concat(u," ").concat(r)),[2,{code:u,msg:Ge[u]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:Ge[i.NOT_SUPPORT]}]}))}))},searchMessages:function(e,t,n,o){return B(this,void 0,void 0,(function(){var r=this;return D(this,(function(a){return M()?m("conversation",e,l.CONVERSATION,!0)&&m("keyword",t,l.STRING,!0)&&m("startTime",n,l.NUMBER,!0)&&m("count",o,l.NUMBER,!0)?[2,pe((function(a,s){return B(r,void 0,void 0,(function(){var r,c,u,d,f,l,g,v,I,h;return D(this,(function(m){switch(m.label){case 0:return r="conversation: ".concat(JSON.stringify(e),", keyword: ").concat(t,", timestamp: ").concat(n,", count: ").concat(o),s.info(R.O,"searchMessages -> ".concat(r)),c=e.targetId,u=e.conversationType,d=e.channelId,L(d)?[4,a.searchMessageByContentWithAllChannel(u,c,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===i.SUCCESS&&g?(v=g.messages,I=g.count,h=v.map((function(e){return le(e)})),[2,{code:l,data:{messages:h,count:I}}]):(s.warn(R.O,"searchMessages fail -> code: ".concat(l," ").concat(r)),[2,{code:l,msg:Ge[l]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:Ge[i.NOT_SUPPORT]}]}))}))},searchMessageInTimeRange:function(e,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,pe((function(o,r){return B(n,void 0,void 0,(function(){var n,a,s,c,u,d,f,l,g,v,I;return D(this,(function(h){switch(h.label){case 0:return n="conversation: ".concat(JSON.stringify(e),", option: ").concat(JSON.stringify(t)),r.info(R.O,"searchMessageInTimeRange -> ".concat(n)),a=e.conversationType,s=e.targetId,c=t.keyword,u=t.startTime,d=t.endTime,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=h.sent(),v=g.code,I=g.data,v===i.SUCCESS&&I?[2,{code:v,data:{messages:I.messages.map((function(e){return le(e)}))}}]:(r.warn(R.O,"searchMessageInTimeRange fail -> code: ".concat(v,", ").concat(n)),[2,{code:v}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:Ge[i.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,pe((function(o,r){return B(n,void 0,void 0,(function(){var n,a,s,c,u,d,f,l,g,v,I,h,m,E,S;return D(this,(function(T){switch(T.label){case 0:return n=t.count,a=t.timestamp,s=t.order,c=t.messageTypes,u="conversation: ".concat(JSON.stringify(e),", option: ").concat(JSON.stringify(t)),r.info(R.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=T.sent(),v=g.code,I=g.data,v===i.SUCCESS?(m=(h=I).list,E=h.hasMore,S=m.map((function(e){return le(e)})),[2,{code:v,data:{messages:S,hasMore:E,list:S}}]):(r.warn(R.O,"getHistoryMessagesByMessageTypes fail -> code: ".concat(v," ").concat(u)),[2,{code:v,msg:Ge[v]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:Ge[i.NOT_SUPPORT]}]}))}))},setMessageStatusToRead:function(e,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,pe((function(o,i){return B(n,void 0,void 0,(function(){var n,r,a,s;return D(this,(function(c){switch(c.label){case 0:return n="conversation: ".concat(JSON.stringify(e),", timestamp: ").concat(t),i.info(R.O,"updateSentMsgReceiptStatus -> ".concat(n)),r=e.conversationType,a=e.targetId,s=e.channelId,[4,o.setMessageStatusToRead(r,a,t,s)];case 1:return[2,c.sent()]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:Ge[i.NOT_SUPPORT]}]}))}))},setMessageReceivedStatus:function(e,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!L(r[e])}),!0)?[2,pe((function(o,i){return B(n,void 0,void 0,(function(){return D(this,(function(n){switch(n.label){case 0:return i.info(R.O,"setMessageReceivedStatus -> messageId: ".concat(e,", receivedStatus: ").concat(t)),[4,o.setMessageReceivedStatus(e,t)];case 1:return[2,{code:n.sent()}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:Ge[i.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!L(P[e])}),!0)?[2,pe((function(o,i){return B(n,void 0,void 0,(function(){return D(this,(function(n){switch(n.label){case 0:return i.info(R.O,"setMessageSentStatus ->messageId: ".concat(e,", sentStatus: ").concat(t)),[4,o.setMessageSentStatus(e,t)];case 1:return[2,{code:n.sent()}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:Ge[i.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(r){return M()?m("messageId",e,l.NUMBER,!0)&&m("content",t,l.OBJECT,!0)&&m("messageType",n,l.ONLY_STRING,!0)?[2,pe((function(i,r){return B(o,void 0,void 0,(function(){return D(this,(function(o){switch(o.label){case 0:return r.info(R.O,"setMessageSentStatus ->messageId: ".concat(e,", messageType: ").concat(n)),[4,i.setMessageContent(e,t,n)];case 1:return[2,{code:o.sent()}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:Ge[i.NOT_SUPPORT]}]}))}))},deleteMessages:function(e){return B(this,void 0,void 0,(function(){var 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:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,pe((function(n,o){return B(t,void 0,void 0,(function(){return D(this,(function(t){switch(t.label){case 0:return o.info(R.O,"deleteMessages ->messageIds: ".concat(JSON.stringify(e))),[4,n.deleteMessages(e)];case 1:return[2,{code:t.sent()}]}}))}))}))]:[2,{code:i.NOT_SUPPORT,msg:Ge[i.NOT_SUPPORT]}]}))}))},clearMessages:function(e){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(n){return M()?[2,pe((function(n,o){return B(t,void 0,void 0,(function(){var t,r,a,s;return D(this,(function(c){switch(c.label){case 0:return t=e.conversationType,r=e.targetId,a=e.channelId,o.info(R.O,"clearMessages ->targetId:".concat(r,",conversationType:").concat(t)),[4,n.clearMessages(t,r,a)];case 1:return(s=c.sent())===i.SUCCESS?[2,{code:s}]:(o.warn(R.O,"clearMessages ->code:".concat(s,",targetId:").concat(r)),[2,{code:s,msg:Ge[s]}])}}))}))}))]:[2,{code:i.NOT_SUPPORT,msg:Ge[i.NOT_SUPPORT]}]}))}))},deleteMessagesByTimestamp:function(e,t,n){return B(this,void 0,void 0,(function(){var o,r,a,s=this;return D(this,(function(c){return M()?(o=e.conversationType,r=e.targetId,a=e.channelId,m("conversationType",o,l.NUMBER,!0)&&m("targetId",r,l.STRING,!0)&&m("timestamp",t,l.NUMBER,!0)&&m("cleanSpace",n,l.BOOLEAN)?[2,pe((function(e,c){return B(s,void 0,void 0,(function(){var s;return D(this,(function(u){switch(u.label){case 0:return[4,e.deleteMessagesByTimestamp(o,r,t,n,a)];case 1:return(s=u.sent())===i.SUCCESS?[2,{code:s}]:(c.warn(R.O,"deleteMessagesByTimestamp ->code:".concat(s,",targetId:").concat(r)),[2,{code:s,msg:Ge[s]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]):[2,{code:i.NOT_SUPPORT,msg:Ge[i.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(r){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 Qt||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,pe((function(r,a){return B(o,void 0,void 0,(function(){var o,s,c,u,d,f,l,g,v,I,h,m,E,S,T;return D(this,(function(p){switch(p.label){case 0:return o="",s=1,f=!1,g=t.messageType,v=t.content,t instanceof Qt||(o=t.senderUserId,s=t.messageDirection,f=t.canIncludeExpansion,l=t.expansion,d=t.disableNotification,c=t.sentTime,u=t.sentStatus),a.info(R.O,"insertMessage ->targetId:".concat(e.targetId,",conversationType:").concat(e.conversationType)),I=n.isUnread,h=n.searchContent,m={senderUserId:o,messageType:g,content:v,messageDirection:s,sentTime:c,sentStatus:u,searchContent:h,isUnread:I,messageUId:"",disableNotification:d,canIncludeExpansion:f,expansionMsg:JSON.stringify(l),channelId:e.channelId||""},[4,r.insertMessage(e.conversationType,e.targetId,m)];case 1:return E=p.sent(),S=E.code,T=E.data,S===i.SUCCESS?[2,{code:S,data:le(T)}]:(a.warn(R.O,"insertMessage ->code:".concat(S,",targetId:").concat(e.targetId)),[2,{code:S,msg:Ge[S]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:Ge[i.NOT_SUPPORT]}]}))}))},batchInsertMessage:function(e,t){var n,o;return B(this,void 0,void 0,(function(){var r,s=this;return D(this,(function(c){if(!M())return[2,{code:i.NOT_SUPPORT,msg:Ge[i.NOT_SUPPORT]}];if(!m("messages",e,(function(e){return g(e)&&!(e.length<=0||e.length>=500)}),!0)||!m("checkDuplicate",t,l.BOOLEAN))return[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}];for(r in e)if(!(m("message",e[r],l.OBJECT,!0)&&m("message.conversationType",e[r].conversationType,(function(e){return[a.PRIVATE,a.DISCUSSION,a.GROUP,a.CUSTOMER_SERVICE,a.SYSTEM,a.APP_PUBLIC_SERVICE,a.PUBLIC_SERVICE].includes(e)}),!0)&&m("message.targetId",e[r].targetId,l.STRING,!0)&&m("message.senderUserId",e[r].senderUserId,l.STRING,!0)&&m("message.messageType",e[r].messageType,l.STRING,!0)&&m("message.content",e[r].content,l.OBJECT,!0)&&m("message.messageDirection",e[r].messageDirection,l.NUMBER,!0)&&m("message.canIncludeExpansion",e[r].canIncludeExpansion,l.BOOLEAN)&&m("message.expansion",e[r].expansion,l.OBJECT)&&m("message.disableNotification",e[r].disableNotification,l.BOOLEAN)&&m("message.sentTime",e[r].sentTime,l.NUMBER)&&m("message.sentStatus",e[r].sentStatus,l.NUMBER)&&m("options.isUnread",null===(n=e[r])||void 0===n?void 0:n.isUnread,l.BOOLEAN)&&m("options.searchContent",null===(o=e[r])||void 0===o?void 0:o.searchContent,l.STRING)))return[2,{code:i.BIZ_ERROR_INVALID_PARAMETER,msg:String(r)}];return[2,pe((function(n){return B(s,void 0,void 0,(function(){var o,r,a;return D(this,(function(s){switch(s.label){case 0:return[4,n.batchInsertMessage(e,t)];case 1:return o=s.sent(),r=o.code,a=o.data,r===i.SUCCESS?[2,{code:r,data:a}]:[2,{code:r,msg:Ge[r]}]}}))}))}))]}))}))},getMessageCount:function(e){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(n){return M()?[2,pe((function(n){return B(t,void 0,void 0,(function(){var t,o,r,a,s,c;return D(this,(function(u){switch(u.label){case 0:return t=e.conversationType,o=e.targetId,r=e.channelId,[4,n.getMessageCount(t,o,r)];case 1:return a=u.sent(),s=a.code,c=a.data,s===i.SUCCESS?[2,{code:s,data:c}]:[2,{code:s,msg:Ge[s]}]}}))}))}))]:[2,{code:i.NOT_SUPPORT,msg:Ge[i.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,pe((function(n,o){return B(t,void 0,void 0,(function(){var t,r,a;return D(this,(function(s){switch(s.label){case 0:return[4,n.getPrivateMessageDeliverTime(e)];case 1:return t=s.sent(),r=t.code,a=t.data,r===i.SUCCESS?[2,{code:r,data:a}]:(o.warn(R.A_GET_PRIVATE_MESSAGE_DELIVER_TIME_E,"code:".concat(r,",messageUId:").concat(e)),[2,{code:r,msg:Ge[r]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:Ge[i.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,pe((function(o,r){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===i.SUCCESS?[2,{code:a,data:s}]:(r.warn(R.A_GET_GROUP_MESSAGE_DELIVER_LIST_E,"code:".concat(a,", targetId:").concat(e," messageUId:").concat(t)),[2,{code:a,msg:Ge[a]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:Ge[i.NOT_SUPPORT]}]}))}))},setCheckDuplicateMessage:function(e){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(n){return M()?m("enableCheck",e,l.BOOLEAN)?[2,pe((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:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:Ge[i.NOT_SUPPORT]}]}))}))},clearLocalData:function(){return B(this,void 0,void 0,(function(){var e=this;return D(this,(function(t){return M()?[2,pe((function(t,n){return B(e,void 0,void 0,(function(){var e,o,i;return D(this,(function(r){switch(r.label){case 0:return n.info(R.O,"clearLocalData ->"),[4,t.clearData()];case 1:return e=r.sent(),o=e.code,i=e.data,[2,{code:o,data:i}]}}))}))}))]:[2,{code:i.NOT_SUPPORT,msg:Ge[i.NOT_SUPPORT]}]}))}))}}),Fo=function(e,t,n){this.type=e,this.userIdList=t,this.mentionedContent=n};function Zo(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,pe((function(n,o){return B(t,void 0,void 0,(function(){var t;return D(this,(function(r){switch(r.label){case 0:return o.info(R.O,"setProxy: ->".concat(e)),[4,n.setProxy(e)];case 1:return(t=r.sent().code)===i.SUCCESS?[2,{code:t}]:(o.warn(R.O,"setProxy ->code:".concat(t)),[2,{code:t,msg:Ge[t]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function qo(){return B(this,void 0,void 0,(function(){var e=this;return D(this,(function(t){return[2,pe((function(t,n){return B(e,void 0,void 0,(function(){var e,o,r;return D(this,(function(a){switch(a.label){case 0:return[4,t.getProxy()];case 1:return e=a.sent(),o=e.code,r=e.data,o===i.SUCCESS?[2,{code:o,data:r}]:(n.warn(R.O,"getProxy ->code:".concat(o)),[2,{code:o,msg:Ge[o]}])}}))}))}))]}))}))}function Jo(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,pe((function(o,r){return B(n,void 0,void 0,(function(){var n,a,s;return D(this,(function(c){switch(c.label){case 0:return r.info(R.O,"testProxy: ->".concat(e)),[4,o.testProxy(e,t)];case 1:return n=c.sent(),a=n.status,s=n.data,a===i.SUCCESS?[2,{code:a,msg:s}]:(r.warn(R.O,"testProxy ->code:".concat(a)),[2,{code:a,msg:Ge[a]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}export{Qt as BaseMessage,sn as CombineMessage,Vo as ConnectType,V as Events,cn as FileMessage,un as GIFMessage,on as HQVoiceMessage,nn as ImageMessage,fn as LocationMessage,Fo as MentionedInfoBody,ko as MessageType,ln as ReferenceMessage,gn as RichContentMessage,rn as SightMessage,an as TextMessage,dn as VoiceMessage,we as __addSDKVersion,Lo as addConversationsToTag,Oe as addEventListener,Ao as addTag,Yt as addToBlacklist,Kt as bindRTCRoomForChatroom,$e as clearAllMessagesUnreadStatus,Ae as clearEventListeners,fo as clearHistoryMessages,Oo as clearMessages,Qe as clearMessagesUnreadStatus,Ke as clearTextMessageDraft,_o as clearUnreadCountByTimestamp,ke as connect,po as deleteLocalMessagesByTimestamp,uo as deleteMessages,Me as destroy,He as disconnect,Ho as electronExtension,Zt as forceRemoveChatRoomEntry,kt as forceSetChatRoomEntry,Jt as getAllChatRoomEntries,gt as getAllConversationState,Ct as getAllUltraGroupUnreadCount,At as getAllUltraGroupUnreadMentionedCount,lt as getAllUnreadMentionedCount,Wt as getBlacklist,Xt as getBlacklistStatus,It as getBlockUltraGroupList,st as getBlockedConversationList,qt as getChatRoomEntry,Gt as getChatRoomInfo,zt as getChatroomHistoryMessages,Ue as getConnectionStatus,Ze as getConversation,Fe as getConversationList,rt as getConversationNotificationLevel,at as getConversationNotificationStatus,bo as getConversationsFromTagByPage,Le as getCurrentUserId,Be as getDeviceId,Jn as getFileToken,zn as getFileUrl,ho as getFirstUnreadMessage,to as getHistoryMessages,Eo as getMessage,Io as getMessageReader,qo as getProxy,no as getRemoteHistoryMessages,Pe as getServerTime,Uo as getTags,Po as getTagsFromConversation,Je as getTextMessageDraft,ut as getTopConversationList,Ye as getTotalUnreadCount,je as getTotalUnreadCountByLevels,We as getTotalUnreadMentionedCountByLevels,Ot as getUltraGroupDefaultNotificationLevel,Mt as getUltraGroupFirstUnreadMessageTimestamp,vt as getUltraGroupList,ht as getUltraGroupMessageListByMessageUId,_t as getUltraGroupUnreadCountByTargetId,pt as getUltraGroupUnreadMentionedCountByTargetId,yt as getUltraGroupUnreadMentionedMessages,dt as getUnreadConversationList,Xe as getUnreadCount,Go as getUnreadCountByTag,ft as getUnreadMentionedCount,So as getUnreadMentionedMessages,ye as init,mo as insertMessage,De as installPlugin,Bt as joinChatRoom,Dt as joinExistChatRoom,Tt as modifyMessage,Ne as onceEventListener,bt as quitChatRoom,co as recallMessage,Ro as registerMessageType,St as removeAllExpansionForUltraGroupMessage,Ft as removeChatRoomEntries,Ht as removeChatRoomEntry,qe as removeConversation,wo as removeConversationsFromTag,_e as removeEventListener,Ce as removeEventListeners,Et as removeExpansionForUltraGroupMessage,jt as removeFromBlacklist,go as removeMessageExpansionForKey,yo as removeTag,Do as removeTagFromConversations,Bo as removeTagsFromConversation,ze as saveTextMessageDraft,No as searchConversationByContent,To as searchMessages,Wn as sendFileMessage,Qn as sendGIFMessage,$n as sendHQVoiceMessage,Xn as sendImageMessage,Kn as sendMessage,oo as sendReadReceiptMessage,io as sendReadReceiptRequest,ro as sendReadReceiptResponse,ao as sendReadReceiptResponseV2,eo as sendSightMessage,so as sendSyncReadStatusMessage,Yn as sendTextMessage,vo as sendTypingStatusMessage,Rt as sendUltraGroupTypingStatus,Vt as setChatRoomEntries,xt as setChatRoomEntry,ot as setConversationNotificationLevel,it as setConversationNotificationStatus,ct as setConversationToTop,xo as setConversationToTopInTag,Co as setMessageReceivedStatus,Zo as setProxy,Nt as setUltraGroupDefaultNotificationLevel,Jo as testProxy,mt as updateExpansionForUltraGroupMessage,lo as updateMessageExpansion,Mo as updateTag};
1
+ import{NetworkType as e,HttpMethod as n,HTTP_TIMEOUT as t,appendUrl as o,ErrorCode as i,ReceivedStatus as r,ConversationType as a,isNumber as s,EventEmitter as c,RCConnectionStatus as u,VersionManage as d,assert as f,AssertRules as l,isArray as g,isHttpUrl as v,APIContext as I,LogTagId as R,logger as h,validate as m,isValidConversationType as E,isValidNotificationLevel as T,NotificationLevel as S,isTypeInConversationList as p,UltraGroupChannelType as O,isString as N,UploadMethod as _,getUUID as C,isValidFileType as A,FileType as y,usingCppEngine as M,MessageDirection as U,SentStatus as P,isUndefined as L}from"@rongcloud/engine";export{ChatroomEntryType,ChatroomUserChangeType,ConnectionStatus,ConversationType,ErrorCode,FileType,LogL,LogLevel,MentionedType,MessageBlockSourceType,MessageBlockType,MessageDirection,NotificationLevel,NotificationStatus,OperateStatus,RCConnectionStatus,ReceivedStatus,SentStatus,UltraGroupChannelChangeType,UltraGroupChannelType,UploadMethod}from"@rongcloud/engine";var w=function(){return w=Object.assign||function(e){for(var n,t=1,o=arguments.length;t<o;t++)for(var i in n=arguments[t])Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i]);return e},w.apply(this,arguments)};function B(e,n,t,o){return new(t||(t=Promise))((function(i,r){function a(e){try{c(o.next(e))}catch(e){r(e)}}function s(e){try{c(o.throw(e))}catch(e){r(e)}}function c(e){var n;e.done?i(e.value):(n=e.value,n instanceof t?n:new t((function(e){e(n)}))).then(a,s)}c((o=o.apply(e,n||[])).next())}))}function D(e,n){var t,o,i,r,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return r={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function s(s){return function(c){return function(s){if(t)throw new TypeError("Generator is already executing.");for(;r&&(r=0,s[0]&&(a=0)),a;)try{if(t=1,o&&(i=2&s[0]?o.return:s[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,s[1])).done)return i;switch(o=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,o=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=n.call(e,a)}catch(e){s=[6,e],o=0}finally{t=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}}var b=function(){return!("undefined"==typeof uni||!function(e){for(var n=["request","getSystemInfo"],t=0,o=n.length;t<o;t++)if(!e[n[t]])return!1;return!0}(uni))},G=b(),x=function(){var e="undefined"!=typeof XMLHttpRequest&&"withCredentials"in new XMLHttpRequest;return"undefined"!=typeof XMLHttpRequest&&e?new XMLHttpRequest:"undefined"!=typeof XDomainRequest?new XDomainRequest:new ActiveXObject("Microsoft.XMLHTTP")};var V,k={tag:"browser",httpReq:function(e){var i=e.method||n.GET,r=e.timeout||t,a=e.headers,s=e.query,c=e.body,u=o(e.url,s);return new Promise((function(e){var n=x(),t="[object XDomainRequest]"===Object.prototype.toString.call(n);if(n.open(i,u),a&&n.setRequestHeader)for(var o in a)n.setRequestHeader(o,a[o]);if(t){n.timeout=r,n.onload=function(){e({data:n.responseText,status:n.status||200})},n.onerror=function(){e({status:n.status})},n.ontimeout=function(){e({status:n.status})};var s="object"==typeof c?JSON.stringify(c):c;n.send(s)}else n.onreadystatechange=function(){4===n.readyState&&e({data:n.responseText,status:n.status})},n.onerror=function(){e({status:n.status})},setTimeout((function(){n.abort(),e({status:n.status})}),r),n.send(c)}))},localStorage:null===window||void 0===window?void 0:window.localStorage,sessionStorage:null===window||void 0===window?void 0:window.sessionStorage,useNavi:!0,connectPlatform:"",isFromUniapp:G,createWebSocket:function(e,n){var t=new WebSocket(e,n);return t.binaryType="arraybuffer",{id:Date.now(),onClose:function(e){t.onclose=function(n){var t=n.code,o=n.reason;e(t,o)}},onError:function(e){t.onerror=e},onMessage:function(e){t.onmessage=function(n){e(n.data)}},onOpen:function(e){t.onopen=e},send:function(e){t.send(e)},close:function(e,n){t.close()}}},getNetworkType:function(){var n=navigator.connection||navigator.mozConnection||navigator.webkitConnection,t=n.type,o=n.effectiveType,i=t||o||e.UNKONWN;return Promise.resolve(i)}},H=b(),F=function(e){return function(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];try{return wx[e].apply(wx,n)}catch(e){null===console||void 0===console||console.error(e)}}},Z={setItem:F("setStorageSync"),getItem:F("getStorageSync"),removeItem:F("removeStorageSync"),clear:F("clearStorageSync")},q={tag:"wechat",httpReq:function(e){var r=e.method||n.GET,a=e.timeout||t,s=e.headers,c=e.query,u=e.body,d=o(e.url,c);return new Promise((function(e){wx.request({url:d,method:r,header:s,timeout:a,data:u,success:function(n){e({data:n.data,status:n.statusCode})},fail:function(){e({status:i.RC_HTTP_REQ_FAIL})}})}))},localStorage:Z,sessionStorage:Z,useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:H,createWebSocket:function(e,n){var t=wx.connectSocket({url:e,protocols:n});return{id:Date.now(),onClose:function(e){t.onClose((function(n){e(n.code,n.reason)}))},onError:function(e){t.onError((function(n){e(n.errMsg)}))},onMessage:function(e){t.onMessage((function(n){e(n.data)}))},onOpen:function(e){t.onOpen(e)},send:function(e){t.send({data:e})},close:function(e,n){t.close({code:e,reason:n})}}},getNetworkType:function(){return new Promise((function(n){wx.getNetworkType({success:function(e){var t=e.networkType;n(t)},fail:function(){n(e.UNKONWN)}})}))}},J=b(),z=function(e){return function(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];try{if("setStorageSync"===e)return my[e]({key:n[0],data:JSON.parse(n[1])});if("clearStorageSync"===e)return my[e]();if("removeStorageSync"===e)return my[e]({key:n[0]});var o=my[e]({key:n[0]}).data;return o?JSON.stringify(o):o}catch(e){}}},K={setItem:z("setStorageSync"),getItem:z("getStorageSync"),removeItem:z("removeStorageSync"),clear:z("clearStorageSync")},Y={tag:"alipay",httpReq:function(e){var r=e.method||n.GET,a=e.timeout||t,s=e.headers,c=e.query,u=e.body,d=o(e.url,c),f=e.dataType||"json";return new Promise((function(e){my.request({url:d,method:r,headers:s,timeout:a,data:u,dataType:f,success:function(n){e({data:n.data,status:n.status})},fail:function(){e({status:i.RC_HTTP_REQ_FAIL})}})}))},localStorage:K,sessionStorage:K,useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:J,createWebSocket:function(e){return my.connectSocket({url:e}),{id:Date.now(),onClose:function(e){my.onSocketClose(e)},onError:function(e){my.onSocketError((function(n){e(n.errMsg)}))},onMessage:function(e){my.onSocketMessage((function(n){n.isBuffer?e(my.base64ToArrayBuffer(n.data)):e(n.data)}))},onOpen:function(e){my.onSocketOpen(e)},send:function(e){my.sendSocketMessage({data:my.arrayBufferToBase64(e),isBuffer:!0})},close:function(){my.closeSocket()}}},getNetworkType:function(){return new Promise((function(n){my.getNetworkType({success:function(e){var t=e.networkType;n(t)},fail:function(){n(e.UNKONWN)}})}))}},j=b(),W=function(e){return function(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];try{return tt[e].apply(tt,n)}catch(e){}}},X={setItem:W("setStorageSync"),getItem:W("getStorageSync"),removeItem:W("removeStorageSync"),clear:W("clearStorageSync")},Q={tag:"toutiao",useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:j,localStorage:X,sessionStorage:X,httpReq:function(e){return new Promise((function(n){tt.request({url:e.url,data:e.body,header:e.headers,method:e.method,success:function(e){var t=(null==e?void 0:e.data)||{},o={data:JSON.stringify(t),status:e.statusCode};n(o)},fail:function(e){n({status:i.RC_HTTP_REQ_FAIL})}})}))},createWebSocket:function(e,n){var t=tt.connectSocket({url:e,protocols:n});return{id:Date.now(),onOpen:function(e){t.onOpen(e)},onClose:function(e){t.onClose((function(n){return e(n.code,n.reason)}))},onError:function(e){t.onError((function(n){return e(n.errMsg)}))},onMessage:function(e){t.onMessage((function(n){return e(n.data)}))},send:function(e){t.send({data:e})},close:function(e,n){t.close({code:e,reason:n})}}},getNetworkType:function(){return new Promise((function(n){tt.getNetworkType({success:function(e){var t=e.networkType;n(t)},fail:function(){n(e.UNKONWN)}})}))}},$=b(),ee=function(e){return function(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];try{return swan[e].apply(swan,n)}catch(e){}}},ne={setItem:ee("setStorageSync"),getItem:ee("getStorageSync"),removeItem:ee("removeStorageSync"),clear:ee("clearStorageSync")},te={tag:"baidu",useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:$,localStorage:ne,sessionStorage:ne,httpReq:function(e){return new Promise((function(n,t){swan.request({url:e.url,data:e.body,header:e.headers,method:e.method,success:function(e){var t=(null==e?void 0:e.data)||{},o={data:JSON.stringify(t),status:e.statusCode};n(o)},fail:function(e){n({status:i.RC_HTTP_REQ_FAIL})}})}))},createWebSocket:function(e,n){var t=swan.connectSocket({url:e,protocols:n});return{id:Date.now(),onOpen:function(e){t.onOpen(e)},onClose:function(e){t.onClose((function(n){return e(n.code,n.reason)}))},onError:function(e){t.onError((function(n){return e(n.errMsg)}))},onMessage:function(e){t.onMessage((function(n){return e(n.data)}))},send:function(e){t.send({data:e})},close:function(e,n){t.close({code:e,reason:n})}}},getNetworkType:function(){return B(this,void 0,void 0,(function(){return D(this,(function(n){return[2,new Promise((function(n){swan.getNetworkType({success:function(e){var t=e.networkType;n(t)},fail:function(){n(e.UNKONWN)}})}))]}))}))}},oe=b(),ie=function(e){return function(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];try{return jd[e].apply(jd,n)}catch(e){null===console||void 0===console||console.error(e)}}},re={setItem:ie("setStorageSync"),getItem:ie("getStorageSync"),removeItem:ie("removeStorageSync"),clear:ie("clearStorageSync")},ae={tag:"jingdong",httpReq:function(e){var r=e.method||n.GET,a=e.timeout||t,s=e.headers,c=e.query,u=e.body,d=o(e.url,c);return new Promise((function(e){jd.request({url:d,method:r,headers:s,timeout:a,data:u,success:function(n){e({data:n.data,status:n.statusCode})},fail:function(){e({status:i.RC_HTTP_REQ_FAIL})}})}))},localStorage:re,sessionStorage:re,useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:oe,createWebSocket:function(e,n){return jd.connectSocket({url:e,protocols:n}),{id:Date.now(),onClose:function(e){jd.onSocketClose((function(n){e(n.code,n.reason)}))},onError:function(e){jd.onSocketError((function(n){e(n.errMsg)}))},onMessage:function(e){jd.onSocketMessage((function(n){e(n.data)}))},onOpen:function(e){jd.onSocketOpen(e)},send:function(e){jd.sendSocketMessage({data:e})},close:function(e,n){jd.closeSocket({code:e,reason:n})}}},getNetworkType:function(){return new Promise((function(n){jd.getNetworkType({success:function(e){var t=e.networkType;n(t)},fail:function(){n(e.UNKONWN)}})}))}},se=function(e){return function(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];try{return uni[e].apply(uni,n)}catch(e){null===console||void 0===console||console.error(e)}}},ce={setItem:se("setStorageSync"),getItem:se("getStorageSync"),removeItem:se("removeStorageSync"),clear:se("clearStorageSync")},ue={tag:"uniapp",httpReq:function(e){var r=e.method||n.GET,a=e.timeout||t,s=e.headers,c=e.query,u=e.body,d=o(e.url,c);return new Promise((function(e){uni.request({url:d,method:r,header:s,timeout:a,data:u,success:function(n){e({data:n.data,status:n.statusCode})},fail:function(){e({status:i.RC_HTTP_REQ_FAIL})}})}))},localStorage:ce,sessionStorage:ce,useNavi:!0,connectPlatform:"",isFromUniapp:!0,createWebSocket:function(e,n){var t={complete:function(){},url:e,protocols:n},o=uni.connectSocket(t);return{id:Date.now(),onClose:function(e){o.onClose((function(n){e(n.code,n.reason)}))},onError:function(e){o.onError((function(n){e(n.errMsg)}))},onMessage:function(e){o.onMessage((function(n){e(n.data)}))},onOpen:function(e){o.onOpen(e)},send:function(e){o.send({data:e})},close:function(e,n){o.close({code:e,reason:n})}}},getNetworkType:function(){return new Promise((function(n){uni.getNetworkType({success:function(e){var t=e.networkType;n(t)},fail:function(){n(e.UNKONWN)}})}))}},de=function(e){return e&&e.request&&e.getSystemInfo},fe="undefined"!=typeof uni&&de(uni)?function(){switch(process.env.VUE_APP_PLATFORM){case"app-plus":return ue;case"mp-jd":return ae;case"mp-baidu":return te;case"mp-toutiao":return Q;case"mp-alipay":return Y;case"mp-weixin":return q;default:return k}}():"undefined"!=typeof jd&&de(jd)?ae:"undefined"!=typeof my&&de(my)?Y:"undefined"!=typeof tt&&de(tt)?Q:"undefined"!=typeof swan&&de(swan)?te:"undefined"!=typeof wx&&de(wx)?q:k;function le(e){var n=e.conversationType,t=e.channelId,o=e.messageType,i=e.content,c=e.senderUserId,u=e.targetId,d=e.sentTime,f=e.receivedTime,l=e.messageUId,g=e.messageDirection,v=e.isPersited,I=e.isCounted,R=e.isOffLineMessage,h=e.canIncludeExpansion,m=e.expansion,E=e.receivedStatus,T=e.disableNotification,S=e.isMentioned,p=e.isStatusMessage,O=e.readReceiptInfo,N=e.pushConfig,_=e.messageId,C=e.isInterrupt,A=e.isModifyMessage,y=e.channelType,M=e.sentStatus;E||(E=r.UNREAD);var U={messageType:o,channelId:t||"",content:i,senderUserId:c,targetId:u,conversationType:n,sentTime:d,receivedTime:f,messageUId:l,messageDirection:g,isPersited:v,isCounted:I,isMentioned:S,disableNotification:T,isStatusMessage:p,canIncludeExpansion:h,expansion:m,receivedStatus:E,readReceiptInfo:O,pushConfig:N,messageId:_,isInterrupt:C,isModifyMessage:A,sentStatus:M};return n!==a.ULTRA_GROUP&&(U.isOffLineMessage=R),n===a.ULTRA_GROUP&&s(y)&&(U.channelType=y),U}function ge(e){var n=e.conversationType,t=e.targetId,o=e.latestMessage,i=e.unreadMessageCount,r=e.hasMentioned,s=e.mentionedInfo,c=e.lastUnreadTime,u=e.notificationStatus,d=e.notificationLevel,f=e.isTop,l=e.channelId,g=e.unreadMentionedCount,v=e.matchCount,I={conversationType:n,targetId:t,latestMessage:o&&le(o),unreadMessageCount:i,hasMentioned:r,mentionedInfo:r?{type:null==s?void 0:s.type,userIdList:null==s?void 0:s.userIdList}:void 0,lastUnreadTime:c,notificationStatus:u,notificationLevel:d,isTop:f,channelId:l,unreadMentionedCount:g,matchCount:v};return I.conversationType===a.ULTRA_GROUP&&(I.firstUnreadMessage=e.firstUnreadMessage,I.channelType=e.channelType),I}function ve(e,n){null===console||void 0===console||console.warn("Method '".concat(e,"' is deprecated, please use '").concat(n,"' instead"))}!function(e){e.CONNECTING="CONNECTING",e.CONNECTED="CONNECTED",e.DISCONNECT="DISCONNECT",e.SUSPEND="SUSPEND",e.MESSAGES="MESSAGES",e.READ_RECEIPT_RECEIVED="READ_RECEIPT_RECEIVED",e.MESSAGE_RECEIPT_REQUEST="MESSAGE_RECEIPT_REQUEST",e.MESSAGE_RECEIPT_RESPONSE="MESSAGE_RECEIPT_RESPONSE",e.CONVERSATION="CONVERSATION",e.CHATROOM="CHATROOM",e.EXPANSION="EXPANSION",e.PULL_OFFLINE_MESSAGE_FINISHED="PULL_OFFLINE_MESSAGE_FINISHED",e.TAG="TAG",e.CONVERSATION_TAG="CONVERSATION_TAG",e.TYPING_STATUS="TYPING_STATUS",e.MESSAGE_BLOCKED="MESSAGE_BLOCKED",e.ULTRA_GROUP_ENABLE="ULTRA_GROUP_ENABLE",e.OPERATE_STATUS="OPERATE_STATUS",e.ULTRA_GROUP_MESSAGE_EXPANSION_UPDATED="ULTRA_GROUP_MESSAGE_EXPANSION_UPDATED",e.ULTRA_GROUP_MESSAGE_MODIFIED="ULTRA_GROUP_MESSAGE_MODIFIED",e.ULTRA_GROUP_MESSAGE_RECALLED="ULTRA_GROUP_MESSAGE_RECALLED",e.ULTRA_GROUP_CHANNEL_TYPE_CHANGE="ULTRA_GROUP_CHANNEL_TYPE_CHANGE",e.ULTRA_GROUP_CHANNEL_DELETE="ULTRA_GROUP_CHANNEL_DELETE",e.ULTRA_GROUP_CHANNEL_USER_KICKED="ULTRA_GROUP_CHANNEL_USER_KICKED",e.PRIVATE_MESSAGE_DELIVERED="PRIVATE_MESSAGE_DELIVERED",e.GROUP_MESSAGE_DELIVERED="GROUP_MESSAGE_DELIVERED",e.USER_GROUP_STATUS="USER_GROUP_STATUS"}(V||(V={}));var Ie=new c,Re={connection:function(e,n){switch(e){case u.CONNECTED:Ie.emit(V.CONNECTED);break;case u.CONNECTING:Ie.emit(V.CONNECTING);break;case u.SUSPENDED:Ie.emit(V.SUSPEND,n);break;case u.DISCONNECTED:Ie.emit(V.DISCONNECT,n)}},batchMessage:function(e){Ie.emit(V.MESSAGES,{messages:e.map((function(e){return le(e)}))})},typingState:function(e){Ie.emit(V.TYPING_STATUS,{status:e})},readReceiptReceived:function(e,n,t){Ie.emit(V.READ_RECEIPT_RECEIVED,{conversation:e,messageUId:n,sentTime:t})},messageReceiptRequest:function(e,n,t){Ie.emit(V.MESSAGE_RECEIPT_REQUEST,{conversation:e,messageUId:n,senderUserId:t})},messageReceiptResponse:function(e,n,t){Ie.emit(V.MESSAGE_RECEIPT_RESPONSE,{conversation:e,receivedUserId:n,messageUIdList:t})},conversationState:function(e){var n=e.map((function(e){var n=e.conversationType,t={conversationType:n,latestMessage:e.latestMessage?le(e.latestMessage):null,targetId:e.targetId,unreadMessageCount:e.unreadMessageCount,unreadMentionedCount:e.unreadMentionedCount,notificationStatus:e.notificationStatus,notificationLevel:e.notificationLevel,lastUnreadTime:e.lastUnreadTime,channelId:e.channelId};return n===a.ULTRA_GROUP?(t.versionTime=e.versionTime,{conversation:t}):(t.hasMentioned=e.hasMentioned,t.mentionedInfo=e.mentionedInfo,t.isTop=e.isTop,{conversation:t,updatedItems:e.updatedItems})}));Ie.emit(V.CONVERSATION,{conversationList:n})},chatroomState:function(e){Ie.emit(V.CHATROOM,e)},expansion:function(e){Ie.emit(V.EXPANSION,e)},pullFinished:function(){Ie.emit(V.PULL_OFFLINE_MESSAGE_FINISHED)},tag:function(){Ie.emit(V.TAG)},conversationTagChanged:function(){Ie.emit(V.CONVERSATION_TAG)},messageBlocked:function(e){Ie.emit(V.MESSAGE_BLOCKED,e)},messageDelivered:function(e){Ie.emit(V.PRIVATE_MESSAGE_DELIVERED,e)},groupMessageDeliveredStatus:function(e){Ie.emit(V.GROUP_MESSAGE_DELIVERED,e)},ultraGroupEnable:function(e){Ie.emit(V.ULTRA_GROUP_ENABLE,e.map((function(e){return ge(e)})))},operateStatus:function(e){Ie.emit(V.OPERATE_STATUS,e)},ultraGroupMessageExpansionUpdated:function(e){Ie.emit(V.ULTRA_GROUP_MESSAGE_EXPANSION_UPDATED,e.map((function(e){return le(e)})))},ultraGroupMessageModified:function(e){Ie.emit(V.ULTRA_GROUP_MESSAGE_MODIFIED,e.map((function(e){return le(e)})))},ultraGroupMessageRecalled:function(e){Ie.emit(V.ULTRA_GROUP_MESSAGE_RECALLED,e.map((function(e){return le(e)})))},ultraGroupChannelChangeType:function(e){Ie.emit(V.ULTRA_GROUP_CHANNEL_TYPE_CHANGE,e)},ultraGroupChannelUserKicked:function(e){Ie.emit(V.ULTRA_GROUP_CHANNEL_USER_KICKED,e)},ultraGroupChannelDelete:function(e){Ie.emit(V.ULTRA_GROUP_CHANNEL_DELETE,e)},userGroupStatus:function(e){Ie.emit(V.USER_GROUP_STATUS,e)}};d.add("imlib-next","5.7.8");var he=null,me=null,Ee=null;function Te(){return B(this,void 0,void 0,(function(){return D(this,(function(e){switch(e.label){case 0:return he?(Ee.info(R.A_DESTROY_O),[4,I.destroy()]):[2];case 1:return e.sent(),me=null,he=null,Ee=null,[2]}}))}))}function Se(e){if(!he)throw new Error("Not initialized yet!");return e(he,Ee,me)}function pe(e){return he?e(he,Ee,me):Promise.resolve({code:i.BIZ_ERROR_CLIENT_NOT_INIT})}function Oe(e,n,t){Ie.on(e,n,t)}function Ne(e,n,t){Ie.once(e,n,t)}function _e(e,n,t){Ie.off(e,n,t)}function Ce(e){Ie.removeAll(e)}function Ae(){Ie.clear()}function ye(e){!function(e){var n,t=e.appkey,o=e.navigators;he?Ee.warn(R.A_INIT_REPEAT_O):(f("options.appkey",e.appkey,l.STRING,!0),f("options.navigators",e.navigators,(function(e){return g(e)&&(0===e.length||e.every(v))})),me=e,he=I.init((null===(n=e.__runtimeCreator__)||void 0===n?void 0:n.call(e))||fe,{appkey:e.appkey,navigators:e.navigators||[],miniCMPProxy:e.customCMP||[],logOutputLevel:e.logOutputLevel,__reportLogLevel:e.__reportLogLevel,httpInMainProcess:!!e.httpInMainProcess,logExpireTime:e.logExpireTime}),(Ee=he.createLogger("RC-IM","IM")).setOutputLevel(e.logOutputLevel),Ee.info(R.A_INIT_O,JSON.stringify({appkey:t,navigators:o,version:"5.7.8",commit:"a8c6bdefd42b849d4ba9a105ecf5c00403c17522"})),he.assignWatcher(Re),h.init(Ee))}(e)}function Me(){return B(this,void 0,void 0,(function(){return D(this,(function(e){return he?(Ae(),[2,Te()]):[2]}))}))}function Ue(){return Se((function(e){return e.getConnectionStatus()}))}function Pe(){return Se((function(e){return e.getServerTime()}))}function Le(){return Se((function(e){return e.getCurrentUserId()}))}function we(e,n){d.add(e,n)}function Be(){return Se((function(e){return e.getDeviceId()}))}function De(e,n){return Se((function(t){return t.install(e,n)}))}var be={TIMEOUT:{code:-1,msg:"Network timeout"},SDK_INTERNAL_ERROR:{code:-2,msg:"SDK internal error"},PARAMETER_ERROR:{code:-3,msg:"Please check the parameters, the {param} expected a value of {expect} but received {current}"},REJECTED_BY_BLACKLIST:{code:405,msg:"Blacklisted by the other party"},SEND_TOO_FAST:{code:20604,msg:"Sending messages too quickly"},NOT_IN_GROUP:{code:22406,msg:"Not in group"},ULTRA_GROUP_USER_NOT_IN_PRIVATE_CHANNEL:{code:i.ULTRA_GROUP_USER_NOT_IN_PRIVATE_CHANNEL,msg:"ultra group user not in private channel"},FORBIDDEN_IN_GROUP:{code:22408,msg:"Forbbiden from speaking in the group"},NOT_IN_CHATROOM:{code:23406,msg:"Not in chatRoom"},FORBIDDEN_IN_CHATROOM:{code:23408,msg:"Forbbiden from speaking in the chatRoom"},KICKED_FROM_CHATROOM:{code:23409,msg:"Kicked out and forbbiden from joining the chatRoom"},CHATROOM_NOT_EXIST:{code:23410,msg:"ChatRoom does not exist"},CHATROOM_IS_FULL:{code:23411,msg:"ChatRoom members exceeded"},PARAMETER_INVALID_CHATROOM:{code:23412,msg:"Invalid chatRoom parameters"},ROAMING_SERVICE_UNAVAILABLE_CHATROOM:{code:23414,msg:"ChatRoom message roaming service is not open, Please go to the developer to open this service"},RECALLMESSAGE_PARAMETER_INVALID:{code:25101,msg:"Invalid recall message parameter"},ROAMING_SERVICE_UNAVAILABLE_MESSAGE:{code:25102,msg:"Single group chat roaming service is not open, Please go to the developer to open this service"},PUSHSETTING_PARAMETER_INVALID:{code:26001,msg:"Invalid push parameter"},OPERATION_BLOCKED:{code:20605,msg:"Operation is blocked"},OPERATION_NOT_SUPPORT:{code:20606,msg:"Operation is not supported"},MSG_BLOCKED_SENSITIVE_WORD:{code:21501,msg:"The sent message contains sensitive words"},REPLACED_SENSITIVE_WORD:{code:21502,msg:"Sensitive words in the message have been replaced"},NOT_CONNECTED:{code:30001,msg:"Please connect successfully first"},NAVI_REQUEST_ERROR:{code:30007,msg:"Navigation http request failed"},CMP_REQUEST_ERROR:{code:30010,msg:"CMP sniff http request failed"},CONN_APPKEY_FAKE:{code:31002,msg:"Your appkey is fake"},CONN_MINI_SERVICE_NOT_OPEN:{code:31003,msg:"Mini program service is not open, Please go to the developer to open this service"},CONN_ACK_TIMEOUT:{code:31e3,msg:"Connection ACK timeout"},CONN_TOKEN_INCORRECT:{code:31004,msg:"Your token is not valid or expired"},CONN_NOT_AUTHRORIZED:{code:31005,msg:"AppKey and Token do not match"},CONN_REDIRECTED:{code:31006,msg:"Connection redirection"},CONN_APP_BLOCKED_OR_DELETED:{code:31008,msg:"AppKey is banned or deleted"},CONN_USER_BLOCKED:{code:31009,msg:"User blocked"},CONN_DOMAIN_INCORRECT:{code:31012,msg:"Connect domain error, Please check the set security domain"},ROAMING_SERVICE_UNAVAILABLE:{code:33007,msg:"Roaming service cloud is not open, Please go to the developer to open this service"},RC_CONNECTION_EXIST:{code:34001,msg:"Connection already exists"},CHATROOM_KV_EXCEED:{code:23423,msg:"ChatRoom KV setting exceeds maximum"},CHATROOM_KV_OVERWRITE_INVALID:{code:23424,msg:"ChatRoom KV already exists"},CHATROOM_KV_STORE_NOT_OPEN:{code:23426,msg:"ChatRoom KV storage service is not open, Please go to the developer to open this service"},CHATROOM_KEY_NOT_EXIST:{code:23427,msg:"ChatRoom key does not exist"},MSG_KV_NOT_SUPPORT:{code:34008,msg:"The message cannot be extended"},SEND_MESSAGE_KV_FAIL:{code:34009,msg:"Sending RC expansion message fail"},EXPANSION_LIMIT_EXCEET:{code:34010,msg:"The message expansion size is beyond the limit"},ILLGAL_PARAMS:{code:33003,msg:"Incorrect parameters passed in while calling the interface"},UPLOAD_FILE_FAILED:{code:35020,msg:"File upload failed"},CHATROOM_KV_STORE_NOT_ALL_SUCCESS:{code:23428,msg:"Chatroom kv store not all success"},CHATROOM_KV_STORE_OUT_LIMIT:{code:23429,msg:"Chatroom kv's length is out of limit"},TAG_EXISTS:{code:33101,msg:"The tag already exists"},TAG_NOT_EXIST:{code:33100,msg:"The tag does not exist"},NOT_SUPPORT:{code:i.NOT_SUPPORT,msg:"The method is not supported in a browser!"}},Ge={};for(var xe in be){var Ve=be[xe].code;Ge[Ve]=xe}function ke(e,n){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(o){return[2,pe((function(o,r){return B(t,void 0,void 0,(function(){var t,a,s;return D(this,(function(c){switch(c.label){case 0:return m("token",e,l.STRING,!0)&&m("reconnectKickEnable",n,l.BOOLEAN)?(t=r.createTraceId(),r.info(R.A_CONNECT_T,JSON.stringify({token:e,reconnectKickEnable:n}),t),[4,o.connect(e,!!n,t)]):[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}];case 1:return a=c.sent(),s=a.code===i.SUCCESS?"info":"warn",r[s](R.A_CONNECT_R,JSON.stringify({code:a.code,userId:a.userId}),t),a.code===i.SUCCESS?[2,{code:a.code,data:{userId:a.userId}}]:[2,{code:a.code,msg:Ge[a.code]}]}}))}))}))]}))}))}function He(e){return h.info(R.A_DISCONNECT_O,{}),Se((function(n){return n.disconnect(e)}))}function Fe(e,n){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(o){return m("options.count",null==e?void 0:e.count,l.NUMBER)&&m("options.startTime",null==e?void 0:e.startTime,l.NUMBER)&&m("options.order",null==e?void 0:e.order,l.NUMBER)&&m("channelId",n,l.CHANNEL_ID)?[2,pe((function(o,r){return B(t,void 0,void 0,(function(){var t,a,s;return D(this,(function(c){switch(c.label){case 0:return[4,o.getConversationList(null==e?void 0:e.count,void 0,null==e?void 0:e.startTime,null==e?void 0:e.order,n)];case 1:return t=c.sent(),a=t.code,s=t.data,a===i.SUCCESS&&s?[2,{code:0,data:s.map((function(e){return ge(e)}))}]:(r.warn(R.O,"get conversation list fail ->".concat(a,":").concat(Ge[a])),[2,{code:a,msg:Ge[a]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Ze(e){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(t){return m("options",e,l.CONVERSATION,!0)?[2,pe((function(t,o){return B(n,void 0,void 0,(function(){var n,r,a;return D(this,(function(s){switch(s.label){case 0:return[4,t.getConversation(e.conversationType,e.targetId,e.channelId||"")];case 1:return n=s.sent(),r=n.code,a=n.data,r!==i.SUCCESS?(o.warn(R.O,"getConversation ->code:".concat(r,", targetId:").concat(e.targetId)),[2,{code:r,msg:Ge[r]}]):[2,{code:r,data:a?ge(a):null}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function qe(e){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(t){return m("options",e,l.CONVERSATION,!0)?[2,pe((function(t,o){return B(n,void 0,void 0,(function(){var n,r;return D(this,(function(a){switch(a.label){case 0:return[4,t.removeConversation(e.conversationType,e.targetId,e.channelId)];case 1:return n=a.sent(),r="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),o.debug(R.O,"destroy conversation ->".concat(r)),n!==i.SUCCESS?(o.warn(R.O,"destroy conversation fail ->".concat(n,":").concat(Ge[n],",").concat(r)),[2,{code:n,msg:Ge[n]}]):[2,{code:n}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Je(e){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(t){return m("options",e,l.CONVERSATION,!0)?[2,pe((function(t,o){return B(n,void 0,void 0,(function(){var n,r,a,s;return D(this,(function(c){switch(c.label){case 0:return[4,t.getConversationMessageDraft(e.conversationType,e.targetId,e.channelId)];case 1:return n=c.sent(),r=n.code,a=n.data,s="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),o.debug(R.O,"get draft ->".concat(s)),r===i.SUCCESS?[2,{code:r,data:a||""}]:(o.warn(R.O,"get draft fail ->".concat(r,":").concat(Ge[r],",").concat(s)),[2,{code:r,msg:Ge[r]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function ze(e,n){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(o){return m("options",e,l.CONVERSATION,!0)&&m("draft",n,l.STRING,!0)?[2,pe((function(o,r){return B(t,void 0,void 0,(function(){var t,a;return D(this,(function(s){switch(s.label){case 0:return t="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),r.debug(R.O,"set draft ->".concat(t)),[4,o.saveConversationMessageDraft(e.conversationType,e.targetId,n,e.channelId)];case 1:return(a=s.sent())===i.SUCCESS?[2,{code:a}]:(r.warn(R.O,"set draft fail ->".concat(a,":").concat(Ge[a],",").concat(t)),[2,{code:a,msg:Ge[a]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Ke(e){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(t){return m("options",e,l.CONVERSATION,!0)?[2,pe((function(t,o){return B(n,void 0,void 0,(function(){var n,r;return D(this,(function(a){switch(a.label){case 0:return n="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),o.debug(R.O,"delete draft ->".concat(n)),[4,t.clearConversationMessageDraft(e.conversationType,e.targetId,e.channelId)];case 1:return(r=a.sent())===i.SUCCESS?[2,{code:r}]:(o.warn(R.O,"delete draft fail ->".concat(r,":").concat(Ge[r],",").concat(n)),[2,{code:r,msg:Ge[r]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Ye(e,n){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(o){return m("includeMuted",e,l.BOOLEAN,!1)&&m("conversationTypes",n,l.ARRAY,!1)&&!(null==n?void 0:n.some((function(e){return!m("conversationType",e,E)})))?[2,pe((function(o,r){return B(t,void 0,void 0,(function(){var t,a,s;return D(this,(function(c){switch(c.label){case 0:return r.debug(R.O,"get total unread count -> ConversationType:".concat(JSON.stringify(n)," includeMuted:").concat(e)),[4,o.getTotalUnreadCount("",n,e)];case 1:return t=c.sent(),a=t.code,s=t.data,a===i.SUCCESS?[2,{code:a,data:s}]:(r.warn(R.O,"getTotalUnreadCount fail ->".concat(a,":").concat(Ge[a])),[2,{code:a,msg:Ge[a]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function je(e,n){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(o){return!m("conversationTypes",e,l.ARRAY,!0)||!m("levels",n,l.ARRAY,!0)||e.some((function(e){return!m("conversationType",e,E)}))||n.some((function(e){return!m("level",e,T)}))?[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,pe((function(o,r){return B(t,void 0,void 0,(function(){var t,a,s;return D(this,(function(c){switch(c.label){case 0:return[4,o.getTotalUnreadCountByLevels(e,n)];case 1:return t=c.sent(),a=t.code,s=t.data,a===i.SUCCESS?[2,{code:a,data:s}]:(r.warn(R.O,"getTotalUnreadCountByLevels fail ->".concat(a,":").concat(Ge[a])),[2,{code:a,msg:Ge[a]}])}}))}))}))]}))}))}function We(e,n){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(o){return!m("conversationTypes",e,l.ARRAY,!0)||!m("levels",n,l.ARRAY,!0)||e.some((function(e){return!m("conversationType",e,E)}))||n.some((function(e){return!m("level",e,T)}))?[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,pe((function(o,r){return B(t,void 0,void 0,(function(){var t,a,s;return D(this,(function(c){switch(c.label){case 0:return[4,o.getTotalUnreadCountByLevels(e,n,!0)];case 1:return t=c.sent(),a=t.code,s=t.data,a===i.SUCCESS?[2,{code:a,data:s}]:(r.warn(R.O,"getTotalUnreadMentionedCountByLevels fail ->".concat(a,":").concat(Ge[a])),[2,{code:a,msg:Ge[a]}])}}))}))}))]}))}))}function Xe(e){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(t){return m("options",e,l.CONVERSATION,!0)?[2,pe((function(t,o){return B(n,void 0,void 0,(function(){var n,r,a,s;return D(this,(function(c){switch(c.label){case 0:return[4,t.getUnreadCount(e.conversationType,e.targetId,e.channelId)];case 1:return n=c.sent(),r=n.code,a=n.data,s="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),o.debug(R.O,"get unreadCount ->".concat(s)),r===i.SUCCESS?[2,{code:r,data:a}]:(o.warn(R.O,"get unreadCount fail ->".concat(r,":").concat(Ge[r],",").concat(s)),[2,{code:r,msg:Ge[r]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Qe(e){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(t){return m("options",e,l.CONVERSATION,!0)?[2,pe((function(t,o){return B(n,void 0,void 0,(function(){var n,r;return D(this,(function(a){switch(a.label){case 0:return[4,t.clearUnreadCount(e.conversationType,e.targetId,e.channelId)];case 1:return n=a.sent(),r="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),o.debug(R.O,"clear unreadMsgNum ->".concat(r)),n!==i.SUCCESS?(o.warn(R.O,"clear unreadMsgNum fail ->".concat(n,":").concat(Ge[n],",").concat(r)),[2,{code:n,msg:Ge[n]}]):[2,{code:n}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function $e(){return B(this,void 0,void 0,(function(){var e=this;return D(this,(function(n){return[2,pe((function(n,t){return B(e,void 0,void 0,(function(){return D(this,(function(e){switch(e.label){case 0:return[4,n.clearAllUnreadCount()];case 1:return[2,{code:e.sent()}]}}))}))}))]}))}))}be.ROAMING_SERVICE_UNAVAILABLE.code;var en=function(e,n,t){void 0===t&&(t="");var o="conversationType:".concat(n.conversationType,",targetId:").concat(n.targetId);return e.debug(R.O,"".concat(t," -> ").concat(o)),o},nn=function(e,n,t,o){return void 0===o&&(o=""),B(void 0,void 0,void 0,(function(){var r,a;return D(this,(function(s){switch(s.label){case 0:return r=en(e,n,o),[4,t()];case 1:return(a=s.sent())!==i.SUCCESS?(e.warn(R.O,"".concat(o," fail -> ").concat(a," : ").concat(Ge[a]," , ").concat(r)),[2,{code:a,msg:Ge[a]}]):[2,{code:a}]}}))}))};function tn(e,n){return B(this,void 0,void 0,(function(){return D(this,(function(t){return m("notificationLevel",n,(function(e){return void 0!==S[e]}),!0)&&m("options",e,l.CONVERSATION,!0)?[2,pe((function(t,o){return nn(o,e,(function(){return t.setConversationNotificationLevel(e.conversationType,e.targetId,n,e.channelId)}),"setConversationNotificationLevel")}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function on(e,n){return B(this,void 0,void 0,(function(){return D(this,(function(t){return m("notificationStatus",n,(function(e){return 1===e||2===e}),!0)&&m("options",e,l.CONVERSATION,!0)?[2,pe((function(t,o){return nn(o,e,(function(){return t.setConversationStatus(e.conversationType,e.targetId,void 0,n,e.channelId)}),"setConversationNotificationStatus")}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function rn(e){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(t){return m("options",e,l.CONVERSATION,!0)?[2,pe((function(t,o){return B(n,void 0,void 0,(function(){var n,r,a,s;return D(this,(function(c){switch(c.label){case 0:return n=en(o,e,"getConversationNotificationLevel"),[4,t.getConversationNotificationLevel(e.conversationType,e.targetId,e.channelId)];case 1:return r=c.sent(),a=r.code,s=r.data,a===i.SUCCESS?[2,{code:a,data:s}]:(o.warn(R.O,"getConversationNotificationLevel fail -> ".concat(a," : ").concat(Ge[a]," , ").concat(n)),[2,{code:a,msg:Ge[a]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function an(e){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(t){return m("options",e,l.CONVERSATION,!0)?[2,pe((function(t,o){return B(n,void 0,void 0,(function(){var n,r,a;return D(this,(function(s){switch(s.label){case 0:return o.info(R.O,"getConversationNotificationStatus ->targetId:".concat(e.targetId,",conversationType:").concat(e.conversationType)),[4,t.getConversationNotificationStatus(e.conversationType,e.targetId,e.channelId)];case 1:return n=s.sent(),r=n.code,a=n.data,r===i.SUCCESS?[2,{code:r,data:a}]:(o.warn(R.O,"getConversationNotificationStatus ->code:".concat(r,",targetId:").concat(e.targetId)),[2,{code:r,msg:Ge[r]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function sn(){return B(this,void 0,void 0,(function(){return D(this,(function(e){return[2,pe((function(e){return e.getBlockConversationList()}))]}))}))}function cn(e,n){return void 0===n&&(n=!0),B(this,void 0,void 0,(function(){var t=this;return D(this,(function(o){return m("options",e,l.CONVERSATION,!0)&&m("isTop",n,l.BOOLEAN)?[2,pe((function(o,r){return B(t,void 0,void 0,(function(){var t,a;return D(this,(function(s){switch(s.label){case 0:return t="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),r.debug(R.O,"set conversation status ->".concat(t)),[4,o.setConversationStatus(e.conversationType,e.targetId,n,void 0,e.channelId)];case 1:return(a=s.sent())!==i.SUCCESS?(r.warn(R.O,"set conversation status fail ->".concat(a,":").concat(Ge[a],",").concat(t)),[2,{code:a,msg:Ge[a]}]):[2,{code:a}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function un(e,n){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(o){return m("conversationTypes",e,l.ARRAY)&&!(null==e?void 0:e.some((function(e){return!m("conversationType",e,E)})))&&m("channelId",n,l.CHANNEL_ID)?[2,pe((function(o,r){return B(t,void 0,void 0,(function(){var t,a,s;return D(this,(function(c){switch(c.label){case 0:return[4,o.getTopConversationList(e,n)];case 1:return t=c.sent(),a=t.code,s=t.data,a===i.SUCCESS&&s?[2,{code:0,data:s.map((function(e){return ge(e)}))}]:(r.warn(R.A_GET_TOP_CONVERSATION_LIST_E,"".concat(a,":").concat(Ge[a])),[2,{code:a,msg:Ge[a]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function dn(e){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(t){return!m("conversationTypes",e,l.ARRAY)||(null==e?void 0:e.some((function(e){return!m("conversationType",e,p)})))?[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,pe((function(t,o){return B(n,void 0,void 0,(function(){var n,o,r;return D(this,(function(a){switch(a.label){case 0:return[4,t.getUnreadConversationList(e)];case 1:return n=a.sent(),o=n.code,r=n.data,o===i.SUCCESS&&r?[2,{code:0,data:r.map((function(e){return ge(e)}))}]:[2,{code:o,msg:Ge[o]}]}}))}))}))]}))}))}function fn(e){return B(this,void 0,void 0,(function(){return D(this,(function(n){return m("options",e,l.CONVERSATION,!0)?[2,pe((function(n,t){return t.debug(R.O,"getUnreadMentionedCount".concat(e.targetId,",channelId:").concat(e.channelId)),n.getUnreadMentionedCount(e)}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function ln(){return B(this,void 0,void 0,(function(){return D(this,(function(e){return[2,pe((function(e,n){return n.debug(R.O,"getAllUnreadMentionedCount"),e.getAllUnreadMentionedCount()}))]}))}))}function gn(){return B(this,void 0,void 0,(function(){return D(this,(function(e){return[2,pe((function(e){return e.getAllConversationState()}))]}))}))}function vn(e){return void 0===e&&(e={}),B(this,void 0,void 0,(function(){var n=this;return D(this,(function(t){return m("options.targetId",e.targetId,l.STRING,!1)&&m("options.channelType",e.channelType,(function(e){return void 0!==O[e]}),!1)?[2,pe((function(t,o){return B(n,void 0,void 0,(function(){var n,r,a;return D(this,(function(s){switch(s.label){case 0:return[4,t.getUltraGroupList(e)];case 1:return n=s.sent(),r=n.code,a=n.data,r===i.SUCCESS?[2,{code:i.SUCCESS,data:a}]:(o.warn(R.O,"get ultragroup ->".concat(r,":").concat(Ge[r])),[2,{code:r,msg:Ge[r]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function In(){return B(this,void 0,void 0,(function(){var e=this;return D(this,(function(n){return[2,pe((function(n,t){return B(e,void 0,void 0,(function(){var e,o,r;return D(this,(function(a){switch(a.label){case 0:return[4,n.getBlockUltraGroupList()];case 1:return e=a.sent(),o=e.code,r=e.data,o===i.SUCCESS?[2,{code:i.SUCCESS,data:r}]:(t.warn(R.O,"get block ultragroup ->".concat(o,":").concat(Ge[o])),[2,{code:o,msg:Ge[o]}])}}))}))}))]}))}))}function Rn(e){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(t){return m("options",e,l.CONVERSATION,!0)?[2,pe((function(t,o){return B(n,void 0,void 0,(function(){var n;return D(this,(function(r){switch(r.label){case 0:return[4,t.sendUltraGroupTypingStatus(e)];case 1:return(n=r.sent().code)===i.SUCCESS?[2,{code:i.SUCCESS}]:(o.warn(R.O,"send ultraGroup OperateStatus ->".concat(n,":").concat(Ge[n])),[2,{code:n,msg:Ge[n]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function hn(e,n){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(o){return m("options",e,l.CONVERSATION,!0)&&m("msgs",n,l.ARRAY,!0)?[2,pe((function(o,r){return B(t,void 0,void 0,(function(){var t,a,s,c,u,d,f,l,g,v;return D(this,(function(I){switch(I.label){case 0:return t=e.targetId,a=e.conversationType,s=e.channelId,c=[],n.forEach((function(e){var n=e.sendTime,t=e.messageUId;c.push({sendTime:n,messageUId:t,channelId:s})})),u={targetId:t,conversationType:a,messages:c},[4,o.getUltraGroupMessageListByMessageUId(u)];case 1:if(d=I.sent(),f=d.code,l=d.data,f===i.SUCCESS){for(v in g={},l)g[v]=l[v]?le(l[v]):void 0;return[2,{code:i.SUCCESS,data:g}]}return r.warn(R.O,"get UltraGroup MessageList by messageUId ->".concat(f,":").concat(Ge[f])),[2,{code:f,msg:Ge[f]}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function mn(e,n){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(o){return m("expansion",e,l.OBJECT,!0)&&m("message",n,l.OBJECT,!0)?[2,pe((function(o,r){return B(t,void 0,void 0,(function(){var t,a,s,c,u,d,f,l,g;return D(this,(function(v){switch(v.label){case 0:return t=n.conversationType,a=n.targetId,s=n.messageUId,c=n.sentTime,u=n.canIncludeExpansion,d=n.channelId,f="conversationType:".concat(t,",targetId:").concat(a,",channelId:").concat(d,",messageUId:").concat(s),r.debug(R.O,"update expansion for ultragroup message ->".concat(f)),l={targetId:a,channelId:d,conversationType:t,sendTime:c,canIncludeExpansion:u,messageUId:s,expansion:e},[4,o.expandUltraMessage(l)];case 1:return(g=v.sent().code)===i.SUCCESS?[2,{code:i.SUCCESS}]:(r.warn(R.O,"update expansion for ultragroup message ->".concat(g,":").concat(Ge[g])),[2,{code:g,msg:Ge[g]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function En(e,n){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(o){return m("expansion",e,l.ARRAY,!0)&&m("message",n,l.OBJECT,!0)?[2,pe((function(o,r){return B(t,void 0,void 0,(function(){var t,a,s,c,u,d,f,l,g;return D(this,(function(v){switch(v.label){case 0:return t=n.conversationType,a=n.targetId,s=n.messageUId,c=n.sentTime,u=n.canIncludeExpansion,d=n.channelId,f="conversationType:".concat(t,",targetId:").concat(a,",channelId:").concat(d,",messageUId:").concat(s),r.debug(R.O,"remove expansion for ultragroup message ->".concat(f)),l={targetId:a,channelId:d,conversationType:t,sendTime:c,canIncludeExpansion:u,messageUId:s,keys:e},[4,o.expandUltraMessage(l)];case 1:return(g=v.sent().code)===i.SUCCESS?[2,{code:i.SUCCESS}]:(r.warn(R.O,"remove expansion for ultraGroup message ->".concat(g,":").concat(Ge[g])),[2,{code:g,msg:Ge[g]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Tn(e){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(t){return m("message",e,l.OBJECT,!0)?[2,pe((function(t,o){return B(n,void 0,void 0,(function(){var n,r,a,s,c,u,d,f,l;return D(this,(function(g){switch(g.label){case 0:return n=e.conversationType,r=e.targetId,a=e.messageUId,s=e.sentTime,c=e.canIncludeExpansion,u=e.channelId,d="conversationType:".concat(n,",targetId:").concat(r,",channelId:").concat(u,",messageUId:").concat(a),o.debug(R.O,"remove all expansion for ultraGroup message ->".concat(d)),f={targetId:r,channelId:u,conversationType:n,sendTime:s,canIncludeExpansion:c,messageUId:a,removeAll:!0},[4,t.expandUltraMessage(f)];case 1:return(l=g.sent().code)===i.SUCCESS?[2,{code:i.SUCCESS}]:(o.warn(R.O,"remove all expansion for ultraGroup message ->".concat(l,":").concat(Ge[l])),[2,{code:l,msg:Ge[l]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Sn(e,n){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(o){return m("content",e,l.OBJECT,!0)&&m("message",n,l.OBJECT,!0)?[2,pe((function(o,r){return B(t,void 0,void 0,(function(){var t,a,s,c,u,d,f,l,g,v;return D(this,(function(I){switch(I.label){case 0:return t=n.conversationType,a=n.targetId,s=n.messageUId,c=n.senderUserId,u=n.sentTime,d=n.canIncludeExpansion,f=n.channelId,l="conversationType:".concat(t,",targetId:").concat(a,",channelId:").concat(f,",messageUId:").concat(s),r.debug(R.O,"update ultragroup message expansion ->".concat(l)),g={targetId:a,channelId:f,conversationType:t,fromUserId:c,sendTime:u,canIncludeExpansion:d,messageUId:s,content:e},[4,o.modifyMessage(g)];case 1:return(v=I.sent().code)===i.SUCCESS?[2,{code:i.SUCCESS}]:(r.warn(R.O,"modify ultraGroup message ->".concat(v,":").concat(Ge[v])),[2,{code:v,msg:Ge[v]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function pn(e,n){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(o){return m("targetId",e,l.STRING,!0)&&m("notificationLevels",n,l.ARRAY)&&!(null==n?void 0:n.some((function(e){return!m("notificationLevel",e,T)})))?[2,pe((function(o,r){return B(t,void 0,void 0,(function(){var t,a,s;return D(this,(function(c){switch(c.label){case 0:return r.debug(R.O,"get UltraGroup unreadMentionedCount by targetId: ".concat(e,", notificationLevels: ").concat(JSON.stringify(n))),[4,o.getUltraGroupUnreadMentionedCountByTargetId(e,n)];case 1:return t=c.sent(),a=t.code,s=t.data,a===i.SUCCESS?[2,{code:i.SUCCESS,data:s}]:(r.warn(R.O,"get UltraGroup unreadMentionedCount by targetId error ->".concat(a,":").concat(Ge[a])),[2,{code:a,msg:Ge[a]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function On(e){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(t){return m("options.targetId",e.targetId,l.STRING,!0)&&m("options.channelId",e.channelId,l.CHANNEL_ID)?[2,pe((function(t,o){return B(n,void 0,void 0,(function(){var n,r,a,s,c;return D(this,(function(u){switch(u.label){case 0:return n="getUltraGroupDefaultNotificationLevel",r="targetId: ".concat(e.targetId,", channelId: ").concat(e.channelId),o.debug(R.O,"".concat(n," -> ").concat(r)),[4,t.getUltraGroupDefaultNotificationLevel(e.targetId,e.channelId)];case 1:return a=u.sent(),s=a.code,c=a.data,s===i.SUCCESS?[2,{code:s,data:c}]:(o.warn(R.O,"".concat(n," fail -> ").concat(s," : ").concat(Ge[s]," , ").concat(r)),[2,{code:s,msg:Ge[s]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Nn(e,n){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(o){return e.channelId=e.channelId||"",m("options.targetId",e.targetId,l.STRING,!0)&&m("options.channelId",e.channelId,l.CHANNEL_ID,!0)&&m("notificationLevel",n,(function(e){return void 0!==S[e]}),!0)?[2,pe((function(o,r){return B(t,void 0,void 0,(function(){var t,a,s;return D(this,(function(c){switch(c.label){case 0:return t="setUltraGroupDefaultNotificationLevel",a="targetId: ".concat(e.targetId,", channelId: ").concat(e.channelId),r.debug(R.O,"".concat(t," -> ").concat(a)),[4,o.setUltraGroupDefaultNotificationLevel(e.targetId,n,e.channelId)];case 1:return(s=c.sent().code)===i.SUCCESS?[2,{code:s}]:(r.warn(R.O,"".concat(t," fail -> ").concat(s," : ").concat(Ge[s]," , ").concat(a)),[2,{code:s,msg:Ge[s]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function _n(e,n){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(o){return m("targetId",e,l.STRING,!0)&&m("notificationLevels",n,l.ARRAY)&&!(null==n?void 0:n.some((function(e){return!m("notificationLevel",e,T)})))?[2,pe((function(o,i){return B(t,void 0,void 0,(function(){var t,r,a,s,c;return D(this,(function(u){switch(u.label){case 0:return t="getUltraGroupUnreadCountByTargetId",[4,o.getUltraGroupUnreadCountByTargetId(e,n)];case 1:return r=u.sent(),a=r.code,s=r.data,c="targetId: ".concat(e,", levels: ").concat(JSON.stringify(n)),i.debug(R.O,"".concat(t," -> ").concat(c)),[2,{code:a,data:s}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Cn(){return B(this,void 0,void 0,(function(){var e=this;return D(this,(function(n){return[2,pe((function(n,t){return B(e,void 0,void 0,(function(){var e,o,r,a;return D(this,(function(s){switch(s.label){case 0:return e="getAllUltraGroupUnreadCount",[4,n.getAllUltraGroupUnreadCount()];case 1:return o=s.sent(),r=o.code,a=o.data,t.debug(R.O,e),r===i.SUCCESS?[2,{code:r,data:a}]:(t.warn(R.O,"".concat(e," fail ->").concat(r,": ").concat(Ge[r])),[2,{code:r,msg:Ge[r]}])}}))}))}))]}))}))}function An(){return B(this,void 0,void 0,(function(){var e=this;return D(this,(function(n){return[2,pe((function(n,t){return B(e,void 0,void 0,(function(){var e,o,r,a;return D(this,(function(s){switch(s.label){case 0:return e="getAllUltraGroupUnreadMentionedCount",!0,[4,n.getAllUltraGroupUnreadCount(true)];case 1:return o=s.sent(),r=o.code,a=o.data,t.debug(R.O,e),r===i.SUCCESS?[2,{code:r,data:a}]:(t.warn(R.O,"".concat(e," fail ->").concat(r,": ").concat(Ge[r])),[2,{code:r,msg:Ge[r]}])}}))}))}))]}))}))}function yn(e){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(t){return e.channelId=e.channelId||"",m("options.targetId",e.targetId,l.STRING,!0)&&m("options.channelId",e.channelId,l.CHANNEL_ID,!0)&&m("options.sentTime",e.sentTime,l.NUMBER,!0)&&m("options.count",e.count,(function(e){return s(e)&&e>0&&e<=50}),!0)?[2,pe((function(t,o){return B(n,void 0,void 0,(function(){var n,r,a,s,c,u,d,f;return D(this,(function(l){switch(l.label){case 0:return n=e.targetId,r=e.channelId,a=e.sentTime,s=e.count,c={targetId:n,channelId:r,sentTime:a,count:s},[4,t.getUltraGroupUnreadMentionedMessages(c)];case 1:return u=l.sent(),d=u.code,f=u.data,d===i.SUCCESS?[2,{code:d,data:f}]:(o.warn(R.O,"getUltraGroupUnreadMentionedMessages fail ->".concat(d,": ").concat(Ge[d])),[2,{code:d,msg:Ge[d]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Mn(e){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(t){return m("conversation.targetId",e.targetId,l.STRING,!0)&&m("conversation.channelId",e.channelId,l.CHANNEL_ID,!0)?[2,pe((function(t){return B(n,void 0,void 0,(function(){var n,o,r,a,s,c;return D(this,(function(u){switch(u.label){case 0:return n=e.targetId,o=e.channelId,r={targetId:n,channelId:o},[4,t.getUltraGroupFirstUnreadMessageTimestamp(r)];case 1:return a=u.sent(),s=a.code,c=a.data,s===i.SUCCESS?[2,{code:s,data:c}]:[2,{code:s,msg:Ge[s]}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}var Un=function(e){return!!(m("options.key",e.key,l.STRING,!0)&&m("options.value",e.value,l.STRING,!0)&&m("options.isAutoDelete",e.isAutoDelete,l.BOOLEAN)&&m("options.isSendNotification",e.isSendNotification,l.BOOLEAN)&&m("options.notificationExtra",e.notificationExtra,l.STRING))},Pn=function(e){return e.entries.every((function(e){return m("entry.key",e.key,l.STRING,!0)&&m("entry.value",e.value,l.STRING,!0)}))&&m("options.isAutoDelete",e.isAutoDelete,l.BOOLEAN)&&m("options.notificationExtra",e.notificationExtra,l.STRING)&&m("options.isForce",e.isForce,l.BOOLEAN)},Ln=function(e){return m("options.key",e.key,l.STRING,!0)&&m("options.isSendNotification",e.isSendNotification,l.BOOLEAN)&&m("options.notificationExtra",e.notificationExtra,l.STRING)},wn=function(e){return e.entries.every((function(e){return m("key",e,l.STRING,!0)}))&&m("options.notificationExtra",e.notificationExtra,l.STRING)};function Bn(e,n){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(o){return m("targetId",e,l.STRING,!0)&&m("options.count",n.count,l.NUMBER,!0)?[2,pe((function(o,r){return B(t,void 0,void 0,(function(){var t,a,s;return D(this,(function(c){switch(c.label){case 0:return t=r.createTraceId(),r.info(R.A_JOIN_CHATROOM_T,JSON.stringify({chatroomId:e,count:n.count,joinExist:!1}),t),[4,o.joinChatroom(e,n.count,t)];case 1:return a=c.sent(),s=a===i.SUCCESS?"info":"warn",r[s](R.A_JOIN_CHATROOM_R,JSON.stringify({code:a,timestamp:(new Date).getTime()}),t),a!==i.SUCCESS?[2,{code:a,msg:Ge[a]}]:[2,{code:a}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Dn(e,n){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(o){return m("targetId",e,l.STRING,!0)&&m("options.count",n.count,l.NUMBER,!0)?[2,pe((function(o,r){return B(t,void 0,void 0,(function(){var t,a,s;return D(this,(function(c){switch(c.label){case 0:return t=r.createTraceId(),r.info(R.A_JOIN_CHATROOM_T,JSON.stringify({chatroomId:e,count:n.count,joinExist:!0}),t),[4,o.joinExistChatroom(e,n.count,t)];case 1:return a=c.sent(),s=a===i.SUCCESS?"info":"warn",r[s](R.A_JOIN_CHATROOM_R,JSON.stringify({code:a,timestamp:(new Date).getTime()}),t),a!==i.SUCCESS?[2,{code:a,msg:Ge[a]}]:[2,{code:a}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function bn(e){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(t){return m("targetId",e,l.STRING,!0)?[2,pe((function(t,o){return B(n,void 0,void 0,(function(){var n,r,a;return D(this,(function(s){switch(s.label){case 0:return n=o.createTraceId(),o.info(R.A_QUIT_CHATROOM_T,JSON.stringify({chatroomId:e}),n),[4,t.quitChatroom(e)];case 1:return r=s.sent(),a=r===i.SUCCESS?"info":"warn",o[a](R.A_QUIT_CHATROOM_R,JSON.stringify({code:r}),n),r!==i.SUCCESS?[2,{code:r,msg:Ge[r]}]:[2,{code:r}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Gn(e,n){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(o){return m("targetId",e,l.STRING,!0)&&m("options.count",n.count,l.NUMBER)&&m("options.order",n.order,(function(e){return[0,1,2].includes(e)}))?[2,pe((function(o,r){return B(t,void 0,void 0,(function(){var t,a,s,c;return D(this,(function(u){switch(u.label){case 0:return t="id:".concat(e),r.debug(R.O,"get chatroom info ->".concat(t)),[4,o.getChatroomInfo(e,n.count,n.order)];case 1:return a=u.sent(),s=a.code,c=a.data,s===i.SUCCESS&&c?[2,{code:s,data:c}]:(r.warn(R.O,"get chatroom info fail ->code+:".concat(Ge[s],",").concat(t)),[2,{code:s,msg:Ge[s]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function xn(e,n){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(o){return m("targetId",e,l.STRING,!0)&&Un(n)?[2,pe((function(o,r){return B(t,void 0,void 0,(function(){var t,a;return D(this,(function(s){switch(s.label){case 0:return t="id:".concat(e),r.debug(R.O,"set chatroom entry->".concat(t)),[4,o.setChatroomEntry(e,n)];case 1:return(a=s.sent())!==i.SUCCESS?(r.warn(R.O,"set chatroom entry fail ->code+:".concat(Ge[a],",").concat(t)),[2,{code:a,msg:Ge[a]}]):[2,{code:a}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Vn(e,n){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(o){return m("targetId",e,l.STRING,!0)&&Pn(n)?n.entries.length>10?[2,be.CHATROOM_KV_STORE_OUT_LIMIT]:[2,pe((function(o,r){return B(t,void 0,void 0,(function(){var t,a,s,c;return D(this,(function(u){switch(u.label){case 0:return t="id:".concat(e),r.debug(R.O,"set chatroom entry->".concat(t)),[4,o.setChatroomEntries(e,n)];case 1:return a=u.sent(),s=a.code,c=a.data,s!==i.SUCCESS?(r.warn(R.O,"set chatroom entry fail ->code+:".concat(Ge[s],",").concat(t)),[2,{code:s,msg:Ge[s],data:c}]):[2,{code:s}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function kn(e,n){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(o){return m("targetId",e,l.STRING,!0)&&Un(n)?[2,pe((function(o,r){return B(t,void 0,void 0,(function(){var t,a;return D(this,(function(s){switch(s.label){case 0:return t="id:".concat(e),r.debug(R.O,"force set chatroom entry ->".concat(t)),[4,o.forceSetChatroomEntry(e,n)];case 1:return(a=s.sent())!==i.SUCCESS?(r.warn(R.O,"force set chatroom entry fail ->code+:".concat(Ge[a],",").concat(t)),[2,{code:a,msg:Ge[a]}]):[2,{code:a}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Hn(e,n){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(o){return m("targetId",e,l.STRING,!0)&&Ln(n)?[2,pe((function(o,r){return B(t,void 0,void 0,(function(){var t,a;return D(this,(function(s){switch(s.label){case 0:return t="id:".concat(e),r.debug(R.O,"remove chatroom entry->".concat(t)),[4,o.removeChatroomEntry(e,n)];case 1:return(a=s.sent())!==i.SUCCESS?(r.warn(R.O,"remove chatroom entry fail ->code+:".concat(Ge[a],",").concat(t)),[2,{code:a,msg:Ge[a]}]):[2,{code:a}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Fn(e,n){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(o){return m("targetId",e,l.STRING,!0)&&wn(n)?[2,pe((function(o,r){return B(t,void 0,void 0,(function(){var t,a,s,c,u;return D(this,(function(d){switch(d.label){case 0:return t="id:".concat(e),r.info(R.O,"remove chatroom entry->".concat(t)),(a=w({},n)).entries=n.entries.map((function(e){return{key:e}})),[4,o.removeChatroomEntries(e,a)];case 1:return s=d.sent(),c=s.code,u=s.data,c!==i.SUCCESS?(r.warn(R.O,"remove chatroom entry fail ->code+:".concat(Ge[c],",").concat(t)),[2,{code:c,msg:Ge[c],data:u}]):[2,{code:c}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Zn(e,n){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(o){return m("targetId",e,l.STRING,!0)&&Ln(n)?[2,pe((function(o,r){return B(t,void 0,void 0,(function(){var t,a;return D(this,(function(s){switch(s.label){case 0:return t="id:".concat(e),r.info(R.O,"force remove chatroom entry ->".concat(t)),[4,o.forceRemoveChatroomEntry(e,n)];case 1:return(a=s.sent())!==i.SUCCESS?(r.warn(R.O,"force remove chatroom entry fail ->code+:".concat(Ge[a],",").concat(t)),[2,{code:a,msg:Ge[a]}]):[2,{code:a}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function qn(e,n){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(o){return m("targetId",e,l.STRING,!0)&&m("key",n,(function(e){return N(e)&&/[\w+=-]+/.test(e)&&e.length<=128}),!0)?[2,pe((function(o,r){return B(t,void 0,void 0,(function(){var t,a,s,c;return D(this,(function(u){switch(u.label){case 0:return t="id:".concat(e),r.debug(R.O,"get chatroom entry->".concat(t)),[4,o.getChatroomEntry(e,n)];case 1:return a=u.sent(),s=a.code,c=a.data,s===i.SUCCESS&&c?[2,{code:s,data:c}]:(r.warn(R.O,"get chatroom entry fail ->code+:".concat(Ge[s],",").concat(t)),[2,{code:s,msg:Ge[s]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Jn(e){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(t){return m("targetId",e,l.STRING,!0)?[2,pe((function(t,o){return B(n,void 0,void 0,(function(){var n,r,a,s;return D(this,(function(c){switch(c.label){case 0:return n="id:".concat(e),o.debug(R.O,"get all chatroom entries->".concat(n)),[4,t.getAllChatroomEntries(e)];case 1:return r=c.sent(),a=r.code,s=r.data,a===i.SUCCESS&&s?[2,{code:a,data:s}]:(o.warn(R.O,"get all chatroom entries fail ->code+:".concat(Ge[a],",").concat(n)),[2,{code:a,msg:Ge[a]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function zn(e,n){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(o){return m("targetId",e,l.STRING,!0)&&m("options.timestamp",n.timestamp,l.NUMBER)&&m("options.count",n.count,l.NUMBER)&&m("options.count",n.count,(function(e){var n=e>0&&e<=100;return n||null===console||void 0===console||console.error('"options.count" is invalid, It should be greater than 0 and less than 100'),n}))&&m("options.order",n.order,(function(e){return 0===e||1===e}))?[2,pe((function(o,r){return B(t,void 0,void 0,(function(){var t,a,s,c,u;return D(this,(function(d){switch(d.label){case 0:return t="id:".concat(e),r.debug(R.O,"get chatroom history message->".concat(t)),[4,o.getChatRoomHistoryMessages(e,n.count,n.order,n.timestamp)];case 1:return a=d.sent(),s=a.code,c=a.data,s===i.SUCCESS&&c?(u=c.list.map((function(e){return le(e)})),[2,{code:s,data:{list:u,hasMore:!!c.hasMore}}]):(r.warn(R.O,"get chatroom history message fail ->code+:".concat(Ge[s],",").concat(t)),[2,{code:s,msg:Ge[s]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Kn(e){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(t){return m("option.chatRoomId",e.chatRoomId,l.STRING,!0)&&m("option.rtcRoomId",e.rtcRoomId,l.STRING,!0)?[2,pe((function(t){return B(n,void 0,void 0,(function(){var n;return D(this,(function(o){switch(o.label){case 0:return[4,t.bindRTCRoomForChatroom(e)];case 1:return[2,{code:n=o.sent(),msg:Ge[n]}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Yn(e){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(t){return m("userId",e,l.STRING,!0)?[2,pe((function(t,o){return B(n,void 0,void 0,(function(){return D(this,(function(n){switch(n.label){case 0:return o.info(R.O,"addToBlacklist -> userId: ".concat(e)),[4,t.addToBlacklist(e)];case 1:return[2,{code:n.sent()}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function jn(e){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(t){return m("userId",e,l.STRING,!0)?[2,pe((function(t,o){return B(n,void 0,void 0,(function(){return D(this,(function(n){switch(n.label){case 0:return o.info(R.O,"removeFromBlacklist -> userId: ".concat(e)),[4,t.removeFromBlacklist(e)];case 1:return[2,{code:n.sent()}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Wn(){return B(this,void 0,void 0,(function(){var e=this;return D(this,(function(n){return[2,pe((function(n,t){return B(e,void 0,void 0,(function(){var e,o,r;return D(this,(function(a){switch(a.label){case 0:return t.info(R.O,"getBlacklist -> "),[4,n.getBlacklist()];case 1:return e=a.sent(),o=e.code,r=e.data,o===i.SUCCESS&&r?[2,{code:o,data:r}]:(t.warn(R.O,"getBlacklist fail -> code: ".concat(o)),[2,{code:o}])}}))}))}))]}))}))}function Xn(e){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(t){return m("userId",e,l.STRING,!0)?[2,pe((function(t,o){return B(n,void 0,void 0,(function(){var n,r,a;return D(this,(function(s){switch(s.label){case 0:return o.info(R.O,"getBlacklistStatus -> userId: ".concat(e)),[4,t.getBlacklistStatus(e)];case 1:return n=s.sent(),r=n.code,a=n.data,r===i.SUCCESS?[2,{code:r,data:0===a}]:(o.warn(R.O,"getBlacklistStatus fail -> code: ".concat(r,", userId: ").concat(e)),[2,{code:r}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}var Qn=function(e,n,t,o){void 0===t&&(t=!0),void 0===o&&(o=!0),this.messageType=e,this.content=n,this.isPersited=t,this.isCounted=o};function $n(e,n,t){void 0===n&&(n=!0),void 0===t&&(t=!0);return function(o){return new Qn(e,o,n,t)}}var et,nt,ot=$n("RC:ImgMsg"),it=$n("RC:HQVCMsg"),rt=$n("RC:SightMsg"),at=$n("RC:TxtMsg"),st=$n("RC:CombineMsg"),ct=$n("RC:FileMsg"),ut=$n("RC:GIFMsg"),dt=$n("RC:VcMsg"),ft=$n("RC:LBSMsg"),lt=$n("RC:ReferenceMsg"),gt=$n("RC:ImgTextMsg"),vt={qiniu:function(e,n,t,o){Se((function(i){var r=i.getNaviInfoFromCache();if(1===(null==r?void 0:r.type)&&n.chunk_size&&o.size>n.chunk_size){var a=C();a+=o.name.substr(o.name.lastIndexOf(".")),o.uniqueName=a,Ot(o,n,t)}else pt(e,n,t,o)}))},baidu:function(e,n,t,o){if(o.size>Rt.BOS_CHUNCK_SIZE)throw new Error("the file size is over 5GB!");var i=n||{};n=n||nt;var r=new XMLHttpRequest,a=Et();if(!i.uploadHost.bos&&!i.bosUploadPath)return;var s=a+It[0][1]+i.bosUploadPath;It.shift();var c=i.bosHeader||{},u={filename:n.uniqueValue||o.uniqueName,name:o.name,downloadUrl:s,isBosRes:!0};r.upload&&n.support_options&&(r.upload.onprogress=function(e){t.onProgress(e.loaded,e.total,!0)});r.onreadystatechange=function(){if(4===r.readyState)if(JSON.parse(r.responseText||"{}").filename=n.uniqueValue,200===r.status){t.onCompleted(u,!0)}else It.length?vt[It[0][0]](e,n,t,o):t.onError("upload fail")},r.open(n.method,s,!0),r.setRequestHeader("authorization",c.bosToken),r.setRequestHeader("x-bce-date",c.bosDate),r.send(o)},aliyun:function(e,n,t,o){if(o.size>Rt.BOS_CHUNCK_SIZE)throw new Error("the file size is over 5GB!");var i=new FormData;i.set("file",e.get("file")),i.set("key",e.get("key")),i.set("token",e.get("token"));var r=It[0][1];It.shift(),e=e||et,n=(n=n||{})||nt;var a=new XMLHttpRequest,s=Et(),c="".concat(s+n.ossBucketName,".").concat(r);a.upload&&n.support_options&&(a.upload.onprogress=function(e){t.onProgress(e.loaded,e.total)});a.onreadystatechange=function(){if(4===a.readyState){var e=JSON.parse(a.responseText||"{}");e.name=n.uniqueValue,e.filename=n.uploadFileName,e.uploadMethod=_?_.ALI:"",200===a.status?t.onCompleted(e):It.length?vt[It[0][0]](i,n,t,o):t.onError("upload fail")}},a.open(n.method,c,!0),console.log("ali:url",c);var u=n.aliHeader||{};e.set("OSSAccessKeyId",u.osskeyId),e.set("policy",u.ossPolicy),e.set("Signature",u.ossSign),e.set("success_action_status",200),e.delete("key"),e.append("key",n.uploadFileName),e.delete("file"),e.append("file",o),a.send(e)},s3:function(e,n,t,o){var i=new FormData,r=new XMLHttpRequest,a=Et(),s=n.contentDisposition,c=It[0][1],u="".concat(a+n.s3BucketName,".").concat(c);console.log("uploadS3:url",u),It.shift(),r.upload&&n.support_options&&(r.upload.onprogress=function(e){t.onProgress(e.loaded,e.total)});r.onreadystatechange=function(){if(4===r.readyState){var i=JSON.parse(r.responseText||"{}");if(i.name=n.uniqueValue,i.filename=n.uploadFileName,i.uploadMethod=_.AWS,200===r.status||204===r.status)t.onCompleted(i);else if(It.length){var a=new FormData;a.set("file",e.get("file")),a.set("key",e.get("key")),a.set("token",e.get("token")),vt[It[0][0]](a,n,t,o)}else t.onError("upload fail")}},r.open(n.method,u,!0);var d=n?n.s3Header:{},f=o&&o.type;s?i.set("Content-Disposition","".concat(s,";")):i.set("Content-Disposition","text/html"===f?"inline;":"attachment;");i.set("Content-Type",f),i.set("x-amz-credential",d.s3Credential),i.set("x-amz-algorithm",d.s3Algorithm),i.set("x-amz-date",d.s3Date),i.set("policy",d.s3Policy),i.set("x-amz-signature",d.s3Signature),i.set("key",n.uploadFileName),i.set("file",o),r.send(i)},stc:Nt,minio:Nt},It=[],Rt={BOS_CHUNCK_SIZE:5368709120},ht="http://",mt="https://";function Et(){var e=mt;return"http:"!==location.protocol&&"file:"!==location.protocol||(e=ht),e}var Tt,St=(Tt="RC-upload-",{get:function(e){e=Tt+e;var n=localStorage.getItem(e);if(n)return null!==(n=JSON.parse(n||"{}"))&&n.type&&n.data?n.data:null},set:function(e,n){var t=localStorage;e=Tt+e,n={data:n,type:typeof n,updateTime:Date.now()},t.setItem(e,JSON.stringify(n))},remove:function(e){e=Tt+e,localStorage.removeItem(e)}});function pt(e,n,t,o){var i=mt+n.uploadHost.qiniu,r=(/http/.test(It[0][1])?"":Et())+It[0][1]||i;n.isChunk||It.shift();var a=new XMLHttpRequest;a.upload&&n.support_options&&(a.upload.onprogress=function(e){t.onProgress(e.loaded,e.total)}),a.onreadystatechange=function(){if(4===a.readyState){var i=JSON.parse(a.responseText||"{}");i.filename=n.uniqueValue,i.uploadMethod=_?_.QINIU:"",200===a.status||204===a.status?t.onCompleted(i):It.length?vt[It[0][0]](e,n,t,o):t.onError("upload fail")}},a.open(n.method,r,!0),t.onOpen(a),n.stream&&a.setRequestHeader("authorization","UpToken ".concat(n.multi_parmas.token)),function(e,n){for(var t in e)n(t,e[t])}(n.headers,(function(e,n){a.setRequestHeader(e,n)})),a.send(e)}function Ot(e,n,t,o){var i=0,r=o||C(),a=St.get(r);a&&(e.uniqueName=a.sessionId,i=a.offset);var s=Math.min(n.chunk_size,e.size-i),c=e.slice(i,i+s),u=e.uniqueName;n.multi_parmas.name=u,n.filesize=e.size;var d="bytes=".concat(i,"-").concat(i+s);n.headers={Range:d,"X-File-TransactionId":u,"X-File-Total-Size":e.size},n.isChunk=!0,c.name=e.name,c=function(e,n,t){var o=new FormData;for(var i in n.unique_key&&o.append(n.unique_key,t),o.append(n.file_data_name,e,e.name),n.multi_parmas){var r=n.multi_parmas[i];o.append(i,r)}return o}(c,n,e.uniqueName),pt(c,n,{onCompleted:function(o){i+=s;var a=e.uniqueName;St.set(r,{offset:i,sessionId:a}),i<e.size?Ot(e,n,t,r):(i=0,St.remove(r),t.onCompleted(o))},onError:function(e){console.error(e),t.onError(e)},onProgress:function(e,o){var r=e+i;t.onProgress(r,n.filesize)},onOpen:function(e){t.onOpen(e)}},e)}function Nt(e,n,t,o,i){var r=new XMLHttpRequest,a=n.contentDisposition,s=It[0][1],c=i===_.STC?n.stcBucketName:n.minioBucketName,u="https://".concat(s,"/").concat(c,"/").concat(n.uploadFileName);It.shift(),r.upload&&n.support_options&&(r.upload.onprogress=function(e){t.onProgress(e.loaded,e.total)}),r.onreadystatechange=function(){if(4===r.readyState){var a=JSON.parse(r.responseText||"{}");if(a.name=n.uniqueValue,a.filename=n.uploadFileName,a.uploadMethod=i,200===r.status||204===r.status)t.onCompleted(a);else if(It.length){var s=new FormData;s.set("file",e.get("file")),s.set("key",e.get("key")),s.set("token",e.get("token")),vt[It[0][0]](s,n,t,o)}else t.onError("upload fail")}},r.open("PUT",u,!0);var d=n.stcHeader.stcAuthorization,f=n.stcHeader.stcContentSha256,l=n.stcHeader.stcDate;i===_.MINIO&&(d=n.minioHeader.minioAuthorization,f=n.minioHeader.minioContentSha256,l=n.minioHeader.minioDate),r.setRequestHeader("Content-Type",o.type),a?r.setRequestHeader("Content-Disposition","".concat(a,";")):r.setRequestHeader("Content-Disposition","text/html"===o.type?"inline;":"attachment;"),r.setRequestHeader("Authorization",d),r.setRequestHeader("x-amz-content-sha256",f),r.setRequestHeader("x-amz-date",l),r.send(o)}function _t(e,n,t,o,i,r){var a,s,c=n&&n.type||"text/plain",u=c.indexOf("image")>-1?1:4,d=t.contentDisposition,f=Math.ceil(n.size/t.stc_chunk_size),l=i===_.STC?t.stcBucketName:t.minioBucketName,g="uploads";e.getFileToken(u,n.name,"POST",g).then((function(e){a=e.fileName,s="https://".concat(r,"/").concat(l,"/").concat(a),console.log("uploadStcMultipart:url",s);var t=new XMLHttpRequest;t.open("POST","".concat(s,"?").concat(g),!0),d?t.setRequestHeader("Content-Disposition","".concat(d,";")):t.setRequestHeader("Content-Disposition","text/html"===n.type?"inline;":"attachment;");var u=e.stcAuthorization,v=e.stcContentSha256,I=e.stcDate;i===_.MINIO&&(u=e.minioAuthorization,v=e.minioContentSha256,I=e.minioDate),t.setRequestHeader("Authorization",u),t.setRequestHeader("x-amz-content-sha256",v),t.setRequestHeader("x-amz-date",I),t.setRequestHeader("Content-Type",c),t.send(),t.onreadystatechange=function(){if(4===t.readyState){var e=t.response.match(/(?:<UploadId>)(\S*?)(?:<\/UploadId>)/);console.log("uploadId",e),200===t.status||204===t.status?function(e){for(var n=[],t=1;t<=f;t++)n.push(h(e,t));R(e,n)}(Array.isArray(e)&&e[1]):o.onError("uploadStcMultipart:did not get uploadId")}}}),(function(e){o.onError("uploadStcMultipart:".concat(e))}));var v=[],I=new Map;function R(t,r){r&&Array.isArray(r)&&0!==r.length&&Promise.all(r).then((function(){var r="uploadId=".concat(t);if(I.size===f)e.getFileToken(u,a,"POST",r).then((function(e){console.log("onSuccess",e),console.log("onSuccess:uploadId",t);var u=e.stcAuthorization,d=e.stcContentSha256,f=e.stcDate;i===_.MINIO&&(u=e.minioAuthorization,d=e.minioContentSha256,f=e.minioDate);var l=new XMLHttpRequest;l.open("POST","".concat(s,"?").concat(r),!0),l.setRequestHeader("Authorization",u),l.setRequestHeader("x-amz-content-sha256",d),l.setRequestHeader("x-amz-date",f),l.setRequestHeader("Content-Type",c);var g="<CompleteMultipartUpload xmlns='http://s3.amazonaws.com/doc/2006-03-01/'>",v=Array.from(I.keys()||[]).sort((function(e,n){return e-n}));console.log("keys",v),v.forEach((function(e){g+="<Part><ETag>".concat(I.get(e),"</ETag><PartNumber>").concat(e,"</PartNumber></Part>")})),g+="</CompleteMultipartUpload>",l.send(g),console.log("xml",g),l.onreadystatechange=function(){if(4===l.readyState)if(200===l.status||204===l.status){var e={name:n.name,filename:a,uploadMethod:i};o.onCompleted(e)}else o.onError("uploadStcMultipart:upload does not end")}}),(function(e){o.onError("uploadStcMultipart:".concat(e))}));else{for(var d=[],l=0,g=v;l<g.length;l++){var m=g[l];d.push(h(t,m))}R(t,d)}}),(function(e){console.error(e),o.onError("uploadStcMultipart: chunkFiles upload failed and those will reupload");for(var n=[],i=0,r=v;i<r.length;i++){var a=r[i];n.push(h(t,a))}R(t,n)}))}function h(o,r){return new Promise((function(d,f){var l="partNumber=".concat(r,"&uploadId=").concat(o);e.getFileToken(u,a,"PUT",l).then((function(e){console.log("signature ".concat(r," onSuccess"),e);var o=n&&n.slice((r-1)*t.stc_chunk_size,r*t.stc_chunk_size);console.log("fileChunk:size",o.size);var a=e.stcAuthorization,u=e.stcContentSha256,g=e.stcDate;i===_.MINIO&&(a=e.minioAuthorization,u=e.minioContentSha256,g=e.minioDate);var R=new XMLHttpRequest;R.open("PUT","".concat(s,"?").concat(l),!0),R.setRequestHeader("Authorization",a),R.setRequestHeader("x-amz-content-sha256",u),R.setRequestHeader("x-amz-date",g),R.setRequestHeader("Content-Type",c),R.send(o),R.onreadystatechange=function(){if(4===R.readyState)if(200===R.status||204===R.status){var e=R.getResponseHeader("etag");console.log("etag:".concat(r),e),I.set(r,e),d(e)}else v.includes(r)||v.push(r),f(r)}}),(function(e){console.log("getETags:签名验证失败"),v.includes(r)||v.push(r),f(r)}))}))}}var Ct={form:function(e,n){var t=new FormData;if(n.unique_key){var o=e.name.substr(e.name.lastIndexOf(".")),i=At()+o;t.append(n.unique_key,i),n.uniqueValue=i}return t.append(n.file_data_name,e),yt(n.multi_parmas,(function(e,n){t.append(e,n)})),t},json:function(e,n){var t={};if(n.unique_key){var o=e.name.substr(e.name.lastIndexOf(".")),i=At()+o;t[n.unique_key]=i,n.uniqueValue=i}return t[n.file_data_name]=e,yt(n.multi_parmas,(function(e,n){t[e]=n})),JSON.stringify(t)},data:function(e,n){return e}};function At(){var e=(new Date).getTime();return"xxxxxx4xxxyxxxxxxx".replace(/[xy]/g,(function(n){var t=(e+16*Math.random())%16|0;return e=Math.floor(e/16),("x"===n?t:3&t|8).toString(16)}))}function yt(e,n){for(var t in e)n(t,e[t])}var Mt,Ut=0,Pt=function(){function e(e){this.options=function(e){var n={domain:"",method:"POST",file_data_name:"file",unique_key:"key",base64_size:4194304,chunk_size:4194304,bos_chunk_size:4294967296,stc_chunk_size:10485760,headers:{},multi_parmas:{},query:{},support_options:!0,data:Ct.form,genUId:At};if(!e||!e.domain)throw new Error("domain is null");for(var t in e)n[t]=e[t];return n}(e)}return e.prototype.setOptions=function(e){var n=this;yt(e,(function(e,t){n.options[e]=t}))},e.prototype.upload=function(e,n,t,o){if(t){var i=this;!function(e,n,t,o,i){et=t,nt=o,It=[];var r,a,s=e.getNaviInfoFromCache();if(1===(null==s?void 0:s.type)&&n.uploadDomain&&!o.ossConfig)It=[["qiniu",n.uploadDomain]];else if(o.ossConfig){var c,u,d,f=JSON.parse(o.ossConfig),l="",g=[];f.forEach((function(e){var n=Number(e.p)-1;for(var t in e)"aliyun"===t&&(l=e[t]),"s3"===t&&(c=e[t]),"stc"===t&&(u=e[t]),"minio"===t&&(d=e[t]),"p"!==t&&(g[n]=[t,e[t]])})),g.forEach((function(e){e&&It.push(e)})),f.length!==It.length&&(It=[["qiniu",o.domain],["baidu",o.uploadHost.bos],["aliyun",l],["s3",c],["stc",u],["minio",d]])}else It=[["qiniu",o.domain],["baidu",o.uploadHost.bos]];if(o.ossConfig){var v=o&&JSON.parse(o.ossConfig);Array.isArray(v)||(v=[]),r=v.find((function(e){return Object.keys(e).includes("stc")})),a=v.find((function(e){return Object.keys(e).includes("minio")}))}if(r&&1===parseInt(r.p,10)&&t.size>=4194304)_t(e,t,o,i,_.STC,r.stc);else if(a&&1===parseInt(a.p,10)&&t.size>=4194304)_t(e,t,o,i,_.MINIO,a.minio);else{var I=o.data(t,o);vt[It[0][0]](I,o,i,t,_.MINIO)}}(e,n,t,this.options,{onProgress:function(e,n,t){(Mt=e,t)?Mt=Ut+e/n*(n-Ut):Ut=Mt;o.onProgress(Mt,n)},onCompleted:function(e){o.onCompleted(e)},onError:function(e){o.onError(e)},onOpen:function(e){i.xhr=e}})}else o.onError("upload file is null.")},e.prototype.cancel=function(){var e;null===(e=this.xhr)||void 0===e||e.abort()},e}();var Lt,wt,Bt={init:function(e){return new Pt(e)},dataType:Ct,resize:function(e,n,t){var o=document.createElement("canvas"),i=new FileReader;i.readAsDataURL(e),i.onload=function(e){var i=e.target.result,r=new Image;r.src=i;var a=r.width,s=r.height,c=function(e,n){var t=1,o=e.width,i=n.maxWidth||0;i>0&&o>i&&(t=i/o);var r=e.height,a=n.maxHeight||0;if(a>0&&r>a){var s=a/r;t=Math.min(t,s)}var c=n.maxSize||0,u=Math.ceil(e.size/1e3);if(u>c){var d=c/u;t=Math.min(t,d)}return t}({width:a,height:s,size:e.total},n),u=i;c<1&&(u=function(e,n,t){o.width=n,o.height=t;var i=o.getContext("2d");return i.drawImage(e,0,0,n,t),o.toDataURL("image/jpg")}(r,a*c,s*c)),t(u)}},Upload:Pt},Dt=function(e,n,t){var o=document.createElement("canvas"),i=o.getContext("2d"),r=new Image,a="string"==typeof e;r.onload=function(a){var s=function(e,n,t){var o,i,r,a=e<n,s=0,c=0;return(a?n/e:e/n)>t.scale?(a?(i=100,c=((r=n/(o=e/100))-t.maxHeight)/2):(r=100,s=((i=e/(o=n/100))-t.maxWidth)/2),{w:i,h:r,x:-s,y:-c}):(a?(o=n/t.maxHeight,r=t.maxHeight,i=e/o):(o=e/t.maxWidth,i=t.maxWidth,r=n/o),{w:i,h:r,x:-s,y:-c})}(r.width,r.height,n);o.width=s.w>n.maxWidth?n.maxWidth:s.w,o.height=s.h>n.maxHeight?n.maxHeight:s.h,i.drawImage(r,s.x,s.y,s.w,s.h);var c=o.toDataURL("string"==typeof e?"image/jpg":e.type,n.quality);c=c.replace(/data:image\/[^;]+;base64,/,""),t(c)},r.src=a?"data:image/jpg;base64,".concat(e):function(e){var n=window.URL||window.webkitURL;return n?n.createObjectURL(e):""}(e)},bt=function(e,n){var t=e.file,o=e.compress;Dt(t,o,n)},Gt=function(e,n){if(e.getToken)e.getToken((function(t,o){o=o||{},e.multi_parmas=e.multi_parmas||{},e.multi_parmas.token=t,e.uploadHost=e.uploadHost||{},e.uploadHost.bos=o.bos,e.ossConfig=o.ossConfig,e.bosHeader=e.bosHeader||{},e.bosHeader.bosDate=o.bosDate,e.bosHeader.bosToken=o.bosToken,e.bosUploadPath=o.path,e.aliHeader={},e.aliHeader.osskeyId=o.osskeyId,e.aliHeader.ossPolicy=o.ossPolicy,e.aliHeader.ossSign=o.ossSign,e.ossBucketName=o.ossBucketName,e.uploadFileName=o.fileName,e.s3Header={},e.s3Header.s3Credential=o.s3Credential,e.s3Header.s3Algorithm=o.s3Algorithm,e.s3Header.s3Date=o.s3Date,e.s3Header.s3Policy=o.s3Policy,e.s3Header.s3Signature=o.s3Signature,e.s3BucketName=o.s3BucketName,e.stcHeader={},e.stcHeader.stcAuthorization=o.stcAuthorization,e.stcHeader.stcContentSha256=o.stcContentSha256,e.stcHeader.stcDate=o.stcDate,e.stcBucketName=o.stcBucketName,e.minioHeader={},e.minioHeader.minioAuthorization=o.minioAuthorization,e.minioHeader.minioContentSha256=o.minioContentSha256,e.minioHeader.minioDate=o.minioDate,e.minioBucketName=o.minioBucketName,e.headers=e.headers||{},e.base64&&(e.headers["Content-type"]="application/octet-stream",e.headers.Authorization="UpToken ".concat(t));var i=Bt.init(e);n(i)}));else{e.headers=e.headers||{},e.base64&&(e.headers["Content-type"]="application/octet-stream");var t=Bt.init(e);n(t)}},xt=function(e,n,t,o,i){o.upload(e,n,t.file,{onError:function(e){i.onError(e)},onProgress:function(e,n){i.onProgress(e,n)},onCompleted:function(e){e.filename=e.filename||e.hash;var n=t.compressThumbnail||bt;t.compress?n(t,(function(n){e.thumbnail=n,i.onCompleted(e)})):i.onCompleted(e)}})},Vt=function(){function e(e){this.instance=e}return e.prototype.upload=function(e,n,t,o){xt(e,n,{file:t},this.instance,o)},e.prototype.cancel=function(){this.instance.cancel()},e}(),kt=function(){function e(e,n){this.instance=e,this.cfg=n}return e.prototype.upload=function(e,n,t,o){var i={file:t,compress:this.cfg};xt(e,n,i,this.instance,o)},e.prototype.cancel=function(){this.instance.cancel()},e}(),Ht={initFile:function(e,n){Gt(e,(function(e){var t=new Vt(e);n(t)}))},initImage:function(e,n){Gt(e,(function(t){var o,i,r,a,s={maxHeight:(null===(o=e.thumbnailConfig)||void 0===o?void 0:o.maxHeight)||160,maxWidth:(null===(i=e.thumbnailConfig)||void 0===i?void 0:i.maxWidth)||160,quality:(null===(r=e.thumbnailConfig)||void 0===r?void 0:r.quality)||.5,scale:(null===(a=e.thumbnailConfig)||void 0===a?void 0:a.scale)||2.4},c=new kt(t,s);n(c)}))},dataType:Bt.dataType};function Ft(e,n,t,o,i,r,a){var s=this;void 0===a&&(a=y.FILE);var c=y.FILE;a===y.IMAGE&&(c=y.IMAGE);var u=e.getNaviInfoFromCache();if(!wt&&(wt="upload.qiniup.com",u&&u.ossConfig))try{var d=JSON.parse(u.ossConfig).find((function(e){return void 0!==e.qiniu}));d&&(wt=d.qiniu)}catch(e){}var f=w({domain:wt,getToken:function(n){e.getFileToken(c,o.name).then((function(e){n(e.token,e)})).catch((function(e){i.onFail(e)}))}},r),l=Ht.initFile;c===y.IMAGE&&(l=Ht.initImage),l(f,(function(n){n.upload(e,t,o,{onProgress:function(e,n){var t,o=Math.floor(e/n*100);null===(t=i.onProgress)||void 0===t||t.call(i,o)},onCompleted:function(e){return B(s,void 0,void 0,(function(){return D(this,(function(n){return 1!==(null==u?void 0:u.type)||(null==u?void 0:u.ossConfig)?(function(e,n,t,o,i){zt(n,o.filename,o.name,o,o.uploadMethod).then((function(r){if(0===r.code){var a=r.data;a.type=t.type,a.name=o.name||o.filename,e!==y.AUDIO?(n===y.IMAGE&&(a.thumbnail=o.thumbnail,a.width=o.w,a.height=o.h,a.size=o.size),i.onSuccess(a)):Zt(t).then((function(e){i.onSuccess(w(w({},a),e))}))}else i.onFail(r)})).catch((function(e){i.onFail(e)}))}(a,c,o,e,i),[2]):(function(e,n,t,o,i,r){var a={type:o.type,name:i.rc_url.file_name,downloadUrl:e.uploadDomain+i.rc_url.path};if(n===y.AUDIO)return void Zt(o).then((function(e){r.onSuccess(w(w({},a),e))}));n===y.IMAGE&&(a.thumbnail=i.thumbnail,a.width=i.w,a.height=i.h,a.size=i.size);r.onSuccess(a)}(t,a,0,o,e,i),[2])}))}))},onError:function(e){i.onFail(e)}})}))}function Zt(e){return new Promise((function(n){if("function"!=typeof e.arrayBuffer){var t=new FileReader;t.onload=function(){t.result?qt(t.result).then((function(e){n(e)}),(function(){n({})})):n({})},t.onerror=function(){n({duration:0})},t.readAsArrayBuffer(e)}else e.arrayBuffer().then(qt).then((function(e){n(e)}))}))}function qt(e){return Lt=Lt||new AudioContext,new Promise((function(n,t){Lt.decodeAudioData(e,(function(e){n({duration:e.duration,length:e.length})}),t)}))}function Jt(e,n,t,o){return pe((function(r){return new Promise((function(a){r.getFileToken(e,n,t,o).then((function(e){a({code:i.SUCCESS,data:e})})).catch((function(e){a({code:e,msg:Ge[e]})}))}))}))}function zt(e,n,t,o,r){return m("fileType",e,A,!0)&&m("filename",n,l.STRING)&&m("saveName",t,l.STRING)&&m("serverType",r,l.NUMBER)?pe((function(a){return new Promise((function(s){a.getFileUrl(e,n,t,o,r).then((function(e){s({code:i.SUCCESS,data:e})})).catch((function(e){s({code:e})}))}))})):Promise.resolve({code:i.BIZ_ERROR_INVALID_PARAMETER})}function Kt(e,n,t){return B(this,void 0,void 0,(function(){var o=this;return D(this,(function(s){return[2,pe((function(s,c){return B(o,void 0,void 0,(function(){var o,u,d,f,g,v,I,h,E,T,S,p;return D(this,(function(O){switch(O.label){case 0:return t=t||{},n instanceof Qn==!1?(c.warn(R.O,"send message fail -> message parameter is not an instance of BaseMessage"),[2,be.ILLGAL_PARAMS]):m("conversation",e,l.OBJECT,!0)?(o=e.conversationType,u=e.targetId,d=e.channelId,m("conversation.targetId",u,l.STRING,!0)&&m("conversation.conversationType",o,l.NUMBER,!0)&&m("conversation.channelId",d,l.CHANNEL_ID)&&m("options.isStatusMessage",null==t?void 0:t.isStatusMessage,l.BOOLEAN)&&m("options.disableNotification",null==t?void 0:t.disableNotification,l.BOOLEAN)&&m("options.pushContent",null==t?void 0:t.pushContent,l.STRING)&&m("options.pushData",null==t?void 0:t.pushData,l.STRING)&&m("options.isMentioned",null==t?void 0:t.isMentioned,l.BOOLEAN)&&m("options.mentionedType",null==t?void 0:t.mentionedType,l.NUMBER)&&m("options.mentionedUserIdList",null==t?void 0:t.mentionedUserIdList,l.ARRAY)&&m("options.directionalUserIdList",null==t?void 0:t.directionalUserIdList,l.ARRAY)&&m("options.isVoipPush",null==t?void 0:t.isVoipPush,l.BOOLEAN)&&m("options.canIncludeExpansion",null==t?void 0:t.canIncludeExpansion,l.BOOLEAN)&&m("options.expansion",null==t?void 0:t.expansion,l.OBJECT)&&m("options.pushConfig",null==t?void 0:t.pushConfig,l.OBJECT)&&m("options.messageId",null==t?void 0:t.messageId,l.NUMBER)?(f="conversationType:".concat(o,",targetId:").concat(u),c.debug(R.O,"send message ->".concat(f)),g=function(e,n,t){var o=e.isStatusMessage,i=e.disableNotification,r=e.pushContent,a=e.pushData,s=e.isMentioned,c=e.mentionedType,u=e.mentionedUserIdList,d=e.directionalUserIdList,f=e.isVoipPush,l=e.canIncludeExpansion,g=e.expansion,v=e.isFilerWhiteBlacklist,I=e.pushConfig,R=e.messageId,h=t.channelId;return w({isStatusMessage:o,disableNotification:i,pushContent:r,pushData:a,isMentioned:s,mentionedType:c,mentionedUserIdList:u,directionalUserIdList:d,isVoipPush:f,canIncludeExpansion:l,expansion:g,isFilerWhiteBlacklist:v,pushConfig:I,channelId:h||"",messageId:R},n)}(t,n,e),v={isMentioned:!!t.isMentioned,content:n.content,messageType:n.messageType,isPersited:!!n.isPersited,isCounted:!!n.isCounted,disableNotification:!!(null==t?void 0:t.disableNotification),canIncludeExpansion:!!(null==t?void 0:t.canIncludeExpansion),expansion:(null==t?void 0:t.expansion)||null,conversationType:e.conversationType,targetId:e.targetId,channelId:e.channelId,senderUserId:s.getCurrentUserId(),messageUId:"",messageDirection:U.SEND,receivedTime:0,isStatusMessage:!!t.isStatusMessage,receivedStatus:r.UNREAD,isOffLineMessage:!1,pushConfig:null==t?void 0:t.pushConfig,sentStatus:P.SENDING},o!==a.ULTRA_GROUP&&(v.isOffLineMessage=!1),I=c.createTraceId(),h=function(e){v.messageId=e;try{(null==t?void 0:t.onSendBefore)&&t.onSendBefore(le(v))}catch(e){c.error(R.O,'Callback method "onSendBefore" execution error.\n'.concat(null==e?void 0:e.stack),I)}},c.info(R.A_SEND_MSG_T,JSON.stringify({messageType:n.messageType,conversationType:o,targetId:u,channelId:d}),I),[4,s.sendMessage(o,u,g,h,I)]):[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]):[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}];case 1:return E=O.sent(),T=E.code,S=E.data,T===i.SUCCESS?(c.info(R.A_SEND_MSG_R,JSON.stringify({code:T,messageUId:S.messageUId,messageId:S.messageId}),I),p=le(S),[2,{code:T,data:p}]):(c.warn(R.A_SEND_MSG_R,"send message fail ->".concat(T,":").concat(Ge[T],",").concat(f)),v.sentTime=(null==S?void 0:S.sentTime)||0,v.sentStatus=null==S?void 0:S.sentStatus,[2,{code:T,msg:Ge[T],data:le(v)}])}}))}))}))]}))}))}function Yt(e,n,t){return Kt(e,new at(n),t)}function jt(e,n){return function(t,o,r,a){if(!m("sendOptions.contentDisposition",null==a?void 0:a.contentDisposition,(function(e){return["inline","attachment"].includes(e)})))return Promise.resolve({code:i.BIZ_ERROR_INVALID_PARAMETER});var s={contentDisposition:null==a?void 0:a.contentDisposition};if(a&&"thumbnailConfig"in a){var c=null==a?void 0:a.thumbnailConfig;if(!(m("sendOptions.maxHeight",null==c?void 0:c.maxHeight,l.NUMBER)&&m("sendOptions.maxWidth",null==c?void 0:c.maxWidth,l.NUMBER)&&m("sendOptions.quality",null==c?void 0:c.quality,l.NUMBER)&&m("sendOptions.scale",null==c?void 0:c.scale,l.NUMBER)))return Promise.resolve({code:i.BIZ_ERROR_INVALID_PARAMETER});s.thumbnailConfig=c}return pe((function(c,u,d){return new Promise((function(f){var l=u.createTraceId();u.info(R.L_MEDIA_UPLOAD_T,JSON.stringify({filesize:o.file.size,type:e}),l),Ft(c,0,d,o.file,{onProgress:null==r?void 0:r.onProgress,onSuccess:function(e){var s,c=(null===(s=null==r?void 0:r.onComplete)||void 0===s?void 0:s.call(r,w({url:e.downloadUrl},e)))||n(e,o);e&&e.downloadUrl&&u.info(R.L_MEDIA_UPLOAD_R,JSON.stringify({downurl:e.downloadUrl,code:i.SUCCESS}),l),Kt(t,c,a).then(f)},onFail:function(e){u.warn(R.L_MEDIA_UPLOAD_R,JSON.stringify({code:i.UPLOAD_FILE_FAILED}),l),f({code:i.UPLOAD_FILE_FAILED,msg:e||i[i.UPLOAD_FILE_FAILED]})}},s,e)}))}))}}var Wt=jt(y.FILE,(function(e,n){return new ct({name:e.name,size:n.file.size,type:(t=e.name,o=t.match(/\.(\w+)$/),o?o[1]:"bin"),fileUrl:e.downloadUrl,user:n.user,extra:n.extra});var t,o})),Xt=jt(y.IMAGE,(function(e,n){return new ot({content:e.thumbnail,imageUri:e.downloadUrl,user:n.user,extra:n.extra})})),Qt=jt(y.IMAGE,(function(e,n){return new ut({gifDataSize:e.size,remoteUrl:e.downloadUrl,width:e.width,height:e.height,user:n.user,extra:n.extra})})),$t=jt(y.AUDIO,(function(e,n){return new it({remoteUrl:e.downloadUrl,duration:e.duration,type:e.type,user:n.user,extra:n.extra})})),eo=jt(y.SIGHT,(function(e,n){return new rt({sightUrl:e.downloadUrl,content:n.thumbnail,duration:n.duration,size:n.file.size||e.size,name:n.name||e.name,user:n.user,extra:n.extra})}));function no(e,n){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(o){return m("options.timestamp",null==n?void 0:n.timestamp,l.NUMBER)&&m("options.count",null==n?void 0:n.count,l.NUMBER)&&(M()||m("options.count",null==n?void 0:n.count,(function(e){var n=e>0&&e<=100;return n||null===console||void 0===console||console.error('"options.count" is invalid, It should be greater than 0 and less than 100'),n})))&&m("options.order",null==n?void 0:n.order,(function(e){return 0===e||1===e}))&&m("conversation",e,l.CONVERSATION,!0)?[2,pe((function(o,r){return B(t,void 0,void 0,(function(){var t,a,s,c,u;return D(this,(function(d){switch(d.label){case 0:return t=r.createTraceId(),r.info(R.A_GET_HISTORY_MSG_T,JSON.stringify({targetId:e.targetId,conversationType:e.conversationType,channelId:e.channelId,timestamp:null==n?void 0:n.timestamp,count:null==n?void 0:n.count}),t),[4,o.getHistoryMessage(e.conversationType,e.targetId,null==n?void 0:n.timestamp,null==n?void 0:n.count,null==n?void 0:n.order,null==e?void 0:e.channelId,"",t)];case 1:return a=d.sent(),s=a.code,c=a.data,s===i.SUCCESS&&c?(u=c.list.map((function(e){return le(e)})),r.info(R.A_GET_HISTORY_MSG_R,JSON.stringify({code:s,messageLength:u.length}),t),[2,{code:s,data:{list:u,hasMore:c.hasMore}}]):(r.warn(R.A_GET_HISTORY_MSG_R,JSON.stringify({code:s,messageUIds:""}),t),[2,{code:s,msg:Ge[s]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function to(e,n){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(o){return m("options.timestamp",null==n?void 0:n.timestamp,l.NUMBER)&&m("options.count",null==n?void 0:n.count,l.NUMBER)&&m("options.count",null==n?void 0:n.count,(function(e){var n=e>0&&e<=100;return n||null===console||void 0===console||console.error("options.count is invalid, It should be greater than 0 and less than 100"),n}))&&m("options.order",null==n?void 0:n.order,(function(e){return 0===e||1===e}))&&m("conversation",e,l.CONVERSATION,!0)?[2,pe((function(o,r){return B(t,void 0,void 0,(function(){var t,a,s,c,u;return D(this,(function(d){switch(d.label){case 0:return t="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),r.debug(R.O,"get history message ->".concat(t)),[4,o.getRemoteHistoryMessages(e.conversationType,e.targetId,(null==n?void 0:n.timestamp)||0,(null==n?void 0:n.count)||20,(null==n?void 0:n.order)||0,e.channelId||"")];case 1:return a=d.sent(),s=a.code,c=a.data,s===i.SUCCESS&&c?(u=c.list.map((function(e){return le(e)})),[2,{code:s,data:{list:u,hasMore:c.hasMore}}]):(r.warn(R.O,"get history message fail ->".concat(s,":").concat(Ge[s],",").concat(t)),[2,{code:s,msg:Ge[s]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function oo(e,n,t,o){return B(this,void 0,void 0,(function(){var r=this;return D(this,(function(s){return m("targetId",e,l.STRING,!0)&&m("messageUId",n,l.STRING,!0)&&m("timestamp",t,l.NUMBER,!0)&&m("channelId",o,l.CHANNEL_ID)?[2,pe((function(i){return B(r,void 0,void 0,(function(){var i,r,s,c,u;return D(this,(function(d){switch(d.label){case 0:return i={targetId:e,conversationType:a.PRIVATE,channelId:o},r=new Qn("RC:ReadNtf",{messageUId:n,lastMessageSendTime:t,type:1}),[4,Kt(i,r)];case 1:return s=d.sent(),c=s.code,u=s.msg,0===c?[2,{code:c}]:[2,{code:c,msg:u}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function io(e,n,t){return B(this,void 0,void 0,(function(){var o=this;return D(this,(function(r){return m("messageUId",n,l.STRING,!0)&&m("targetId",e,l.STRING,!0)&&m("channelId",t,l.CHANNEL_ID)?[2,pe((function(i,r){return B(o,void 0,void 0,(function(){var o,i,s,c,u;return D(this,(function(d){switch(d.label){case 0:return o="messageUId:".concat(n,",targetId:").concat(e),r.debug(R.O,"send read receipt message ->".concat(o)),i=new Qn("RC:RRReqMsg",{messageUId:n}),[4,Kt({targetId:e,conversationType:a.GROUP,channelId:t},i)];case 1:return s=d.sent(),c=s.code,u=s.msg,0===c?[2,{code:c}]:[2,{code:c,msg:u}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function ro(e,n,t){return B(this,void 0,void 0,(function(){return D(this,(function(e){throw new Error("This method is deprecated, please use method sendReadReceiptResponseV2.")}))}))}function ao(e,n,t){return B(this,void 0,void 0,(function(){var o=this;return D(this,(function(r){return m("targetId",e,l.STRING,!0)&&m("messageList",n,l.OBJECT,!0)&&m("channelId",t,l.CHANNEL_ID)&&!Object.keys(n).some((function(e){return!m(e,n[e],l.ARRAY)}))?[2,pe((function(r,s){return B(o,void 0,void 0,(function(){var o,c,u,d,f,l;return D(this,(function(g){switch(g.label){case 0:return o={targetId:e,conversationType:a.GROUP,channelId:t},u=r.getNaviInfoFromCache(),1!==(null==u?void 0:u.grpRRVer)?[3,2]:(d=[],Object.keys(n).forEach((function(e){n[e].forEach((function(e){-1===d.indexOf(e)&&d.push(e)}))})),d.length?[4,r.sendReadReceiptMessage(e,d,t)]:(s.warn(R.O,"Error in parameter messageList."),[2,{code:i.PARAMETER_ERROR}]));case 1:return c=g.sent(),[3,4];case 2:return f=new Qn("RC:RRRspMsg",{receiptMessageDic:n}),[4,Kt(o,f)];case 3:c=g.sent(),g.label=4;case 4:return(l=c.code)===i.SUCCESS?[2,{code:l}]:(s.warn(R.O,"send read receipt message fail ->".concat(l,":").concat(Ge[l])),[2,{code:l,msg:Ge[l]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function so(e,n){return B(this,void 0,void 0,(function(){var t,o,r,a;return D(this,(function(s){switch(s.label){case 0:return m("conversation",e,l.CONVERSATION,!0)&&m("lastMessageSendTime",n,l.NUMBER,!0)?(t=new Qn("RC:SRSMsg",{lastMessageSendTime:n}),[4,Kt(e,t)]):[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}];case 1:return o=s.sent(),r=o.code,a=o.msg,0===r?[2,{code:r}]:[2,{code:r,msg:a}]}}))}))}function co(e,n){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(o){return m("conversation",e,l.CONVERSATION,!0)&&m("options.messageUId",n.messageUId,l.STRING,!0)&&m("options.sentTime",n.sentTime,l.NUMBER,!0)&&m("options.disableNotification",null==n?void 0:n.disableNotification,l.BOOLEAN)&&m("options.pushConfig",null==n?void 0:n.pushConfig,l.OBJECT)?[2,pe((function(o,r){return B(t,void 0,void 0,(function(){var t,a,s,c,u;return D(this,(function(d){switch(d.label){case 0:return t={user:n.user,channelId:e.channelId||"",disableNotification:null==n?void 0:n.disableNotification,pushConfig:null==n?void 0:n.pushConfig,extra:n.extra,isDelete:n.isDelete},a="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId,",messageUId:").concat(n.messageUId),r.debug(R.O,"recall message ->".concat(a)),[4,o.recallMessage(e.conversationType,e.targetId,n.messageUId,n.sentTime,t)];case 1:return s=d.sent(),c=s.code,u=s.data,c===i.SUCCESS&&u?[2,{code:c,data:le(u)}]:c===i.SUCCESS?[2,{code:c}]:(r.warn(R.O,"recall message fail ->".concat(c,":").concat(Ge[c],",").concat(a)),[2,{code:c,msg:Ge[c]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function uo(e,n){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(o){return m("conversation",e,l.CONVERSATION,!0)&&m("options",n,(function(e){return g(e)&&e.length}),!0)&&!n.some((function(e){return!m("options.messageUId",e.messageUId,l.STRING,!0)||!m("options.sentTime",e.sentTime,l.NUMBER,!0)||!m("options.messageDirection",e.messageDirection,(function(e){return 1===e||2===e}),!0)}))?[2,pe((function(o,r){return B(t,void 0,void 0,(function(){var t,a;return D(this,(function(s){switch(s.label){case 0:return t="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),r.debug(R.O,"delete messages ->".concat(t)),[4,o.deleteRemoteMessage(e.conversationType,e.targetId,n,e.channelId)];case 1:return(a=s.sent())!==i.SUCCESS?(r.warn(R.O,"delete message fail ->".concat(a,":").concat(Ge[a],",").concat(t)),[2,{code:a,msg:Ge[a]}]):[2,{code:i.SUCCESS}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function fo(e,n){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(o){return m("conversation",e,l.CONVERSATION,!0)&&m("timestamp",n,l.NUMBER,!0)?[2,pe((function(o,r){return B(t,void 0,void 0,(function(){var t,a;return D(this,(function(s){switch(s.label){case 0:return t="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),r.debug(R.O,"clear message ->".concat(t)),[4,o.deleteRemoteMessageByTimestamp(e.conversationType,e.targetId,n,e.channelId)];case 1:return(a=s.sent())!==i.SUCCESS?(r.warn(R.O,"clear message ->".concat(a,":").concat(Ge[a],",").concat(t)),[2,{code:a,msg:Ge[a]}]):[2,{code:i.SUCCESS}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function lo(e,n){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(o){return m("expansion",e,l.OBJECT,!0)&&m("message",n,l.OBJECT,!0)&&m("message.conversationType",n.conversationType,l.NUMBER,!0)&&m("message.targetId",n.targetId,l.STRING,!0)&&m("message.channelId",n.channelId,l.CHANNEL_ID)&&m("message.messageUId",n.messageUId,l.STRING,!0)&&m("message.expansion",n.expansion,l.OBJECT)&&m("message.canIncludeExpansion",n.canIncludeExpansion,l.BOOLEAN,!0)?[2,pe((function(o,r){return B(t,void 0,void 0,(function(){var t,a,s,c,u,d,f,l;return D(this,(function(g){switch(g.label){case 0:return t=n.conversationType,a=n.targetId,s=n.messageUId,c=n.canIncludeExpansion,u=n.expansion,d=n.channelId,f="conversationType:".concat(t,",targetId:").concat(a,",messageUId:").concat(s),r.debug(R.O,"update message expansion ->".concat(f)),[4,o.sendExpansionMessage({conversationType:t,targetId:a,messageUId:s,expansion:e,canIncludeExpansion:c,originExpansion:u,channelId:d})];case 1:return(l=g.sent().code)!==i.SUCCESS?(r.warn(R.O,"update message expansion fail ->".concat(l,":").concat(Ge[l],",").concat(f)),[2,{code:l,msg:Ge[l]}]):[2,{code:l}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function go(e,n){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(o){return m("keys",e,l.ARRAY,!0)&&m("message",n,l.OBJECT,!0)&&m("message.conversationType",n.conversationType,l.NUMBER,!0)&&m("message.targetId",n.targetId,l.STRING,!0)&&m("message.channelId",n.channelId,l.CHANNEL_ID)&&m("message.messageUId",n.messageUId,l.STRING,!0)&&m("message.canIncludeExpansion",n.canIncludeExpansion,l.BOOLEAN,!0)?[2,pe((function(o,r){return B(t,void 0,void 0,(function(){var t,a,s,c,u,d,f;return D(this,(function(l){switch(l.label){case 0:return t=n.conversationType,a=n.targetId,s=n.messageUId,c=n.canIncludeExpansion,u=n.channelId,d="conversationType:".concat(t,",targetId:").concat(a,",messageUId:").concat(s),r.debug(R.O,"remove message expansion ->".concat(d)),[4,o.sendExpansionMessage({conversationType:t,targetId:a,messageUId:s,canIncludeExpansion:c,keys:e,channelId:u})];case 1:return(f=l.sent().code)!==i.SUCCESS?(r.warn(R.O,"remove message expansion fail ->".concat(f,":").concat(Ge[f],",").concat(d)),[2,{code:f,msg:Ge[f]}]):[2,{code:f}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function vo(e,n){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(o){return m("conversation",e,l.CONVERSATION,!0)&&m("typingContentType",n,l.STRING,!0)?[2,pe((function(o,r){return B(t,void 0,void 0,(function(){var t,a,s,c,u,d;return D(this,(function(f){switch(f.label){case 0:return t={messageType:"RC:TypSts",content:{typingContentType:n},isStatusMessage:!0,channelId:e.channelId},a=r.createTraceId(),r.info(R.A_SEND_MSG_T,JSON.stringify({messageType:t.messageType,conversationType:e.conversationType,targetId:e.targetId,channelId:e.channelId}),a),[4,o.sendMessage(e.conversationType,e.targetId,t,void 0,a)];case 1:return s=f.sent(),c=s.code,u=s.data,d=c===i.SUCCESS?"info":"warn",r[d](R.A_SEND_MSG_R,JSON.stringify({code:c,messageUId:u?u.messageUId:"",messageId:u?u.messageId:""}),a),c===i.SUCCESS?[2,{code:c,data:le(u)}]:[2,{code:c,msg:Ge[c]}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Io(e,n,t){return B(this,void 0,void 0,(function(){var o=this;return D(this,(function(r){return m("messageUId",n,l.STRING,!0)&&m("targetId",e,l.STRING,!0)&&m("channelId",t,l.CHANNEL_ID)?[2,pe((function(r,a){return B(o,void 0,void 0,(function(){var o,s,c,u;return D(this,(function(d){switch(d.label){case 0:return o="messageUId:".concat(n,",targetId:").concat(e),a.debug(R.O,"get message reader ->".concat(o)),[4,r.getMessageReader(e,n,t)];case 1:return s=d.sent(),c=s.code,u=s.data,c===i.SUCCESS?[2,{code:c,data:u}]:(a.warn(R.O,"get message reader fail ->".concat(c,":").concat(Ge[c],",").concat(o)),[2,{code:c,msg:Ge[c]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Ro(e,n,t,o,i){return Se((function(r,a){return f("messageType",e,l.STRING,!0),f("isPersited",n,l.BOOLEAN,!0),f("isCounted",t,l.BOOLEAN,!0),f("isStatusMessage",i,l.BOOLEAN,!1),f("searchProps",o,l.ARRAY),a.info(R.A_REGTYP_O,JSON.stringify({messageType:e,isCounted:t,isStatusMessage:i,isPersited:n})),r.registerMessageType(e,n,t,o,i),$n(e,n,t)}))}function ho(e){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(t){return M()?m("conversation",e,l.CONVERSATION,!0)?[2,pe((function(t,o){return B(n,void 0,void 0,(function(){var n,r,a,s;return D(this,(function(c){switch(c.label){case 0:return[4,t.getFirstUnreadMessage(e.conversationType,e.targetId,e.channelId)];case 1:return n=c.sent(),r=n.code,a=n.data,r===i.SUCCESS?(s=a&&le(a)||null,[2,{code:r,data:s}]):(o.warn(R.O,"insertMessage ->code:".concat(r,",targetId:").concat(e.targetId)),[2,{code:r,msg:Ge[r]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:Ge[i.NOT_SUPPORT]}]}))}))}function mo(e,n,t){return void 0===t&&(t={}),B(this,void 0,void 0,(function(){var o=this;return D(this,(function(r){return ve("RongIMLib.insertMessage","RongIMLib.ElectronExtension.insertMessage"),M()?m("conversation",e,l.CONVERSATION,!0)&&m("message",n,l.OBJECT,!0)&&m("options",t,l.OBJECT)&&m("options.isUnread",null==t?void 0:t.isUnread,l.BOOLEAN)&&m("options.searchContent",null==t?void 0:t.searchContent,l.STRING)&&m("content.senderUserId",n.senderUserId,l.STRING,!0)&&m("content.messageType",n.messageType,l.STRING,!0)&&m("content.content",n.content,l.OBJECT,!0)&&m("content.messageDirection",n.messageDirection,l.NUMBER,!0)&&m("content.canIncludeExpansion",n.canIncludeExpansion,l.BOOLEAN)&&m("content.expansion",n.expansion,l.OBJECT)&&m("content.disableNotification",n.disableNotification,l.BOOLEAN)&&m("content.sentTime",n.sentTime,l.NUMBER)&&m("content.sentStatus",n.sentStatus,l.NUMBER)?[2,pe((function(r,a){return B(o,void 0,void 0,(function(){var o,s,c,u,d,f,l,g,v,I,h,m,E,T,S,p;return D(this,(function(O){switch(O.label){case 0:return o=n.senderUserId,s=n.messageType,c=n.content,u=n.messageDirection,d=n.messageUId,f=n.canIncludeExpansion,l=n.expansion,g=n.disableNotification,v=n.sentTime,I=n.sentStatus,a.info(R.O,"insertMessage ->targetId:".concat(e.targetId,",conversationType:").concat(e.conversationType)),h=t.isUnread,m=t.searchContent,E={senderUserId:o,messageType:s,content:c,messageDirection:u,sentTime:v,sentStatus:I,searchContent:m,isUnread:h,messageUId:d,disableNotification:g,canIncludeExpansion:f,expansionMsg:JSON.stringify(l),channelId:e.channelId||""},[4,r.insertMessage(e.conversationType,e.targetId,E)];case 1:return T=O.sent(),S=T.code,p=T.data,S===i.SUCCESS?[2,{code:S,data:le(p)}]:(a.warn(R.O,"insertMessage ->code:".concat(S,",targetId:").concat(e.targetId)),[2,{code:S,msg:Ge[S]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:Ge[i.NOT_SUPPORT]}]}))}))}function Eo(e){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(t){return M()?m("messageId",e,(function(e){return s(e)||N(e)}),!0)?[2,pe((function(t,o){return B(n,void 0,void 0,(function(){var n,r,a;return D(this,(function(s){switch(s.label){case 0:return[4,t.getMessage(e)];case 1:return n=s.sent(),r=n.code,a=n.data,r===i.SUCCESS?[2,{code:r,data:le(a)}]:(o.warn(R.O,"getMessage ->code:".concat(r,",messageId:").concat(e)),[2,{code:r,msg:Ge[r]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:Ge[i.NOT_SUPPORT]}]}))}))}function To(e){if(!M())return{code:i.NOT_SUPPORT,msg:Ge[i.NOT_SUPPORT]};var n,t=e.conversationType,o=e.targetId,r=e.channelId;return m("conversation",e,l.CONVERSATION,!0)?(n=function(e){var n=e.getUnreadMentionedMessages(t,o,r),a=[];return n&&n.length&&n.forEach((function(e){return a.push(le(e))})),{code:i.SUCCESS,data:a}},he?n(he,Ee,me):{code:i.BIZ_ERROR_CLIENT_NOT_INIT}):{code:i.BIZ_ERROR_INVALID_PARAMETER}}function So(e,n,t,o){return B(this,void 0,void 0,(function(){var r=this;return D(this,(function(a){return ve("RongIMLib.searchMessages","RongIMLib.ElectronExtension.searchMessages"),M()?m("conversation",e,l.CONVERSATION,!0)&&m("keyword",n,l.STRING,!0)&&m("timestamp",t,l.NUMBER)&&m("count",o,l.NUMBER)?[2,pe((function(a,s){return B(r,void 0,void 0,(function(){var r,c,u,d;return D(this,(function(f){switch(f.label){case 0:return 1,[4,a.searchMessageByContent(e.conversationType,e.targetId,n,t,o,1,e.channelId)];case 1:return r=f.sent(),c=r.code,u=r.data,c===i.SUCCESS?(d=[],(null==u?void 0:u.messages)&&u.messages.length&&u.messages.forEach((function(e){return d.push(le(e))})),[2,{code:c,data:{messages:d,count:null==u?void 0:u.count}}]):(s.warn(R.O,"searchMessages ->code:".concat(c,",targetId:").concat(e.targetId)),[2,{code:c,msg:Ge[c]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:Ge[i.NOT_SUPPORT]}]}))}))}function po(e,n,t){return B(this,void 0,void 0,(function(){var o,r,a,s=this;return D(this,(function(c){return ve("RongIMLib.deleteLocalMessagesByTimestamp","RongIMLib.ElectronExtension.deleteMessagesByTimestamp"),M()?(o=e.conversationType,r=e.targetId,a=e.channelId,m("conversationType",o,l.NUMBER,!0)&&m("targetId",r,l.STRING,!0)&&m("timestamp",n,l.NUMBER,!0)&&m("cleanSpace",t,l.BOOLEAN)?[2,pe((function(c,u){return B(s,void 0,void 0,(function(){var s;return D(this,(function(d){switch(d.label){case 0:return[4,c.deleteMessagesByTimestamp(o,r,n,t,a)];case 1:return s=d.sent(),u.debug(R.A_DELETE_MESSAGES_S,JSON.stringify({code:s,conversationType:o,targetId:r,channelId:a,timestamp:n})),s===i.SUCCESS?[2,{code:s}]:(u.warn(R.O,"deleteLocalMessagesByTimestamp ->code:".concat(s,",targetId:").concat(e.targetId)),[2,{code:s,msg:Ge[s]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]):[2,{code:i.NOT_SUPPORT,msg:Ge[i.NOT_SUPPORT]}]}))}))}function Oo(e){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(t){return ve("RongIMLib.clearMessages","RongIMLib.ElectronExtension.clearMessages"),M()?[2,pe((function(t,o){return B(n,void 0,void 0,(function(){var n,r,a,s;return D(this,(function(c){switch(c.label){case 0:return n=e.conversationType,r=e.targetId,a=e.channelId,o.info(R.O,"clearMessages ->targetId:".concat(r,",conversationType:").concat(n)),[4,t.clearMessages(n,r,a)];case 1:return(s=c.sent())===i.SUCCESS?[2,{code:s}]:(o.warn(R.O,"clearMessages ->code:".concat(s,",targetId:").concat(r)),[2,{code:s,msg:Ge[s]}])}}))}))}))]:[2,{code:i.NOT_SUPPORT,msg:Ge[i.NOT_SUPPORT]}]}))}))}function No(e,n,t,o){return B(this,void 0,void 0,(function(){var r=this;return D(this,(function(a){return ve("RongIMLib.searchConversationByContent","RongIMLib.ElectronExtension.searchConversationByContent"),M()?[2,pe((function(a,s){return B(r,void 0,void 0,(function(){var r,c,u;return D(this,(function(d){switch(d.label){case 0:return s.info(R.O,"searchConversationByContent ->keyword:".concat(e)),[4,a.searchConversationByContent(e,t,o,n)];case 1:return r=d.sent(),c=r.code,u=r.data,c===i.SUCCESS?[2,{code:c,data:u}]:(s.warn(R.O,"searchConversationByContent ->code:".concat(c,",keyword:").concat(e)),[2,{code:c,msg:Ge[c]}])}}))}))}))]:[2,{code:i.NOT_SUPPORT,msg:Ge[i.NOT_SUPPORT]}]}))}))}function _o(e,n){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(o){return M()?m("conversation",e,l.CONVERSATION,!0)&&m("timestamp",n,l.NUMBER)?[2,pe((function(o,r){return B(t,void 0,void 0,(function(){var t,a,s,c;return D(this,(function(u){switch(u.label){case 0:return t=e.conversationType,a=e.targetId,s=e.channelId,r.info(R.O,"clearUnreadCountByTimestamp ->targetId:".concat(a,",conversationType:").concat(t)),[4,o.clearUnreadCountByTimestamp(t,a,n,s)];case 1:return(c=u.sent())===i.SUCCESS?[2,{code:c}]:(r.warn(R.O,"clearUnreadCountByTimestamp ->code:".concat(c,",targetId:").concat(a)),[2,{code:c,msg:Ge[c]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:Ge[i.NOT_SUPPORT]}]}))}))}function Co(e,n){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(o){return ve("RongIMLib.setMessageReceivedStatus","RongIMLib.ElectronExtension.setMessageReceivedStatus"),M()?m("messageId",e,l.NUMBER,!0)&&m("receivedStatus",n,l.NUMBER,!0)?[2,pe((function(o,r){return B(t,void 0,void 0,(function(){var t;return D(this,(function(a){switch(a.label){case 0:return r.info(R.O,"setMessageReceivedStatus ->messageId:".concat(e,",receivedStatus:").concat(n)),[4,o.setMessageReceivedStatus(e,n)];case 1:return(t=a.sent())===i.SUCCESS?[2,{code:t}]:(r.warn(R.O,"setMessageReceivedStatus ->code:".concat(t,",messageId:").concat(e)),[2,{code:t,msg:Ge[t]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:Ge[i.NOT_SUPPORT]}]}))}))}function Ao(e){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(t){return m("tag.tagId",e.tagId,l.STRING,!0)&&m("tag.tagId",e.tagId,(function(e){return e.length<=10}))&&m("tag.tagName",e.tagName,(function(e){return e.length<=15}))&&m("tag.tagName",e.tagName,l.STRING,!0)?[2,pe((function(t,o){return B(n,void 0,void 0,(function(){var n;return D(this,(function(r){switch(r.label){case 0:return o.info(R.O,"createTag ->tagId:".concat(e.tagId,",tagName:").concat(e.tagName)),[4,t.createTag(e)];case 1:return(n=r.sent().code)===i.SUCCESS?[2,{code:n}]:(o.warn(R.O,"createTag ->code:".concat(n,",tagId:").concat(e.tagId)),[2,{code:n,msg:Ge[n]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function yo(e){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(t){return m("tagId",e,l.STRING,!0)?[2,pe((function(t,o){return B(n,void 0,void 0,(function(){var n;return D(this,(function(r){switch(r.label){case 0:return o.info(R.O,"removeTag ->tagId:".concat(e)),[4,t.removeTag(e)];case 1:return(n=r.sent().code)===i.SUCCESS?[2,{code:n}]:(o.warn(R.O,"removeTag ->code:".concat(n,",tagId:").concat(e)),[2,{code:n,msg:Ge[n]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Mo(e){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(t){return m("tag.tagId",e.tagId,l.STRING,!0)&&m("tag.tagName",e.tagName,l.STRING,!0)&&m("tag.tagName",e.tagName,(function(e){return e.length<=15}))?[2,pe((function(t,o){return B(n,void 0,void 0,(function(){var n;return D(this,(function(r){switch(r.label){case 0:return o.info(R.O,"updateTag ->tagId:".concat(e.tagId,",tagName:").concat(e.tagName)),[4,t.updateTag(e)];case 1:return(n=r.sent().code)===i.SUCCESS?[2,{code:n}]:(o.warn(R.O,"updateTag ->code:".concat(n,",tagId:").concat(e.tagId)),[2,{code:n,msg:Ge[n]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Uo(){return B(this,void 0,void 0,(function(){var e=this;return D(this,(function(n){return[2,pe((function(n,t){return B(e,void 0,void 0,(function(){var e,o,r;return D(this,(function(a){switch(a.label){case 0:return[4,n.getTagList()];case 1:return e=a.sent(),o=e.code,r=e.data,t.warn(R.O,"getTagList ->code:".concat(o)),[2,{code:i.SUCCESS,data:r}]}}))}))}))]}))}))}function Po(e){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(t){return m("conversation",e,l.CONVERSATION,!0)?[2,pe((function(t,o){return B(n,void 0,void 0,(function(){var n,r,a;return D(this,(function(s){switch(s.label){case 0:return o.info(R.O,"getTagsForConversation ->targetId:".concat(e.targetId,",conversationType:").concat(e.conversationType)),[4,t.getTagsForConversation(e)];case 1:return n=s.sent(),r=n.code,a=n.data,r===i.SUCCESS?[2,{code:r,data:a}]:[2,{code:r,msg:Ge[r]}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Lo(e,n){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(o){return m("tagId",e,l.STRING,!0)&&m("conversations",n,l.ARRAY,!0)&&!n.some((function(e){return!m("conversation",e,l.CONVERSATION,!0)}))?[2,pe((function(o,r){return B(t,void 0,void 0,(function(){var t;return D(this,(function(a){switch(a.label){case 0:return r.info(R.O,"addTagForConversations ->tagId:".concat(e)),[4,o.addTagForConversations(e,n)];case 1:return(t=a.sent().code)===i.SUCCESS?[2,{code:t}]:(r.warn(R.O,"addTagForConversations ->code:".concat(t,",tagId:").concat(e)),[2,{code:t,msg:Ge[t]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function wo(e,n){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(o){return m("tagId",e,l.STRING,!0)&&m("conversations",n,l.ARRAY,!0)&&!n.some((function(e){return!m("conversation",e,l.CONVERSATION,!0)}))?[2,pe((function(o,r){return B(t,void 0,void 0,(function(){var t;return D(this,(function(a){switch(a.label){case 0:return r.info(R.O,"removeTagForConversations ->tagId:".concat(e)),[4,o.removeTagForConversations(e,n)];case 1:return(t=a.sent().code)===i.SUCCESS?[2,{code:t}]:(r.warn(R.O,"removeTagForConversations ->code:".concat(t,",tagId:").concat(e)),[2,{code:t,msg:Ge[t]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Bo(e,n){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(o){return m("conversation",e,l.CONVERSATION,!0)&&m("tagIds",n,l.ARRAY,!0)&&!n.some((function(e){return!m("tagId",e,l.STRING,!0)}))?[2,pe((function(o,r){return B(t,void 0,void 0,(function(){var t;return D(this,(function(a){switch(a.label){case 0:return r.info(R.O,"removeTagsForConversation ->tagIds:".concat(n,",targetId:").concat(e.targetId,",conversationType:").concat(e.conversationType)),[4,o.removeTagsForConversation(e,n)];case 1:return(t=a.sent().code)===i.SUCCESS?[2,{code:t}]:(r.warn(R.O,"removeTagsForConversation ->code:".concat(t,",tagIds:").concat(n)),[2,{code:t,msg:Ge[t]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Do(e,n){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(o){return m("tagId",e,l.STRING,!0)&&m("conversations",n,l.ARRAY,!0)&&!n.some((function(e){return!m("conversation",e,l.CONVERSATION,!0)}))?[2,pe((function(o,r){return B(t,void 0,void 0,(function(){var t;return D(this,(function(a){switch(a.label){case 0:return r.info(R.O,"removeTagForConversations ->tagId:".concat(e)),[4,o.removeTagForConversations(e,n)];case 1:return(t=a.sent().code)===i.SUCCESS?[2,{code:t}]:(r.warn(R.O,"removeTagForConversations ->code:".concat(t,",tagId:").concat(e)),[2,{code:t,msg:Ge[t]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function bo(e,n,t){return B(this,void 0,void 0,(function(){var o=this;return D(this,(function(r){return m("tagId",e,l.STRING,!0)&&m("count",n,l.NUMBER,!0)&&m("startTime",t,l.NUMBER,!0)?[2,pe((function(r,a){return B(o,void 0,void 0,(function(){var o,s,c;return D(this,(function(u){switch(u.label){case 0:return a.info(R.O,"getConversationListByTag ->tagId:".concat(e)),[4,r.getConversationListByTag(e,t,n)];case 1:return o=u.sent(),s=o.code,c=o.data,s===i.SUCCESS?[2,{code:s,data:null==c?void 0:c.map((function(e){return function(e){return w(w({},ge(e)),{isTopInTag:e.isTopInTag})}(e)}))}]:(a.warn(R.O,"getConversationListByTag ->code:".concat(s,",tagId:").concat(e)),[2,{code:s,msg:Ge[s]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Go(e,n){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(o){return m("tagId",e,l.STRING,!0)&&m("containMuted",n,l.BOOLEAN,!0)?[2,pe((function(o,i){return B(t,void 0,void 0,(function(){var t,r,a;return D(this,(function(s){switch(s.label){case 0:return i.info(R.O,"getUnreadCountByTag ->tagId:".concat(e)),[4,o.getUnreadCountByTag(e,n)];case 1:return t=s.sent(),r=t.code,a=t.data,[2,{code:r,data:a}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function xo(e,n,t){return B(this,void 0,void 0,(function(){var o=this;return D(this,(function(r){return m("tagId",e,l.STRING,!0)&&m("conversation",n,l.CONVERSATION,!0)&&m("status.isTop",t,l.BOOLEAN,!0)?[2,pe((function(r,a){return B(o,void 0,void 0,(function(){var o;return D(this,(function(s){switch(s.label){case 0:return a.info(R.O,"setConversationStatusInTag ->tagId:".concat(e,",targetId:").concat(n.targetId,",conversationType").concat(n.conversationType)),[4,r.setConversationStatusInTag(e,n,{isTop:t})];case 1:return(o=s.sent().code)===i.SUCCESS?[2,{code:o}]:(a.warn(R.O,"setConversationStatusInTag ->code:".concat(o,",tagId:").concat(e)),[2,{code:o,msg:Ge[o]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}jt(y.COMBINE_HTML,(function(e,n){return new st({remoteUrl:e.downloadUrl,nameList:n.nameList,summaryList:n.summaryList,conversationType:n.conversationType,user:n.user,extra:n.extra})}));var Vo={COMET:"comet",WEBSOCKET:"websocket"},ko={TEXT:"RC:TxtMsg",VOICE:"RC:VcMsg",HQ_VOICE:"RC:HQVCMsg",IMAGE:"RC:ImgMsg",GIF:"RC:GIFMsg",RICH_CONTENT:"RC:ImgTextMsg",LOCATION:"RC:LBSMsg",FILE:"RC:FileMsg",SIGHT:"RC:SightMsg",COMBINE:"RC:CombineMsg",CHRM_KV_NOTIFY:"RC:chrmKVNotiMsg",LOG_COMMAND:"RC:LogCmdMsg",EXPANSION_NOTIFY:"RC:MsgExMsg",REFERENCE:"RC:ReferenceMsg",RECALL_MESSAGE_TYPE:"RC:RcCmd"};var Ho=Object.freeze({__proto__:null,getAllConversationList:function(e){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(t){return M()?m("channelId",e,l.CHANNEL_ID)?[2,pe((function(t,o){return B(n,void 0,void 0,(function(){var n,r,a,s;return D(this,(function(c){switch(c.label){case 0:return o.info(R.O,"getAllConversationList -> channelId: ".concat(e)),L(e)?[4,t.getConversationListWithAllChannel()]:[3,2];case 1:return n=c.sent(),[3,4];case 2:return[4,t.getConversationList(void 0,void 0,void 0,void 0,e)];case 3:n=c.sent(),c.label=4;case 4:return r=n.code,a=n.data,r===i.SUCCESS&&a?(s=a.map((function(e){return ge(e)})),[2,{code:r,data:s}]):(o.warn(R.O,"getAllConversationList fail -> code: ".concat(r," channelId: ").concat(e)),[2,{code:r,msg:Ge[r]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:Ge[i.NOT_SUPPORT]}]}))}))},getConversationList:function(e,n,t){return B(this,void 0,void 0,(function(){var o=this;return D(this,(function(r){return M()?m("startTime",e,l.NUMBER,!0)&&m("count",n,l.NUMBER,!0)&&m("channelId",t,l.CHANNEL_ID)?[2,pe((function(r,a){return B(o,void 0,void 0,(function(){var o,s,c,u,d,f;return D(this,(function(l){switch(l.label){case 0:return o="startTime: ".concat(e,", count: ").concat(n,", channelId: ").concat(t),a.info(R.O,"getConversationList -> ".concat(o)),L(t)?[4,r.getConversationListWithAllChannelByPage(e,n)]:[3,2];case 1:return s=l.sent(),[3,4];case 2:return c=[1,2,3,5,6,7,8],[4,r.getConversationsByPage(c,e,n,t)];case 3:s=l.sent(),l.label=4;case 4:return u=s.code,d=s.data,u===i.SUCCESS&&d?(f=d.map((function(e){return ge(e)})),[2,{code:u,data:f}]):(a.warn(R.O,"getConversationList fail -> code: ".concat(u," ").concat(o)),[2,{code:u,msg:Ge[u]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:Ge[i.NOT_SUPPORT]}]}))}))},searchConversationByContent:function e(n,t,o){return B(this,void 0,void 0,(function(){var r=this;return D(this,(function(a){return M()?m("keyword",n,l.STRING,!0)&&m("messageTypes",t,l.ARRAY,!0)&&m("channelId",o,l.CHANNEL_ID)&&!t.some((function(e){return!m("messageType",e,l.STRING,!0)}))?[2,pe((function(a,s){return B(r,void 0,void 0,(function(){var r,c,u,d,f;return D(this,(function(l){switch(l.label){case 0:return r="keyword: ".concat(n,", messageTypes: ").concat(JSON.stringify(t),", channelId: ").concat(o),s.info(R.O,"searchConversationByContent -> ".concat(e)),L(o)?[4,a.searchConversationByContentWithAllChannel(n,t)]:[3,2];case 1:return c=l.sent(),[3,4];case 2:return[4,a.searchConversationByContent(n,t,o)];case 3:c=l.sent(),l.label=4;case 4:return u=c.code,d=c.data,u===i.SUCCESS&&d?(f=d.map((function(e){return ge(e)})),[2,{code:u,data:f}]):(s.warn(R.O,"searchConversationByContent fail -> code: ".concat(u," ").concat(r)),[2,{code:u,msg:Ge[u]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:Ge[i.NOT_SUPPORT]}]}))}))},searchMessages:function(e,n,t,o){return B(this,void 0,void 0,(function(){var r=this;return D(this,(function(a){return M()?m("conversation",e,l.CONVERSATION,!0)&&m("keyword",n,l.STRING,!0)&&m("startTime",t,l.NUMBER,!0)&&m("count",o,l.NUMBER,!0)?[2,pe((function(a,s){return B(r,void 0,void 0,(function(){var r,c,u,d,f,l,g,v,I,h;return D(this,(function(m){switch(m.label){case 0:return r="conversation: ".concat(JSON.stringify(e),", keyword: ").concat(n,", timestamp: ").concat(t,", count: ").concat(o),s.info(R.O,"searchMessages -> ".concat(r)),c=e.targetId,u=e.conversationType,d=e.channelId,L(d)?[4,a.searchMessageByContentWithAllChannel(u,c,n,t,o)]:[3,2];case 1:return f=m.sent(),[3,4];case 2:return 0,[4,a.searchMessageByContent(u,c,n,t,o,0,d)];case 3:f=m.sent(),m.label=4;case 4:return l=f.code,g=f.data,l===i.SUCCESS&&g?(v=g.messages,I=g.count,h=v.map((function(e){return le(e)})),[2,{code:l,data:{messages:h,count:I}}]):(s.warn(R.O,"searchMessages fail -> code: ".concat(l," ").concat(r)),[2,{code:l,msg:Ge[l]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:Ge[i.NOT_SUPPORT]}]}))}))},searchMessageInTimeRange:function(e,n){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(o){return M()?m("conversation",e,l.CONVERSATION,!0)&&m("option",n,l.OBJECT,!0)&&m("option.keyword",n.keyword,l.STRING,!0)&&m("option.startTime",n.startTime,l.NUMBER,!0)&&m("option.endTime",n.endTime,l.NUMBER,!0)&&m("option.offset",n.offset,l.NUMBER)&&m("option.limit",n.limit,l.NUMBER)?[2,pe((function(o,r){return B(t,void 0,void 0,(function(){var t,a,s,c,u,d,f,l,g,v,I;return D(this,(function(h){switch(h.label){case 0:return t="conversation: ".concat(JSON.stringify(e),", option: ").concat(JSON.stringify(n)),r.info(R.O,"searchMessageInTimeRange -> ".concat(t)),a=e.conversationType,s=e.targetId,c=n.keyword,u=n.startTime,d=n.endTime,f=n.offset,l=n.limit,f=f||0,l=l||5,[4,o.searchMessageByContentInTimeRangeWithAllChannel(a,s,c,u,d,f,l)];case 1:return g=h.sent(),v=g.code,I=g.data,v===i.SUCCESS&&I?[2,{code:v,data:{messages:I.messages.map((function(e){return le(e)}))}}]:(r.warn(R.O,"searchMessageInTimeRange fail -> code: ".concat(v,", ").concat(t)),[2,{code:v}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:Ge[i.NOT_SUPPORT]}]}))}))},getHistoryMessagesByMessageTypes:function(e,n){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(o){return M()?m("conversation",e,l.CONVERSATION,!0)&&m("option",n,l.OBJECT,!0)&&m("option.count",n.count,l.NUMBER)&&m("options.count",n.count,(function(e){var n=e>0&&e<=100;return n||null===console||void 0===console||console.error("option.count is invalid, It should be greater than 0 and less than 100"),n}))&&m("option.timestamp",n.timestamp,l.NUMBER)&&m("option.order",n.order,(function(e){return[0,1].includes(e)}))&&m("option.messageTypes",n.messageTypes,l.ARRAY,!0)&&!n.messageTypes.some((function(e){return!m("option.messageType",e,l.STRING,!0)}))?[2,pe((function(o,r){return B(t,void 0,void 0,(function(){var t,a,s,c,u,d,f,l,g,v,I,h,m,E,T;return D(this,(function(S){switch(S.label){case 0:return t=n.count,a=n.timestamp,s=n.order,c=n.messageTypes,u="conversation: ".concat(JSON.stringify(e),", option: ").concat(JSON.stringify(n)),r.info(R.O,"getHistoryMessagesByMessageTypes -> ".concat(u)),d=e.conversationType,f=e.targetId,l=e.channelId,t||(t=20),a||(a=0),s||(s=0),l||(l=""),[4,o.getHistoryMessagesByObjectNames(d,f,a,t,c,s,l)];case 1:return g=S.sent(),v=g.code,I=g.data,v===i.SUCCESS?(m=(h=I).list,E=h.hasMore,T=m.map((function(e){return le(e)})),[2,{code:v,data:{messages:T,hasMore:E,list:T}}]):(r.warn(R.O,"getHistoryMessagesByMessageTypes fail -> code: ".concat(v," ").concat(u)),[2,{code:v,msg:Ge[v]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:Ge[i.NOT_SUPPORT]}]}))}))},setMessageStatusToRead:function(e,n){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(o){return M()?m("conversation",e,l.CONVERSATION,!0)&&m("timestamp",n,l.NUMBER,!0)?[2,pe((function(o,i){return B(t,void 0,void 0,(function(){var t,r,a,s;return D(this,(function(c){switch(c.label){case 0:return t="conversation: ".concat(JSON.stringify(e),", timestamp: ").concat(n),i.info(R.O,"updateSentMsgReceiptStatus -> ".concat(t)),r=e.conversationType,a=e.targetId,s=e.channelId,[4,o.setMessageStatusToRead(r,a,n,s)];case 1:return[2,c.sent()]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:Ge[i.NOT_SUPPORT]}]}))}))},setMessageReceivedStatus:function(e,n){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(o){return M()?m("messageId",e,l.NUMBER,!0)&&m("receivedStatus",n,(function(e){return!L(r[e])}),!0)?[2,pe((function(o,i){return B(t,void 0,void 0,(function(){return D(this,(function(t){switch(t.label){case 0:return i.info(R.O,"setMessageReceivedStatus -> messageId: ".concat(e,", receivedStatus: ").concat(n)),[4,o.setMessageReceivedStatus(e,n)];case 1:return[2,{code:t.sent()}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:Ge[i.NOT_SUPPORT]}]}))}))},setMessageSentStatus:function(e,n){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(o){return M()?m("messageId",e,l.NUMBER,!0)&&m("sentStatus",n,(function(e){return!L(P[e])}),!0)?[2,pe((function(o,i){return B(t,void 0,void 0,(function(){return D(this,(function(t){switch(t.label){case 0:return i.info(R.O,"setMessageSentStatus ->messageId: ".concat(e,", sentStatus: ").concat(n)),[4,o.setMessageSentStatus(e,n)];case 1:return[2,{code:t.sent()}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:Ge[i.NOT_SUPPORT]}]}))}))},setMessageContent:function(e,n,t){return void 0===t&&(t=""),B(this,void 0,void 0,(function(){var o=this;return D(this,(function(r){return M()?m("messageId",e,l.NUMBER,!0)&&m("content",n,l.OBJECT,!0)&&m("messageType",t,l.ONLY_STRING,!0)?[2,pe((function(i,r){return B(o,void 0,void 0,(function(){return D(this,(function(o){switch(o.label){case 0:return r.info(R.O,"setMessageSentStatus ->messageId: ".concat(e,", messageType: ").concat(t)),[4,i.setMessageContent(e,n,t)];case 1:return[2,{code:o.sent()}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:Ge[i.NOT_SUPPORT]}]}))}))},deleteMessages:function(e){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(t){return M()?!m("messageIds",e,l.ARRAY,!0)||e.some((function(e){return!m("messageId",e,l.NUMBER,!0)}))?[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,pe((function(t,o){return B(n,void 0,void 0,(function(){return D(this,(function(n){switch(n.label){case 0:return o.info(R.O,"deleteMessages ->messageIds: ".concat(JSON.stringify(e))),[4,t.deleteMessages(e)];case 1:return[2,{code:n.sent()}]}}))}))}))]:[2,{code:i.NOT_SUPPORT,msg:Ge[i.NOT_SUPPORT]}]}))}))},clearMessages:function(e){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(t){return M()?[2,pe((function(t,o){return B(n,void 0,void 0,(function(){var n,i,r;return D(this,(function(a){switch(a.label){case 0:return n=e.conversationType,i=e.targetId,r=e.channelId,o.info(R.O,"clearMessages ->targetId:".concat(i,",conversationType:").concat(n)),[4,t.clearMessages(n,i,r)];case 1:return[2,{code:a.sent()}]}}))}))}))]:[2,{code:i.NOT_SUPPORT,msg:Ge[i.NOT_SUPPORT]}]}))}))},deleteMessagesByTimestamp:function(e,n,t){return B(this,void 0,void 0,(function(){var o,r,a,s=this;return D(this,(function(c){return M()?(o=e.conversationType,r=e.targetId,a=e.channelId,m("conversationType",o,l.NUMBER,!0)&&m("targetId",r,l.STRING,!0)&&m("timestamp",n,l.NUMBER,!0)&&m("cleanSpace",t,l.BOOLEAN)?[2,pe((function(e,i){return B(s,void 0,void 0,(function(){return D(this,(function(i){switch(i.label){case 0:return[4,e.deleteMessagesByTimestamp(o,r,n,t,a)];case 1:return[2,{code:i.sent()}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]):[2,{code:i.NOT_SUPPORT,msg:Ge[i.NOT_SUPPORT]}]}))}))},insertMessage:function(e,n,t){return void 0===t&&(t={}),B(this,void 0,void 0,(function(){var o=this;return D(this,(function(r){return console.log(M()),M()?m("conversation",e,l.CONVERSATION,!0)&&m("message",n,l.OBJECT,!0)&&m("options",t,l.OBJECT)&&m("options.isUnread",null==t?void 0:t.isUnread,l.BOOLEAN)&&m("options.searchContent",null==t?void 0:t.searchContent,l.STRING)&&(n instanceof Qn||m("message.senderUserId",n.senderUserId,l.STRING,!0)&&m("message.messageType",n.messageType,l.STRING,!0)&&m("message.content",n.content,l.OBJECT,!0)&&m("message.messageDirection",n.messageDirection,l.NUMBER,!0)&&m("message.canIncludeExpansion",n.canIncludeExpansion,l.BOOLEAN)&&m("message.expansion",n.expansion,l.OBJECT)&&m("message.disableNotification",n.disableNotification,l.BOOLEAN)&&m("message.sentTime",n.sentTime,l.NUMBER)&&m("message.sentStatus",n.sentStatus,l.NUMBER))?[2,pe((function(r,a){return B(o,void 0,void 0,(function(){var o,s,c,u,d,f,l,g,v,I,h,m,E,T,S;return D(this,(function(p){switch(p.label){case 0:return o="",s=1,f=!1,g=n.messageType,v=n.content,n instanceof Qn||(o=n.senderUserId,s=n.messageDirection,f=n.canIncludeExpansion,l=n.expansion,d=n.disableNotification,c=n.sentTime,u=n.sentStatus),a.info(R.O,"insertMessage ->targetId:".concat(e.targetId,",conversationType:").concat(e.conversationType)),I=t.isUnread,h=t.searchContent,m={senderUserId:o,messageType:g,content:v,messageDirection:s,sentTime:c,sentStatus:u,searchContent:h,isUnread:I,messageUId:"",disableNotification:d,canIncludeExpansion:f,expansionMsg:JSON.stringify(l),channelId:e.channelId||""},[4,r.insertMessage(e.conversationType,e.targetId,m)];case 1:return E=p.sent(),T=E.code,S=E.data,T===i.SUCCESS?[2,{code:T,data:le(S)}]:(a.warn(R.O,"insertMessage ->code:".concat(T,",targetId:").concat(e.targetId)),[2,{code:T,msg:Ge[T]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:Ge[i.NOT_SUPPORT]}]}))}))},batchInsertMessage:function(e,n){var t,o;return B(this,void 0,void 0,(function(){var r,s=this;return D(this,(function(c){if(!M())return[2,{code:i.NOT_SUPPORT,msg:Ge[i.NOT_SUPPORT]}];if(!m("messages",e,(function(e){return g(e)&&!(e.length<=0||e.length>=500)}),!0)||!m("checkDuplicate",n,l.BOOLEAN))return[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}];for(r in e)if(!(m("message",e[r],l.OBJECT,!0)&&m("message.conversationType",e[r].conversationType,(function(e){return[a.PRIVATE,a.DISCUSSION,a.GROUP,a.CUSTOMER_SERVICE,a.SYSTEM,a.APP_PUBLIC_SERVICE,a.PUBLIC_SERVICE].includes(e)}),!0)&&m("message.targetId",e[r].targetId,l.STRING,!0)&&m("message.senderUserId",e[r].senderUserId,l.STRING,!0)&&m("message.messageType",e[r].messageType,l.STRING,!0)&&m("message.content",e[r].content,l.OBJECT,!0)&&m("message.messageDirection",e[r].messageDirection,l.NUMBER,!0)&&m("message.canIncludeExpansion",e[r].canIncludeExpansion,l.BOOLEAN)&&m("message.expansion",e[r].expansion,l.OBJECT)&&m("message.disableNotification",e[r].disableNotification,l.BOOLEAN)&&m("message.sentTime",e[r].sentTime,l.NUMBER)&&m("message.sentStatus",e[r].sentStatus,l.NUMBER)&&m("options.isUnread",null===(t=e[r])||void 0===t?void 0:t.isUnread,l.BOOLEAN)&&m("options.searchContent",null===(o=e[r])||void 0===o?void 0:o.searchContent,l.STRING)))return[2,{code:i.BIZ_ERROR_INVALID_PARAMETER,msg:String(r)}];return[2,pe((function(t){return B(s,void 0,void 0,(function(){var o,r,a;return D(this,(function(s){switch(s.label){case 0:return[4,t.batchInsertMessage(e,n)];case 1:return o=s.sent(),r=o.code,a=o.data,r===i.SUCCESS?[2,{code:r,data:a}]:[2,{code:r,msg:Ge[r]}]}}))}))}))]}))}))},getMessageCount:function(e){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(t){return M()?[2,pe((function(t){return B(n,void 0,void 0,(function(){var n,o,i,r,a,s;return D(this,(function(c){switch(c.label){case 0:return n=e.conversationType,o=e.targetId,i=e.channelId,[4,t.getMessageCount(n,o,i)];case 1:return r=c.sent(),a=r.code,s=r.data,[2,{code:a,data:s}]}}))}))}))]:[2,{code:i.NOT_SUPPORT,msg:Ge[i.NOT_SUPPORT]}]}))}))},getPrivateMessageDeliverTime:function(e){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(t){return M()?m("messageUId",e,l.STRING,!0)?[2,pe((function(t,o){return B(n,void 0,void 0,(function(){var n,r,a;return D(this,(function(s){switch(s.label){case 0:return[4,t.getPrivateMessageDeliverTime(e)];case 1:return n=s.sent(),r=n.code,a=n.data,r===i.SUCCESS?[2,{code:r,data:a}]:(o.warn(R.A_GET_PRIVATE_MESSAGE_DELIVER_TIME_E,"code:".concat(r,",messageUId:").concat(e)),[2,{code:r,msg:Ge[r]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:Ge[i.NOT_SUPPORT]}]}))}))},getGroupMessageDeliverList:function(e,n){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(o){return M()?m("targetId",e,l.STRING,!0)&&m("messageUId",n,l.STRING,!0)?[2,pe((function(o,r){return B(t,void 0,void 0,(function(){var t,a,s;return D(this,(function(c){switch(c.label){case 0:return[4,o.getGroupMessageDeliverList(e,n)];case 1:return t=c.sent(),a=t.code,s=t.data,a===i.SUCCESS?[2,{code:a,data:s}]:(r.warn(R.A_GET_GROUP_MESSAGE_DELIVER_LIST_E,"code:".concat(a,", targetId:").concat(e," messageUId:").concat(n)),[2,{code:a,msg:Ge[a]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:Ge[i.NOT_SUPPORT]}]}))}))},setCheckDuplicateMessage:function(e){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(t){return M()?m("enableCheck",e,l.BOOLEAN)?[2,pe((function(t){return B(n,void 0,void 0,(function(){return D(this,(function(n){switch(n.label){case 0:return[4,t.setCheckDuplicateMessage(e)];case 1:return[2,{code:n.sent().code}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:Ge[i.NOT_SUPPORT]}]}))}))},clearLocalData:function(){return B(this,void 0,void 0,(function(){var e=this;return D(this,(function(n){return M()?[2,pe((function(n,t){return B(e,void 0,void 0,(function(){var e,o,i;return D(this,(function(r){switch(r.label){case 0:return t.info(R.O,"clearLocalData ->"),[4,n.clearData()];case 1:return e=r.sent(),o=e.code,i=e.data,[2,{code:o,data:i}]}}))}))}))]:[2,{code:i.NOT_SUPPORT,msg:Ge[i.NOT_SUPPORT]}]}))}))}}),Fo=function(e,n,t){this.type=e,this.userIdList=n,this.mentionedContent=t};function Zo(e){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(t){return!e||m("proxy.socksHost",e.socksHost,l.STRING,!0)&&m("proxy.socksPort",e.socksPort,l.NUMBER,!0)?[2,pe((function(t,o){return B(n,void 0,void 0,(function(){var n;return D(this,(function(r){switch(r.label){case 0:return o.info(R.O,"setProxy: ->".concat(e)),[4,t.setProxy(e)];case 1:return(n=r.sent().code)===i.SUCCESS?[2,{code:n}]:(o.warn(R.O,"setProxy ->code:".concat(n)),[2,{code:n,msg:Ge[n]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function qo(){return B(this,void 0,void 0,(function(){var e=this;return D(this,(function(n){return[2,pe((function(n,t){return B(e,void 0,void 0,(function(){var e,o,r;return D(this,(function(a){switch(a.label){case 0:return[4,n.getProxy()];case 1:return e=a.sent(),o=e.code,r=e.data,o===i.SUCCESS?[2,{code:o,data:r}]:(t.warn(R.O,"getProxy ->code:".concat(o)),[2,{code:o,msg:Ge[o]}])}}))}))}))]}))}))}function Jo(e,n){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(o){return!e||m("proxy.socksHost",e.socksHost,l.STRING,!0)&&m("proxy.socksPort",e.socksPort,l.NUMBER,!0)?[2,pe((function(o,r){return B(t,void 0,void 0,(function(){var t,a,s;return D(this,(function(c){switch(c.label){case 0:return r.info(R.O,"testProxy: ->".concat(e)),[4,o.testProxy(e,n)];case 1:return t=c.sent(),a=t.status,s=t.data,a===i.SUCCESS?[2,{code:a,msg:s}]:(r.warn(R.O,"testProxy ->code:".concat(a)),[2,{code:a,msg:Ge[a]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}export{Qn as BaseMessage,st as CombineMessage,Vo as ConnectType,V as Events,ct as FileMessage,ut as GIFMessage,it as HQVoiceMessage,ot as ImageMessage,ft as LocationMessage,Fo as MentionedInfoBody,ko as MessageType,lt as ReferenceMessage,gt as RichContentMessage,rt as SightMessage,at as TextMessage,dt as VoiceMessage,we as __addSDKVersion,Lo as addConversationsToTag,Oe as addEventListener,Ao as addTag,Yn as addToBlacklist,Kn as bindRTCRoomForChatroom,$e as clearAllMessagesUnreadStatus,Ae as clearEventListeners,fo as clearHistoryMessages,Oo as clearMessages,Qe as clearMessagesUnreadStatus,Ke as clearTextMessageDraft,_o as clearUnreadCountByTimestamp,ke as connect,po as deleteLocalMessagesByTimestamp,uo as deleteMessages,Me as destroy,He as disconnect,Ho as electronExtension,Zn as forceRemoveChatRoomEntry,kn as forceSetChatRoomEntry,Jn as getAllChatRoomEntries,gn as getAllConversationState,Cn as getAllUltraGroupUnreadCount,An as getAllUltraGroupUnreadMentionedCount,ln as getAllUnreadMentionedCount,Wn as getBlacklist,Xn as getBlacklistStatus,In as getBlockUltraGroupList,sn as getBlockedConversationList,qn as getChatRoomEntry,Gn as getChatRoomInfo,zn as getChatroomHistoryMessages,Ue as getConnectionStatus,Ze as getConversation,Fe as getConversationList,rn as getConversationNotificationLevel,an as getConversationNotificationStatus,bo as getConversationsFromTagByPage,Le as getCurrentUserId,Be as getDeviceId,Jt as getFileToken,zt as getFileUrl,ho as getFirstUnreadMessage,no as getHistoryMessages,Eo as getMessage,Io as getMessageReader,qo as getProxy,to as getRemoteHistoryMessages,Pe as getServerTime,Uo as getTags,Po as getTagsFromConversation,Je as getTextMessageDraft,un as getTopConversationList,Ye as getTotalUnreadCount,je as getTotalUnreadCountByLevels,We as getTotalUnreadMentionedCountByLevels,On as getUltraGroupDefaultNotificationLevel,Mn as getUltraGroupFirstUnreadMessageTimestamp,vn as getUltraGroupList,hn as getUltraGroupMessageListByMessageUId,_n as getUltraGroupUnreadCountByTargetId,pn as getUltraGroupUnreadMentionedCountByTargetId,yn as getUltraGroupUnreadMentionedMessages,dn as getUnreadConversationList,Xe as getUnreadCount,Go as getUnreadCountByTag,fn as getUnreadMentionedCount,To as getUnreadMentionedMessages,ye as init,mo as insertMessage,De as installPlugin,Bn as joinChatRoom,Dn as joinExistChatRoom,Sn as modifyMessage,Ne as onceEventListener,bn as quitChatRoom,co as recallMessage,Ro as registerMessageType,Tn as removeAllExpansionForUltraGroupMessage,Fn as removeChatRoomEntries,Hn as removeChatRoomEntry,qe as removeConversation,wo as removeConversationsFromTag,_e as removeEventListener,Ce as removeEventListeners,En as removeExpansionForUltraGroupMessage,jn as removeFromBlacklist,go as removeMessageExpansionForKey,yo as removeTag,Do as removeTagFromConversations,Bo as removeTagsFromConversation,ze as saveTextMessageDraft,No as searchConversationByContent,So as searchMessages,Wt as sendFileMessage,Qt as sendGIFMessage,$t as sendHQVoiceMessage,Xt as sendImageMessage,Kt as sendMessage,oo as sendReadReceiptMessage,io as sendReadReceiptRequest,ro as sendReadReceiptResponse,ao as sendReadReceiptResponseV2,eo as sendSightMessage,so as sendSyncReadStatusMessage,Yt as sendTextMessage,vo as sendTypingStatusMessage,Rn as sendUltraGroupTypingStatus,Vn as setChatRoomEntries,xn as setChatRoomEntry,tn as setConversationNotificationLevel,on as setConversationNotificationStatus,cn as setConversationToTop,xo as setConversationToTopInTag,Co as setMessageReceivedStatus,Zo as setProxy,Nn as setUltraGroupDefaultNotificationLevel,Jo as testProxy,mn as updateExpansionForUltraGroupMessage,lo as updateMessageExpansion,Mo as updateTag};