@rongcloud/imlib-next 5.10.2 → 5.10.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.d.ts +11 -1
- package/index.esm.js +2 -2
- package/index.js +1 -1
- package/package.json +2 -2
package/index.js
CHANGED
|
@@ -12,4 +12,4 @@ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
|
12
12
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
13
13
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
14
14
|
PERFORMANCE OF THIS SOFTWARE.
|
|
15
|
-
***************************************************************************** */function n(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}var r=function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)};function o(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{d(r.next(e))}catch(e){i(e)}}function s(e){try{d(r.throw(e))}catch(e){i(e)}}function d(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}d((r=r.apply(e,t||[])).next())}))}function i(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}}var a=function(){return!("undefined"==typeof uni||!function(e){for(var t=["request","getSystemInfo"],n=0,r=t.length;n<r;n++)if(!e[t[n]])return!1;return!0}(uni))},s=a();var d=null,u=function(e){return o(void 0,void 0,void 0,(function(){var t;return i(this,(function(n){switch(n.label){case 0:return[4,c.getNetworkType()];case 1:return t=n.sent(),d({status:"online"===e.type,type:t}),[2]}}))}))};var c={tag:"browser",httpReq:function(t){return e.httpRequest(t).result()},localStorage:null===window||void 0===window?void 0:window.localStorage,sessionStorage:null===window||void 0===window?void 0:window.sessionStorage,useNavi:!0,connectPlatform:"",isFromUniapp:s,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,r=t.reason;e(n,r)}},onError:function(e){n.onerror=e},onMessage:function(e){n.onmessage=function(t){e(t.data)}},onOpen:function(e){n.onopen=e},send:function(e){n.send(e)},close:function(e,t){n.close()}}},getNetworkType:function(){var t=navigator.connection||navigator.mozConnection||navigator.webkitConnection||{effectiveType:e.NetworkType.UNKONWN},n=t.type,r=t.effectiveType,o=n||r||e.NetworkType.UNKONWN;return Promise.resolve(o)},setNetworkStatusListener:function(e){d=e,"undefined"!=typeof window&&window&&(window.addEventListener("offline",u),window.addEventListener("online",u))},removeNetworkStatusListener:function(){"undefined"!=typeof window&&window&&(window.removeEventListener("offline",u),window.removeEventListener("online",u)),d=null}},l=a(),v=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)}}},f={setItem:v("setStorageSync"),getItem:v("getStorageSync"),removeItem:v("removeStorageSync"),clear:v("clearStorageSync")},g=null,T=function(e){var t=e.isConnected,n=e.networkType;g({status:t,type:n})};var S={tag:"wechat",httpReq:function(t){var n=t.method||e.HttpMethod.GET,r=t.timeout||e.HTTP_TIMEOUT,o=t.headers,i=t.query,a=t.body,s=e.appendUrl(t.url,i);return new Promise((function(t){wx.request({url:s,method:n,header:o,timeout:r,data:a,success:function(e){t({data:e.data,status:e.statusCode})},fail:function(){t({status:e.ErrorCode.RC_HTTP_REQ_FAIL})}})}))},localStorage:f,sessionStorage:f,useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:l,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.NetworkType.UNKONWN)}})}))},setNetworkStatusListener:function(e){g=e,wx.onNetworkStatusChange(T)},removeNetworkStatusListener:function(){wx.offNetworkStatusChange(T),g=null}},p=a(),I=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 r=my[e]({key:t[0]}).data;return r?JSON.stringify(r):r}catch(e){}}},h={setItem:I("setStorageSync"),getItem:I("getStorageSync"),removeItem:I("removeStorageSync"),clear:I("clearStorageSync")},_=null,E=function(e){var t=e.isConnected,n=e.networkType;_({status:t,type:n})};var R={tag:"alipay",httpReq:function(t){var n=t.method||e.HttpMethod.GET,r=t.timeout||e.HTTP_TIMEOUT,o=t.headers,i=t.query,a=t.body,s=e.appendUrl(t.url,i),d=t.dataType||"json";return new Promise((function(t){my.request({url:s,method:n,headers:o,timeout:r,data:a,dataType:d,success:function(e){t({data:e.data,status:e.status})},fail:function(){t({status:e.ErrorCode.RC_HTTP_REQ_FAIL})}})}))},localStorage:h,sessionStorage:h,useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:p,createWebSocket:function(e){var t=my.connectSocket({url:e,multiple:!0});return{id:Date.now(),onClose:function(e){t.onClose(e)},onError:function(e){t.onError((function(t){e(t.errMsg)}))},onMessage:function(e){t.onMessage((function(t){t.data.isBuffer?e(my.base64ToArrayBuffer(t.data.data)):e(t.data.data)}))},onOpen:function(e){t.onOpen(e)},send:function(e){t.send({data:my.arrayBufferToBase64(e),isBuffer:!0})},close:function(){t.close()}}},getNetworkType:function(){return new Promise((function(t){my.getNetworkType({success:function(e){var n=e.networkType;t(n)},fail:function(){t(e.NetworkType.UNKONWN)}})}))},setNetworkStatusListener:function(e){_=e,my.onNetworkStatusChange(E)},removeNetworkStatusListener:function(){my.offNetworkStatusChange(E),_=null}},C=a(),m=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){}}},y={setItem:m("setStorageSync"),getItem:m("getStorageSync"),removeItem:m("removeStorageSync"),clear:m("clearStorageSync")},A=null,N=function(e){var t=e.isConnected,n=e.networkType;A({status:t,type:n})};var O={tag:"toutiao",useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:C,localStorage:y,sessionStorage:y,httpReq:function(t){return new Promise((function(n){tt.request({url:t.url,data:t.body,header:t.headers,method:t.method,success:function(e){var t=(null==e?void 0:e.data)||{},r={data:JSON.stringify(t),status:e.statusCode};n(r)},fail:function(t){n({status:e.ErrorCode.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.NetworkType.UNKONWN)}})}))},setNetworkStatusListener:function(e){A=e,tt.onNetworkStatusChange(N)},removeNetworkStatusListener:function(){tt.offNetworkStatusChange(N),A=null}},U=a(),M=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return swan[e].apply(swan,t)}catch(e){}}},w={setItem:M("setStorageSync"),getItem:M("getStorageSync"),removeItem:M("removeStorageSync"),clear:M("clearStorageSync")},P=null,L=function(e){var t=e.isConnected,n=e.networkType;P({status:t,type:n})};var b={tag:"baidu",useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:U,localStorage:w,sessionStorage:w,httpReq:function(t){return new Promise((function(n){swan.request({url:t.url,data:t.body,header:t.headers,method:t.method,success:function(e){var t=(null==e?void 0:e.data)||{},r={data:JSON.stringify(t),status:e.statusCode};n(r)},fail:function(t){n({status:e.ErrorCode.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 o(this,void 0,void 0,(function(){return i(this,(function(t){return[2,new Promise((function(t){swan.getNetworkType({success:function(e){var n=e.networkType;t(n)},fail:function(){t(e.NetworkType.UNKONWN)}})}))]}))}))},setNetworkStatusListener:function(e){P=e,swan.onNetworkStatusChange(L)},removeNetworkStatusListener:function(){swan.offNetworkStatusChange(L),P=null}},x=a(),G=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)}}},D={setItem:G("setStorageSync"),getItem:G("getStorageSync"),removeItem:G("removeStorageSync"),clear:G("clearStorageSync")},J=null,V=function(e){var t=e.isConnected,n=e.networkType;J({status:t,type:n})};var B={tag:"jingdong",httpReq:function(t){var n=t.method||e.HttpMethod.GET,r=t.timeout||e.HTTP_TIMEOUT,o=t.headers,i=t.query,a=t.body,s=e.appendUrl(t.url,i);return new Promise((function(t){jd.request({url:s,method:n,header:o,timeout:r,data:a,success:function(e){t({data:e.data,status:e.statusCode})},fail:function(){t({status:e.ErrorCode.RC_HTTP_REQ_FAIL})}})}))},localStorage:D,sessionStorage:D,useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:x,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.NetworkType.UNKONWN)}})}))},setNetworkStatusListener:function(e){J=e,jd.onNetworkStatusChange(V)},removeNetworkStatusListener:function(){jd.offNetworkStatusChange(V),J=null}},k=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)}}},H={setItem:k("setStorageSync"),getItem:k("getStorageSync"),removeItem:k("removeStorageSync"),clear:k("clearStorageSync")},F=null,Y=function(e){var t=e.isConnected,n=e.networkType;F({status:t,type:n})};var q,j={tag:"uniapp",httpReq:function(t){var n=t.method||e.HttpMethod.GET,r=t.timeout||e.HTTP_TIMEOUT,o=t.headers,i=t.query,a=t.body,s=e.appendUrl(t.url,i);return new Promise((function(t){uni.request({url:s,method:n,header:o,timeout:r,data:a,success:function(e){t({data:e.data,status:e.statusCode})},fail:function(){t({status:e.ErrorCode.RC_HTTP_REQ_FAIL})}})}))},localStorage:H,sessionStorage:H,useNavi:!0,connectPlatform:"",isFromUniapp:!0,createWebSocket:function(e,t){var n={complete:function(){},url:e,protocols:t},r=uni.connectSocket(n);return{id:Date.now(),onClose:function(e){r.onClose((function(t){e(t.code,t.reason)}))},onError:function(e){r.onError((function(t){e(t.errMsg)}))},onMessage:function(e){r.onMessage((function(t){e(t.data)}))},onOpen:function(e){r.onOpen(e)},send:function(e){r.send({data:e})},close:function(e,t){r.close({code:e,reason:t})}}},getNetworkType:function(){return new Promise((function(t){uni.getNetworkType({success:function(e){var n=e.networkType;t(n)},fail:function(){t(e.NetworkType.UNKONWN)}})}))},setNetworkStatusListener:function(e){F=e,uni.onNetworkStatusChange(Y)},removeNetworkStatusListener:function(){uni.offNetworkStatusChange(Y),F=null}},K=function(e){return e&&e.request&&e.getSystemInfo},z="undefined"!=typeof uni&&K(uni)?function(){switch(process.env.VUE_APP_PLATFORM){case"app-plus":return j;case"mp-jd":return B;case"mp-baidu":return b;case"mp-toutiao":return O;case"mp-alipay":return R;case"mp-weixin":return S;default:return c}}():"undefined"!=typeof jd&&K(jd)?B:"undefined"!=typeof my&&K(my)?R:"undefined"!=typeof tt&&K(tt)?O:"undefined"!=typeof swan&&K(swan)?b:"undefined"!=typeof wx&&K(wx)?S:c;function W(t){var n=t.conversationType,r=t.channelId,o=t.messageType,i=t.content,a=t.senderUserId,s=t.targetId,d=t.sentTime,u=t.receivedTime,c=t.messageUId,l=t.messageDirection,v=t.isPersited,f=t.isCounted,g=t.isOffLineMessage,T=t.canIncludeExpansion,S=t.expansion,p=t.receivedStatus,I=t.receivedStatusInfo,h=t.disableNotification,_=t.isMentioned,E=t.isStatusMessage,R=t.readReceiptInfo,C=t.pushConfig,m=t.messageId,y=t.isInterrupt,A=t.isModifyMessage,N=t.channelType,O=t.sentStatus,U=t.directedUserIds;return p||(p=e.ReceivedStatus.UNREAD),{messageType:o,channelId:r||"",content:i,senderUserId:a,targetId:s,conversationType:n,sentTime:d,receivedTime:u,messageUId:c,messageDirection:l,isPersited:v,isCounted:f,isMentioned:_,disableNotification:h,isStatusMessage:E,canIncludeExpansion:T,expansion:S,receivedStatus:p,receivedStatusInfo:I,readReceiptInfo:R,pushConfig:C,messageId:m,isInterrupt:y,isModifyMessage:A,sentStatus:O,isOffLineMessage:g,channelType:N,directedUserIds:U}}function X(t){var n=t.conversationType,r=t.targetId,o=t.latestMessage,i=t.unreadMessageCount,a=t.hasMentioned,s=t.mentionedInfo,d=t.lastUnreadTime,u=t.notificationStatus,c=t.notificationLevel,l=t.isTop,v=t.channelId,f=t.unreadMentionedCount,g=t.matchCount,T=t.operationTime,S=t.draft,p={conversationType:n,targetId:r,latestMessage:o&&W(o),unreadMessageCount:i,hasMentioned:a,mentionedInfo:a?{type:null==s?void 0:s.type,userIdList:null==s?void 0:s.userIdList}:void 0,lastUnreadTime:d,notificationStatus:u,notificationLevel:c,isTop:l,channelId:v,unreadMentionedCount:f,matchCount:g,operationTime:T,draft:S||""};return p.conversationType===e.ConversationType.ULTRA_GROUP&&(p.firstUnreadMessage=t.firstUnreadMessage,p.channelType=t.channelType,p.unreadMentionedMeCount=t.unreadMentionedMeCount),p}function Q(e,t){null===console||void 0===console||console.warn("Method '"+e+"' is deprecated, please use '"+t+"' instead")}exports.Events=void 0,(q=exports.Events||(exports.Events={})).CONNECTING="CONNECTING",q.CONNECTED="CONNECTED",q.DISCONNECT="DISCONNECT",q.SUSPEND="SUSPEND",q.MESSAGES="MESSAGES",q.READ_RECEIPT_RECEIVED="READ_RECEIPT_RECEIVED",q.MESSAGE_RECEIPT_REQUEST="MESSAGE_RECEIPT_REQUEST",q.MESSAGE_RECEIPT_RESPONSE="MESSAGE_RECEIPT_RESPONSE",q.MESSAGE_READ_RECEIPT_V4="MESSAGE_READ_RECEIPT_V4",q.SYNC_READ_STATUS="SYNC_READ_STATUS",q.CONVERSATION="CONVERSATION",q.CHATROOM="CHATROOM",q.EXPANSION="EXPANSION",q.PULL_OFFLINE_MESSAGE_FINISHED="PULL_OFFLINE_MESSAGE_FINISHED",q.TAG="TAG",q.CONVERSATION_TAG="CONVERSATION_TAG",q.TYPING_STATUS="TYPING_STATUS",q.MESSAGE_BLOCKED="MESSAGE_BLOCKED",q.ULTRA_GROUP_ENABLE="ULTRA_GROUP_ENABLE",q.OPERATE_STATUS="OPERATE_STATUS",q.ULTRA_GROUP_MESSAGE_EXPANSION_UPDATED="ULTRA_GROUP_MESSAGE_EXPANSION_UPDATED",q.ULTRA_GROUP_MESSAGE_MODIFIED="ULTRA_GROUP_MESSAGE_MODIFIED",q.ULTRA_GROUP_MESSAGE_RECALLED="ULTRA_GROUP_MESSAGE_RECALLED",q.ULTRA_GROUP_CHANNEL_TYPE_CHANGE="ULTRA_GROUP_CHANNEL_TYPE_CHANGE",q.ULTRA_GROUP_CHANNEL_DELETE="ULTRA_GROUP_CHANNEL_DELETE",q.ULTRA_GROUP_CHANNEL_USER_KICKED="ULTRA_GROUP_CHANNEL_USER_KICKED",q.PRIVATE_MESSAGE_DELIVERED="PRIVATE_MESSAGE_DELIVERED",q.GROUP_MESSAGE_DELIVERED="GROUP_MESSAGE_DELIVERED",q.USER_GROUP_STATUS="USER_GROUP_STATUS",q.SUBSCRIBED_USER_STATUS_CHANGE="SUBSCRIBED_USER_STATUS_CHANGE",q.SUBSCRIBED_RELATION_CHANGE="SUBSCRIBED_RELATION_CHANGE",q.SYNC_SUBSCRIBED_USER_STATUS_FINISHED="SYNC_SUBSCRIBED_USER_STATUS_FINISHED",q.OWN_USER_PROFILE_CHANGED="OWN_USER_PROFILE_CHANGED";var Z,$="A-add_to_blacklist-T",ee="A-add_to_blacklist-R",te="A-remove_from_blacklist-T",ne="A-remove_from_blacklist-R",re="A-get_blacklist-T",oe="A-get_blacklist-R",ie="A-get_blacklist_status-T",ae="A-get_blacklist_status-R",se="A-get_chatroom_info-T",de="A-get_chatroom_info-R",ue="A-set_chatroom_entry-T",ce="A-set_chatroom_entry-R",le="A-set_chatroom_entries-T",ve="A-set_chatroom_entries-R",fe="A-force_set_chatroom_entry-T",ge="A-force_set_chatroom_entry-R",Te="A-remove_chatroom_entry-T",Se="A-remove_chatroom_entry-R",pe="A-remove_chatroom_entries-T",Ie="A-remove_chatroom_entries-R",he="A-force_remove_chatroom_entry-T",_e="A-force_remove_chatroom_entry-R",Ee="A-get_chatroom_entry-T",Re="A-get_chatroom_entry-R",Ce="A-get_all_chatroom_entries-T",me="A-get_all_chatroom_entries-R",ye="A-get_chatroom_history_messages-T",Ae="A-get_chatroom_history_messages-R",Ne="A-bind_rtc_room_for_chatroom-T",Oe="A-bind_rtc_room_for_chatroom-R",Ue="A-get_top_conversation_list-R",Me="A-get_top_conversation_list-T",we="A-get_conversation_list-T",Pe="A-get_conversation_list-R",Le="A-get_conversation-T",be="A-get_conversation-R",xe="A-remove_conversation-T",Ge="A-remove_conversation-R",De="A-get_conversation_message_draft-T",Je="A-get_conversation_message_draft-R",Ve="A-save_conversation_message_draft-T",Be="A-save_conversation_message_draft-R",ke="A-clear_conversation_message_draft-T",He="A-clear_conversation_message_draft-R",Fe="A-get_total_unread_count-T",Ye="A-get_total_unread_count-R",qe="A-get_total_unread_count_by_levels-T",je="A-get_total_unread_count_by_levels-R",Ke="A-get_unread_count-T",ze="A-get_unread_count-R",We="A-clear_unread_count-T",Xe="A-clear_unread_count-R",Qe="A-clear_all_unread_count-O",Ze="A-set_conversation_notification_level-T",$e="A-set_conversation_notification_level-R",et="A-set_conversation_status-T",nt="A-set_conversation_status-R",rt="A-get_conversation_notification_level-T",ot="A-get_conversation_notification_level-R",it="A-get_conversation_notification_status-T",at="A-get_conversation_notification_status-R",st="A-set_conversation_notification_status-T",dt="A-set_conversation_notification_status-R",ut="A-get_unread_conversation_list-T",ct="A-get_unread_conversation_list-R",lt="A-get_unread_mentioned_count-T",vt="A-get_unread_mentioned_count-R",ft="A-get_all_unread_mentioned_count-T",gt="A-get_all_unread_mentioned_count-R",Tt="A-get_all_conversation-state-T",St="A-e_get_all_conversation_list-T",pt="A-e_get_all_conversation_list-R",It="A-e_get_conversation_list-T",ht="A-e_get_conversation_list-R",_t="A-e_search_conversation_by_content-T",Et="A-e_search_conversation_by_content-R",Rt="A-get_conversations-T",Ct="A-get_conversations-R",mt="A-e_search_messages-T",yt="A-e_search_messages-R",At="A-e_search_message_in_time_range-T",Nt="A-e_search_message_in_time_range-R",Ot="A-e_search_messages_by_user-T",Ut="A-e_search_messages_by_user-R",Mt="A-e_get_history_messages_by_message_types-T",wt="A-e_get_history_messages_by_message_types-R",Pt="A-e_get_continuous_messages-T",Lt="A-e_get_continuous_messages-R",bt="A-e_set_message_status_to_read-T",xt="A-e_set_message_status_to_read-R",Gt="A-e_set_message_received_status-T",Dt="A-e_set_message_received_status-R",Jt="A-e_set_message_sent_status-T",Vt="A-e_set_message_sent_status-R",Bt="A-e_set_message_sent_status_info-T",kt="A-e_set_message_sent_status_info-R",Ht="A-e_set_message_content-T",Ft="A-e_set_message_content-R",Yt="A-e_delete_messages-T",qt="A-e_delete_messages-R",jt="A-e_clear_messages-T",Kt="A-e_clear_messages-R",zt="A-e_delete_messages_by_timestamp-T",Wt="A-e_delete_messages_by_timestamp-R",Xt="A-e_insert_message-T",Qt="A-e_insert_message-R",Zt="A-e_batch_insert_message-T",$t="A-e_batch_insert_message-R",en="A-e_get_message_count-T",tn="A-e_get_message_count-R",nn="A-e_get_private_message_deliver_time-T",rn="A-e_get_private_message_deliver_time-R",on="A-e_get_group_message_deliver_list-T",an="A-e_get_group_message_deliver_list-R",sn="A-e_set_check_duplicate_message-T",dn="A-e_set_check_duplicate_message-R",un="A-e_set_check_duplicate_message-T",cn="A-e_set_check_duplicate_message-R",ln="A-batch_Remove_conversation-T",vn="A-batch_Remove_conversation-R",fn="A-batch_set_con_notifi_level-T",gn="A-batch_set_con_notifi_level-R",Tn="A-batch_set_con_to_top-T",Sn="A-batch_set_con_to_top-R",pn="A-batch_clear_remote_msg-T",In="A-batch_clear_remote_msg-R",hn="A-batch_clear_msg-T",_n="A-batch_clear_msg-R",En="A-get_remote_history_messages-T",Rn="A-get_remote_history_messages-R",Cn="A-recall_message-T",mn="A-recall_message-R",yn="A-delete_remote_message-T",An="A-delete_remote_message-R",Nn="A-delete_remote_message_by_timestamp-T",On="A-delete_remote_message_by_timestamp-R",Un="A-update_message_expansion-T",Mn="A-update_message_expansion-R",wn="A-remove_message_expansion_for_key-T",Pn="A-remove_message_expansion_for_key-R",Ln="A-get_message_reader-T",bn="A-get_message_reader-R",xn="A-get_first_unread_message-T",Gn="A-get_first_unread_message-R",Dn="A-get_first_unread_message_info-T",Jn="A-get_first_unread_message_info-R",Vn="A-insert_message-T",Bn="A-insert_message-R",kn="A-get_message-T",Hn="A-get_message-R",Fn="A-get_unread_mentioned_messages-T",Yn="A-get_unread_mentioned_messages-R",qn="A-delete_local_messages_by_timestamp-T",jn="A-delete_local_messages_by_timestamp-R",Kn="A-clear_messages-T",zn="A-clear_messages-R",Wn="A-search_conversation_by_content-T",Xn="A-search_conversation_by_content-R",Qn="A-clear_unread_count_by_timestamp-T",Zn="A-clear_unread_count_by_timestamp-R",$n="A-set_message_received_status-T",er="A-set_message_received_status-R",tr="A-set_proxy-T",nr="A-set_proxy-R",rr="A-get_proxy-T",or="A-get_proxy-R",ir="A-test_proxy-T",ar="A-test_proxy-R",sr="A-add_tag-T",dr="A-add_tag-R",ur="A-remove_tag-T",cr="A-remove_tag-R",lr="A-update_tag-T",vr="A-update_tag-R",fr="A-get_tags-T",gr="A-get_tags-R",Tr="A-get_tags_for_conversation-T",Sr="A-get_tags_for_conversation-R",pr="A-add_tag_for_conversations-T",Ir="A-add_tag_for_conversations-R",hr="A-remove_conversations_from_tag-T",_r="A-remove_conversations_from_tag-R",Er="A-remove_tags_from_conversation-T",Rr="A-remove_tags_from_conversation-R",Cr="A-remove_tag_from_conversations-T",mr="A-remove_tag_from_conversations-R",yr="A-get_conversations_from_tag_by_page-T",Ar="A-get_conversations_from_tag_by_page-R",Nr="A-get_unread_count_by_tag-T",Or="A-get_unread_count_by_tag-R",Ur="A-set_conversation_status_in_tag-R",Mr="A-get_ultra_group_list-T",wr="A-get_ultra_group_list-R",Pr="A-get_block_ultra_group_list-T",Lr="A-get_block_ultra_group_list-R",br="A-send_ultra_group_typing_status-T",xr="A-send_ultra_group_typing_status-R",Gr="A-get_ultra_group_message_list_by_message_uid-T",Dr="A-get_ultra_group_message_list_by_message_uid-R",Jr="A-update_expansion_for_ultra_group_message-T",Vr="A-update_expansion_for_ultra_group_message-R",Br="A-remove_expansion_for_ultra_group_message-T",kr="A-remove_expansion_for_ultra_group_message-R",Hr="A-remove_all_expansion_for_ultra_group_message-T",Fr="A-remove_all_expansion_for_ultra_group_message-R",Yr="A-modify_message-T",qr="A-modify_message-R",jr="A-get_ultra_group_unread_mentioned_count_by_target_id-T",Kr="A-get_ultra_group_unread_mentioned_count_by_target_id-R",zr="A-get_ultra_group_default_notification_level-T",Wr="A-get_ultra_group_default_notification_level-R",Xr="A-set_ultra_group_default_notification_level-T",Qr="A-set_ultra_group_default_notification_level-R",Zr="A-get_ultra_group_unread_count_by_target_id-T",$r="A-get_ultra_group_unread_count_by_target_id-R",eo="A-get_all_ultra_group_unread_count-T",to="A-get_all_ultra_group_unread_count-R",no="A-get_all_ultra_group_unread_mentioned_count-T",ro="A-get_all_ultra_group_unread_mentioned_count-R",oo="A-get_ultra_group_unread_mentioned_messages-T",io="A-get_ultra_group_unread_mentioned_messages-R",ao="A-get_ultra_group_first_unread_message_timestamp-T",so="A-get_ultra_group_first_unread_message_timestamp-R",uo="A-get_ultra_group_unread_info_list-T",co="A-get_ultra_group_unread_info_list-R",lo="A-subscribe_user_status-T",vo="A-subscribe_user_status-R",fo="A-unsubscribe_user_status-T",go="A-unsubscribe_user_status-R",To="A-get_subscribe_user_status-T",So="A-get_subscribe_user_status-R",po="A-get_subscribe_user_status_list-T",Io="A-get_subscribe_user_status_list-R",ho="A-get_message_by_timestamp-T",_o="A-get_message_by_timestamp-R",Eo="A-update_my_user_profile-T",Ro="A-update_my_user_profile-R",Co="A-get_user_profiles-T",mo="A-get_user_profiles-R",yo="A-get_my_user_profile-T",Ao="A-get_my_user_profile-R",No="A-update_my_user_profile_visibility-T",Oo="A-update_my_user_profile_visibility-R",Uo="A-get_my_user_profile_visibility-T",Mo="A-get_my_user_profile_visibility-R",wo="A-search_user_profile_by_unique_id-T",Po="A-search_user_profile_by_unique_id-R";exports.MessageAuditType=void 0,(Z=exports.MessageAuditType||(exports.MessageAuditType={}))[Z.DISALLOW=0]="DISALLOW",Z[Z.ALLOW=1]="ALLOW";var Lo=new e.EventEmitter,bo={connection:function(t,n){switch(t){case e.RCConnectionStatus.CONNECTED:Lo.emit(exports.Events.CONNECTED);break;case e.RCConnectionStatus.CONNECTING:Lo.emit(exports.Events.CONNECTING);break;case e.RCConnectionStatus.SUSPENDED:Lo.emit(exports.Events.SUSPEND,n);break;case e.RCConnectionStatus.DISCONNECTED:Lo.emit(exports.Events.DISCONNECT,n)}},batchMessage:function(e){Lo.emit(exports.Events.MESSAGES,{messages:e.map((function(e){return W(e)}))})},typingState:function(e){Lo.emit(exports.Events.TYPING_STATUS,{status:e})},readReceiptReceived:function(e,t,n,r){Lo.emit(exports.Events.READ_RECEIPT_RECEIVED,{conversation:e,messageUId:t,sentTime:n,sendUserId:r})},messageReceiptRequest:function(e,t,n){Lo.emit(exports.Events.MESSAGE_RECEIPT_REQUEST,{conversation:e,messageUId:t,senderUserId:n})},messageReceiptResponse:function(e,t,n){Lo.emit(exports.Events.MESSAGE_RECEIPT_RESPONSE,{conversation:e,receivedUserId:t,messageUIdList:n})},conversationState:function(t){var n=t.map((function(t){var n=t.conversationType,r={conversationType:n,latestMessage:t.latestMessage?W(t.latestMessage):null,targetId:t.targetId,unreadMessageCount:t.unreadMessageCount,unreadMentionedCount:t.unreadMentionedCount,notificationStatus:t.notificationStatus,notificationLevel:t.notificationLevel,lastUnreadTime:t.lastUnreadTime,channelId:t.channelId};return n===e.ConversationType.ULTRA_GROUP?(r.versionTime=t.versionTime,r.unreadMessageCount=xo(t.unreadMessageCount||0),r.unreadMentionedCount=xo(t.unreadMentionedCount||0),r.unreadMentionedMeCount=xo(t.unreadMentionedMeCount||0),{conversation:r}):(r.hasMentioned=t.hasMentioned,r.mentionedInfo=t.mentionedInfo,r.isTop=t.isTop,{conversation:r,updatedItems:t.updatedItems})}));Lo.emit(exports.Events.CONVERSATION,{conversationList:n})},chatroomState:function(e){Lo.emit(exports.Events.CHATROOM,e)},expansion:function(e){Lo.emit(exports.Events.EXPANSION,e)},pullFinished:function(){Lo.emit(exports.Events.PULL_OFFLINE_MESSAGE_FINISHED)},tag:function(){Lo.emit(exports.Events.TAG)},conversationTagChanged:function(){Lo.emit(exports.Events.CONVERSATION_TAG)},messageBlocked:function(e){Lo.emit(exports.Events.MESSAGE_BLOCKED,e)},messageDelivered:function(e){Lo.emit(exports.Events.PRIVATE_MESSAGE_DELIVERED,e)},groupMessageDeliveredStatus:function(e){Lo.emit(exports.Events.GROUP_MESSAGE_DELIVERED,e)},ultraGroupEnable:function(e){Lo.emit(exports.Events.ULTRA_GROUP_ENABLE,e.map((function(e){return X(e)})))},operateStatus:function(e){Lo.emit(exports.Events.OPERATE_STATUS,e)},ultraGroupMessageExpansionUpdated:function(e){Lo.emit(exports.Events.ULTRA_GROUP_MESSAGE_EXPANSION_UPDATED,e.map((function(e){return W(e)})))},ultraGroupMessageModified:function(e){Lo.emit(exports.Events.ULTRA_GROUP_MESSAGE_MODIFIED,e.map((function(e){return W(e)})))},ultraGroupMessageRecalled:function(e){Lo.emit(exports.Events.ULTRA_GROUP_MESSAGE_RECALLED,e.map((function(e){return W(e)})))},ultraGroupChannelChangeType:function(e){Lo.emit(exports.Events.ULTRA_GROUP_CHANNEL_TYPE_CHANGE,e)},ultraGroupChannelUserKicked:function(e){Lo.emit(exports.Events.ULTRA_GROUP_CHANNEL_USER_KICKED,e)},ultraGroupChannelDelete:function(e){Lo.emit(exports.Events.ULTRA_GROUP_CHANNEL_DELETE,e)},userGroupStatus:function(e){Lo.emit(exports.Events.USER_GROUP_STATUS,e)},messageReadReceipt:function(e){Lo.emit(exports.Events.MESSAGE_READ_RECEIPT_V4,e)},syncReadStatus:function(e){Lo.emit(exports.Events.SYNC_READ_STATUS,e)},subscribedUserStatusChange:function(e){Lo.emit(exports.Events.SUBSCRIBED_USER_STATUS_CHANGE,e)},subscribedRelationChange:function(e){Lo.emit(exports.Events.SUBSCRIBED_RELATION_CHANGE,e)},syncSubscribedUserStatusFinished:function(e){Lo.emit(exports.Events.SYNC_SUBSCRIBED_USER_STATUS_FINISHED,e)},ownUserProfileChanged:function(e){Lo.emit(exports.Events.OWN_USER_PROFILE_CHANGED,e)}};function xo(e){return e>999?999:e}e.VersionManage.add("imlib-next","5.10.2");var Go=null,Do=null,Jo=null;function Vo(){return o(this,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return Go?(Jo.info(e.LogTagId.A_DESTROY_O),[4,e.APIContext.destroy()]):[2];case 1:return t.sent(),Do=null,Go=null,Jo=null,[2]}}))}))}function Bo(e){if(!Go)throw new Error("Not initialized yet!");return e(Go,Jo,Do)}function ko(t){return Go?t(Go,Jo,Do):Promise.resolve({code:e.ErrorCode.BIZ_ERROR_CLIENT_NOT_INIT})}function Ho(){Lo.clear()}var Fo={TIMEOUT:{code:-1,msg:"Network timeout"},REJECTED_BY_BLACKLIST:{code:405,msg:"Blacklisted by the other party"},SEND_TOO_FAST:{code:20604,msg:"Sending messages too quickly"},NOT_IN_GROUP:{code:22406,msg:"Not in group"},ULTRA_GROUP_USER_NOT_IN_PRIVATE_CHANNEL:{code:e.ErrorCode.ULTRA_GROUP_USER_NOT_IN_PRIVATE_CHANNEL,msg:"ultra group user not in private channel"},FORBIDDEN_IN_GROUP:{code:22408,msg:"Forbbiden from speaking in the group"},NOT_IN_CHATROOM:{code:23406,msg:"Not in chatRoom"},FORBIDDEN_IN_CHATROOM:{code:23408,msg:"Forbbiden from speaking in the chatRoom"},KICKED_FROM_CHATROOM:{code:23409,msg:"Kicked out and forbbiden from joining the chatRoom"},CHATROOM_NOT_EXIST:{code:23410,msg:"ChatRoom does not exist"},CHATROOM_IS_FULL:{code:23411,msg:"ChatRoom members exceeded"},PARAMETER_INVALID_CHATROOM:{code:23412,msg:"Invalid chatRoom parameters"},ROAMING_SERVICE_UNAVAILABLE_CHATROOM:{code:23414,msg:"ChatRoom message roaming service is not open, Please go to the developer to open this service"},RECALLMESSAGE_PARAMETER_INVALID:{code:25101,msg:"Invalid recall message parameter"},ROAMING_SERVICE_UNAVAILABLE_MESSAGE:{code:25102,msg:"Single group chat roaming service is not open, Please go to the developer to open this service"},PUSHSETTING_PARAMETER_INVALID:{code:26001,msg:"Invalid push parameter"},OPERATION_BLOCKED:{code:20605,msg:"Operation is blocked"},OPERATION_NOT_SUPPORT:{code:20606,msg:"Operation is not supported"},MSG_BLOCKED_SENSITIVE_WORD:{code:21501,msg:"The sent message contains sensitive words"},REPLACED_SENSITIVE_WORD:{code:21502,msg:"Sensitive words in the message have been replaced"},NOT_CONNECTED:{code:30001,msg:"Please connect successfully first"},NAVI_REQUEST_ERROR:{code:30007,msg:"Navigation http request failed"},CMP_REQUEST_ERROR:{code:30010,msg:"CMP sniff http request failed"},CONN_APPKEY_FAKE:{code:31002,msg:"Your appkey is fake"},CONN_MINI_SERVICE_NOT_OPEN:{code:31003,msg:"Mini program service is not open, Please go to the developer to open this service"},CONN_ACK_TIMEOUT:{code:31e3,msg:"Connection ACK timeout"},CONN_TOKEN_INCORRECT:{code:31004,msg:"Your token is not valid or expired"},CONN_NOT_AUTHRORIZED:{code:31005,msg:"AppKey and Token do not match"},CONN_REDIRECTED:{code:31006,msg:"Connection redirection"},CONN_APP_BLOCKED_OR_DELETED:{code:31008,msg:"AppKey is banned or deleted"},CONN_USER_BLOCKED:{code:31009,msg:"User blocked"},CONN_DOMAIN_INCORRECT:{code:31012,msg:"Connect domain error, Please check the set security domain"},ROAMING_SERVICE_UNAVAILABLE:{code:33007,msg:"Roaming service cloud is not open, Please go to the developer to open this service"},RC_CONNECTION_EXIST:{code:34001,msg:"Connection already exists"},CHATROOM_KV_EXCEED:{code:23423,msg:"ChatRoom KV setting exceeds maximum"},CHATROOM_KV_OVERWRITE_INVALID:{code:23424,msg:"ChatRoom KV already exists"},CHATROOM_KV_STORE_NOT_OPEN:{code:23426,msg:"ChatRoom KV storage service is not open, Please go to the developer to open this service"},CHATROOM_KEY_NOT_EXIST:{code:23427,msg:"ChatRoom key does not exist"},MSG_KV_NOT_SUPPORT:{code:34008,msg:"The message cannot be extended"},SEND_MESSAGE_KV_FAIL:{code:34009,msg:"Sending RC expansion message fail"},EXPANSION_LIMIT_EXCEET:{code:34010,msg:"The message expansion size is beyond the limit"},ILLGAL_PARAMS:{code:33003,msg:"Incorrect parameters passed in while calling the interface"},UPLOAD_FILE_FAILED:{code:35020,msg:"File upload failed"},CHATROOM_KV_STORE_NOT_ALL_SUCCESS:{code:23428,msg:"Chatroom kv store not all success"},CHATROOM_KV_STORE_OUT_LIMIT:{code:23429,msg:"Chatroom kv's length is out of limit"},TAG_EXISTS:{code:33101,msg:"The tag already exists"},TAG_NOT_EXIST:{code:33100,msg:"The tag does not exist"},NOT_SUPPORT:{code:e.ErrorCode.NOT_SUPPORT,msg:"The method is not supported in a browser!"}},Yo={},qo={};for(var jo in Fo){var Ko=Fo[jo],zo=Ko.code;Yo[zo]=jo,qo[zo]=Ko}Fo.ROAMING_SERVICE_UNAVAILABLE.code;var Wo=function(t,n,r,a){return void 0===a&&(a=""),o(void 0,void 0,void 0,(function(){var o,s;return i(this,(function(i){switch(i.label){case 0:return o=function(t,n,r){void 0===r&&(r="");var o="conversationType:"+n.conversationType+",targetId:"+n.targetId;return t.debug(e.LogTagId.O,r+" -> "+o),o}(t,n,a),[4,r()];case 1:return(s=i.sent())!==e.ErrorCode.SUCCESS?(t.warn(e.LogTagId.O,a+" fail -> "+s+" : "+Yo[s]+" , "+o),[2,{code:s,msg:Yo[s]}]):[2,{code:s}]}}))}))};var Xo=function(e,t,n,r){void 0===n&&(n=!0),void 0===r&&(r=!0),this.messageType=e,this.content=t,this.isPersited=n,this.isCounted=r};function Qo(e,t,n){void 0===t&&(t=!0),void 0===n&&(n=!0);return function(r){return new Xo(e,r,t,n)}}var Zo,$o=Qo("RC:ImgMsg"),ei=Qo("RC:HQVCMsg"),ti=Qo("RC:SightMsg"),ni=Qo("RC:TxtMsg"),ri=Qo("RC:CombineMsg"),oi=Qo(e.MessageType.COMBINE_V2),ii=Qo("RC:FileMsg"),ai=Qo("RC:GIFMsg"),si=Qo("RC:VcMsg"),di=Qo("RC:LBSMsg"),ui=Qo("RC:ReferenceMsg"),ci=Qo("RC:ImgTextMsg"),li=Qo("RC:CmdMsg"),vi=Qo("RC:InfoNtf"),fi=Qo("RC:GrpNtf");!function(e){e.ALIYUN="aliyun",e.S3="s3",e.STC="stc",e.MINIO="minio",e.QINIU="qiniu",e.BAIDU="baidu",e.RCX="rcx"}(Zo||(Zo={}));var gi,Ti=function(){function t(e,t,n){this.isSupportMultipart=!1,this._serverType=0,this._isAbort=!1,this._url=e,this._getFileToken=t,this._serverType=n}return t.prototype.isAbort=function(){return this._isAbort},t.prototype.abort=function(){this._isAbort=!0,this._abortHandler()},t.prototype.upload=function(t){return t.file.size>e.MAX_UPLOAD_FILE_SIZE?Promise.resolve({code:e.ErrorCode.UPLOAD_FAIL,msg:"the file size is over 5GB!"}):t.file.size>e.UPLOAD_FILE_CHUNK_SIZE&&this.isSupportMultipart?this.multipartUpload(t):this.commonUpload(t)},t}(),Si=function(t){function r(){var e=null!==t&&t.apply(this,arguments)||this;return e._promise=null,e}return n(r,t),r.prototype.commonUpload=function(t){return o(this,void 0,void 0,(function(){var n,r,o,a,s,d,u;return i(this,(function(i){switch(i.label){case 0:n=t.file,r=t.onProgress,o=t.fileType,i.label=1;case 1:return i.trys.push([1,3,,4]),[4,this._getFileToken(o,n.name)];case 2:return a=i.sent(),[3,4];case 3:return[2,{code:i.sent()}];case 4:return s={},(d=new FormData).set("token",a.token),d.set("key",a.fileName),d.set("file",n),this._promise=e.httpRequest({url:e.fixUrlProtocol(this._url),headers:s,onProgress:function(e){return null==r?void 0:r(e.loaded,e.total)},method:"POST",body:d,timeout:0}),[4,this._promise.result()];case 5:return u=i.sent().status,this._promise=null,200===u||204===u?[2,{code:e.ErrorCode.SUCCESS,data:{uniqueName:a.fileName,uploadMethod:e.UploadMethod.QINIU}}]:[2,{code:e.ErrorCode.UPLOAD_FAIL,msg:u.toString()}]}}))}))},r.prototype.multipartUpload=function(e){return o(this,void 0,void 0,(function(){return i(this,(function(e){throw new Error("Method not implemented.")}))}))},r.prototype._abortHandler=function(){var e;null===(e=this._promise)||void 0===e||e.abort()},r}(Ti),pi=function(t){function r(){var e=null!==t&&t.apply(this,arguments)||this;return e._promise=null,e}return n(r,t),r.prototype.commonUpload=function(t){return o(this,void 0,void 0,(function(){var n,r,o,a,s,d,u;return i(this,(function(i){switch(i.label){case 0:n=t.file,r=t.onProgress,o=t.fileType,i.label=1;case 1:return i.trys.push([1,3,,4]),[4,this._getFileToken(o)];case 2:return a=i.sent(),[3,4];case 3:return[2,{code:i.sent()}];case 4:return s=e.fixUrlProtocol(a.ossBucketName+"."+this._url),(d=new FormData).set("token",a.token),d.set("OSSAccessKeyId",a.osskeyId),d.set("policy",a.ossPolicy),d.set("Signature",a.ossSign),d.set("success_action_status","200"),d.set("key",a.fileName),d.set("file",n),this._promise=e.httpRequest({url:s,onProgress:function(e){return null==r?void 0:r(e.loaded,e.total)},method:"POST",body:d,timeout:0}),[4,this._promise.result()];case 5:return u=i.sent().status,this._promise=null,200===u||204===u?[2,{code:e.ErrorCode.SUCCESS,data:{uniqueName:a.fileName,uploadMethod:e.UploadMethod.ALI}}]:[2,{code:e.ErrorCode.UPLOAD_FAIL,msg:u.toString()}]}}))}))},r.prototype._abortHandler=function(){var e;null===(e=this._promise)||void 0===e||e.abort()},r.prototype.multipartUpload=function(e){throw new Error("Method not implemented.")},r}(Ti),Ii=function(t){function r(){var e=null!==t&&t.apply(this,arguments)||this;return e._promise=null,e}return n(r,t),r.prototype.commonUpload=function(t){return o(this,void 0,void 0,(function(){var n,r,o,a,s,d,u,c,l;return i(this,(function(i){switch(i.label){case 0:n=t.file,r=t.onProgress,o=t.fileType,a=t.contentDisposition,i.label=1;case 1:return i.trys.push([1,3,,4]),[4,this._getFileToken(o<=e.FileType.FILE?o:e.FileType.FILE)];case 2:return s=i.sent(),[3,4];case 3:return[2,{code:i.sent()}];case 4:return d=a||("text/html"===n.type?"inline":"attachment"),u={authorization:s.bosToken,"x-bce-date":s.bosDate,"Content-Disposition":d+"; filename="+encodeURIComponent(n.name)+";"},c=e.fixUrlProtocol(""+this._url+s.path),this._promise=e.httpRequest({url:c,headers:u,onProgress:function(e){return null==r?void 0:r(e.loaded,e.total)},method:"POST",body:n,timeout:0}),[4,this._promise.result()];case 5:return l=i.sent().status,this._promise=null,200===l||204===l?[2,{code:e.ErrorCode.SUCCESS,data:{uniqueName:s.fileName,downloadUrl:c}}]:[2,{code:e.ErrorCode.UPLOAD_FAIL,msg:l.toString()}]}}))}))},r.prototype.multipartUpload=function(e){throw new Error("Method not implemented.")},r.prototype._abortHandler=function(){var e;null===(e=this._promise)||void 0===e||e.abort()},r}(Ti),hi=function(t){function r(){var e=null!==t&&t.apply(this,arguments)||this;return e._promise=null,e.isSupportMultipart=!0,e}return n(r,t),r.prototype.commonUpload=function(t){return o(this,void 0,void 0,(function(){var n,r,o,a,s,d,u;return i(this,(function(i){switch(i.label){case 0:n=t.file,r=t.onProgress,o=t.fileType,i.label=1;case 1:return i.trys.push([1,3,,4]),[4,this._getFileToken(o)];case 2:return a=i.sent(),[3,4];case 3:return[2,{code:i.sent()}];case 4:return s=e.fixUrlProtocol(this._url+"/"+a.minioBucketName+"/"+a.fileName),d=this.getBaseHeaders(n,a,t),this._promise=e.httpRequest({url:s,headers:d,onProgress:function(e){return null==r?void 0:r(e.loaded,e.total)},method:"PUT",body:n,timeout:0}),[4,this._promise.result()];case 5:return u=i.sent().status,this._promise=null,200===u||204===u?[2,{code:e.ErrorCode.SUCCESS,data:{uniqueName:a.fileName,uploadMethod:e.UploadMethod.MINIO}}]:[2,{code:e.ErrorCode.UPLOAD_FAIL,msg:u.toString()}]}}))}))},r.prototype.multipartUpload=function(t){var n;return o(this,void 0,void 0,(function(){var r,o,a,s,d,u,c,l,v,f,g,T,S,p,I,h;return i(this,(function(i){switch(i.label){case 0:r=t.file,o=t.fileType,i.label=1;case 1:return i.trys.push([1,3,,4]),[4,this._getFileToken(o,r.name,"POST","uploads")];case 2:return a=i.sent(),[3,4];case 3:return[2,{code:i.sent()}];case 4:return s=e.fixUrlProtocol(this._url+"/"+a.minioBucketName+"/"+a.fileName),d=this.getBaseHeaders(r,a,t),this._promise=e.httpRequest({url:s+"?uploads",headers:d,method:"POST"}),[4,this._promise.result()];case 5:return u=i.sent(),c=u.status,l=u.data,this._promise=null,v=null===(n=null==l?void 0:l.match(/(?:<UploadId>)(\S*?)(?:<\/UploadId>)/))||void 0===n?void 0:n[1],200!==c&&204!==c||!v?[2,{code:e.ErrorCode.UPLOAD_FAIL,msg:"start upload fail"}]:(f=[],[4,this.requestUploadPart(s,r,v,a.fileName,t,f)]);case 6:if(g=i.sent(),T=g.code,S=g.msg,T!==e.ErrorCode.SUCCESS)return[2,{code:T,msg:S}];i.label=7;case 7:return i.trys.push([7,9,,10]),[4,this._getFileToken(o,a.fileName,"POST","uploadId="+v)];case 8:return a=i.sent(),[3,10];case 9:return[2,{code:i.sent()}];case 10:return p=f.map((function(e,t){return"<Part><PartNumber>"+(t+1)+"</PartNumber><ETag>"+e+"</ETag></Part>"})).join(""),p="<CompleteMultipartUpload xmlns='http://s3.amazonaws.com/doc/2006-03-01/'>"+p+"</CompleteMultipartUpload>",I=this.getBaseHeaders(r,a,t),this._promise=e.httpRequest({url:s+"?uploadId="+v,headers:I,method:"POST",body:p,timeout:0}),[4,this._promise.result()];case 11:return h=i.sent().status,this._promise=null,200===h||204===h?[2,{code:e.ErrorCode.SUCCESS,data:{uniqueName:a.fileName,uploadMethod:e.UploadMethod.MINIO}}]:[2,{code:e.ErrorCode.UPLOAD_FAIL,msg:"end upload fail"}]}}))}))},r.prototype.requestUploadPart=function(t,n,r,a,s,d,u,c){return void 0===u&&(u=1),void 0===c&&(c=0),o(this,void 0,void 0,(function(){var o,l,v,f,g,T,S,p,I;return i(this,(function(i){switch(i.label){case 0:if(c>=5)return[2,{code:e.ErrorCode.UPLOAD_FAIL,msg:"Upload retry times exceeded 5. Procedure"}];o=(u-1)*e.UPLOAD_FILE_CHUNK_SIZE,l=Math.min(e.UPLOAD_FILE_CHUNK_SIZE,n.size-o),v="partNumber="+u+"&uploadId="+r,i.label=1;case 1:return i.trys.push([1,3,,4]),[4,this._getFileToken(s.fileType,a,"PUT",v)];case 2:return f=i.sent(),[3,4];case 3:return[2,{code:i.sent()}];case 4:return g=n.slice(o,u*e.UPLOAD_FILE_CHUNK_SIZE),T=this.getBaseHeaders(n,f,s),this._promise=e.httpRequest({url:t+"?"+v,headers:T,method:"PUT",body:g,timeout:0,onProgress:function(e){var t;return null===(t=null==s?void 0:s.onProgress)||void 0===t?void 0:t.call(s,o+e.loaded,n.size)}}),[4,this._promise.result()];case 5:return S=i.sent(),p=S.status,I=S.xhr,this._promise=null,200===p||204===p?(d.push((null==I?void 0:I.getResponseHeader("ETag"))||""),o+l<n.size?[2,this.requestUploadPart(t,n,r,a,s,d,u+1,0)]:[2,{code:e.ErrorCode.SUCCESS}]):[2,this.requestUploadPart(t,n,r,a,s,d,u,c+1)]}}))}))},r.prototype.getBaseHeaders=function(e,t,n){return{"Content-Disposition":(n.contentDisposition||("text/html"===e.type?"inline":"attachment"))+"; filename="+encodeURIComponent(e.name)+";",Authorization:t.minioAuthorization,"x-amz-content-sha256":t.minioContentSha256,"x-amz-date":t.minioDate,"Content-Type":e.type||"text/plain"}},r.prototype._abortHandler=function(){var e;null===(e=this._promise)||void 0===e||e.abort()},r}(Ti),_i=function(t){function r(){var e=null!==t&&t.apply(this,arguments)||this;return e.isSupportMultipart=!0,e._promise=null,e}return n(r,t),r.prototype.commonUpload=function(t){return o(this,void 0,void 0,(function(){var n,r,o,a,s,d,u,c,l,v,f;return i(this,(function(i){switch(i.label){case 0:n=t.file,r=t.onProgress,o=t.fileType,i.label=1;case 1:return i.trys.push([1,3,,4]),[4,this._getFileToken(o,n.name)];case 2:return a=i.sent(),[3,4];case 3:return[2,{code:i.sent()}];case 4:return s={},(d=new FormData).set("token",a.token),d.set("key",a.fileName),d.set("file",n),u=e.fixUrlProtocol(this._url),this._promise=e.httpRequest({url:u,headers:s,onProgress:function(e){return null==r?void 0:r(e.loaded,e.total)},method:"POST",body:d,timeout:0}),[4,this._promise.result()];case 5:return c=i.sent(),l=c.status,v=c.data,this._promise=null,200!==l&&204!==l||!v?[2,{code:e.ErrorCode.UPLOAD_FAIL,msg:l.toString()}]:(f=JSON.parse(v),[2,{code:e.ErrorCode.SUCCESS,data:{uniqueName:f.rc_url.file_name,downloadUrl:u+"/"+f.rc_url.path}}])}}))}))},r.prototype.multipartUpload=function(t){return o(this,void 0,void 0,(function(){var n,r,o,a,s;return i(this,(function(i){switch(i.label){case 0:n=t.file,r=t.onProgress,o=t.fileType,a=e.getUUID(),i.label=1;case 1:return i.trys.push([1,3,,4]),[4,this._getFileToken(o,n.name)];case 2:return s=i.sent(),[3,4];case 3:return[2,{code:i.sent()}];case 4:return[2,this._requestUploadPart(a,n,s.token,r)]}}))}))},r.prototype._requestUploadPart=function(t,n,r,a,s){return void 0===s&&(s=0),o(this,void 0,void 0,(function(){var o,d,u,c,l,v,f,g,T,S;return i(this,(function(i){switch(i.label){case 0:return o=Math.min(e.UPLOAD_FILE_CHUNK_SIZE,n.size-s),d=t+n.name.substring(n.name.lastIndexOf(".")),u={Range:"bytes="+s+"-"+(s+o),"X-File-TransactionId":d,"X-File-Total-Size":n.size.toString()},c=n.slice(s,s+o),(l=new FormData).set("file",c,n.name),l.set("key",d),l.set("name",d),l.set("token",r),v=e.fixUrlProtocol(this._url),this._promise=e.httpRequest({url:v,headers:u,onProgress:function(e){return null==a?void 0:a(s+e.loaded,n.size)},method:"POST",body:l,timeout:0}),[4,this._promise.result()];case 1:return f=i.sent(),g=f.status,T=f.data,this._promise=null,200===g||204===g?s+o<n.size?[2,this._requestUploadPart(t,n,r,a,s+o)]:(S=JSON.parse(T),[2,{code:e.ErrorCode.SUCCESS,data:{uniqueName:S.rc_url.file_name,downloadUrl:v+"/"+S.rc_url.path}}]):[2,{code:e.ErrorCode.UPLOAD_FAIL,msg:g.toString()}]}}))}))},r.prototype._abortHandler=function(){var e;null===(e=this._promise)||void 0===e||e.abort()},r}(Ti),Ei=function(t){function r(){var e=null!==t&&t.apply(this,arguments)||this;return e._promise=null,e}return n(r,t),r.prototype.commonUpload=function(t){return o(this,void 0,void 0,(function(){var n,r,o,a,s,d,u,c,l,v;return i(this,(function(i){switch(i.label){case 0:n=t.file,r=t.onProgress,o=t.fileType,a=t.contentDisposition,i.label=1;case 1:return i.trys.push([1,3,,4]),[4,this._getFileToken(o,n.name)];case 2:return s=i.sent(),[3,4];case 3:return[2,{code:i.sent()}];case 4:return d={},u=e.fixUrlProtocol(s.s3BucketName+"."+this._url),c=new FormData,a?c.set("Content-Disposition",a):c.set("Content-Disposition","text/html"===n.type?"inline;":"attachment;"),c.set("Content-Type",n.type),c.set("x-amz-credential",s.s3Credential),c.set("x-amz-algorithm",s.s3Algorithm),c.set("x-amz-date",s.s3Date),c.set("policy",s.s3Policy),c.set("x-amz-signature",s.s3Signature),c.set("key",s.fileName),c.set("file",n),this._promise=e.httpRequest({url:u,headers:d,onProgress:function(e){return null==r?void 0:r(e.loaded,e.total)},method:"POST",body:c,timeout:0}),[4,this._promise.result()];case 5:return l=i.sent(),v=l.status,this._promise=null,200===v||204===v?[2,{code:e.ErrorCode.SUCCESS,data:{uniqueName:s.fileName,uploadMethod:e.UploadMethod.AWS}}]:[2,{code:e.ErrorCode.UPLOAD_FAIL,msg:v.toString()}]}}))}))},r.prototype.multipartUpload=function(e){throw new Error("Method not implemented.")},r.prototype._abortHandler=function(){var e;null===(e=this._promise)||void 0===e||e.abort()},r}(Ti),Ri=function(t){function r(){var e=null!==t&&t.apply(this,arguments)||this;return e._promise=null,e.isSupportMultipart=!0,e}return n(r,t),r.prototype.commonUpload=function(t){return o(this,void 0,void 0,(function(){var n,r,o,a,s,d,u;return i(this,(function(i){switch(i.label){case 0:n=t.file,r=t.onProgress,o=t.fileType,i.label=1;case 1:return i.trys.push([1,3,,4]),[4,this._getFileToken(o)];case 2:return a=i.sent(),[3,4];case 3:return[2,{code:i.sent()}];case 4:return s=e.fixUrlProtocol(this._url+"/"+a.stcBucketName+"/"+a.fileName),d=this.getBaseHeaders(n,a,t),this._promise=e.httpRequest({url:s,headers:d,onProgress:function(e){return null==r?void 0:r(e.loaded,e.total)},method:"PUT",body:n,timeout:0}),[4,this._promise.result()];case 5:return u=i.sent().status,this._promise=null,200===u||204===u?[2,{code:e.ErrorCode.SUCCESS,data:{uniqueName:a.fileName,uploadMethod:e.UploadMethod.STC}}]:[2,{code:e.ErrorCode.UPLOAD_FAIL}]}}))}))},r.prototype.multipartUpload=function(t){var n;return o(this,void 0,void 0,(function(){var r,o,a,s,d,u,c,l,v,f,g,T,S,p,I,h;return i(this,(function(i){switch(i.label){case 0:r=t.file,o=t.fileType,i.label=1;case 1:return i.trys.push([1,3,,4]),[4,this._getFileToken(o,r.name,"POST","uploads")];case 2:return a=i.sent(),[3,4];case 3:return[2,{code:i.sent()}];case 4:return s=e.fixUrlProtocol(this._url+"/"+a.stcBucketName+"/"+a.fileName),d=this.getBaseHeaders(r,a,t),this._promise=e.httpRequest({url:s+"?uploads",headers:d,method:"POST"}),[4,this._promise.result()];case 5:return u=i.sent(),c=u.status,l=u.data,this._promise=null,v=null===(n=null==l?void 0:l.match(/(?:<UploadId>)(\S*?)(?:<\/UploadId>)/))||void 0===n?void 0:n[1],200!==c&&204!==c||!v?[2,{code:e.ErrorCode.UPLOAD_FAIL,msg:"start upload fail"}]:(f=[],[4,this.requestUploadPart(s,r,v,a.fileName,t,f)]);case 6:if(g=i.sent(),T=g.code,S=g.msg,T!==e.ErrorCode.SUCCESS)return[2,{code:T,msg:S}];i.label=7;case 7:return i.trys.push([7,9,,10]),[4,this._getFileToken(o,a.fileName,"POST","uploadId="+v)];case 8:return a=i.sent(),[3,10];case 9:return[2,{code:i.sent()}];case 10:return p=f.map((function(e,t){return"<Part><PartNumber>"+(t+1)+"</PartNumber><ETag>"+e+"</ETag></Part>"})).join(""),p="<CompleteMultipartUpload xmlns='http://s3.amazonaws.com/doc/2006-03-01/'>"+p+"</CompleteMultipartUpload>",I=this.getBaseHeaders(r,a,t),this._promise=e.httpRequest({url:s+"?uploadId="+v,headers:I,method:"POST",body:p}),[4,this._promise.result()];case 11:return h=i.sent().status,this._promise=null,200===h||204===h?[2,{code:e.ErrorCode.SUCCESS,data:{uniqueName:a.fileName,uploadMethod:e.UploadMethod.STC}}]:[2,{code:e.ErrorCode.UPLOAD_FAIL,msg:"end upload fail"}]}}))}))},r.prototype.requestUploadPart=function(t,n,r,a,s,d,u,c){return void 0===u&&(u=1),void 0===c&&(c=0),o(this,void 0,void 0,(function(){var o,l,v,f,g,T,S,p,I;return i(this,(function(i){switch(i.label){case 0:if(c>=5)return[2,{code:e.ErrorCode.UPLOAD_FAIL,msg:"Upload retry times exceeded 5. Procedure"}];o=(u-1)*e.UPLOAD_FILE_CHUNK_SIZE,l=Math.min(e.UPLOAD_FILE_CHUNK_SIZE,n.size-o),v="partNumber="+u+"&uploadId="+r,i.label=1;case 1:return i.trys.push([1,3,,4]),[4,this._getFileToken(s.fileType,a,"PUT",v)];case 2:return f=i.sent(),[3,4];case 3:return[2,{code:i.sent()}];case 4:return g=n.slice(o,u*e.UPLOAD_FILE_CHUNK_SIZE),T=this.getBaseHeaders(n,f,s),this._promise=e.httpRequest({url:t+"?"+v,headers:T,method:"PUT",body:g,onProgress:function(e){var t;return null===(t=null==s?void 0:s.onProgress)||void 0===t?void 0:t.call(s,o+e.loaded,n.size)},timeout:0}),[4,this._promise.result()];case 5:return S=i.sent(),p=S.status,I=S.xhr,this._promise=null,200===p||204===p?(d.push((null==I?void 0:I.getResponseHeader("ETag"))||""),o+l<n.size?[2,this.requestUploadPart(t,n,r,a,s,d,u+1,0)]:[2,{code:e.ErrorCode.SUCCESS}]):[2,this.requestUploadPart(t,n,r,a,s,d,u,c+1)]}}))}))},r.prototype.getBaseHeaders=function(e,t,n){return{"Content-Disposition":(n.contentDisposition||("text/html"===e.type?"inline":"attachment"))+"; filename="+encodeURIComponent(e.name)+";",Authorization:t.stcAuthorization,"x-amz-content-sha256":t.stcContentSha256,"x-amz-date":t.stcDate,"Content-Type":e.type||"text/plain"}},r.prototype._abortHandler=function(){var e;null===(e=this._promise)||void 0===e||e.abort()},r}(Ti);var Ci=((gi={})[Zo.QINIU]=Si,gi[Zo.ALIYUN]=pi,gi[Zo.BAIDU]=Ii,gi[Zo.S3]=Ei,gi[Zo.STC]=Ri,gi[Zo.MINIO]=hi,gi[Zo.RCX]=_i,gi);function mi(t,n,o,i){var a=document.createElement("canvas"),s=a.getContext("2d"),d=new Image;d.onload=function(n){var u=i||{},c=u.maxHeight,l=void 0===c?160:c,v=u.maxWidth,f=void 0===v?160:v,g=u.quality,T=void 0===g?.7:g,S=u.scale,p=void 0===S?1:S,I=Ai(d.width,d.height,{maxHeight:l,maxWidth:f,scale:p});a.width=Math.min(I.w,f),a.height=Math.min(I.h,l),s.drawImage(d,I.x,I.y,I.w,I.h);var h=yi(a,T);h=h.replace(/data:image\/[^;]+;base64,/,""),t({code:e.ErrorCode.SUCCESS,data:r(r({},o),{thumbnail:h,width:I.w,height:I.h})})},d.onerror=function(n){t({code:e.ErrorCode.UPLOAD_FAIL,msg:"get image info fail:"+JSON.stringify(n)})},d.src=(window.URL||window.webkitURL).createObjectURL(n)}function yi(t,n){var r=t.toDataURL("image/jpeg",n);return r.length>e.MAX_MESSAGE_CONTENT_BYTES-10240?yi(t,n-.1):r}var Ai=function(e,t,n){var r,o,i=n.maxHeight,a=void 0===i?160:i,s=n.maxWidth,d=void 0===s?160:s,u=n.scale,c=e<t,l=0,v=0;return(c?t/e:e/t)>(void 0===u?1:u)?(c?(r=100,v=((o=t/(e/100))-a)/2):(o=100,l=((r=e/(t/100))-d)/2),{w:r,h:o,x:-l,y:-v}):(c?(o=a,r=e/(t/a)):(r=d,o=t/(e/d)),{w:r,h:o,x:-l,y:-v})},Ni=0,Oi=function(){function t(e,t){this._client=null,this.id=++Ni,this._promise=this._handleUpload(e,t)}return t.prototype.abort=function(){var t;this._resolve({code:e.ErrorCode.UPLOAD_FAIL,msg:"upload abort"}),null===(t=this._client)||void 0===t||t.abort()},t.prototype._uploadInLoop=function(t,n,r,a,s){return void 0===s&&(s=[]),o(this,void 0,void 0,(function(){var o,d,u,c,l,v;return i(this,(function(i){switch(i.label){case 0:o=0,i.label=1;case 1:return o<t.length?(d=t[o],this._client=new Ci[d.type](d.url,r,a),[4,this._client.upload(n)]):[3,4];case 2:if(u=i.sent(),c=u.code,l=u.data,v=u.msg,c===e.ErrorCode.SUCCESS)return[2,{code:c,data:l}];if(this._client.isAbort())return this._client=null,[2,{code:c,data:l,msg:v}];this._client=null,s.push({type:d.type,url:d.url,code:c,msg:v}),i.label=3;case 3:return o++,[3,1];case 4:return[2,{code:e.ErrorCode.UPLOAD_FAIL,msg:"Failed to upload all channels, msg: "+JSON.stringify(s)}]}}))}))},t.prototype._handleUpload=function(t,n){return o(this,void 0,void 0,(function(){var a=this;return i(this,(function(s){return[2,new Promise((function(s){return o(a,void 0,void 0,(function(){var o,a,d,u,c,l,v,f,g,T,S,p,I,h,_,E,R,C,m;return i(this,(function(i){switch(i.label){case 0:return this._resolve=s,o=n.getFileToken,a=n.serverType,d=n.customDomain,u=n.ossConfig,c=n.uploadServer,l=n.bosAddr,v=t.file,f=t.fileType,g=t.thumbnailConfig,T=function(e,t,n,r,o){if(n)return[{type:Zo.RCX,url:n,p:"1"}];if(e)return JSON.parse(e).map((function(e){var t={type:Zo.QINIU,url:"",p:""};return Object.keys(e).forEach((function(n){"p"===n?t.p=e[n]:(t.type=n,t.url=e[n])})),t})).sort((function(e,t){return e.p-t.p}));var i=[];return r&&i.push({type:Zo.QINIU,url:r,p:"1"}),o&&i.push({type:Zo.BAIDU,url:o,p:"2"}),i}(u,0,d,c,l),0===T.length?(s({code:e.ErrorCode.INVALID_PARAMETER_MEDIA_URL,msg:"uploadUrlList is empty"}),[2]):[4,this._uploadInLoop(T,t,o,a)];case 1:if(S=i.sent(),p=S.code,I=S.data,h=S.msg,p!==e.ErrorCode.SUCCESS||!I)return s({code:p,msg:h}),[2];if(_=I.downloadUrl)return[3,5];i.label=2;case 2:return i.trys.push([2,4,,5]),[4,n.getFileUrl(f,I.uniqueName,v.name,void 0,I.uploadMethod)];case 3:return E=i.sent(),_=E.downloadUrl,[3,5];case 4:return R=i.sent(),s({code:R,msg:"Get download url fail"}),[3,5];case 5:return _?(C={downloadUrl:_,uniqueName:(null==I?void 0:I.uniqueName)||"",name:v.name,size:v.size,type:v.type},f!==e.FileType.AUDIO?[3,7]:[4,v.arrayBuffer()]):(s({code:e.ErrorCode.UPLOAD_FAIL,msg:"Get download url fail"}),[2]);case 6:return m=i.sent(),function(t,n,o){(new AudioContext).decodeAudioData(n,(function(n){t({code:e.ErrorCode.SUCCESS,data:r(r({},o),{duration:n.duration,length:n.length})})}),(function(n){t({code:e.ErrorCode.UPLOAD_FAIL,msg:"get audio info fail:"+JSON.stringify(n)})}))}(s,m,C),[2];case 7:return f===e.FileType.IMAGE?(mi(s,v,C,g),[2]):(s({code:p,data:C}),[2])}}))}))}))]}))}))},t.prototype.awaitResult=function(){return o(this,void 0,void 0,(function(){return i(this,(function(e){return[2,this._promise]}))}))},t}(),Ui={};function Mi(e,t){var n=new Oi(e,t);return function(e){o(this,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return Ui[e.id]=e,[4,e.awaitResult()];case 1:return t.sent(),delete Ui[e.id],[2]}}))}))}(n),n}function wi(e){var t=Ui[e];return!!t&&(t.abort(),!0)}var Pi=function(e,t){var n=e.getNaviInfoFromCache();return{getFileToken:e.getFileToken.bind(e),getFileUrl:e.getFileUrl.bind(e),customDomain:t.uploadDomain||"",serverType:null==n?void 0:n.type,ossConfig:null==n?void 0:n.ossConfig,uploadServer:null==n?void 0:n.uploadServer,bosAddr:null==n?void 0:n.bosAddr}};function Li(t){return o(this,void 0,void 0,(function(){var n,r,a;return i(this,(function(s){return n=t.contentDisposition,r=t.fileType,a=t.file,[2,new e.ValidatorManage("","").validate("contentDisposition",n,(function(e){return"inline"===e||"attachment"===e}),!1).validate("fileType",r,(function(t){return!!e.FileType[t]}),!0).validate("file",a,(function(t){return t instanceof File&&(!(r===e.FileType.IMAGE&&!t.type.match(/^image\//))&&!(r===e.FileType.AUDIO&&!t.type.match(/^audio\//)))}),!0).ifReady((function(e,n,r){return function(e,t){return o(this,void 0,void 0,(function(){return i(this,(function(n){return[2,new Oi(e,t).awaitResult()]}))}))}(t,Pi(e,r))}))]}))}))}function bi(t,n,a){return o(this,void 0,void 0,(function(){var s=this;return i(this,(function(d){return[2,new e.ValidatorManage(e.LogTagId.A_SEND_MSG_T,e.LogTagId.A_SEND_MSG_R).validate("message",n,(function(){return n instanceof Xo}),!0).validate("conversation",t,e.AssertRules.OBJECT,!0).validate("conversationType",null==t?void 0:t.conversationType,e.AssertRules.CONVERSATION_TYPE,!0).validate("targetId",null==t?void 0:t.targetId,e.AssertRules.STRING,!0).validate("channelId",null==t?void 0:t.channelId,e.AssertRules.CHANNEL_ID).validate("isStatusMessage",null==a?void 0:a.isStatusMessage,e.AssertRules.BOOLEAN).validate("disableNotification",null==a?void 0:a.disableNotification,e.AssertRules.BOOLEAN).validate("pushContent",null==a?void 0:a.pushContent,e.AssertRules.STRING).validate("pushData",null==a?void 0:a.pushData,e.AssertRules.STRING).validate("isMentioned",null==a?void 0:a.isMentioned,e.AssertRules.BOOLEAN).validate("mentionedType",null==a?void 0:a.mentionedType,e.AssertRules.NUMBER).validate("mentionedUserIdList",null==a?void 0:a.mentionedUserIdList,e.isLimitedArray({itemValidator:e.isValidTargetId})).validate("directionalUserIdList",null==a?void 0:a.directionalUserIdList,e.isLimitedArray({maxLength:300,itemValidator:e.isValidTargetId})).validate("isVoipPush",null==a?void 0:a.isVoipPush,e.AssertRules.BOOLEAN).validate("canIncludeExpansion",null==a?void 0:a.canIncludeExpansion,e.AssertRules.BOOLEAN).validate("expansion",null==a?void 0:a.expansion,e.AssertRules.OBJECT).validate("pushConfig",null==a?void 0:a.pushConfig,e.AssertRules.OBJECT).validate("messageId",null==a?void 0:a.messageId,e.AssertRules.NUMBER).ifReady((function(d,u){return o(s,void 0,void 0,(function(){var o,s,c,l,v,f,g,T,S,p,I,h,_,E,R,C,m,y,A,N,O;return i(this,(function(i){switch(i.label){case 0:return s=(o=a||{}).disableNotification,c=o.isMentioned,l=o.directionalUserIdList,v=o.canIncludeExpansion,f=o.onSendBefore,g=o.expansion,T=o.pushConfig,S=o.isStatusMessage,p=u.createTraceId(),I=t.conversationType,h=t.targetId,_=t.channelId,l&&l.length>0&&![3,10].includes(I)?[2,{code:e.ErrorCode.RC_DIRECTIONAL_MESSAGE_INVALID_CONVERSATION_TYPE}]:(E=function(e,t,n){var o=e.isStatusMessage,i=e.disableNotification,a=e.pushContent,s=e.pushData,d=e.isMentioned,u=e.mentionedType,c=e.mentionedUserIdList,l=e.directionalUserIdList,v=e.isVoipPush,f=e.canIncludeExpansion,g=e.expansion,T=e.isFilerWhiteBlacklist,S=e.pushConfig,p=e.messageId,I=n.channelId;return r({isStatusMessage:o,disableNotification:i,pushContent:a,pushData:s,isMentioned:d,mentionedType:u,mentionedUserIdList:c,directionalUserIdList:l,isVoipPush:v,canIncludeExpansion:f,expansion:g,isFilerWhiteBlacklist:T,pushConfig:S,channelId:I||"",messageId:p},t)}(a||{},n,t),R={isMentioned:!!c,content:n.content,messageType:n.messageType,isPersited:!!n.isPersited,isCounted:!!n.isCounted,disableNotification:!!s,canIncludeExpansion:!!v,expansion:g||null,conversationType:t.conversationType,targetId:t.targetId,channelId:t.channelId,senderUserId:d.getCurrentUserId(),messageUId:"",messageDirection:e.MessageDirection.SEND,receivedTime:0,isStatusMessage:!!S,receivedStatus:e.ReceivedStatus.UNREAD,isOffLineMessage:!1,pushConfig:T,sentStatus:e.SentStatus.SENDING,sentTime:0,directedUserIds:l||[]},I!==e.ConversationType.ULTRA_GROUP&&(R.isOffLineMessage=!1),C=function(t){R.messageId=t;try{f&&f(W(R))}catch(t){u.error(e.LogTagId.A_SEND_MSG_T,'Callback method "onSendBefore" execution error.\n'+(null==t?void 0:t.stack),p)}},u.info(e.LogTagId.A_SEND_MSG_T,JSON.stringify({messageType:n.messageType,conversationType:I,targetId:h,channelId:_}),p),[4,d.sendMessage(I,h,E,C,p)]);case 1:return m=i.sent(),y=m.code,A=m.data,N=m.msg,y===e.ErrorCode.SUCCESS?(u.info(e.LogTagId.A_SEND_MSG_R,JSON.stringify({code:y,messageUId:A.messageUId,messageId:A.messageId}),p),O=W(A),[2,{code:y,data:O}]):(u.warn(e.LogTagId.A_SEND_MSG_R,JSON.stringify({code:y}),p),R.sentTime=(null==A?void 0:A.sentTime)||0,R.sentStatus=null==A?void 0:A.sentStatus,[2,{code:y,msg:N||Yo[y],data:W(R)}])}}))}))}))]}))}))}function xi(t,n){return function(o,i,a,s){var d;if(!e.validate("sendOptions.contentDisposition",null==s?void 0:s.contentDisposition,(function(e){return["inline","attachment"].includes(e)})))return Promise.resolve({code:e.ErrorCode.INVALID_PARAMETER_SENDOPTIONS});var u={contentDisposition:null==s?void 0:s.contentDisposition};if(s&&"thumbnailConfig"in s){var c=null===(d=s)||void 0===d?void 0:d.thumbnailConfig;if(!(e.validate("sendOptions.maxHeight",null==c?void 0:c.maxHeight,e.AssertRules.NUMBER)&&e.validate("sendOptions.maxWidth",null==c?void 0:c.maxWidth,e.AssertRules.NUMBER)&&e.validate("sendOptions.quality",null==c?void 0:c.quality,e.AssertRules.NUMBER)&&e.validate("sendOptions.scale",null==c?void 0:c.scale,e.AssertRules.NUMBER)))return Promise.resolve({code:e.ErrorCode.INVALID_PARAMETER_SENDOPTIONS});u.thumbnailConfig=c}return ko((function(d,c,l){return new Promise((function(d){var l=c.createTraceId();c.info(e.LogTagId.L_MEDIA_UPLOAD_T,JSON.stringify({filesize:i.file.size,type:t}),l),Li({file:i.file,fileType:t,onProgress:function(e,t){var n;null===(n=null==a?void 0:a.onProgress)||void 0===n||n.call(a,Math.floor(e/t*100))},contentDisposition:u.contentDisposition,thumbnailConfig:u.thumbnailConfig}).then((function(t){var u,v=t.code,f=t.data,g=t.msg;if(v===e.ErrorCode.SUCCESS&&f){var T=(null===(u=null==a?void 0:a.onComplete)||void 0===u?void 0:u.call(a,r({url:f.downloadUrl},f)))||n(f,i);return c.info(e.LogTagId.L_MEDIA_UPLOAD_R,JSON.stringify({downurl:f.downloadUrl,code:e.ErrorCode.SUCCESS}),l),void bi(o,T,s).then(d)}d({code:v,msg:g})}))}))}))}}var Gi=xi(e.FileType.FILE,(function(e,t){var n,r,o={name:e.name,size:t.file.size,type:(n=e.name,r=n.match(/\.(\w+)$/),r?r[1]:"bin"),fileUrl:e.downloadUrl};return t.user&&(o.user=t.user),t.extra&&(o.extra=t.extra),t.mentionedInfo&&(o.mentionedInfo=t.mentionedInfo),new ii(o)})),Di=xi(e.FileType.IMAGE,(function(e,t){var n={content:e.thumbnail,imageUri:e.downloadUrl};return t.user&&(n.user=t.user),t.extra&&(n.extra=t.extra),t.mentionedInfo&&(n.mentionedInfo=t.mentionedInfo),t.audit&&(n.audit=t.audit),new $o(n)})),Ji=xi(e.FileType.IMAGE,(function(e,t){var n={gifDataSize:e.size,remoteUrl:e.downloadUrl,width:e.width,height:e.height};return t.user&&(n.user=t.user),t.extra&&(n.extra=t.extra),t.mentionedInfo&&(n.mentionedInfo=t.mentionedInfo),t.audit&&(n.audit=t.audit),new ai(n)})),Vi=xi(e.FileType.AUDIO,(function(e,t){var n={remoteUrl:e.downloadUrl,duration:e.duration,type:e.type};return t.user&&(n.user=t.user),t.extra&&(n.extra=t.extra),t.mentionedInfo&&(n.mentionedInfo=t.mentionedInfo),t.audit&&(n.audit=t.audit),new ei(n)})),Bi=xi(e.FileType.SIGHT,(function(e,t){var n={sightUrl:e.downloadUrl,content:t.thumbnail,duration:t.duration,size:t.file.size||e.size,name:t.name||e.name};return t.user&&(n.user=t.user),t.extra&&(n.extra=t.extra),t.mentionedInfo&&(n.mentionedInfo=t.mentionedInfo),t.audit&&(n.audit=t.audit),new ti(n)}));xi(e.FileType.COMBINE_HTML,(function(e,t){var n={remoteUrl:e.downloadUrl,nameList:t.nameList,summaryList:t.summaryList,conversationType:t.conversationType};return t.user&&(n.user=t.user),t.extra&&(n.extra=t.extra),t.mentionedInfo&&(n.mentionedInfo=t.mentionedInfo),new ri(n)}));var ki=function(t,n,r,a){return o(void 0,void 0,void 0,(function(){var o,s;return i(this,(function(i){switch(i.label){case 0:return!e.validate("messageList",a,e.AssertRules.OBJECT,!0)||Object.keys(a).some((function(t){return!e.validate(t,a[t],e.AssertRules.ARRAY)}))?[2,Promise.resolve({code:e.ErrorCode.MSG_LIMIT_ERROR})]:(o=[],Object.keys(a).forEach((function(e){a[e].forEach((function(e){-1===o.indexOf(e)&&o.push(e)}))})),o.length?[4,t.sendReadReceiptMessage(r.targetId,o,r.channelId)]:(n.warn(e.LogTagId.A_SEND_MSG_R,JSON.stringify({code:e.ErrorCode.MSG_LIMIT_ERROR,msg:"Error in parameter messageList."})),[2,Promise.resolve({code:e.ErrorCode.MSG_LIMIT_ERROR})]));case 1:return s=i.sent().code,[2,Promise.resolve({code:s})]}}))}))};var Hi=Object.freeze({__proto__:null,getAllConversationList:function(t){return o(this,void 0,void 0,(function(){var n=this;return i(this,(function(r){return e.usingCppEngine()?[2,new e.ValidatorManage(St,pt).validate("channelId",t,e.AssertRules.CHANNEL_ID).ifReady((function(r,a){return o(n,void 0,void 0,(function(){var n,o,s,d,u;return i(this,(function(i){switch(i.label){case 0:return n=a.createTraceId(),a.info(St,JSON.stringify({channelId:t}),n),e.isUndefined(t)?[4,r.getConversationListWithAllChannel()]:[3,2];case 1:return o=i.sent(),[3,4];case 2:return[4,r.getConversationList(void 0,void 0,void 0,void 0,t)];case 3:o=i.sent(),i.label=4;case 4:return s=o.code,d=o.data,a.info(pt,JSON.stringify({code:s,length:null==d?void 0:d.length}),n),s===e.ErrorCode.SUCCESS&&d?(u=d.map((function(e){return X(e)})),[2,{code:s,data:u}]):(a.warn(pt,JSON.stringify({code:s}),n),[2,{code:s,msg:Yo[s]}])}}))}))}))]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:Yo[e.ErrorCode.NOT_SUPPORT]}]}))}))},getConversationList:function(t,n,r,a){return o(this,void 0,void 0,(function(){var s=this;return i(this,(function(d){return e.usingCppEngine()?[2,new e.ValidatorManage(It,ht).validate("startTime",t,e.AssertRules.NUMBER,!0).validate("count",n,e.AssertRules.NUMBER,!0).validate("channelId",r,e.AssertRules.CHANNEL_ID).ifReady((function(d,u){return o(s,void 0,void 0,(function(){var o,s,c,l,v,f;return i(this,(function(i){switch(i.label){case 0:return o=u.createTraceId(),u.info(It,JSON.stringify({startTime:t,count:n,channelId:r}),o),e.isUndefined(r)?[4,d.getConversationListWithAllChannelByPage(t,n)]:[3,2];case 1:return s=i.sent(),[3,4];case 2:return c=[1,2,3,5,6,7,8],[4,d.getConversationsByPage(c,t,n,r,!!a)];case 3:s=i.sent(),i.label=4;case 4:return l=s.code,v=s.data,l===e.ErrorCode.SUCCESS&&v?(f=v.map((function(e){return X(e)})),u.info(ht,JSON.stringify({code:l,length:f.length}),o),[2,{code:l,data:f}]):(u.warn(ht,JSON.stringify({code:l}),o),[2,{code:l,msg:Yo[l]}])}}))}))}))]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:Yo[e.ErrorCode.NOT_SUPPORT]}]}))}))},searchConversationByContent:function(t,n,r){return o(this,void 0,void 0,(function(){var a=this;return i(this,(function(s){return e.usingCppEngine()?[2,new e.ValidatorManage(_t,Et).validate("keyword",t,e.AssertRules.STRING,!0).validate("messageTypes",n,(function(t){return!!e.isArray(t)&&!t.some((function(t){return!e.notEmptyString(t)}))}),!0).validate("channelId",r,e.AssertRules.CHANNEL_ID).ifReady((function(s,d){return o(a,void 0,void 0,(function(){var o,a,u,c,l;return i(this,(function(i){switch(i.label){case 0:return o=d.createTraceId(),d.info(_t,JSON.stringify({keyword:t,messageTypes:n,channelId:r}),o),e.isUndefined(r)?[4,s.searchConversationByContentWithAllChannel(t,n)]:[3,2];case 1:return a=i.sent(),[3,4];case 2:return[4,s.searchConversationByContent(t,n,r)];case 3:a=i.sent(),i.label=4;case 4:return u=a.code,c=a.data,u===e.ErrorCode.SUCCESS&&c?(l=c.map((function(e){return X(e)})),d.info(Et,JSON.stringify({code:u,length:l.length}),o),[2,{code:u,data:l}]):(d.warn(Et,JSON.stringify({code:u}),o),[2,{code:u,msg:Yo[u]}])}}))}))}))]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:Yo[e.ErrorCode.NOT_SUPPORT]}]}))}))},getConversations:function(t){return o(this,void 0,void 0,(function(){var n=this;return i(this,(function(r){return e.usingCppEngine()?[2,new e.ValidatorManage(Rt,Ct).validate("conversationList",t,e.isLimitedArray({maxLength:100,minLength:1,itemValidator:function(t){return e.isValidConversation(t,[e.ConversationType.PRIVATE,e.ConversationType.GROUP,e.ConversationType.SYSTEM])}}),!0).ifReady((function(r,a){return o(n,void 0,void 0,(function(){var n,o,s,d,u;return i(this,(function(i){switch(i.label){case 0:return n=a.createTraceId(),a.info(Rt,JSON.stringify({conversations:t}),n),[4,r.getConversations(t)];case 1:return o=i.sent(),s=o.code,d=o.data,s===e.ErrorCode.SUCCESS&&d?(u=d.map((function(e){return X(e)})),a.info(Ct,JSON.stringify({code:s,length:u.length}),n),[2,{code:s,data:u}]):(a.warn(Ct,JSON.stringify({code:s}),n),[2,{code:s,msg:Yo[s]}])}}))}))}))]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:Yo[e.ErrorCode.NOT_SUPPORT]}]}))}))},searchMessages:function(t,n,r,a,s){return o(this,void 0,void 0,(function(){var d=this;return i(this,(function(u){return e.usingCppEngine()?[2,new e.ValidatorManage(mt,yt).validate("conversation",t,e.AssertRules.OBJECT,!0).validate("conversationType",null==t?void 0:t.conversationType,e.AssertRules.CONVERSATION_TYPE,!0).validate("targetId",null==t?void 0:t.targetId,e.AssertRules.STRING,!0).validate("channelId",null==t?void 0:t.channelId,e.AssertRules.CHANNEL_ID).validate("keyword",n,e.AssertRules.STRING,!0).validate("startTime",r,e.AssertRules.NUMBER,!0).validate("count",a,e.AssertRules.NUMBER,!0).validate("messageTypes",s,e.isLimitedArray({itemValidator:e.notEmptyString})).ifReady((function(u,c){return o(d,void 0,void 0,(function(){var o,d,l,v,f,g,T,S,p,I,h;return i(this,(function(i){switch(i.label){case 0:return o=t.targetId,d=t.conversationType,l=t.channelId,v=c.createTraceId(),c.info(mt,JSON.stringify({targetId:o,conversationType:d,channelId:l,keyword:n,startTime:r,count:a}),v),s?[4,u.searchMessageByContentAndMessageType(d,o,n,r,a,s,l)]:[3,2];case 1:return f=i.sent(),[3,6];case 2:return e.isUndefined(l)?[4,u.searchMessageByContentWithAllChannel(d,o,n,r,a)]:[3,4];case 3:return f=i.sent(),[3,6];case 4:return[4,u.searchMessageByContent(d,o,n,r,a,0,l)];case 5:f=i.sent(),i.label=6;case 6:return g=f.code,T=f.data,g===e.ErrorCode.SUCCESS&&T?(S=T.messages,p=T.count,I=[],h=S.map((function(e){return I.push(e.messageUId),W(e)})),c.info(yt,JSON.stringify({code:g,list:I}),v),[2,{code:g,data:{messages:h,count:p}}]):(c.warn(yt,JSON.stringify({code:g}),v),[2,{code:g,msg:Yo[g]}])}}))}))}))]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:Yo[e.ErrorCode.NOT_SUPPORT]}]}))}))},searchMessageInTimeRange:function(t,n){return o(this,void 0,void 0,(function(){var r=this;return i(this,(function(a){return e.usingCppEngine()?[2,new e.ValidatorManage(At,Nt).validate("conversation",t,e.AssertRules.OBJECT,!0).validate("conversationType",null==t?void 0:t.conversationType,e.AssertRules.CONVERSATION_TYPE,!0).validate("targetId",null==t?void 0:t.targetId,e.AssertRules.STRING,!0).validate("startTime",null==n?void 0:n.startTime,e.AssertRules.NUMBER,!0).validate("endTime",null==n?void 0:n.endTime,e.AssertRules.NUMBER,!0).validate("offset",null==n?void 0:n.offset,e.AssertRules.NUMBER).validate("limit",null==n?void 0:n.limit,e.AssertRules.NUMBER).validate("keyword",null==n?void 0:n.keyword,e.AssertRules.STRING,!0).ifReady((function(a,s){return o(r,void 0,void 0,(function(){var r,o,d,u,c,l,v,f,g,T,S;return i(this,(function(i){switch(i.label){case 0:return r=t.conversationType,o=t.targetId,d=n.keyword,u=n.startTime,c=n.endTime,l=n.offset,v=n.limit,l=l||0,v=v||5,f=s.createTraceId(),s.info(At,JSON.stringify({targetId:o,conversationType:r,keyword:d,startTime:u,endTime:c,offset:l,limit:v}),f),[4,a.searchMessageByContentInTimeRangeWithAllChannel(r,o,d,u,c,l,v)];case 1:return g=i.sent(),T=g.code,S=g.data,T===e.ErrorCode.SUCCESS&&S?[2,{code:T,data:{messages:S.messages.map((function(e){return W(e)}))}}]:(s.warn(Nt,JSON.stringify({code:T}),f),[2,{code:T}])}}))}))}))]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:Yo[e.ErrorCode.NOT_SUPPORT]}]}))}))},searchMessagesByUser:function(t,n,r,a){return o(this,void 0,void 0,(function(){var s=this;return i(this,(function(d){return e.usingCppEngine()?[2,new e.ValidatorManage(Ot,Ut).validate("conversation",t,e.AssertRules.OBJECT,!0).validate("conversationType",null==t?void 0:t.conversationType,e.AssertRules.CONVERSATION_TYPE,!0).validate("targetId",null==t?void 0:t.targetId,e.AssertRules.STRING,!0).validate("channelId",null==t?void 0:t.channelId,e.AssertRules.CHANNEL_ID).validate("userId",n,e.AssertRules.STRING,!0).validate("startTime",r,e.AssertRules.NUMBER,!0).validate("count",a,e.AssertRules.NUMBER,!0).ifReady((function(d,u){return o(s,void 0,void 0,(function(){var o,s,c,l,v,f,g;return i(this,(function(i){switch(i.label){case 0:return o=t.conversationType,s=t.targetId,c=t.channelId,l=u.createTraceId(),u.info(Ot,JSON.stringify({targetId:s,conversationType:o,channelId:c,startTime:r,userId:n,count:a}),l),[4,d.searchMessagesByUser(o,s,n,r,a,c)];case 1:return v=i.sent(),f=v.code,g=v.data,f===e.ErrorCode.SUCCESS&&g?[2,{code:f,data:{messages:g.messages.map((function(e){return W(e)}))}}]:(u.warn(Ut,JSON.stringify({code:f})),[2,{code:f}])}}))}))}))]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:Yo[e.ErrorCode.NOT_SUPPORT]}]}))}))},getHistoryMessagesByMessageTypes:function(t,n){return o(this,void 0,void 0,(function(){var r=this;return i(this,(function(a){return e.usingCppEngine()?[2,new e.ValidatorManage(Mt,wt).validate("conversation",t,e.AssertRules.OBJECT,!0).validate("conversationType",null==t?void 0:t.conversationType,e.AssertRules.CONVERSATION_TYPE,!0).validate("targetId",null==t?void 0:t.targetId,e.AssertRules.STRING,!0).validate("channelId",null==t?void 0:t.channelId,e.AssertRules.CHANNEL_ID).validate("count",null==n?void 0:n.count,e.AssertRules.NUMBER).validate("count",null==n?void 0:n.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})).validate("timestamp",null==n?void 0:n.timestamp,e.AssertRules.NUMBER).validate("order",null==n?void 0:n.order,(function(e){return[0,1].includes(e)})).validate("messageTypes",null==n?void 0:n.messageTypes,(function(t){return!!e.isArray(t)&&!t.some((function(t){return!e.notEmptyString(t)}))}),!0).ifReady((function(a,s){return o(r,void 0,void 0,(function(){var r,o,d,u,c,l,v,f,g,T,S,p,I,h,_,E,R,C,m;return i(this,(function(i){switch(i.label){case 0:return r=n.count,o=void 0===r?20:r,d=n.timestamp,u=void 0===d?0:d,c=n.order,l=void 0===c?0:c,v=n.messageTypes,f=t.conversationType,g=t.targetId,T=t.channelId,S=void 0===T?"":T,p=s.createTraceId(),s.info(Mt,JSON.stringify({targetId:g,conversationType:f,channelId:S,count:o,timestamp:u,messageTypes:v}),p),[4,a.getHistoryMessagesByObjectNames(f,g,u,o,v,l,S)];case 1:return I=i.sent(),h=I.code,_=I.data,h===e.ErrorCode.SUCCESS?(R=(E=_).list,C=E.hasMore,m=R.map((function(e){return W(e)})),[2,{code:h,data:{messages:m,hasMore:C,list:m}}]):(s.warn(wt,JSON.stringify({code:h})),[2,{code:h,msg:Yo[h]}])}}))}))}))]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:Yo[e.ErrorCode.NOT_SUPPORT]}]}))}))},getContinuousMessages:function(t,n){return o(this,void 0,void 0,(function(){var r=this;return i(this,(function(a){return e.usingCppEngine()?[2,new e.ValidatorManage(Pt,Lt).validate("conversation",t,e.AssertRules.OBJECT,!0).validate("conversationType",null==t?void 0:t.conversationType,e.AssertRules.CONVERSATION_TYPE,!0).validate("targetId",null==t?void 0:t.targetId,e.AssertRules.STRING,!0).validate("channelId",null==t?void 0:t.channelId,e.AssertRules.CHANNEL_ID).validate("timestamp",null==n?void 0:n.timestamp,e.AssertRules.NUMBER).validate("count",null==n?void 0:n.count,e.AssertRules.NUMBER).validate("count",null==n?void 0:n.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})).validate("order",null==n?void 0:n.order,(function(e){return 0===e||1===e})).ifReady((function(a,s){return o(r,void 0,void 0,(function(){var r,o,d,u,c,l,v,f,g,T,S,p,I,h,_;return i(this,(function(i){switch(i.label){case 0:return r=n.count,o=n.timestamp,d=n.order,u=t.conversationType,c=t.targetId,l=t.channelId,v=s.createTraceId(),s.info(Pt,JSON.stringify({targetId:c,conversationType:u,channelId:l,count:r,timestamp:o}),v),(a.getNaviInfoFromCache()||{}).historyMsg?[4,a.getContinuousMessages(u,c,o||0,r||20,d||0,l||"")]:[2,{code:e.ErrorCode.MESSAGE_STORAGE_SERVICE_UNAVAILABLE}];case 1:return f=i.sent(),g=f.code,T=f.data,g===e.ErrorCode.SUCCESS?(p=(S=T).list,I=S.timestamp,h=S.hasMore,_=p.map((function(e){return W(e)})),[2,{code:g,data:{list:_,timestamp:I,hasMore:h}}]):(s.warn(Lt,JSON.stringify({code:g})),[2,{code:g,msg:Yo[g]}])}}))}))}))]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:Yo[e.ErrorCode.NOT_SUPPORT]}]}))}))},setMessageStatusToRead:function(t,n){return o(this,void 0,void 0,(function(){var r=this;return i(this,(function(a){return e.usingCppEngine()?[2,new e.ValidatorManage(bt,xt).validate("conversation",t,e.AssertRules.OBJECT,!0).validate("conversationType",null==t?void 0:t.conversationType,e.AssertRules.CONVERSATION_TYPE,!0).validate("targetId",null==t?void 0:t.targetId,e.AssertRules.STRING,!0).validate("channelId",null==t?void 0:t.channelId,e.AssertRules.CHANNEL_ID).validate("timestamp",n,e.AssertRules.NUMBER,!0).ifReady((function(e,a){return o(r,void 0,void 0,(function(){var r,o,s,d,u;return i(this,(function(i){switch(i.label){case 0:return r=t.conversationType,o=t.targetId,s=t.channelId,d=a.createTraceId(),a.info(bt,JSON.stringify({targetId:o,conversationType:r,channelId:s,timestamp:n}),d),[4,e.setMessageStatusToRead(r,o,n,s)];case 1:return u=i.sent(),a.info(xt,JSON.stringify(u),d),[2,u]}}))}))}))]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:Yo[e.ErrorCode.NOT_SUPPORT]}]}))}))},setMessageReceivedStatus:function(t,n){return o(this,void 0,void 0,(function(){var r=this;return i(this,(function(a){return console.warn("`setMessageSentStatus` has being deprecated, use `setMessageReceivedStatusInfo` instead."),e.usingCppEngine()?[2,new e.ValidatorManage(Gt,Dt).validate("messageId",t,e.AssertRules.NUMBER,!0).validate("receivedStatus",n,(function(t){return!e.isUndefined(e.ReceivedStatus[t])}),!0).ifReady((function(e,a){return o(r,void 0,void 0,(function(){var r,o;return i(this,(function(i){switch(i.label){case 0:return r=a.createTraceId(),a.info(Gt,JSON.stringify({messageId:t,receivedStatus:n}),r),[4,e.setMessageReceivedStatus(t,n)];case 1:return o=i.sent(),a.info(Dt,JSON.stringify({code:o}),r),[2,{code:o}]}}))}))}))]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:Yo[e.ErrorCode.NOT_SUPPORT]}]}))}))},setMessageReceivedStatusInfo:function(t,n){return o(this,void 0,void 0,(function(){var r=this;return i(this,(function(a){return e.usingCppEngine()?[2,new e.ValidatorManage(Bt,kt).validate("messageId",t,e.AssertRules.NUMBER,!0).validate("receivedStatusInfo",n,e.AssertRules.OBJECT,!0).validate("receivedStatusInfo",null==n?void 0:n.isRead,e.AssertRules.BOOLEAN).validate("receivedStatusInfo",null==n?void 0:n.isListened,e.AssertRules.BOOLEAN).validate("receivedStatusInfo",null==n?void 0:n.isDownload,e.AssertRules.BOOLEAN).validate("receivedStatusInfo",null==n?void 0:n.isRetrieved,e.AssertRules.BOOLEAN).ifReady((function(a,s){return o(r,void 0,void 0,(function(){var r,o,d;return i(this,(function(i){switch(i.label){case 0:return r=e.transformReceivedStatusFlag(n),o=s.createTraceId(),s.info(Bt,JSON.stringify({messageId:t,sentStatus:r}),o),[4,a.setMessageReceivedStatus(t,r)];case 1:return d=i.sent(),s.info(kt,JSON.stringify({code:d}),o),[2,{code:d}]}}))}))}))]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:Yo[e.ErrorCode.NOT_SUPPORT]}]}))}))},setMessageSentStatus:function(t,n){return o(this,void 0,void 0,(function(){var r=this;return i(this,(function(a){return e.usingCppEngine()?[2,new e.ValidatorManage(Jt,Jt).validate("messageId",t,e.AssertRules.NUMBER,!0).validate("sentStatus",n,(function(t){return!e.isUndefined(e.SentStatus[t])}),!0).ifReady((function(e,a){return o(r,void 0,void 0,(function(){var r,o;return i(this,(function(i){switch(i.label){case 0:return r=a.createTraceId(),a.info(Jt,JSON.stringify({messageId:t,sentStatus:n}),r),[4,e.setMessageSentStatus(t,n)];case 1:return o=i.sent(),a.info(Vt,JSON.stringify({code:o}),r),[2,{code:o}]}}))}))}))]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:Yo[e.ErrorCode.NOT_SUPPORT]}]}))}))},setMessageContent:function(t,n,r){return void 0===r&&(r=""),o(this,void 0,void 0,(function(){var a=this;return i(this,(function(s){return e.usingCppEngine()?[2,new e.ValidatorManage(Ht,Ft).validate("messageId",t,e.AssertRules.NUMBER,!0).validate("content",n,e.AssertRules.OBJECT,!0).validate("messageType",r,e.AssertRules.ONLY_STRING,!0).ifReady((function(e,s){return o(a,void 0,void 0,(function(){var o,a;return i(this,(function(i){switch(i.label){case 0:return o=s.createTraceId(),s.info(Ht,JSON.stringify({messageId:t,messageType:r}),o),[4,e.setMessageContent(t,n,r)];case 1:return a=i.sent(),s.info(Ft,JSON.stringify({code:a}),o),[2,{code:a}]}}))}))}))]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:Yo[e.ErrorCode.NOT_SUPPORT]}]}))}))},deleteMessages:function(t){return o(this,void 0,void 0,(function(){var n=this;return i(this,(function(r){return e.usingCppEngine()?[2,new e.ValidatorManage(Yt,qt).validate("messageIds",t,(function(t){return!!e.isArray(t)&&!t.some((function(t){return!e.isNumber(t)}))}),!0).ifReady((function(e,r){return o(n,void 0,void 0,(function(){var n,o;return i(this,(function(i){switch(i.label){case 0:return n=r.createTraceId(),r.info(Yt,JSON.stringify({messageIds:t}),n),[4,e.deleteMessages(t)];case 1:return o=i.sent(),r.info(qt,JSON.stringify({code:o}),n),[2,{code:o}]}}))}))}))]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:Yo[e.ErrorCode.NOT_SUPPORT]}]}))}))},clearMessages:function(t){return o(this,void 0,void 0,(function(){var n=this;return i(this,(function(r){return e.usingCppEngine()?[2,new e.ValidatorManage(jt,Kt).validate("conversation",t,e.AssertRules.OBJECT,!0).validate("conversationType",null==t?void 0:t.conversationType,e.AssertRules.CONVERSATION_TYPE,!0).validate("targetId",null==t?void 0:t.targetId,e.AssertRules.STRING,!0).validate("channelId",null==t?void 0:t.channelId,e.AssertRules.CHANNEL_ID).ifReady((function(e,r){return o(n,void 0,void 0,(function(){var n,o,a,s,d;return i(this,(function(i){switch(i.label){case 0:return n=t.conversationType,o=t.targetId,a=t.channelId,s=r.createTraceId(),r.info(jt,JSON.stringify({conversationType:n,targetId:o,channelId:a}),s),[4,e.clearMessages(n,o,a)];case 1:return d=i.sent(),r.info(Kt,JSON.stringify({code:d}),s),[2,{code:d}]}}))}))}))]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:Yo[e.ErrorCode.NOT_SUPPORT]}]}))}))},deleteMessagesByTimestamp:function(t,n,r){return o(this,void 0,void 0,(function(){var a,s,d,u=this;return i(this,(function(c){return e.usingCppEngine()?(a=t.conversationType,s=t.targetId,d=t.channelId,[2,new e.ValidatorManage(zt,Wt).validate("conversation",t,e.AssertRules.OBJECT,!0).validate("conversationType",null==t?void 0:t.conversationType,e.AssertRules.CONVERSATION_TYPE,!0).validate("targetId",null==t?void 0:t.targetId,e.AssertRules.STRING,!0).validate("channelId",null==t?void 0:t.channelId,e.AssertRules.CHANNEL_ID).validate("timestamp",n,e.AssertRules.NUMBER,!0).validate("cleanSpace",r,e.AssertRules.BOOLEAN).ifReady((function(t,c){return o(u,void 0,void 0,(function(){var o,u,l;return i(this,(function(i){switch(i.label){case 0:return o=c.createTraceId(),c.info(zt,JSON.stringify({conversationType:a,targetId:s,channelId:d,timestamp:n,cleanSpace:r}),o),[4,t.deleteMessagesByTimestamp(a,s,n,r,d)];case 1:return u=i.sent(),l=u===e.ErrorCode.SUCCESS?"info":"warn",c[l](Wt,JSON.stringify({code:u}),o),[2,{code:u}]}}))}))}))]):[2,{code:e.ErrorCode.NOT_SUPPORT,msg:Yo[e.ErrorCode.NOT_SUPPORT]}]}))}))},batchClearMessagesByTimestamp:function(t){return o(this,void 0,void 0,(function(){var n=this;return i(this,(function(r){return e.usingCppEngine()?[2,new e.ValidatorManage(hn,_n).ifReady((function(r,a){return o(n,void 0,void 0,(function(){var n,o,s,d;return i(this,(function(i){switch(i.label){case 0:return n=function(t,n){if(!e.validate("options",t,e.AssertRules.ARRAY,!0)||!e.validate("options",t,(function(e){return!(t.length>20||0===t.length)||(n.error(_n,"conversations length should not be greater than 20 and not be equal to 0"),!1)}),!0))return e.ErrorCode.INVALID_PARAMETER_CLEAR_MESSAGE_OPTION_LIST;for(var r=0,o=t;r<o.length;r++){var i=o[r];if(!(e.validate("options",i,e.AssertRules.OBJECT,!0)&&e.validate("options.targetId",i.targetId,e.AssertRules.STRING,!0)&&e.validate("options.conversationType",i.conversationType,(function(t){var r=[e.ConversationType.PRIVATE,e.ConversationType.GROUP,e.ConversationType.CHATROOM,e.ConversationType.SYSTEM].includes(t);return r||n.error(_n,"conversations.conversationType is invalid, It should be one of the following values:\n ConversationType.PRIVATE,\n ConversationType.GROUP,\n ConversationType.CHATROOM,\n ConversationType.SYSTEM,\n "),r}),!0)&&e.validate("options.timestamp",i.timestamp,e.AssertRules.NUMBER,!0)&&e.validate("options.channelId",i.channelId,e.AssertRules.ONLY_STRING)))return e.ErrorCode.INVALID_PARAMETER_CLEAR_MESSAGE_OPTION_LIST}}(t,a),n?[2,{code:e.ErrorCode.INVALID_PARAMETER_CLEAR_MESSAGE_OPTION_LIST}]:(o=t.map((function(e){return{conversationType:e.conversationType,targetId:e.targetId,timestamp:e.timestamp,channelId:e.channelId||""}})),s=a.createTraceId(),a.info(hn,"options: "+JSON.stringify(o),s),[4,r.batchClearMessagesByTimestamp(o)]);case 1:return d=i.sent(),a[e.ErrorCode.SUCCESS===d?"info":"warn"](_n,"code: "+d,s),[2,{code:d}]}}))}))}))]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:Yo[e.ErrorCode.NOT_SUPPORT]}]}))}))},insertMessage:function(t,n,r){return void 0===r&&(r={}),o(this,void 0,void 0,(function(){var a=this;return i(this,(function(s){return e.usingCppEngine()?[2,new e.ValidatorManage(Xt,Qt).validate("conversation",t,e.AssertRules.OBJECT,!0).validate("conversationType",null==t?void 0:t.conversationType,e.AssertRules.CONVERSATION_TYPE,!0).validate("targetId",null==t?void 0:t.targetId,e.AssertRules.STRING,!0).validate("channelId",null==t?void 0:t.channelId,e.AssertRules.CHANNEL_ID).validate("userId",n,(function(t){return t instanceof Xo||e.validate("message.senderUserId",null==t?void 0:t.senderUserId,e.AssertRules.STRING,!0)}),!0).validate("messageType",null==n?void 0:n.messageType,e.AssertRules.STRING,!0).validate("content",null==n?void 0:n.content,e.AssertRules.OBJECT,!0).validate("messageDirection",n,(function(t){return t instanceof Xo||e.validate("message.messageDirection",null==t?void 0:t.messageDirection,e.AssertRules.NUMBER,!0)}),!0).validate("canIncludeExpansion",n,(function(t){return t instanceof Xo||e.validate("message.canIncludeExpansion",null==t?void 0:t.canIncludeExpansion,e.AssertRules.BOOLEAN)})).validate("expansion",n,(function(t){return t instanceof Xo||e.validate("message.expansion",null==t?void 0:t.expansion,e.AssertRules.OBJECT)})).validate("disableNotification",n,(function(t){return t instanceof Xo||e.validate("message.expansion",null==t?void 0:t.disableNotification,e.AssertRules.BOOLEAN)})).validate("timestamp",n,(function(t){return t instanceof Xo||e.validate("message.sentTime",null==t?void 0:t.sentTime,e.AssertRules.NUMBER)})).validate("sentStatus",n,(function(t){return t instanceof Xo||e.validate("message.sentStatus",null==t?void 0:t.sentStatus,e.AssertRules.NUMBER)})).validate("receivedStatus",n,(function(t){return t instanceof Xo||e.validate("message.receivedStatus",null==t?void 0:t.receivedStatus,e.AssertRules.NUMBER)})).validate("receivedStatusInfo",n,(function(t){return t instanceof Xo||e.validate("message.receivedStatusInfo",null==t?void 0:t.receivedStatusInfo,e.AssertRules.OBJECT)})).validate("directedUserIds",n,(function(t){return t instanceof Xo||!(null==t?void 0:t.directedUserIds)||!(!(null==t?void 0:t.directedUserIds)||!e.isArray(null==t?void 0:t.directedUserIds))&&(!t.directedUserIds.some((function(t){return!e.isString(t)}))&&t.directedUserIds.length<300)})).validate("searchContent",null==r?void 0:r.searchContent,e.AssertRules.STRING).ifReady((function(s,d){return o(a,void 0,void 0,(function(){var o,a,u,c,l,v,f,g,T,S,p,I,h,_,E,R,C,m,y,A;return i(this,(function(i){switch(i.label){case 0:return o="",a=1,v=!1,g=e.ReceivedStatus.UNREAD,p=n.messageType,I=n.content,n instanceof Xo||(o=n.senderUserId,a=n.messageDirection,v=n.canIncludeExpansion,f=n.expansion,l=n.disableNotification,u=n.sentTime,c=n.sentStatus,g=n.receivedStatus,T=n.receivedStatusInfo,S=n.directedUserIds),h=d.createTraceId(),d.info(Xt,JSON.stringify({conversationType:t.conversationType,targetId:t.targetId,messageType:p,sentTime:u}),h),_=r.isUnread,E=r.searchContent,R=g,T&&(R=e.transformReceivedStatusFlag(T)),C={senderUserId:o,messageType:p,content:I,messageDirection:a,sentTime:u,sentStatus:c,searchContent:E,isUnread:!!_,messageUId:"",disableNotification:l,canIncludeExpansion:v,expansionMsg:JSON.stringify(f),channelId:t.channelId||"",readStatus:R,directedUserIds:S},[4,s.insertMessage(t.conversationType,t.targetId,C)];case 1:return m=i.sent(),y=m.code,A=m.data,y===e.ErrorCode.SUCCESS?(d.info(Qt,JSON.stringify({code:y,messageId:null==A?void 0:A.messageId}),h),[2,{code:y,data:W(A)}]):(d.warn(Qt,JSON.stringify({code:y}),h),[2,{code:y,msg:Yo[y]}])}}))}))}))]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:Yo[e.ErrorCode.NOT_SUPPORT]}]}))}))},batchInsertMessage:function(t,n){return o(this,void 0,void 0,(function(){var r=this;return i(this,(function(a){return e.usingCppEngine()?[2,new e.ValidatorManage($t,$t).validate("messages",t,(function(t){var n,r,o,i;if(!e.validate("messages",t,e.AssertRules.ARRAY,!0))return!1;if(t.length<=0||t.length>=500)return!1;for(var a in t)if(!e.validate("message",t[a],e.AssertRules.OBJECT,!0)||!e.validate("message.conversationType",t[a].conversationType,(function(t){return[e.ConversationType.PRIVATE,e.ConversationType.DISCUSSION,e.ConversationType.GROUP,e.ConversationType.CUSTOMER_SERVICE,e.ConversationType.SYSTEM,e.ConversationType.APP_PUBLIC_SERVICE,e.ConversationType.PUBLIC_SERVICE].includes(t)}),!0)||!e.validate("message.targetId",t[a].targetId,e.AssertRules.STRING,!0)||!e.validate("message.senderUserId",t[a].senderUserId,e.AssertRules.STRING,!0)||!e.validate("message.messageType",t[a].messageType,e.AssertRules.STRING,!0)||!e.validate("message.content",t[a].content,e.AssertRules.OBJECT,!0)||!e.validate("message.messageDirection",t[a].messageDirection,e.AssertRules.NUMBER,!0)||!e.validate("message.canIncludeExpansion",t[a].canIncludeExpansion,e.AssertRules.BOOLEAN)||!e.validate("message.expansion",t[a].expansion,e.AssertRules.OBJECT)||!e.validate("message.disableNotification",t[a].disableNotification,e.AssertRules.BOOLEAN)||!e.validate("message.sentTime",t[a].sentTime,e.AssertRules.NUMBER)||!e.validate("message.sentStatus",t[a].sentStatus,e.AssertRules.NUMBER)||!e.validate("options.isUnread",null===(n=t[a])||void 0===n?void 0:n.isUnread,e.AssertRules.BOOLEAN)||!e.validate("options.searchContent",null===(r=t[a])||void 0===r?void 0:r.searchContent,e.AssertRules.STRING)||!e.validate("options.receivedStatus",null===(o=t[a])||void 0===o?void 0:o.receivedStatus,e.AssertRules.NUMBER)||!e.validate("options.receivedStatusInfo",null===(i=t[a])||void 0===i?void 0:i.receivedStatusInfo,e.AssertRules.OBJECT)||t[a].directedUserIds&&t[a].directedUserIds.some((function(t){return!e.validate("userId",t,e.AssertRules.STRING,!0)}))&&t[a].directedUserIds.length<300)return console.warn("then "+a+" index message validation failed"),!1;return!0}),!0).validate("checkDuplicate",n,e.AssertRules.BOOLEAN).ifReady((function(a,s){return o(r,void 0,void 0,(function(){var r,o,d,u;return i(this,(function(i){switch(i.label){case 0:return r=s.createTraceId(),s.info(Zt,JSON.stringify({checkDuplicate:n,length:t.length}),r),[4,a.batchInsertMessage(t,n)];case 1:return o=i.sent(),d=o.code,u=o.data,d===e.ErrorCode.SUCCESS?(s.info($t,JSON.stringify({code:d,data:u}),r),[2,{code:d,data:u}]):(s.warn($t,JSON.stringify({code:d}),r),[2,{code:d,msg:Yo[d]}])}}))}))}))]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:Yo[e.ErrorCode.NOT_SUPPORT]}]}))}))},getMessageCount:function(t){return o(this,void 0,void 0,(function(){var n=this;return i(this,(function(r){return e.usingCppEngine()?[2,new e.ValidatorManage(en,tn).validate("conversation",t,e.AssertRules.OBJECT,!0).validate("conversationType",null==t?void 0:t.conversationType,e.AssertRules.CONVERSATION_TYPE,!0).validate("targetId",null==t?void 0:t.targetId,e.AssertRules.STRING,!0).validate("channelId",null==t?void 0:t.channelId,e.AssertRules.CHANNEL_ID).ifReady((function(e,r){return o(n,void 0,void 0,(function(){var n,o,a,s,d,u,c;return i(this,(function(i){switch(i.label){case 0:return n=t.conversationType,o=t.targetId,a=t.channelId,s=r.createTraceId(),r.info(en,JSON.stringify({conversationType:n,targetId:o,channelId:a}),s),[4,e.getMessageCount(n,o,a)];case 1:return d=i.sent(),u=d.code,c=d.data,r.info(tn,JSON.stringify({code:u,data:c}),s),[2,{code:u,data:c}]}}))}))}))]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:Yo[e.ErrorCode.NOT_SUPPORT]}]}))}))},getPrivateMessageDeliverTime:function(t){return o(this,void 0,void 0,(function(){var n=this;return i(this,(function(r){return e.usingCppEngine()?[2,new e.ValidatorManage(nn,rn).validate("messageUId",t,e.AssertRules.STRING,!0).ifReady((function(r,a){return o(n,void 0,void 0,(function(){var n,o,s,d;return i(this,(function(i){switch(i.label){case 0:return n=a.createTraceId(),a.info(nn,JSON.stringify({messageUId:t}),n),[4,r.getPrivateMessageDeliverTime(t)];case 1:return o=i.sent(),s=o.code,d=o.data,s===e.ErrorCode.SUCCESS?(a.info(rn,JSON.stringify({code:s,data:d}),n),[2,{code:s,data:d}]):(a.warn(rn,JSON.stringify({code:s}),n),[2,{code:s,msg:Yo[s]}])}}))}))}))]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:Yo[e.ErrorCode.NOT_SUPPORT]}]}))}))},getGroupMessageDeliverList:function(t,n){return o(this,void 0,void 0,(function(){var r=this;return i(this,(function(a){return e.usingCppEngine()?[2,new e.ValidatorManage(on,an).validate("targetId",t,e.AssertRules.STRING,!0).validate("messageUId",n,e.AssertRules.STRING,!0).ifReady((function(a,s){return o(r,void 0,void 0,(function(){var r,o,d,u,c;return i(this,(function(i){switch(i.label){case 0:return r=s.createTraceId(),s.info(on,JSON.stringify({targetId:t,messageUId:n}),r),[4,a.getGroupMessageDeliverList(t,n)];case 1:return o=i.sent(),d=o.code,u=o.data,c=d===e.ErrorCode.SUCCESS?"info":"warn",s[c](an,JSON.stringify({code:d}),r),d===e.ErrorCode.SUCCESS?[2,{code:d,data:u}]:[2,{code:d,msg:Yo[d]}]}}))}))}))]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:Yo[e.ErrorCode.NOT_SUPPORT]}]}))}))},setCheckDuplicateMessage:function(t){return o(this,void 0,void 0,(function(){var n=this;return i(this,(function(r){return e.usingCppEngine()?[2,new e.ValidatorManage(sn,dn).validate("checkDuplicate",t,e.AssertRules.BOOLEAN).ifReady((function(e,r){return o(n,void 0,void 0,(function(){var n,o,a,s;return i(this,(function(i){switch(i.label){case 0:return n=r.createTraceId(),r.info(sn,JSON.stringify({checkDuplicate:t}),n),[4,e.setCheckDuplicateMessage(!!t)];case 1:return o=i.sent(),a=o.code,s=o.data,r.info(dn,JSON.stringify({code:a,data:s}),n),[2,{code:a}]}}))}))}))]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:Yo[e.ErrorCode.NOT_SUPPORT]}]}))}))},setCheckChatRoomDuplicateMessage:function(t){return o(this,void 0,void 0,(function(){var n=this;return i(this,(function(r){return e.usingCppEngine()?[2,new e.ValidatorManage(un,cn).validate("checkDuplicate",t,e.AssertRules.BOOLEAN).ifReady((function(e,r){return o(n,void 0,void 0,(function(){var n,o,a,s;return i(this,(function(i){switch(i.label){case 0:return n=r.createTraceId(),r.info(un,JSON.stringify({checkDuplicate:t}),n),[4,e.setCheckChatRoomDuplicateMessage(!!t)];case 1:return o=i.sent(),a=o.code,s=o.data,r.info(cn,JSON.stringify({code:a,data:s}),n),[2,{code:a}]}}))}))}))]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:Yo[e.ErrorCode.NOT_SUPPORT]}]}))}))},getMessagesAroundTimestamp:function(t,n){return o(this,void 0,void 0,(function(){var r=this;return i(this,(function(a){return e.usingCppEngine()?[2,new e.ValidatorManage(ho,_o).validate("conversation",t,e.AssertRules.OBJECT,!0).validate("conversationType",null==t?void 0:t.conversationType,e.AssertRules.CONVERSATION_TYPE,!0).validate("targetId",null==t?void 0:t.targetId,e.isValidTargetId,!0).validate("channelId",null==t?void 0:t.channelId,e.AssertRules.CHANNEL_ID).validate("timestamp",null==n?void 0:n.timestamp,e.isInteger({min:0}),!0).validate("beforeCount",null==n?void 0:n.beforeCount,e.isInteger({min:0}),!0).validate("afterCount",null==n?void 0:n.afterCount,e.isInteger({min:0}),!0).ifReady((function(a,s){return o(r,void 0,void 0,(function(){var r,o,d,u,c,l,v;return i(this,(function(i){switch(i.label){case 0:return r=s.createTraceId(),s.info(ho,JSON.stringify({option:n,conversation:t}),r),o=n.timestamp,d=n.beforeCount,u=n.afterCount,[4,a.getMessagesByTimestamp(t,o,d,u)];case 1:return c=i.sent(),l=c.code,v=c.data,l===e.ErrorCode.SUCCESS?(s.info(_o,JSON.stringify({code:l,data:v}),r),[2,{code:l,data:null==v?void 0:v.map((function(e){return W(e)}))}]):(s.warn(_o,JSON.stringify({code:l}),r),[2,{code:l,msg:Yo[l]}])}}))}))}))]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:Yo[e.ErrorCode.NOT_SUPPORT]}]}))}))},clearLocalData:function(){return o(this,void 0,void 0,(function(){var t=this;return i(this,(function(n){return e.usingCppEngine()?[2,ko((function(n,r){return o(t,void 0,void 0,(function(){var t,o,a,s,d;return i(this,(function(i){switch(i.label){case 0:return t=r.createTraceId(),r.info(sn,"clearLocalData ->",t),[4,n.clearData()];case 1:return o=i.sent(),a=o.code,s=o.data,d=a===e.ErrorCode.SUCCESS?"info":"warn",r[d](dn,JSON.stringify({code:a}),t),[2,{code:a,data:s}]}}))}))}))]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:Yo[e.ErrorCode.NOT_SUPPORT]}]}))}))},enable:function(){return e.usingCppEngine()}});Object.defineProperty(exports,"AreaCode",{enumerable:!0,get:function(){return e.AreaCode}}),Object.defineProperty(exports,"ChatroomEntryType",{enumerable:!0,get:function(){return e.ChatroomEntryType}}),Object.defineProperty(exports,"ChatroomSyncStatusReason",{enumerable:!0,get:function(){return e.ChatroomSyncStatusReason}}),Object.defineProperty(exports,"ChatroomUserChangeType",{enumerable:!0,get:function(){return e.ChatroomUserChangeType}}),Object.defineProperty(exports,"ChrmMemBanType",{enumerable:!0,get:function(){return e.ChrmMemBanType}}),Object.defineProperty(exports,"ChrmMemOperateType",{enumerable:!0,get:function(){return e.ChrmMemOperateType}}),Object.defineProperty(exports,"ChrmSyncStatus",{enumerable:!0,get:function(){return e.ChrmSyncStatus}}),Object.defineProperty(exports,"ConnectionStatus",{enumerable:!0,get:function(){return e.ConnectionStatus}}),Object.defineProperty(exports,"ConversationType",{enumerable:!0,get:function(){return e.ConversationType}}),Object.defineProperty(exports,"ErrorCode",{enumerable:!0,get:function(){return e.ErrorCode}}),Object.defineProperty(exports,"FileType",{enumerable:!0,get:function(){return e.FileType}}),Object.defineProperty(exports,"InterruptionLevel",{enumerable:!0,get:function(){return e.InterruptionLevel}}),Object.defineProperty(exports,"LogL",{enumerable:!0,get:function(){return e.LogL}}),Object.defineProperty(exports,"LogLevel",{enumerable:!0,get:function(){return e.LogLevel}}),Object.defineProperty(exports,"MentionedType",{enumerable:!0,get:function(){return e.MentionedType}}),Object.defineProperty(exports,"MessageBlockSourceType",{enumerable:!0,get:function(){return e.MessageBlockSourceType}}),Object.defineProperty(exports,"MessageBlockType",{enumerable:!0,get:function(){return e.MessageBlockType}}),Object.defineProperty(exports,"MessageDirection",{enumerable:!0,get:function(){return e.MessageDirection}}),Object.defineProperty(exports,"NotificationLevel",{enumerable:!0,get:function(){return e.NotificationLevel}}),Object.defineProperty(exports,"NotificationStatus",{enumerable:!0,get:function(){return e.NotificationStatus}}),Object.defineProperty(exports,"OnlineStatus",{enumerable:!0,get:function(){return e.OnlineStatus}}),Object.defineProperty(exports,"OperateStatus",{enumerable:!0,get:function(){return e.OperateStatus}}),Object.defineProperty(exports,"PlatformInfo",{enumerable:!0,get:function(){return e.PlatformInfo}}),Object.defineProperty(exports,"PushImportanceHonor",{enumerable:!0,get:function(){return e.PushImportanceHonor}}),Object.defineProperty(exports,"RCConnectionStatus",{enumerable:!0,get:function(){return e.RCConnectionStatus}}),Object.defineProperty(exports,"ReceivedStatus",{enumerable:!0,get:function(){return e.ReceivedStatus}}),Object.defineProperty(exports,"SentStatus",{enumerable:!0,get:function(){return e.SentStatus}}),Object.defineProperty(exports,"SubscribeOperationType",{enumerable:!0,get:function(){return e.SubscribeOperationType}}),Object.defineProperty(exports,"SubscribeType",{enumerable:!0,get:function(){return e.SubscribeType}}),Object.defineProperty(exports,"UltraGroupChannelChangeType",{enumerable:!0,get:function(){return e.UltraGroupChannelChangeType}}),Object.defineProperty(exports,"UltraGroupChannelType",{enumerable:!0,get:function(){return e.UltraGroupChannelType}}),Object.defineProperty(exports,"UploadMethod",{enumerable:!0,get:function(){return e.UploadMethod}}),Object.defineProperty(exports,"UserProfileVisibility",{enumerable:!0,get:function(){return e.UserProfileVisibility}}),exports.BaseMessage=Xo,exports.CombineMessage=ri,exports.CombineV2Message=oi,exports.CommandMessage=li,exports.ConnectType={COMET:"comet",WEBSOCKET:"websocket"},exports.FileMessage=ii,exports.GIFMessage=ai,exports.GroupNotificationMessage=fi,exports.HQVoiceMessage=ei,exports.ImageMessage=$o,exports.InformationNotificationMessage=vi,exports.LocationMessage=di,exports.MessageType={TEXT:"RC:TxtMsg",VOICE:"RC:VcMsg",HQ_VOICE:"RC:HQVCMsg",IMAGE:"RC:ImgMsg",GIF:"RC:GIFMsg",RICH_CONTENT:"RC:ImgTextMsg",LOCATION:"RC:LBSMsg",FILE:"RC:FileMsg",SIGHT:"RC:SightMsg",COMBINE:"RC:CombineMsg",COMBINE_V2:"RC:CombineV2Msg",CHRM_KV_NOTIFY:"RC:chrmKVNotiMsg",LOG_COMMAND:"RC:LogCmdMsg",EXPANSION_NOTIFY:"RC:MsgExMsg",REFERENCE:"RC:ReferenceMsg",RECALL_MESSAGE_TYPE:"RC:RcCmd"},exports.ReferenceMessage=ui,exports.RichContentMessage=ci,exports.SightMessage=ti,exports.TextMessage=ni,exports.UploadTask=Oi,exports.VoiceMessage=si,exports.__addSDKVersion=function(t,n){e.VersionManage.add(t,n)},exports.addConversationsToTag=function(t,n){return o(this,void 0,void 0,(function(){var r=this;return i(this,(function(a){return[2,new e.ValidatorManage(pr,Ir).validate("tagId",t,e.AssertRules.STRING,!0).validate("conversations",n,(function(t){return!(!e.validate("conversations",t,e.AssertRules.ARRAY,!0)||t.length<=0)&&!t.some((function(t){return!e.validate("conversation",t,e.AssertRules.CONVERSATION,!0)}))}),!0).ifReady((function(a,s){return o(r,void 0,void 0,(function(){var r,o,d;return i(this,(function(i){switch(i.label){case 0:return r=s.createTraceId(),s.info(pr,JSON.stringify({conversations:n.map((function(e){return{conversationType:e.conversationType,targetId:e.targetId}})),tagId:t}),r),[4,a.addTagForConversations(t,n)];case 1:return o=i.sent().code,d=o===e.ErrorCode.SUCCESS?"info":"warn",s[d](Ir,JSON.stringify({code:o}),r),o===e.ErrorCode.SUCCESS?[2,{code:o}]:[2,{code:o,msg:Yo[o]}]}}))}))}))]}))}))},exports.addEventListener=function(e,t,n){Lo.on(e,t,n)},exports.addTag=function(t){return o(this,void 0,void 0,(function(){var n=this;return i(this,(function(r){return[2,new e.ValidatorManage(sr,dr).validate("tagId",null==t?void 0:t.tagId,e.AssertRules.STRING,!0).validate("tagId",null==t?void 0:t.tagId,(function(e){return!!e&&e.length<=10})).validate("tagName",null==t?void 0:t.tagName,e.AssertRules.STRING,!0).validate("tagName",null==t?void 0:t.tagName,(function(e){return!!e&&e.length<=15})).ifReady((function(r,a){return o(n,void 0,void 0,(function(){var n,o,s;return i(this,(function(i){switch(i.label){case 0:return n=a.createTraceId(),a.info(sr,JSON.stringify({tagId:t.tagId,tagName:t.tagName}),n),[4,r.createTag(t)];case 1:return o=i.sent().code,s=o===e.ErrorCode.SUCCESS?"info":"warn",a[s](dr,JSON.stringify({code:o}),n),o===e.ErrorCode.SUCCESS?[2,{code:o}]:[2,{code:o,msg:Yo[o]}]}}))}))}))]}))}))},exports.addToBlacklist=function(t){return o(this,void 0,void 0,(function(){var n=this;return i(this,(function(r){return[2,new e.ValidatorManage($,ee).validate("userId",t,e.AssertRules.STRING,!0).ifReady((function(r,a){return o(n,void 0,void 0,(function(){var n,o,s;return i(this,(function(i){switch(i.label){case 0:return n=a.createTraceId(),a.info($,JSON.stringify({userId:t}),n),[4,r.addToBlacklist(t)];case 1:return o=i.sent(),s=o===e.ErrorCode.SUCCESS?"info":"warn",a[s](ee,JSON.stringify({code:o}),n),[2,{code:o}]}}))}))}))]}))}))},exports.batchClearRemoteHistoryMessages=function(t,n){return o(this,void 0,void 0,(function(){var r=this;return i(this,(function(a){return[2,new e.ValidatorManage(pn,In).validate("clearMessageOption",t,(function(t){if(!e.validate("clearMessageOption",t,e.AssertRules.ARRAY,!0))return!1;if(t.length>20||0===t.length)return!1;for(var n=0,r=t;n<r.length;n++){var o=r[n];if(!(e.validate("options",o,e.AssertRules.OBJECT,!0)&&e.validate("options.targetId",o.targetId,e.AssertRules.STRING,!0)&&e.validate("options.conversationType",o.conversationType,(function(t){return[e.ConversationType.PRIVATE,e.ConversationType.GROUP,e.ConversationType.CHATROOM,e.ConversationType.SYSTEM].includes(t)}),!0)&&e.validate("options.timestamp",o.timestamp,e.AssertRules.NUMBER,!0)&&e.validate("options.channelId",o.channelId,e.AssertRules.ONLY_STRING)))return!1}return!0}),!0).ifReady((function(a,s){return o(r,void 0,void 0,(function(){var r,o,d;return i(this,(function(i){switch(i.label){case 0:return r=t.map((function(e){return{conversationType:e.conversationType,targetId:e.targetId,timestamp:e.timestamp,channelId:e.channelId||""}})),o=s.createTraceId(),s.info(pn,"options: "+JSON.stringify(r)+", isDeleteLocal: "+!!n,o),[4,a.batchClearRemoteHistoryMessages(r,!!n)];case 1:return d=i.sent(),s[e.ErrorCode.SUCCESS===d?"info":"warn"](In,"code: "+d,o),[2,{code:d}]}}))}))}))]}))}))},exports.batchGetMessageReadReceiptInfoV4=function(t,n){return o(this,void 0,void 0,(function(){var r=this;return i(this,(function(a){return[2,new e.ValidatorManage(e.LogTagId.A_BATCH_GET_MESSAGE_READ_RECEIPT_INFO_V4_T,e.LogTagId.A_BATCH_GET_MESSAGE_READ_RECEIPT_INFO_V4_R).validate("conversation",t,e.AssertRules.OBJECT,!0).validate("conversationType",null==t?void 0:t.conversationType,(function(t){return t===e.ConversationType.GROUP}),!0,"It should be ConversationType.GROUP").validate("targetId",null==t?void 0:t.targetId,e.AssertRules.STRING,!0).validate("channelId",null==t?void 0:t.channelId,e.AssertRules.CHANNEL_ID).validate("messageUId",n,(function(t){return!!e.validate("messageUIds",t,e.AssertRules.ARRAY,!0)&&!t.some((function(t){return!e.isString(t)}))}),!0).ifReady((function(a,s){return o(r,void 0,void 0,(function(){var r,o,d,u,c,l,v;return i(this,(function(i){switch(i.label){case 0:return r="conversationType:"+t.conversationType+",targetId:"+t.targetId+",\n channelId: "+t.channelId+", messageUid:"+n.toString(),o=s.createTraceId(),s.info(e.LogTagId.A_BATCH_GET_MESSAGE_READ_RECEIPT_INFO_V4_T,r,o),3!==(null==(d=a.getNaviInfoFromCache())?void 0:d.grpRRVer)?[2,{code:e.ErrorCode.READ_RECEIPT_V4_NOT_SUPPORT}]:[4,a.batchGetMessageReadReceiptInfoV4(t,n)];case 1:return u=i.sent(),c=u.code,l=u.msg,v=u.data,s[c===e.ErrorCode.SUCCESS?"info":"warn"](e.LogTagId.A_BATCH_GET_MESSAGE_READ_RECEIPT_INFO_V4_R,"code: "+c+", msg: "+l,o),c===e.ErrorCode.SUCCESS?[2,{code:c,data:v}]:[2,{code:c,msg:l}]}}))}))}))]}))}))},exports.batchRemoveConversation=function(t){return o(this,void 0,void 0,(function(){var n=this;return i(this,(function(r){return[2,new e.ValidatorManage(ln,vn).validate("conversations",t,(function(n){if(!e.validate("conversations",n,e.AssertRules.ARRAY,!0))return!1;if(n.length>20||0===n.length)return!1;for(var r=0,o=t;r<o.length;r++){var i=o[r];if(!(e.validate("conversations",i,e.AssertRules.OBJECT,!0)&&e.validate("conversations.targetId",i.targetId,e.AssertRules.STRING,!0)&&e.validate("conversations.conversationType",i.conversationType,(function(t){var n=[e.ConversationType.PRIVATE,e.ConversationType.GROUP,e.ConversationType.SYSTEM].includes(t);return n||console.warn(vn,"conversations.conversationType is invalid, It should be one of the following values:\n ConversationType.PRIVATE,\n ConversationType.GROUP,\n ConversationType.SYSTEM,\n "),n}),!0)&&e.validate("conversations.channelId",i.channelId,e.AssertRules.ONLY_STRING)))return!1}return!0}),!0).ifReady((function(r,a){return o(n,void 0,void 0,(function(){var n,o,s;return i(this,(function(i){switch(i.label){case 0:return n=t.map((function(e){return{conversationType:e.conversationType,targetId:e.targetId,channelId:e.channelId||""}})),o=a.createTraceId(),a.info(ln,"conversations: "+JSON.stringify(n),o),[4,r.batchRemoveConversation(n)];case 1:return s=i.sent(),a[e.ErrorCode.SUCCESS===s?"info":"warn"](vn,"code: "+s,o),[2,{code:s}]}}))}))}))]}))}))},exports.batchSetConversationNotificationLevel=function(t,n){return o(this,void 0,void 0,(function(){var r=this;return i(this,(function(a){return[2,new e.ValidatorManage(fn,gn).validate("conversations",t,(function(t){if(!e.validate("conversations",t,e.AssertRules.ARRAY,!0))return!1;if(t.length>20||0===t.length)return!1;for(var n=0,r=t;n<r.length;n++){var o=r[n];if(!(e.validate("conversations",o,e.AssertRules.OBJECT,!0)&&e.validate("conversations.targetId",o.targetId,e.AssertRules.STRING,!0)&&e.validate("conversations.conversationType",o.conversationType,(function(t){var n=[e.ConversationType.PRIVATE,e.ConversationType.GROUP,e.ConversationType.SYSTEM].includes(t);return n||console.warn(vn,"conversations.conversationType is invalid, It should be one of the following values:\n ConversationType.PRIVATE,\n ConversationType.GROUP,\n ConversationType.SYSTEM,\n "),n}),!0)&&e.validate("conversations.channelId",o.channelId,e.AssertRules.ONLY_STRING)))return!1}return!0}),!0).validate("notificationLevel",n,(function(e){return[-1,0,1,2,3,4,5].includes(e)}),!0).ifReady((function(a,s){return o(r,void 0,void 0,(function(){var r,o,d;return i(this,(function(i){switch(i.label){case 0:return r=t.map((function(e){return{conversationType:e.conversationType,targetId:e.targetId,channelId:e.channelId||""}})),o=s.createTraceId(),s.info(fn,"conversations: "+JSON.stringify(r),o),[4,a.batchSetConversationNotificationLevel(r,n)];case 1:return d=i.sent(),s[e.ErrorCode.SUCCESS===d?"info":"warn"](gn,"code: "+d,o),[2,{code:d}]}}))}))}))]}))}))},exports.batchSetConversationToTop=function(t,n,r){return o(this,void 0,void 0,(function(){var a=this;return i(this,(function(s){return[2,new e.ValidatorManage(Tn,Sn).validate("conversations",t,(function(t){if(!e.validate("conversations",t,e.AssertRules.ARRAY,!0))return!1;if(t.length>20||0===t.length)return!1;for(var n=0,r=t;n<r.length;n++){var o=r[n];if(!(e.validate("conversations",o,e.AssertRules.OBJECT,!0)&&e.validate("conversations.targetId",o.targetId,e.AssertRules.STRING,!0)&&e.validate("conversations.conversationType",o.conversationType,(function(t){var n=[e.ConversationType.PRIVATE,e.ConversationType.GROUP,e.ConversationType.SYSTEM].includes(t);return n||console.warn(vn,"conversations.conversationType is invalid, It should be one of the following values:\n ConversationType.PRIVATE,\n ConversationType.GROUP,\n ConversationType.SYSTEM,\n "),n}),!0)&&e.validate("conversations.channelId",o.channelId,e.AssertRules.ONLY_STRING)))return!1}return!0}),!0).validate("isTop",n,e.AssertRules.BOOLEAN,!0).ifReady((function(s,d){return o(a,void 0,void 0,(function(){var o,a,u;return i(this,(function(i){switch(i.label){case 0:return o=t.map((function(e){return{conversationType:e.conversationType,targetId:e.targetId,channelId:e.channelId||""}})),a=d.createTraceId(),d.info(Tn,"conversations: "+JSON.stringify(o),a),[4,s.batchSetConversationToTop(o,n,r)];case 1:return u=i.sent(),d[e.ErrorCode.SUCCESS===u?"info":"warn"](Sn,"code: "+u,a),[2,{code:u}]}}))}))}))]}))}))},exports.bindRTCRoomForChatroom=function(t){return o(this,void 0,void 0,(function(){var n=this;return i(this,(function(r){return[2,new e.ValidatorManage(Ne,Oe).validate("targetId",null==t?void 0:t.chatRoomId,e.AssertRules.STRING,!0).validate("rtcRoomId",null==t?void 0:t.rtcRoomId,e.AssertRules.STRING,!0).ifReady((function(r,a){return o(n,void 0,void 0,(function(){var n,o,s;return i(this,(function(i){switch(i.label){case 0:return n=a.createTraceId(),a.info(Ne,JSON.stringify({chatRoomId:t.chatRoomId,rtcRoomId:t.rtcRoomId}),n),[4,r.bindRTCRoomForChatroom(t)];case 1:return o=i.sent(),s=o===e.ErrorCode.SUCCESS?"info":"warn",a[s](Oe,JSON.stringify({code:o}),n),[2,{code:o,msg:Yo[o]}]}}))}))}))]}))}))},exports.clearAllMessagesUnreadStatus=function(){return o(this,void 0,void 0,(function(){var t=this;return i(this,(function(n){return[2,new e.ValidatorManage("","").ifReady((function(e,n){return o(t,void 0,void 0,(function(){var t;return i(this,(function(r){switch(r.label){case 0:return t=n.createTraceId(),n.info(Qe,"",t),[4,e.clearAllUnreadCount()];case 1:return[2,{code:r.sent()}]}}))}))}))]}))}))},exports.clearEventListeners=Ho,exports.clearHistoryMessages=function(t,n){return o(this,void 0,void 0,(function(){var r=this;return i(this,(function(a){return[2,new e.ValidatorManage(Nn,On).validate("conversation",t,e.AssertRules.OBJECT,!0).validate("conversationType",null==t?void 0:t.conversationType,e.AssertRules.CONVERSATION_TYPE,!0).validate("targetId",null==t?void 0:t.targetId,e.AssertRules.STRING,!0).validate("channelId",null==t?void 0:t.channelId,e.AssertRules.CHANNEL_ID).validate("timestamp",n,e.AssertRules.NUMBER,!0).ifReady((function(a,s){return o(r,void 0,void 0,(function(){var r,o,d;return i(this,(function(i){switch(i.label){case 0:return r=s.createTraceId(),s.info(Nn,JSON.stringify({targetId:t.targetId,conversationType:t.conversationType,channelId:t.channelId,timestamp:n}),r),[4,a.deleteRemoteMessageByTimestamp(t.conversationType,t.targetId,n,t.channelId)];case 1:return o=i.sent(),d=o===e.ErrorCode.SUCCESS?"info":"warn",s[d](On,JSON.stringify({code:o}),r),o!==e.ErrorCode.SUCCESS?[2,{code:o,msg:Yo[o]}]:[2,{code:e.ErrorCode.SUCCESS}]}}))}))}))]}))}))},exports.clearMessages=function(t){return o(this,void 0,void 0,(function(){var n=this;return i(this,(function(r){return Q("RongIMLib.clearMessages","RongIMLib.ElectronExtension.clearMessages"),e.usingCppEngine()?[2,new e.ValidatorManage(Kn,zn).validate("conversation",t,e.AssertRules.OBJECT,!0).validate("conversationType",null==t?void 0:t.conversationType,e.AssertRules.CONVERSATION_TYPE,!0).validate("targetId",null==t?void 0:t.targetId,e.AssertRules.STRING,!0).validate("channelId",null==t?void 0:t.channelId,e.AssertRules.CHANNEL_ID).ifReady((function(r,a){return o(n,void 0,void 0,(function(){var n,o,s,d,u,c;return i(this,(function(i){switch(i.label){case 0:return n=t.conversationType,o=t.targetId,s=t.channelId,d=a.createTraceId(),a.info(Kn,JSON.stringify({conversationType:n,targetId:o,channelId:s}),d),[4,r.clearMessages(n,o,s)];case 1:return u=i.sent(),c=u===e.ErrorCode.SUCCESS?"info":"warn",a[c](zn,JSON.stringify({code:u}),d),u===e.ErrorCode.SUCCESS?[2,{code:u}]:[2,{code:u,msg:Yo[u]}]}}))}))}))]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:Yo[e.ErrorCode.NOT_SUPPORT]}]}))}))},exports.clearMessagesUnreadStatus=function(t){return o(this,void 0,void 0,(function(){var n=this;return i(this,(function(r){return[2,new e.ValidatorManage(We,Xe).validate("conversation",t,e.AssertRules.OBJECT,!0).validate("conversationType",null==t?void 0:t.conversationType,e.AssertRules.CONVERSATION_TYPE,!0).validate("targetId",null==t?void 0:t.targetId,e.AssertRules.STRING,!0).validate("channelId",null==t?void 0:t.channelId,e.AssertRules.CHANNEL_ID).ifReady((function(r,a){return o(n,void 0,void 0,(function(){var n,o,s,d,u,c;return i(this,(function(i){switch(i.label){case 0:return n=t.conversationType,o=t.targetId,s=t.channelId,d=a.createTraceId(),a.info(We,JSON.stringify({conversationType:n,targetId:o,channelId:s}),d),[4,r.clearUnreadCount(n,o,s)];case 1:return u=i.sent(),c=u===e.ErrorCode.SUCCESS?"info":"warn",a[c](Xe,JSON.stringify({code:u}),d),u!==e.ErrorCode.SUCCESS?[2,{code:u,msg:Yo[u]}]:[2,{code:u}]}}))}))}))]}))}))},exports.clearTextMessageDraft=function(t){return o(this,void 0,void 0,(function(){var n=this;return i(this,(function(r){return[2,new e.ValidatorManage(ke,He).validate("conversation",t,e.AssertRules.OBJECT,!0).validate("conversationType",null==t?void 0:t.conversationType,e.AssertRules.CONVERSATION_TYPE,!0).validate("targetId",null==t?void 0:t.targetId,e.AssertRules.STRING,!0).validate("channelId",null==t?void 0:t.channelId,e.AssertRules.CHANNEL_ID).ifReady((function(r,a){return o(n,void 0,void 0,(function(){var n,o,s,d,u,c;return i(this,(function(i){switch(i.label){case 0:return n=t.conversationType,o=t.targetId,s=t.channelId,d=a.createTraceId(),a.info(ke,JSON.stringify({conversationType:n,targetId:o,channelId:s}),d),[4,r.clearConversationMessageDraft(n,o,s)];case 1:return u=i.sent(),c=u===e.ErrorCode.SUCCESS?"info":"warn",a[c](He,JSON.stringify({code:u}),d),u===e.ErrorCode.SUCCESS?[2,{code:u}]:[2,{code:u,msg:Yo[u]}]}}))}))}))]}))}))},exports.clearUnreadCountByTimestamp=function(t,n){return o(this,void 0,void 0,(function(){var r=this;return i(this,(function(a){return e.usingCppEngine()?[2,new e.ValidatorManage(Qn,Zn).validate("conversation",t,e.AssertRules.OBJECT,!0).validate("conversationType",null==t?void 0:t.conversationType,e.AssertRules.CONVERSATION_TYPE,!0).validate("targetId",null==t?void 0:t.targetId,e.AssertRules.STRING,!0).validate("channelId",null==t?void 0:t.channelId,e.AssertRules.CHANNEL_ID).validate("timestamp",n,e.AssertRules.NUMBER).ifReady((function(a,s){return o(r,void 0,void 0,(function(){var r,o,d,u,c,l;return i(this,(function(i){switch(i.label){case 0:return r=t.conversationType,o=t.targetId,d=t.channelId,u=s.createTraceId(),s.info(Qn,JSON.stringify({conversationType:r,targetId:o,channelId:d,timestamp:n}),u),[4,a.clearUnreadCountByTimestamp(r,o,n,d)];case 1:return c=i.sent(),l=c===e.ErrorCode.SUCCESS?"info":"warn",s[l](Zn,JSON.stringify({code:c}),u),c===e.ErrorCode.SUCCESS?[2,{code:c}]:[2,{code:c,msg:Yo[c]}]}}))}))}))]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:Yo[e.ErrorCode.NOT_SUPPORT]}]}))}))},exports.connect=function(t,n){return o(this,void 0,void 0,(function(){var r=this;return i(this,(function(a){return[2,new e.ValidatorManage(e.LogTagId.A_CONNECT_T,e.LogTagId.A_CONNECT_R).validate("token",t,e.AssertRules.STRING,!0).ifReady((function(a,s){return o(r,void 0,void 0,(function(){var r,o,d;return i(this,(function(i){switch(i.label){case 0:return r=s.createTraceId(),s.info(e.LogTagId.A_CONNECT_T,JSON.stringify({token:t,reconnectKickEnable:n}),r),[4,a.connect(t,!!n,r)];case 1:return o=i.sent(),d=o.code===e.ErrorCode.SUCCESS?"info":"warn",s[d](e.LogTagId.A_CONNECT_R,JSON.stringify({code:o.code,userId:o.userId}),r),o.code===e.ErrorCode.SUCCESS?[2,{code:o.code,data:{userId:o.userId}}]:[2,{code:o.code,msg:Yo[o.code]}]}}))}))}))]}))}))},exports.createUploadTask=function(t){return o(this,void 0,void 0,(function(){var n,r,o;return i(this,(function(i){return n=t.contentDisposition,r=t.fileType,o=t.file,[2,new e.ValidatorManage("","").validate("contentDisposition",n,(function(e){return"inline"===e||"attachment"===e}),!1).validate("fileType",r,(function(t){return!!e.FileType[t]}),!0).validate("file",o,(function(t){return t instanceof File&&(!(r===e.FileType.IMAGE&&!t.type.match(/^image\//))&&!(r===e.FileType.AUDIO&&!t.type.match(/^audio\//)))}),!0).ifReadySync((function(n,r,o){var i=Mi(t,Pi(n,o));return{code:e.ErrorCode.SUCCESS,data:i}}))]}))}))},exports.deleteLocalMessagesByTimestamp=function(t,n,r){return o(this,void 0,void 0,(function(){var a,s,d,u=this;return i(this,(function(c){return Q("RongIMLib.deleteLocalMessagesByTimestamp","RongIMLib.ElectronExtension.deleteMessagesByTimestamp"),e.usingCppEngine()?(a=t.conversationType,s=t.targetId,d=t.channelId,[2,new e.ValidatorManage(qn,jn).validate("conversation",t,e.AssertRules.OBJECT,!0).validate("conversationType",null==t?void 0:t.conversationType,e.AssertRules.CONVERSATION_TYPE,!0).validate("targetId",null==t?void 0:t.targetId,e.AssertRules.STRING,!0).validate("channelId",null==t?void 0:t.channelId,e.AssertRules.CHANNEL_ID).validate("timestamp",n,e.AssertRules.NUMBER,!0).validate("cleanSpace",r,e.AssertRules.BOOLEAN).ifReady((function(t,c){return o(u,void 0,void 0,(function(){var o,u,l;return i(this,(function(i){switch(i.label){case 0:return o=c.createTraceId(),c.info(qn,JSON.stringify({conversationType:a,targetId:s,channelId:d,timestamp:n,cleanSpace:r}),o),[4,t.deleteMessagesByTimestamp(a,s,n,r,d)];case 1:return u=i.sent(),c.debug(e.LogTagId.A_DELETE_MESSAGES_S,JSON.stringify({code:u,conversationType:a,targetId:s,channelId:d,timestamp:n})),l=u===e.ErrorCode.SUCCESS?"info":"warn",c[l](jn,JSON.stringify({code:u}),o),u===e.ErrorCode.SUCCESS?[2,{code:u}]:[2,{code:u,msg:Yo[u]}]}}))}))}))]):[2,{code:e.ErrorCode.NOT_SUPPORT,msg:Yo[e.ErrorCode.NOT_SUPPORT]}]}))}))},exports.deleteMessages=function(t,n){return o(this,void 0,void 0,(function(){var r=this;return i(this,(function(a){return[2,new e.ValidatorManage(yn,An).validate("conversation",t,e.AssertRules.OBJECT,!0).validate("conversationType",null==t?void 0:t.conversationType,e.AssertRules.CONVERSATION_TYPE,!0).validate("targetId",null==t?void 0:t.targetId,e.AssertRules.STRING,!0).validate("channelId",null==t?void 0:t.channelId,e.AssertRules.CHANNEL_ID).validate("messages",n,(function(t){return e.isArray(t)&&t.length}),!0).validate("messages",n,(function(t){return!(!t||!e.isArray(t))&&!t.some((function(t){return!e.isString(null==t?void 0:t.messageUId)||!e.isNumber(null==t?void 0:t.sentTime)||!e.validate("options.messageDirection",null==t?void 0:t.messageDirection,(function(e){return 1===e||2===e}),!0)}))}),!0).ifReady((function(a,s){return o(r,void 0,void 0,(function(){var r,o,d;return i(this,(function(i){switch(i.label){case 0:return r=s.createTraceId(),s.info(yn,JSON.stringify({targetId:t.targetId,conversationType:t.conversationType,channelId:t.channelId,messages:n.map((function(e){return e.messageUId}))}),r),[4,a.deleteRemoteMessage(t.conversationType,t.targetId,n,t.channelId)];case 1:return o=i.sent(),d=o===e.ErrorCode.SUCCESS?"info":"warn",s[d](An,JSON.stringify({code:o}),r),o!==e.ErrorCode.SUCCESS?[2,{code:o,msg:Yo[o]}]:[2,{code:e.ErrorCode.SUCCESS}]}}))}))}))]}))}))},exports.destroy=function(){return o(this,void 0,void 0,(function(){return i(this,(function(e){return Go?(Ho(),[2,Vo()]):[2]}))}))},exports.disconnect=function(t){return e.logger.info(e.LogTagId.A_DISCONNECT_O,{}),Bo((function(e){return e.disconnect(t)}))},exports.electronExtension=Hi,exports.forceRemoveChatRoomEntry=function(t,n){return o(this,void 0,void 0,(function(){var r=this;return i(this,(function(a){return[2,new e.ValidatorManage(he,_e).validate("targetId",t,e.AssertRules.STRING,!0).validate("key",null==n?void 0:n.key,e.AssertRules.STRING,!0).validate("isSendNotification",null==n?void 0:n.isSendNotification,e.AssertRules.BOOLEAN).validate("notificationExtra",null==n?void 0:n.notificationExtra,e.isLimitedString({maxLength:e.MAX_CHATROOM_NOTIFICATION_EXTRA_LENGTH})).ifReady((function(a,s){return o(r,void 0,void 0,(function(){var r,o,d;return i(this,(function(i){switch(i.label){case 0:return r=s.createTraceId(),s.info(he,JSON.stringify({chatroomId:t,key:n.key,isSendNotification:n.isSendNotification,notificationExtra:n.notificationExtra}),r),[4,a.forceRemoveChatroomEntry(t,n)];case 1:return o=i.sent(),d=o===e.ErrorCode.SUCCESS?"info":"warn",s[d](_e,JSON.stringify({code:o}),r),o!==e.ErrorCode.SUCCESS?[2,{code:o,msg:Yo[o]}]:[2,{code:o}]}}))}))}))]}))}))},exports.forceSetChatRoomEntry=function(t,n){return o(this,void 0,void 0,(function(){var r=this;return i(this,(function(a){return[2,new e.ValidatorManage(fe,ge).validate("targetId",t,e.AssertRules.STRING,!0).validate("key",null==n?void 0:n.key,e.AssertRules.STRING,!0).validate("value",null==n?void 0:n.value,e.AssertRules.STRING,!0).validate("isAutoDelete",null==n?void 0:n.isAutoDelete,e.AssertRules.BOOLEAN).validate("isSendNotification",null==n?void 0:n.isSendNotification,e.AssertRules.BOOLEAN).validate("notificationExtra",null==n?void 0:n.notificationExtra,e.isLimitedString({maxLength:e.MAX_CHATROOM_NOTIFICATION_EXTRA_LENGTH})).ifReady((function(a,s){return o(r,void 0,void 0,(function(){var r,o,d;return i(this,(function(i){switch(i.label){case 0:return r=s.createTraceId(),s.info(fe,JSON.stringify({chatroomId:t,key:n.key,value:n.value,isSendNotification:n.isSendNotification,isAutoDelete:n.isAutoDelete,notificationExtra:n.notificationExtra}),r),[4,a.forceSetChatroomEntry(t,n)];case 1:return o=i.sent(),d=o===e.ErrorCode.SUCCESS?"info":"warn",s[d](ge,JSON.stringify({code:o}),r),o!==e.ErrorCode.SUCCESS?[2,{code:o,msg:Yo[o]}]:[2,{code:o}]}}))}))}))]}))}))},exports.getAllChatRoomEntries=function(t){return o(this,void 0,void 0,(function(){var n=this;return i(this,(function(r){return[2,new e.ValidatorManage(Ce,me).validate("targetId",t,e.AssertRules.STRING,!0).ifReady((function(r,a){return o(n,void 0,void 0,(function(){var n,o,s,d;return i(this,(function(i){switch(i.label){case 0:return n=a.createTraceId(),a.info(Ce,JSON.stringify({chatroomId:t}),n),[4,r.getAllChatroomEntries(t)];case 1:return o=i.sent(),s=o.code,d=o.data,s===e.ErrorCode.SUCCESS&&d?(a.info(me,JSON.stringify({code:s,data:d}),n),[2,{code:s,data:d}]):(a.warn(me,JSON.stringify({code:s}),n),[2,{code:s,msg:Yo[s]}])}}))}))}))]}))}))},exports.getAllConversationState=function(){return o(this,void 0,void 0,(function(){var t=this;return i(this,(function(n){return[2,new e.ValidatorManage("","").ifReady((function(n,r){return o(t,void 0,void 0,(function(){var t,o,a,s,d;return i(this,(function(i){switch(i.label){case 0:return t=r.createTraceId(),r.info(Tt,"",t),[4,n.getAllConversationState()];case 1:return o=i.sent(),a=o.code,s=o.data,d=a===e.ErrorCode.SUCCESS?"info":"warn",r[d](nt,JSON.stringify({code:a}),t),a===e.ErrorCode.SUCCESS?[2,{code:a,data:s}]:[2,{code:a}]}}))}))}))]}))}))},exports.getAllUltraGroupUnreadCount=function(){return o(this,void 0,void 0,(function(){var t=this;return i(this,(function(n){return[2,new e.ValidatorManage(eo,to).ifReady((function(n,r){return o(t,void 0,void 0,(function(){var t,o,a,s,d;return i(this,(function(i){switch(i.label){case 0:return t=r.createTraceId(),r.info(eo,"getAllUltraGroupUnreadCount",t),[4,n.getAllUltraGroupUnreadCount()];case 1:return o=i.sent(),a=o.code,s=o.data,d=a===e.ErrorCode.SUCCESS?"info":"warn",r[d](to,JSON.stringify({code:a,data:s}),t),a===e.ErrorCode.SUCCESS?[2,{code:a,data:s}]:[2,{code:a,msg:Yo[a]}]}}))}))}))]}))}))},exports.getAllUltraGroupUnreadMentionedCount=function(){return o(this,void 0,void 0,(function(){var t=this;return i(this,(function(n){return[2,new e.ValidatorManage(no,ro).ifReady((function(n,r){return o(t,void 0,void 0,(function(){var t,o,a,s,d;return i(this,(function(i){switch(i.label){case 0:return t=r.createTraceId(),r.info(no,"getAllUltraGroupUnreadCount",t),[4,n.getAllUltraGroupUnreadCount(true)];case 1:return o=i.sent(),a=o.code,s=o.data,d=a===e.ErrorCode.SUCCESS?"info":"warn",r[d](ro,JSON.stringify({code:a,data:s}),t),a===e.ErrorCode.SUCCESS?[2,{code:a,data:s}]:[2,{code:a,msg:Yo[a]}]}}))}))}))]}))}))},exports.getAllUnreadMentionedCount=function(){return o(this,void 0,void 0,(function(){var t=this;return i(this,(function(n){return[2,new e.ValidatorManage("","").ifReady((function(n,r){return o(t,void 0,void 0,(function(){var t,o,a,s;return i(this,(function(i){switch(i.label){case 0:return t=r.createTraceId(),r.info(ft,"",t),[4,n.getAllUnreadMentionedCount()];case 1:return o=i.sent(),a=o.code,s=o.data,a===e.ErrorCode.SUCCESS?(r.warn(gt,JSON.stringify({code:a,data:s}),t),[2,{code:a,data:s}]):[2,{code:a}]}}))}))}))]}))}))},exports.getBlacklist=function(){return o(this,void 0,void 0,(function(){var t=this;return i(this,(function(n){return[2,new e.ValidatorManage(re,oe).ifReady((function(n,r){return o(t,void 0,void 0,(function(){var t,o,a,s;return i(this,(function(i){switch(i.label){case 0:return t=r.createTraceId(),r.info(re,"getBlacklist -> ",t),[4,n.getBlacklist()];case 1:return o=i.sent(),a=o.code,s=o.data,a===e.ErrorCode.SUCCESS&&s?(r.info(oe,JSON.stringify({code:a,data:s}),t),[2,{code:a,data:s}]):(r.warn(oe,JSON.stringify({code:a}),t),[2,{code:a}])}}))}))}))]}))}))},exports.getBlacklistStatus=function(t){return o(this,void 0,void 0,(function(){var n=this;return i(this,(function(r){return[2,new e.ValidatorManage(ie,ae).validate("userId",t,e.AssertRules.STRING,!0).ifReady((function(r,a){return o(n,void 0,void 0,(function(){var n,o,s,d;return i(this,(function(i){switch(i.label){case 0:return n=a.createTraceId(),a.info(ie,JSON.stringify({userId:t}),n),[4,r.getBlacklistStatus(t)];case 1:return o=i.sent(),s=o.code,d=o.data,s===e.ErrorCode.SUCCESS?(a.info(ae,JSON.stringify({code:s,data:0===d}),n),[2,{code:s,data:0===d}]):(a.warn(ae,JSON.stringify({code:s}),n),[2,{code:s}])}}))}))}))]}))}))},exports.getBlockUltraGroupList=function(){return o(this,void 0,void 0,(function(){var t=this;return i(this,(function(n){return[2,new e.ValidatorManage("","").ifReady((function(n,r){return o(t,void 0,void 0,(function(){var t,o,a,s;return i(this,(function(i){switch(i.label){case 0:return t=r.createTraceId(),r.info(Pr,"",t),[4,n.getBlockUltraGroupList()];case 1:return o=i.sent(),a=o.code,s=o.data,a===e.ErrorCode.SUCCESS?(r.info(Lr,JSON.stringify({code:a,length:null==s?void 0:s.length}),t),[2,{code:e.ErrorCode.SUCCESS,data:s}]):(r.warn(Lr,JSON.stringify({code:a}),t),[2,{code:a,msg:Yo[a]}])}}))}))}))]}))}))},exports.getBlockedConversationList=function(){return o(this,void 0,void 0,(function(){return i(this,(function(t){return[2,new e.ValidatorManage("","").ifReady((function(e){return e.getBlockConversationList()}))]}))}))},exports.getChatRoomEntry=function(t,n){return o(this,void 0,void 0,(function(){var r=this;return i(this,(function(a){return[2,new e.ValidatorManage(Ee,Re).validate("targetId",t,e.AssertRules.STRING,!0).validate("key",n,(function(t){return e.isString(t)&&/[\w+=-]+/.test(t)&&t.length<=128}),!0).ifReady((function(a,s){return o(r,void 0,void 0,(function(){var r,o,d,u;return i(this,(function(i){switch(i.label){case 0:return r=s.createTraceId(),s.info(Ee,JSON.stringify({chatroomId:t,key:n}),r),[4,a.getChatroomEntry(t,n)];case 1:return o=i.sent(),d=o.code,u=o.data,d===e.ErrorCode.SUCCESS&&u?(s.info(Re,JSON.stringify({code:d,data:u}),r),[2,{code:d,data:u}]):(s.warn(Re,JSON.stringify({code:d}),r),[2,{code:d,msg:Yo[d]}])}}))}))}))]}))}))},exports.getChatRoomInfo=function(t,n){return o(this,void 0,void 0,(function(){var r=this;return i(this,(function(a){return[2,new e.ValidatorManage(e.LogTagId.A_QUIT_CHATROOM_T,e.LogTagId.A_QUIT_CHATROOM_R).validate("targetId",t,e.AssertRules.STRING,!0).validate("count",null==n?void 0:n.count,e.AssertRules.NUMBER).validate("order",null==n?void 0:n.order,(function(e){return[0,1,2].includes(e)})).ifReady((function(a,s){return o(r,void 0,void 0,(function(){var r,o,d,u,c;return i(this,(function(i){switch(i.label){case 0:return r=s.createTraceId(),s.info(se,JSON.stringify({chatroomId:t,count:null==n?void 0:n.count,order:null==n?void 0:n.order}),r),[4,a.getChatroomInfo(t,null==n?void 0:n.count,null==n?void 0:n.order)];case 1:return o=i.sent(),d=o.code,u=o.data,c=d===e.ErrorCode.SUCCESS?"info":"warn",s[c](de,JSON.stringify({code:d}),r),d===e.ErrorCode.SUCCESS&&u?[2,{code:d,data:u}]:[2,{code:d,msg:Yo[d]}]}}))}))}))]}))}))},exports.getChatroomHistoryMessages=function(t,n){return o(this,void 0,void 0,(function(){var r=this;return i(this,(function(a){return[2,new e.ValidatorManage(ye,Ae).validate("targetId",t,e.AssertRules.STRING,!0).validate("timestamp",null==n?void 0:n.timestamp,e.AssertRules.NUMBER).validate("count",null==n?void 0:n.count,e.AssertRules.NUMBER).validate("count",null==n?void 0:n.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})).validate("order",null==n?void 0:n.order,(function(e){return 0===e||1===e})).ifReady((function(a,s){return o(r,void 0,void 0,(function(){var r,o,d,u,c,l;return i(this,(function(i){switch(i.label){case 0:return r=s.createTraceId(),s.info(ye,JSON.stringify({chatroomId:t,timestamp:n.timestamp,count:n.count,order:n.order}),r),[4,a.getChatRoomHistoryMessages(t,n.count,n.order,n.timestamp)];case 1:return o=i.sent(),d=o.code,u=o.data,d===e.ErrorCode.SUCCESS&&u?(c=[],l=u.list.map((function(e){return c.push(e.messageUId),W(e)})),s.info(Ae,JSON.stringify({code:d,data:c}),r),[2,{code:d,data:{list:l,hasMore:!!u.hasMore}}]):(s.warn(Ae,JSON.stringify({code:d}),r),[2,{code:d,msg:Yo[d]}])}}))}))}))]}))}))},exports.getConnectionStatus=function(){return Bo((function(e){return e.getConnectionStatus()}))},exports.getConversation=function(t){return o(this,void 0,void 0,(function(){var n=this;return i(this,(function(r){return[2,new e.ValidatorManage(Le,be).validate("conversation",t,e.AssertRules.OBJECT,!0).validate("conversationType",null==t?void 0:t.conversationType,e.AssertRules.CONVERSATION_TYPE,!0).validate("targetId",null==t?void 0:t.targetId,e.AssertRules.STRING,!0).validate("channelId",null==t?void 0:t.channelId,e.AssertRules.CHANNEL_ID).ifReady((function(r,a){return o(n,void 0,void 0,(function(){var n,o,s,d,u,c,l,v;return i(this,(function(i){switch(i.label){case 0:return n=t.conversationType,o=t.targetId,s=t.channelId,d=a.createTraceId(),a.info(Le,JSON.stringify({conversationType:n,targetId:o,channelId:s}),d),[4,r.getConversation(n,o,s||"")];case 1:return u=i.sent(),c=u.code,l=u.data,v=c===e.ErrorCode.SUCCESS?"info":"warn",a[v](be,JSON.stringify({code:c}),d),c!==e.ErrorCode.SUCCESS?[2,{code:c,msg:Yo[c]}]:[2,{code:c,data:l?X(l):null}]}}))}))}))]}))}))},exports.getConversationList=function(t,n){return o(this,void 0,void 0,(function(){var r=this;return i(this,(function(a){return[2,new e.ValidatorManage(we,Pe).validate("count",null==t?void 0:t.count,e.AssertRules.NUMBER).validate("startTime",null==t?void 0:t.startTime,e.AssertRules.NUMBER).validate("order",null==t?void 0:t.order,e.AssertRules.NUMBER).validate("channelId",n,e.AssertRules.CHANNEL_ID).ifReady((function(a,s){return o(r,void 0,void 0,(function(){var r,o,d,u,c;return i(this,(function(i){switch(i.label){case 0:return r=s.createTraceId(),s.info(we,JSON.stringify({count:null==t?void 0:t.count,startTime:null==t?void 0:t.startTime,order:null==t?void 0:t.order,channelId:n}),r),[4,a.getConversationList(null==t?void 0:t.count,void 0,null==t?void 0:t.startTime,null==t?void 0:t.order,n)];case 1:return o=i.sent(),d=o.code,u=o.data,d===e.ErrorCode.SUCCESS&&u?(c=u.map((function(e){return X(e)})),s.info(Pe,JSON.stringify({code:d,list:c.length}),r),[2,{code:0,data:c}]):(s.warn(Pe,JSON.stringify({code:d})),[2,{code:d,msg:Yo[d]}])}}))}))}))]}))}))},exports.getConversationNotificationLevel=function(t){return o(this,void 0,void 0,(function(){var n=this;return i(this,(function(r){return[2,new e.ValidatorManage(ot,ot).validate("conversation",t,e.AssertRules.OBJECT,!0).validate("conversationType",null==t?void 0:t.conversationType,e.AssertRules.CONVERSATION_TYPE,!0).validate("targetId",null==t?void 0:t.targetId,e.AssertRules.STRING,!0).validate("channelId",null==t?void 0:t.channelId,e.AssertRules.CHANNEL_ID).ifReady((function(r,a){return o(n,void 0,void 0,(function(){var n,o,s,d,u,c,l;return i(this,(function(i){switch(i.label){case 0:return n=t.conversationType,o=t.targetId,s=t.channelId,d=a.createTraceId(),a.info(rt,JSON.stringify({conversationType:n,targetId:o,channelId:s}),d),[4,r.getConversationNotificationLevel(n,o,s)];case 1:return u=i.sent(),c=u.code,l=u.data,c===e.ErrorCode.SUCCESS?(a.info(ot,JSON.stringify({code:c,data:l}),d),[2,{code:c,data:l}]):(a.warn(ot,JSON.stringify({code:c}),d),[2,{code:c,msg:Yo[c]}])}}))}))}))]}))}))},exports.getConversationNotificationStatus=function(t){return o(this,void 0,void 0,(function(){var n=this;return i(this,(function(r){return[2,new e.ValidatorManage(it,at).validate("conversation",t,e.AssertRules.OBJECT,!0).validate("conversationType",null==t?void 0:t.conversationType,e.AssertRules.CONVERSATION_TYPE,!0).validate("targetId",null==t?void 0:t.targetId,e.AssertRules.STRING,!0).validate("channelId",null==t?void 0:t.channelId,e.AssertRules.CHANNEL_ID).ifReady((function(r,a){return o(n,void 0,void 0,(function(){var n,o,s,d,u,c,l;return i(this,(function(i){switch(i.label){case 0:return n=t.conversationType,o=t.targetId,s=t.channelId,d=a.createTraceId(),a.info(it,JSON.stringify({conversationType:n,targetId:o,channelId:s}),d),[4,r.getConversationNotificationStatus(n,o,s)];case 1:return u=i.sent(),c=u.code,l=u.data,c===e.ErrorCode.SUCCESS?(a.info(at,JSON.stringify({code:c,data:l}),d),[2,{code:c,data:l}]):(a.warn(at,JSON.stringify({code:c}),d),[2,{code:c,msg:Yo[c]}])}}))}))}))]}))}))},exports.getConversationTypeNotificationLevel=function(t){return o(this,void 0,void 0,(function(){var n=this;return i(this,(function(r){return e.validate("conversationType",t,(function(){return[e.ConversationType.PRIVATE,e.ConversationType.GROUP,e.ConversationType.SYSTEM,e.ConversationType.PUBLIC_SERVICE,e.ConversationType.APP_PUBLIC_SERVICE,e.ConversationType.ULTRA_GROUP].includes(t)}))?[2,ko((function(r,a){return o(n,void 0,void 0,(function(){var n,o,s;return i(this,(function(i){switch(i.label){case 0:return a.info(e.LogTagId.O,"getConversationTypeNotificationLevel ->conversationType:"+t),[4,r.getConversationTypeNotificationLevel(t)];case 1:return n=i.sent(),o=n.code,s=n.data,o===e.ErrorCode.SUCCESS?[2,{code:o,data:s}]:(a.warn(e.LogTagId.O,"getConversationTypeNotificationLevel ->conversationType:"+t),[2,{code:o,msg:Yo[o]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getConversationsFromTagByPage=function(t,n,a){return o(this,void 0,void 0,(function(){var s=this;return i(this,(function(d){return[2,new e.ValidatorManage(yr,Ar).validate("tagId",t,e.AssertRules.STRING,!0).validate("count",n,e.AssertRules.NUMBER,!0).validate("startTime",a,e.AssertRules.NUMBER,!0).ifReady((function(d,u){return o(s,void 0,void 0,(function(){var o,s,c,l,v;return i(this,(function(i){switch(i.label){case 0:return o=u.createTraceId(),u.info(yr,JSON.stringify({tagId:t,count:n,startTime:a}),o),[4,d.getConversationListByTag(t,a,n)];case 1:return s=i.sent(),c=s.code,l=s.data,c===e.ErrorCode.SUCCESS?(v=null==l?void 0:l.map((function(e){return function(e){return r(r({},X(e)),{isTopInTag:e.isTopInTag})}(e)})),u.info(Ar,JSON.stringify({code:c,length:null==v?void 0:v.length}),o),[2,{code:c,data:v}]):(u.warn(Ar,JSON.stringify({code:c}),o),[2,{code:c,msg:Yo[c]}])}}))}))}))]}))}))},exports.getCurrentUserId=function(){return Bo((function(e){return e.getCurrentUserId()}))},exports.getDeviceId=function(){return Bo((function(e){return e.getDeviceId()}))},exports.getDownloadAuth=function(t){return new e.ValidatorManage("","").validate("mediaUrl",t,e.AssertRules.STRING,!0).ifReady((function(n){return new Promise((function(r){n.getFileToken(1,void 0,void 0,void 0,t).then((function(t){var n=t.token,o=t.downloadAuthInfo,i=t.deadline;r({code:e.ErrorCode.SUCCESS,data:{token:n,downloadAuthInfo:o,deadline:i}})})).catch((function(e){r({code:e,msg:Yo[e]})}))}))}))},exports.getFileToken=function(t,n,r,o){return ko((function(i){return new Promise((function(a){i.getFileToken(t,n,r,o).then((function(t){a({code:e.ErrorCode.SUCCESS,data:t})})).catch((function(e){a({code:e,msg:Yo[e]})}))}))}))},exports.getFileUrl=function(t,n,r,o,i){return new e.ValidatorManage("","").validate("fileType",t,e.isValidFileType,!0).validate("filename",n,e.AssertRules.STRING).validate("saveName",r,e.AssertRules.STRING).validate("serverType",i,e.AssertRules.NUMBER).ifReady((function(a){return new Promise((function(s){a.getFileUrl(t,n,r,o,i).then((function(t){s({code:e.ErrorCode.SUCCESS,data:t})})).catch((function(e){s({code:e})}))}))}))},exports.getFirstUnreadMessage=function(t){return o(this,void 0,void 0,(function(){var n=this;return i(this,(function(r){return e.usingCppEngine()?[2,new e.ValidatorManage(xn,Gn).validate("conversation",t,e.AssertRules.OBJECT,!0).validate("conversationType",null==t?void 0:t.conversationType,e.AssertRules.CONVERSATION_TYPE,!0).validate("targetId",null==t?void 0:t.targetId,e.AssertRules.STRING,!0).validate("channelId",null==t?void 0:t.channelId,e.AssertRules.CHANNEL_ID).ifReady((function(r,a){return o(n,void 0,void 0,(function(){var n,o,s,d,u,c,l,v;return i(this,(function(i){switch(i.label){case 0:return n=t.conversationType,o=t.targetId,s=t.channelId,d=a.createTraceId(),a.info(xn,JSON.stringify({conversationType:n,targetId:o,channelId:s}),d),[4,r.getFirstUnreadMessage(n,o,s)];case 1:return u=i.sent(),c=u.code,l=u.data,c===e.ErrorCode.SUCCESS?(v=l&&W(l)||null,a.info(Gn,JSON.stringify({code:c,messageUId:null==l?void 0:l.messageUId}),d),[2,{code:c,data:v}]):(a.warn(Gn,JSON.stringify({code:c}),d),[2,{code:c,msg:Yo[c]}])}}))}))}))]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:Yo[e.ErrorCode.NOT_SUPPORT]}]}))}))},exports.getFirstUnreadMessageInfo=function(t){return o(this,void 0,void 0,(function(){var n=this;return i(this,(function(r){return[2,new e.ValidatorManage(Dn,Jn).validate("conversation",t,e.AssertRules.OBJECT,!0).validate("conversationType",null==t?void 0:t.conversationType,e.AssertRules.CONVERSATION_TYPE,!0).validate("targetId",null==t?void 0:t.targetId,e.AssertRules.STRING,!0).validate("channelId",null==t?void 0:t.channelId,e.AssertRules.CHANNEL_ID).ifReady((function(r,a){return o(n,void 0,void 0,(function(){var n,o,s,d,u,c,l;return i(this,(function(i){switch(i.label){case 0:return n=t.conversationType,o=t.targetId,s=t.channelId,d=a.createTraceId(),a.info(Dn,JSON.stringify({conversationType:n,targetId:o,channelId:s}),d),[4,r.getFirstUnreadMessageInfo(n,o,s||"")];case 1:return u=i.sent(),c=u.code,l=u.data,c===e.ErrorCode.SUCCESS?(a.info(Jn,JSON.stringify({code:c,messageUId:null==l?void 0:l.messageUId,sentTime:null==l?void 0:l.sentTime}),d),[2,{code:c,data:l}]):(a.warn(Jn,JSON.stringify({code:c}),d),[2,{code:c,msg:Yo[c]}])}}))}))}))]}))}))},exports.getHistoryMessages=function(t,n){return o(this,void 0,void 0,(function(){var r=this;return i(this,(function(a){return[2,new e.ValidatorManage(e.LogTagId.A_GET_HISTORY_MSG_T,e.LogTagId.A_GET_HISTORY_MSG_R).validate("conversation",t,e.AssertRules.OBJECT,!0).validate("conversationType",null==t?void 0:t.conversationType,e.AssertRules.CONVERSATION_TYPE,!0).validate("targetId",null==t?void 0:t.targetId,e.AssertRules.STRING,!0).validate("channelId",null==t?void 0:t.channelId,e.AssertRules.CHANNEL_ID).validate("timestamp",null==n?void 0:n.timestamp,e.AssertRules.NUMBER).validate("count",null==n?void 0:n.count,e.AssertRules.NUMBER).validate("count",null==n?void 0:n.count,(function(t){if(e.usingCppEngine())return!0;var n=t>0&&t<=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})).validate("order",null==n?void 0:n.order,(function(e){return 0===e||1===e})).ifReady((function(a,s){return o(r,void 0,void 0,(function(){var r,o,d,u,c,l;return i(this,(function(i){switch(i.label){case 0:return r=s.createTraceId(),s.info(e.LogTagId.A_GET_HISTORY_MSG_T,JSON.stringify({targetId:t.targetId,conversationType:t.conversationType,channelId:t.channelId,timestamp:null==n?void 0:n.timestamp,count:null==n?void 0:n.count}),r),[4,a.getHistoryMessage(t.conversationType,t.targetId,null==n?void 0:n.timestamp,null==n?void 0:n.count,null==n?void 0:n.order,null==t?void 0:t.channelId,"",r)];case 1:return o=i.sent(),d=o.code,u=o.data,d===e.ErrorCode.SUCCESS&&u?(c=[],l=u.list.map((function(e){return c.push(e.messageUId),W(e)})),s.info(e.LogTagId.A_GET_HISTORY_MSG_R,JSON.stringify({code:d,messageUIds:c}),r),[2,{code:d,data:{list:l,hasMore:u.hasMore}}]):(s.warn(e.LogTagId.A_GET_HISTORY_MSG_R,JSON.stringify({code:d,messageUIds:""}),r),[2,{code:d,msg:Yo[d]}])}}))}))}))]}))}))},exports.getMessage=function(t){return o(this,void 0,void 0,(function(){var n=this;return i(this,(function(r){return e.usingCppEngine()?[2,new e.ValidatorManage(kn,Hn).validate("messageId",t,(function(t){return e.isNumber(t)||e.isString(t)}),!0).ifReady((function(r,a){return o(n,void 0,void 0,(function(){var n,o,s,d;return i(this,(function(i){switch(i.label){case 0:return n=a.createTraceId(),a.info(kn,JSON.stringify({messageId:t}),n),[4,r.getMessage(t)];case 1:return o=i.sent(),s=o.code,d=o.data,s===e.ErrorCode.SUCCESS?(a.info(Hn,JSON.stringify({code:s,messageUId:null==d?void 0:d.messageUId,messageId:null==d?void 0:d.messageId})),[2,{code:s,data:W(d)}]):(a.warn(Hn,JSON.stringify({code:s})),[2,{code:s,msg:Yo[s]}])}}))}))}))]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:Yo[e.ErrorCode.NOT_SUPPORT]}]}))}))},exports.getMessageReadReceiptV4=function(t,n){return o(this,void 0,void 0,(function(){var r=this;return i(this,(function(a){return[2,new e.ValidatorManage(e.LogTagId.A_GET_MESSAGE_READ_RECEIPT_V4_T,e.LogTagId.A_GET_MESSAGE_READ_RECEIPT_V4_R).validate("conversation",t,e.AssertRules.OBJECT,!0).validate("conversationType",null==t?void 0:t.conversationType,(function(t){return t===e.ConversationType.GROUP}),!0,"It should be ConversationType.GROUP").validate("targetId",null==t?void 0:t.targetId,e.AssertRules.STRING,!0).validate("channelId",null==t?void 0:t.channelId,e.AssertRules.CHANNEL_ID).validate("messageUId",n,e.AssertRules.STRING,!0).ifReady((function(a,s){return o(r,void 0,void 0,(function(){var r,o,d,u,c,l,v;return i(this,(function(i){switch(i.label){case 0:return r="conversationType:"+t.conversationType+",targetId:"+t.targetId+",\n channelId: "+t.channelId+", messageUid:"+n,o=s.createTraceId(),s.info(e.LogTagId.A_GET_MESSAGE_READ_RECEIPT_V4_T,r,o),3!==(null==(d=a.getNaviInfoFromCache())?void 0:d.grpRRVer)?[2,{code:e.ErrorCode.READ_RECEIPT_V4_NOT_SUPPORT}]:[4,a.getMessageReadReceiptV4(t,n)];case 1:return u=i.sent(),c=u.code,l=u.msg,v=u.data,s[c===e.ErrorCode.SUCCESS?"info":"warn"](e.LogTagId.A_GET_MESSAGE_READ_RECEIPT_V4_R,"code: "+c+", msg: "+l,o),c===e.ErrorCode.SUCCESS&&v?[2,{code:c,data:v}]:[2,{code:c,msg:l}]}}))}))}))]}))}))},exports.getMessageReader=function(t,n,r){return o(this,void 0,void 0,(function(){var a=this;return i(this,(function(s){return[2,new e.ValidatorManage(Ln,bn).validate("messageUId",n,e.AssertRules.STRING,!0).validate("targetId",t,e.AssertRules.STRING,!0).validate("channelId",r,e.AssertRules.CHANNEL_ID).ifReady((function(s,d){return o(a,void 0,void 0,(function(){var o,a,u,c;return i(this,(function(i){switch(i.label){case 0:return o=d.createTraceId(),d.info(Ln,JSON.stringify({targetId:t,messageUId:n,channelId:r}),o),[4,s.getMessageReader(t,n,r)];case 1:return a=i.sent(),u=a.code,c=a.data,u===e.ErrorCode.SUCCESS?(d.info(bn,JSON.stringify({code:u,totalMemberCount:null==c?void 0:c.totalMemberCount}),o),[2,{code:u,data:c}]):(d.warn(bn,JSON.stringify({code:u})),[2,{code:u,msg:Yo[u]}])}}))}))}))]}))}))},exports.getMyUserProfile=function(){var t=this;return new e.ValidatorManage(yo,Ao).ifReady((function(n,r){return o(t,void 0,void 0,(function(){var t,o,a,s,d;return i(this,(function(i){switch(i.label){case 0:return t=r.createTraceId(),r.info(yo,"",t),[4,n.getMyUserProfile()];case 1:return o=i.sent(),a=o.code,s=o.data,d=a===e.ErrorCode.SUCCESS?"info":"warn",r[d](Ao,JSON.stringify({code:a,data:s}),t),[2,{code:a,data:s}]}}))}))}))},exports.getMyUserProfileVisibility=function(){var t=this;return new e.ValidatorManage(Uo,Mo).ifReady((function(n,r){return o(t,void 0,void 0,(function(){var t,o,a,s,d;return i(this,(function(i){switch(i.label){case 0:return t=r.createTraceId(),r.info(Uo,"",t),[4,n.getMyUserProfileVisibility()];case 1:return o=i.sent(),a=o.code,s=o.data,d=a===e.ErrorCode.SUCCESS?"info":"warn",r[d](Mo,JSON.stringify({code:a,data:s}),t),[2,{code:a,data:s}]}}))}))}))},exports.getProxy=function(){return o(this,void 0,void 0,(function(){var t=this;return i(this,(function(n){return[2,new e.ValidatorManage(rr,or).ifReady((function(n,r){return o(t,void 0,void 0,(function(){var t,o,a,s;return i(this,(function(i){switch(i.label){case 0:return t=r.createTraceId(),r.info(rr,"",t),[4,n.getProxy()];case 1:return o=i.sent(),a=o.code,s=o.data,a===e.ErrorCode.SUCCESS?(r.info(or,JSON.stringify({code:a,data:s}),t),[2,{code:a,data:s}]):(r.warn(or,JSON.stringify({code:a}),t),[2,{code:a,msg:Yo[a]}])}}))}))}))]}))}))},exports.getRemoteHistoryMessages=function(t,n){return o(this,void 0,void 0,(function(){var r=this;return i(this,(function(a){return[2,new e.ValidatorManage(En,Rn).validate("conversation",t,e.AssertRules.OBJECT,!0).validate("conversationType",null==t?void 0:t.conversationType,e.AssertRules.CONVERSATION_TYPE,!0).validate("targetId",null==t?void 0:t.targetId,e.AssertRules.STRING,!0).validate("channelId",null==t?void 0:t.channelId,e.AssertRules.CHANNEL_ID).validate("timestamp",null==n?void 0:n.timestamp,e.AssertRules.NUMBER).validate("count",null==n?void 0:n.count,e.AssertRules.NUMBER).validate("count",null==n?void 0:n.count,(function(e){return e>0&&e<=100})).validate("order",null==n?void 0:n.order,(function(e){return 0===e||1===e})).ifReady((function(a,s){return o(r,void 0,void 0,(function(){var r,o,d,u,c,l;return i(this,(function(i){switch(i.label){case 0:return r=s.createTraceId(),s.info(En,JSON.stringify({targetId:t.targetId,conversationType:t.conversationType,channelId:t.channelId,timestamp:null==n?void 0:n.timestamp,count:null==n?void 0:n.count,order:null==n?void 0:n.order}),r),[4,a.getRemoteHistoryMessages(t.conversationType,t.targetId,(null==n?void 0:n.timestamp)||0,(null==n?void 0:n.count)||20,(null==n?void 0:n.order)||0,t.channelId||"")];case 1:return o=i.sent(),d=o.code,u=o.data,d===e.ErrorCode.SUCCESS&&u?(c=[],l=u.list.map((function(e){return c.push(e.messageUId),W(e)})),s.info(Rn,JSON.stringify({code:d,messageUIds:c})),[2,{code:d,data:{list:l,hasMore:u.hasMore}}]):(s.warn(Rn,JSON.stringify({code:d})),[2,{code:d,msg:Yo[d]}])}}))}))}))]}))}))},exports.getServerTime=function(){return Bo((function(e){return e.getServerTime()}))},exports.getSubscribeUserList=function(t,n,r){return o(this,void 0,void 0,(function(){var a=this;return i(this,(function(s){return[2,new e.ValidatorManage(po,Io).validate("subscribeType",t,(function(t){return[e.SubscribeType.ONLINE_STATUS,e.SubscribeType.USER_PROFILE].includes(t)}),!0).validate("subscribePageSize",n,e.isInteger({min:1,max:200}),!0).validate("offset",r,e.isInteger({min:0}),!0).ifReady((function(s,d){return o(a,void 0,void 0,(function(){var o,a,u,c,l;return i(this,(function(i){switch(i.label){case 0:return o=d.createTraceId(),d.info(po,JSON.stringify({pageSize:n,offset:r}),o),[4,s.getSubscribeUserList(t,n,r)];case 1:return a=i.sent(),u=a.code,c=a.data,l=u===e.ErrorCode.SUCCESS?"info":"warn",d[l](Io,JSON.stringify({code:u,data:c}),o),u===e.ErrorCode.SUCCESS?[2,{code:u,data:c}]:[2,{code:u}]}}))}))}))]}))}))},exports.getSubscribeUserStatus=function(t,n){return o(this,void 0,void 0,(function(){var r=this;return i(this,(function(a){return[2,new e.ValidatorManage(fo,go).validate("subscribeType",t,(function(t){return[e.SubscribeType.ONLINE_STATUS,e.SubscribeType.USER_PROFILE].includes(t)}),!0).validate("subscribeUserIds",n,e.isLimitedArray({maxLength:200,minLength:1,itemValidator:e.isValidTargetId}),!0).ifReady((function(a,s){return o(r,void 0,void 0,(function(){var r,o,d,u,c;return i(this,(function(i){switch(i.label){case 0:return r=s.createTraceId(),s.info(To,JSON.stringify({userIds:n}),r),[4,a.getSubscribeUserStatus(t,n)];case 1:return o=i.sent(),d=o.code,u=o.data,c=d===e.ErrorCode.SUCCESS?"info":"warn",s[c](So,JSON.stringify({code:d}),r),d===e.ErrorCode.SUCCESS?[2,{code:d,data:u}]:[2,{code:d}]}}))}))}))]}))}))},exports.getTags=function(){return o(this,void 0,void 0,(function(){var t=this;return i(this,(function(n){return[2,new e.ValidatorManage("","").ifReady((function(n,r){return o(t,void 0,void 0,(function(){var t,o,a,s,d;return i(this,(function(i){switch(i.label){case 0:return t=r.createTraceId(),r.info(fr,"",t),[4,n.getTagList()];case 1:return o=i.sent(),a=o.code,s=o.data,d=a===e.ErrorCode.SUCCESS?"info":"warn",r[d](gr,JSON.stringify({code:a}),t),[2,{code:e.ErrorCode.SUCCESS,data:s}]}}))}))}))]}))}))},exports.getTagsFromConversation=function(t){return o(this,void 0,void 0,(function(){var n=this;return i(this,(function(r){return[2,new e.ValidatorManage(Tr,Sr).validate("conversation",t,e.AssertRules.OBJECT,!0).validate("conversationType",null==t?void 0:t.conversationType,e.AssertRules.CONVERSATION_TYPE,!0).validate("targetId",null==t?void 0:t.targetId,e.AssertRules.STRING,!0).validate("channelId",null==t?void 0:t.channelId,e.AssertRules.CHANNEL_ID).ifReady((function(r,a){return o(n,void 0,void 0,(function(){var n,o,s,d,u;return i(this,(function(i){switch(i.label){case 0:return n=a.createTraceId(),a.info(Tr,JSON.stringify({conversationType:t.conversationType,targetId:t.targetId,channelId:t.channelId}),n),[4,r.getTagsForConversation(t)];case 1:return o=i.sent(),s=o.code,d=o.data,u=s===e.ErrorCode.SUCCESS?"info":"warn",a[u](Sr,JSON.stringify({code:s}),n),s===e.ErrorCode.SUCCESS?[2,{code:s,data:d}]:[2,{code:s,msg:Yo[s]}]}}))}))}))]}))}))},exports.getTextMessageDraft=function(t){return o(this,void 0,void 0,(function(){var n=this;return i(this,(function(r){return[2,new e.ValidatorManage(De,Je).validate("conversation",t,e.AssertRules.OBJECT,!0).validate("conversationType",null==t?void 0:t.conversationType,e.AssertRules.CONVERSATION_TYPE,!0).validate("targetId",null==t?void 0:t.targetId,e.AssertRules.STRING,!0).validate("channelId",null==t?void 0:t.channelId,e.AssertRules.CHANNEL_ID).ifReady((function(r,a){return o(n,void 0,void 0,(function(){var n,o,s,d,u,c,l,v;return i(this,(function(i){switch(i.label){case 0:return n=t.conversationType,o=t.targetId,s=t.channelId,d=a.createTraceId(),a.info(De,JSON.stringify({conversationType:n,targetId:o,channelId:s}),d),[4,r.getConversationMessageDraft(n,o,s)];case 1:return u=i.sent(),c=u.code,l=u.data,v=c===e.ErrorCode.SUCCESS?"info":"warn",a[v](Je,JSON.stringify({code:c,data:l}),d),c===e.ErrorCode.SUCCESS?[2,{code:c,data:l||""}]:[2,{code:c,msg:Yo[c]}]}}))}))}))]}))}))},exports.getTopConversationList=function(t,n){return o(this,void 0,void 0,(function(){var r=this;return i(this,(function(a){return[2,new e.ValidatorManage(Me,Ue).validate("conversationTypes",t,(function(t){return!!e.isArray(t)&&!t.some((function(t){return!e.isValidConversationType(t)}))})).validate("channelId",n,e.AssertRules.CHANNEL_ID).ifReady((function(a,s){return o(r,void 0,void 0,(function(){var r,o,d,u,c,l;return i(this,(function(i){switch(i.label){case 0:return r=s.createTraceId(),s.info(Me,JSON.stringify({conversationTypes:t,channelId:n}),r),[4,a.getTopConversationList(t,n)];case 1:return o=i.sent(),d=o.code,u=o.data,d===e.ErrorCode.SUCCESS&&u?(c=[],l=u.map((function(e){return c.push({targetId:e.targetId,conversationType:e.conversationType,channelId:e.channelId}),X(e)})),s.info(Ue,JSON.stringify({code:d,list:c}),r),[2,{code:0,data:l}]):(s.warn(e.LogTagId.A_GET_TOP_CONVERSATION_LIST_E,JSON.stringify({code:d}),r),[2,{code:d,msg:Yo[d]}])}}))}))}))]}))}))},exports.getTotalUnreadCount=function(t,n){return o(this,void 0,void 0,(function(){var r=this;return i(this,(function(a){return[2,new e.ValidatorManage(Fe,Ye).validate("conversationTypes",n,(function(t){return!!e.isArray(t)&&!t.some((function(t){return!e.isValidConversationType(t)}))}),!1).ifReady((function(a,s){return o(r,void 0,void 0,(function(){var r,o,d,u;return i(this,(function(i){switch(i.label){case 0:return r=s.createTraceId(),s.info(Fe,JSON.stringify({conversationTypes:n,includeMuted:t}),r),[4,a.getTotalUnreadCount("",n,t)];case 1:return o=i.sent(),d=o.code,u=o.data,d===e.ErrorCode.SUCCESS?(s.info(Ye,JSON.stringify({code:d,data:u}),r),[2,{code:d,data:u}]):(s.warn(Ye,JSON.stringify({code:d}),r),[2,{code:d,msg:Yo[d]}])}}))}))}))]}))}))},exports.getTotalUnreadCountByLevels=function(t,n){return o(this,void 0,void 0,(function(){var r=this;return i(this,(function(a){return[2,new e.ValidatorManage(qe,je).validate("conversationTypes",t,(function(t){return!!e.isArray(t)&&!t.some((function(t){return!e.isValidConversationType(t)}))}),!0).validate("levels",n,(function(t){return!!e.isArray(n)&&!t.some((function(t){return!e.isValidNotificationLevel(t)}))}),!0).ifReady((function(a,s){return o(r,void 0,void 0,(function(){var r,o,d,u;return i(this,(function(i){switch(i.label){case 0:return r=s.createTraceId(),s.info(qe,JSON.stringify({conversationTypes:t,levels:n,isMentioned:!1}),r),[4,a.getTotalUnreadCountByLevels(t,n)];case 1:return o=i.sent(),d=o.code,u=o.data,d===e.ErrorCode.SUCCESS?(s.info(je,JSON.stringify({code:d,data:u}),r),[2,{code:d,data:u}]):(s.warn(je,JSON.stringify({code:d}),r),[2,{code:d,msg:Yo[d]}])}}))}))}))]}))}))},exports.getTotalUnreadMentionedCountByLevels=function(t,n){return o(this,void 0,void 0,(function(){var r=this;return i(this,(function(a){return[2,new e.ValidatorManage(qe,je).validate("conversationTypes",t,(function(t){return!!e.isArray(t)&&!t.some((function(t){return!e.isValidConversationType(t)}))}),!0).validate("levels",n,(function(t){return!!e.isArray(t)&&!t.some((function(t){return!e.isValidNotificationLevel(t)}))}),!0).ifReady((function(a,s){return o(r,void 0,void 0,(function(){var r,o,d,u;return i(this,(function(i){switch(i.label){case 0:return r=s.createTraceId(),s.info(qe,JSON.stringify({conversationTypes:t,levels:n,isMentioned:!0}),r),[4,a.getTotalUnreadCountByLevels(t,n,!0)];case 1:return o=i.sent(),d=o.code,u=o.data,d===e.ErrorCode.SUCCESS?(s.info(je,JSON.stringify({code:d,data:u}),r),[2,{code:d,data:u}]):(s.warn(je,JSON.stringify({code:d}),r),[2,{code:d,msg:Yo[d]}])}}))}))}))]}))}))},exports.getUltraGroupDefaultNotificationLevel=function(t){return o(this,void 0,void 0,(function(){var n=this;return i(this,(function(r){return[2,new e.ValidatorManage(zr,Wr).validate("targetId",null==t?void 0:t.targetId,e.AssertRules.STRING,!0).validate("channelId",null==t?void 0:t.channelId,e.AssertRules.CHANNEL_ID).ifReady((function(r,a){return o(n,void 0,void 0,(function(){var n,o,s,d;return i(this,(function(i){switch(i.label){case 0:return n=a.createTraceId(),a.info(zr,JSON.stringify({targetId:t.targetId,channelId:t.channelId}),n),[4,r.getUltraGroupDefaultNotificationLevel(t.targetId,t.channelId)];case 1:return o=i.sent(),s=o.code,d=o.data,s===e.ErrorCode.SUCCESS?(a.info(Wr,JSON.stringify({code:s,data:d}),n),[2,{code:s,data:d}]):(a.warn(Wr,JSON.stringify({code:s}),n),[2,{code:s,msg:Yo[s]}])}}))}))}))]}))}))},exports.getUltraGroupFirstUnreadMessageTimestamp=function(t){return o(this,void 0,void 0,(function(){var n=this;return i(this,(function(r){return[2,new e.ValidatorManage(oo,io).validate("targetId",null==t?void 0:t.targetId,e.AssertRules.STRING,!0).validate("channelId",null==t?void 0:t.channelId,e.AssertRules.CHANNEL_ID,!0).ifReady((function(r,a){return o(n,void 0,void 0,(function(){var n,o,s,d,u,c,l;return i(this,(function(i){switch(i.label){case 0:return n=t.targetId,o=t.channelId,s={targetId:n,channelId:o},d=a.createTraceId(),a.info(ao,JSON.stringify(s),d),[4,r.getUltraGroupFirstUnreadMessageTimestamp(s)];case 1:return u=i.sent(),c=u.code,l=u.data,c===e.ErrorCode.SUCCESS?(a.info(so,JSON.stringify({code:c,sentTime:null==l?void 0:l.sentTime}),d),[2,{code:c,data:l}]):(a.warn(so,JSON.stringify({code:c}),d),[2,{code:c,msg:Yo[c]}])}}))}))}))]}))}))},exports.getUltraGroupList=function(t){return void 0===t&&(t={}),o(this,void 0,void 0,(function(){var n=this;return i(this,(function(r){return[2,new e.ValidatorManage(Mr,wr).validate("targetId",null==t?void 0:t.targetId,e.AssertRules.STRING,!1).validate("channelType",null==t?void 0:t.channelType,(function(t){return void 0!==e.UltraGroupChannelType[t]}),!1).ifReady((function(r,a){return o(n,void 0,void 0,(function(){var n,o,s,d;return i(this,(function(i){switch(i.label){case 0:return n=a.createTraceId(),a.info(Mr,JSON.stringify({targetId:t.targetId,channelType:t.channelType}),n),[4,r.getUltraGroupList(t)];case 1:return o=i.sent(),s=o.code,d=o.data,s===e.ErrorCode.SUCCESS?(a.info(wr,JSON.stringify({code:s,length:null==d?void 0:d.length}),n),[2,{code:e.ErrorCode.SUCCESS,data:d}]):(a.warn(wr,JSON.stringify({code:s}),n),[2,{code:s,msg:Yo[s]}])}}))}))}))]}))}))},exports.getUltraGroupMessageListByMessageUId=function(t,n){return o(this,void 0,void 0,(function(){var r=this;return i(this,(function(a){return[2,new e.ValidatorManage(Gr,Dr).validate("conversation",t,e.AssertRules.OBJECT,!0).validate("conversationType",null==t?void 0:t.conversationType,e.AssertRules.CONVERSATION_TYPE,!0).validate("targetId",null==t?void 0:t.targetId,e.AssertRules.STRING,!0).validate("channelId",null==t?void 0:t.channelId,e.AssertRules.CHANNEL_ID).validate("messages",n,e.AssertRules.ARRAY,!0).ifReady((function(a,s){return o(r,void 0,void 0,(function(){var r,o,d,u,c,l,v,f,g,T,S,p;return i(this,(function(i){switch(i.label){case 0:return r=t.targetId,o=t.conversationType,d=t.channelId,u=[],n.forEach((function(e){var t=e.sendTime,n=e.messageUId;u.push({sendTime:t,messageUId:n,channelId:d})})),c={targetId:r,conversationType:o,messages:u},l=s.createTraceId(),s.info(Gr,JSON.stringify(c),l),[4,a.getUltraGroupMessageListByMessageUId(c)];case 1:if(v=i.sent(),f=v.code,g=v.data,f===e.ErrorCode.SUCCESS){for(p in T={},S=[],g)S.push(p),T[p]=g[p]?W(g[p]):void 0;return s.info(Dr,JSON.stringify({code:f,messageUIds:S}),l),[2,{code:e.ErrorCode.SUCCESS,data:T}]}return s.warn(Dr,JSON.stringify({code:f}),l),[2,{code:f,msg:Yo[f]}]}}))}))}))]}))}))},exports.getUltraGroupUnreadCountByTargetId=function(t,n){return o(this,void 0,void 0,(function(){var r=this;return i(this,(function(a){return[2,new e.ValidatorManage(Zr,$r).validate("targetId",t,e.AssertRules.STRING,!0).validate("notificationLevels",n,e.AssertRules.ARRAY).validate("notificationLevels",n,(function(t){return!(null==n?void 0:n.some((function(t){return!e.isValidNotificationLevel(t)})))})).ifReady((function(a,s){return o(r,void 0,void 0,(function(){var r,o,d,u,c;return i(this,(function(i){switch(i.label){case 0:return r=s.createTraceId(),s.info(Zr,JSON.stringify({targetId:t,notificationLevels:n}),r),[4,a.getUltraGroupUnreadCountByTargetId(t,n)];case 1:return o=i.sent(),d=o.code,u=o.data,c=d===e.ErrorCode.SUCCESS?"info":"warn",s[c]($r,JSON.stringify({code:d,data:u}),r),[2,{code:d,data:u}]}}))}))}))]}))}))},exports.getUltraGroupUnreadInfoList=function(t){return o(this,void 0,void 0,(function(){var n=this;return i(this,(function(r){return[2,new e.ValidatorManage(uo,co).validate("targetIds",t,(function(n){return!!e.validate("targetIds",t,e.AssertRules.ARRAY,!0)&&(!(n.length<=0||n.length>20)&&!t.some((function(t){return!e.isString(t)})))})).ifReady((function(r,a){return o(n,void 0,void 0,(function(){var n,o,s,d,u,c;return i(this,(function(i){switch(i.label){case 0:return n=t.filter((function(e,n){return t.indexOf(e)===n})),o=a.createTraceId(),a.info(uo,JSON.stringify({targetIds:t}),o),[4,r.getUltraGroupUnreadInfoList(n)];case 1:return s=i.sent(),d=s.code,u=s.data,c=d===e.ErrorCode.SUCCESS?"info":"warn",a[c](co,JSON.stringify({code:d}),o),d===e.ErrorCode.SUCCESS?[2,{code:d,data:u}]:[2,{code:d,msg:Yo[d]}]}}))}))}))]}))}))},exports.getUltraGroupUnreadMentionedCountByTargetId=function(t,n){return o(this,void 0,void 0,(function(){var r=this;return i(this,(function(a){return[2,new e.ValidatorManage(jr,jr).validate("targetId",t,e.AssertRules.STRING,!0).validate("notificationLevels",n,e.AssertRules.ARRAY).validate("notificationLevels",n,(function(t){return!(null==n?void 0:n.some((function(t){return!e.isValidNotificationLevel(t)})))})).ifReady((function(a,s){return o(r,void 0,void 0,(function(){var r,o,d,u;return i(this,(function(i){switch(i.label){case 0:return r=s.createTraceId(),s.info(jr,JSON.stringify({targetId:t,notificationLevels:n}),r),[4,a.getUltraGroupUnreadMentionedCountByTargetId(t,n)];case 1:return o=i.sent(),d=o.code,u=o.data,d===e.ErrorCode.SUCCESS?(s.info(Kr,JSON.stringify({code:d,data:u}),t),[2,{code:e.ErrorCode.SUCCESS,data:u}]):(s.warn(Kr,JSON.stringify({code:d}),r),[2,{code:d,msg:Yo[d]}])}}))}))}))]}))}))},exports.getUltraGroupUnreadMentionedMessages=function(t){return o(this,void 0,void 0,(function(){var n=this;return i(this,(function(r){return t.channelId=t.channelId||"",[2,new e.ValidatorManage(oo,io).validate("targetId",null==t?void 0:t.targetId,e.AssertRules.STRING,!0).validate("channelId",null==t?void 0:t.channelId,e.AssertRules.CHANNEL_ID).validate("sentTime",null==t?void 0:t.sentTime,e.AssertRules.NUMBER,!0).validate("count",null==t?void 0:t.count,(function(t){return e.isNumber(t)&&t>0&&t<=50}),!0).ifReady((function(r,a){return o(n,void 0,void 0,(function(){var n,o,s,d,u,c,l,v,f;return i(this,(function(i){switch(i.label){case 0:return n=t.targetId,o=t.channelId,s=t.sentTime,d=t.count,u={targetId:n,channelId:o,sentTime:s,count:d},c=a.createTraceId(),a.info(oo,JSON.stringify(u),c),[4,r.getUltraGroupUnreadMentionedMessages(u)];case 1:return l=i.sent(),v=l.code,f=l.data,v===e.ErrorCode.SUCCESS?(a.info(io,JSON.stringify({code:v,data:null==f?void 0:f.map((function(e){return e.messageUId}))}),c),[2,{code:v,data:f}]):(a.warn(io,JSON.stringify({code:v}),c),[2,{code:v,msg:Yo[v]}])}}))}))}))]}))}))},exports.getUnreadConversationList=function(t){return o(this,void 0,void 0,(function(){var n=this;return i(this,(function(r){return[2,new e.ValidatorManage(ut,ct).validate("conversationTypes",t,(function(t){return!!e.isArray(t)&&!t.some((function(t){return!e.isValidConversationType(t)}))})).ifReady((function(r,a){return o(n,void 0,void 0,(function(){var n,o,s,d,u,c;return i(this,(function(i){switch(i.label){case 0:return n=a.createTraceId(),a.info(ut,JSON.stringify({conversationTypes:t}),n),[4,r.getUnreadConversationList(t)];case 1:return o=i.sent(),s=o.code,d=o.data,s===e.ErrorCode.SUCCESS&&d?(u=[],c=d.map((function(e){return u.push({targetId:e.targetId,conversationType:e.conversationType,channelId:e.channelId,unreadMessageCount:e.unreadMessageCount}),X(e)})),a.info(ct,JSON.stringify({code:s,list:u}),n),[2,{code:0,data:c}]):(a.warn(ct,JSON.stringify({code:s}),n),[2,{code:s,msg:Yo[s]}])}}))}))}))]}))}))},exports.getUnreadCount=function(t){return o(this,void 0,void 0,(function(){var n=this;return i(this,(function(r){return[2,new e.ValidatorManage(Ke,ze).validate("conversation",t,e.AssertRules.OBJECT,!0).validate("conversationType",null==t?void 0:t.conversationType,e.AssertRules.CONVERSATION_TYPE,!0).validate("targetId",null==t?void 0:t.targetId,e.AssertRules.STRING,!0).validate("channelId",null==t?void 0:t.channelId,e.AssertRules.CHANNEL_ID).ifReady((function(r,a){return o(n,void 0,void 0,(function(){var n,o,s,d,u,c,l;return i(this,(function(i){switch(i.label){case 0:return n=t.conversationType,o=t.targetId,s=t.channelId,d=a.createTraceId(),a.info(Ke,JSON.stringify({conversationType:n,targetId:o,channelId:s}),d),[4,r.getUnreadCount(n,o,s)];case 1:return u=i.sent(),c=u.code,l=u.data,c===e.ErrorCode.SUCCESS?(a.info(ze,JSON.stringify({code:c,data:l})),[2,{code:c,data:l}]):(a.warn(ze,JSON.stringify({code:c})),[2,{code:c,msg:Yo[c]}])}}))}))}))]}))}))},exports.getUnreadCountByTag=function(t,n){return o(this,void 0,void 0,(function(){var r=this;return i(this,(function(a){return[2,new e.ValidatorManage(Nr,Or).validate("tagId",t,e.AssertRules.STRING,!0).validate("containMuted",n,e.AssertRules.BOOLEAN,!0).ifReady((function(a,s){return o(r,void 0,void 0,(function(){var r,o,d,u,c;return i(this,(function(i){switch(i.label){case 0:return r=s.createTraceId(),s.info(Nr,JSON.stringify({tagId:t,containMuted:n}),r),[4,a.getUnreadCountByTag(t,n)];case 1:return o=i.sent(),d=o.code,u=o.data,c=d===e.ErrorCode.SUCCESS?"info":"warn",s[c](Nr,JSON.stringify({code:d,data:u}),r),[2,{code:d,data:u}]}}))}))}))]}))}))},exports.getUnreadMentionedCount=function(t){return o(this,void 0,void 0,(function(){var n=this;return i(this,(function(r){return[2,new e.ValidatorManage(it,at).validate("conversation",t,e.AssertRules.OBJECT,!0).validate("conversationType",null==t?void 0:t.conversationType,e.AssertRules.CONVERSATION_TYPE,!0).validate("targetId",null==t?void 0:t.targetId,e.AssertRules.STRING,!0).validate("channelId",null==t?void 0:t.channelId,e.AssertRules.CHANNEL_ID).ifReady((function(r,a){return o(n,void 0,void 0,(function(){var n,o,s,d;return i(this,(function(i){switch(i.label){case 0:return n=a.createTraceId(),a.info(lt,JSON.stringify({conversationType:t.conversationType,targetId:t.targetId,channelId:t.channelId}),n),[4,r.getUnreadMentionedCount(t)];case 1:return o=i.sent(),s=o.code,d=o.data,s===e.ErrorCode.SUCCESS?(a.info(vt,JSON.stringify({code:s,data:d}),n),[2,{code:s,data:d}]):(a.warn(vt,JSON.stringify({code:s}),n),[2,{code:s}])}}))}))}))]}))}))},exports.getUnreadMentionedMessages=function(t){return e.usingCppEngine()?new e.ValidatorManage(Fn,Yn).validate("conversation",t,e.AssertRules.OBJECT,!0).validate("conversationType",null==t?void 0:t.conversationType,e.AssertRules.CONVERSATION_TYPE,!0).validate("targetId",null==t?void 0:t.targetId,e.AssertRules.STRING,!0).validate("channelId",null==t?void 0:t.channelId,e.AssertRules.CHANNEL_ID).ifReadySync((function(n,r){var o=t.conversationType,i=t.targetId,a=t.channelId,s=r.createTraceId();r.info(Fn,JSON.stringify({conversationType:o,targetId:i,channelId:a}),s);var d=n.getUnreadMentionedMessages(o,i,a),u=[];return d&&d.length&&d.forEach((function(e){return u.push(W(e))})),r.info(Yn,JSON.stringify({code:e.ErrorCode.SUCCESS,count:u.length}),s),{code:e.ErrorCode.SUCCESS,data:u}})):{code:e.ErrorCode.NOT_SUPPORT,msg:Yo[e.ErrorCode.NOT_SUPPORT]}},exports.getUserProfiles=function(t){var n=this;return new e.ValidatorManage(Co,mo).validate("userId",t,e.isLimitedArray({minLength:1,itemValidator:e.notEmptyString}),!0).ifReady((function(r,a){return o(n,void 0,void 0,(function(){var n,o,s,d,u;return i(this,(function(i){switch(i.label){case 0:return n=a.createTraceId(),a.info(Co,JSON.stringify({userIds:t}),n),[4,r.getUserProfiles(t)];case 1:return o=i.sent(),s=o.code,d=o.data,u=s===e.ErrorCode.SUCCESS?"info":"warn",a[u](mo,JSON.stringify({code:s,data:d}),n),[2,{code:s,data:d}]}}))}))}))},exports.init=function(t){!function(t){var n,r,o=t.appkey,i=t.navigators;Go?Jo.warn(e.LogTagId.A_INIT_REPEAT_O):(e.assert("options.appkey",t.appkey,e.AssertRules.STRING,!0),e.assert("options.navigators",t.navigators,(function(t){return e.isArray(t)&&(0===t.length||t.every(e.isHttpUrl))})),Do=t,Go=e.APIContext.init((null===(n=t.__runtimeCreator__)||void 0===n?void 0:n.call(t))||z,{appkey:t.appkey,navigators:t.navigators||[],miniCMPProxy:t.customCMP||[],logOutputLevel:t.logOutputLevel,__reportLogLevel:t.__reportLogLevel,httpInMainProcess:!!t.httpInMainProcess,logExpireTime:t.logExpireTime,areaCode:t.areaCode,logServerUrl:t.logServerUrl,uploadDomain:t.uploadDomain,environment:null!==(r=t.environment)&&void 0!==r?r:"default"}),(Jo=Go.createLogger("RC-IM","IM")).setOutputLevel(t.logOutputLevel),Jo.info(e.LogTagId.A_INIT_O,JSON.stringify({appkey:o,navigators:i,version:"5.10.2",commit:"3cbfa0729fd40ab8df50322aa87f2e7cc2601fcc"})),Go.assignWatcher(bo),e.logger.init(Jo))}(t)},exports.insertMessage=function(t,n,r){return void 0===r&&(r={}),o(this,void 0,void 0,(function(){var a=this;return i(this,(function(s){return Q("RongIMLib.insertMessage","RongIMLib.ElectronExtension.insertMessage"),e.usingCppEngine()?[2,new e.ValidatorManage(Vn,Bn).validate("conversation",t,e.AssertRules.OBJECT,!0).validate("conversationType",null==t?void 0:t.conversationType,e.AssertRules.CONVERSATION_TYPE,!0).validate("targetId",null==t?void 0:t.targetId,e.AssertRules.STRING,!0).validate("channelId",null==t?void 0:t.channelId,e.AssertRules.CHANNEL_ID).validate("searchContent",null==r?void 0:r.searchContent,e.AssertRules.STRING).validate("senderUserId",null==n?void 0:n.senderUserId,e.AssertRules.STRING,!0).validate("messageType",null==n?void 0:n.messageType,e.AssertRules.STRING,!0).validate("content",null==n?void 0:n.content,e.AssertRules.OBJECT,!0).validate("messageDirection",null==n?void 0:n.messageDirection,e.AssertRules.NUMBER,!0).validate("canIncludeExpansion",null==n?void 0:n.canIncludeExpansion,e.AssertRules.BOOLEAN).validate("expansion",null==n?void 0:n.expansion,e.AssertRules.OBJECT).validate("disableNotification",null==n?void 0:n.disableNotification,e.AssertRules.BOOLEAN).validate("sentTime",null==n?void 0:n.sentTime,e.AssertRules.NUMBER).validate("sentStatus",null==n?void 0:n.sentStatus,e.AssertRules.NUMBER).ifReady((function(s,d){return o(a,void 0,void 0,(function(){var o,a,u,c,l,v,f,g,T,S,p,I,h,_,E,R,C;return i(this,(function(i){switch(i.label){case 0:return o=n.senderUserId,a=n.messageType,u=n.content,c=n.messageDirection,l=n.messageUId,v=n.canIncludeExpansion,f=n.expansion,g=n.disableNotification,T=n.sentTime,S=n.sentStatus,p=d.createTraceId(),d.info(Vn,JSON.stringify({conversationType:t.conversationType,targetId:t.targetId,channelId:t.channelId}),p),I=r.isUnread,h=r.searchContent,_={senderUserId:o,messageType:a,content:u,messageDirection:c,sentTime:T,sentStatus:S,searchContent:h,isUnread:!!I,messageUId:l,disableNotification:g,canIncludeExpansion:v,expansionMsg:JSON.stringify(f),channelId:t.channelId||""},[4,s.insertMessage(t.conversationType,t.targetId,_)];case 1:return E=i.sent(),R=E.code,C=E.data,R===e.ErrorCode.SUCCESS?(d.info(Bn,JSON.stringify({code:R,messageId:null==C?void 0:C.messageId}),p),[2,{code:R,data:W(C)}]):(d.warn(Bn,JSON.stringify({code:R}),p),[2,{code:R,msg:Yo[R]}])}}))}))}))]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:Yo[e.ErrorCode.NOT_SUPPORT]}]}))}))},exports.installPlugin=function(e,t){return Bo((function(n){return n.install(e,t)}))},exports.joinChatRoom=function(t,n){return o(this,void 0,void 0,(function(){var r=this;return i(this,(function(a){return[2,new e.ValidatorManage(e.LogTagId.A_JOIN_CHATROOM_T,e.LogTagId.A_JOIN_CHATROOM_R).validate("targetId",t,e.AssertRules.STRING,!0).validate("count",n,e.AssertRules.OBJECT,!0).validate("count",null==n?void 0:n.count,e.AssertRules.NUMBER,!0).ifReady((function(a,s){return o(r,void 0,void 0,(function(){var r,o,d;return i(this,(function(i){switch(i.label){case 0:return r=s.createTraceId(),s.info(e.LogTagId.A_JOIN_CHATROOM_T,JSON.stringify({chatroomId:t,count:n.count,joinExist:!1}),r),[4,a.joinChatroom(t,n.count,r)];case 1:return o=i.sent(),d=o===e.ErrorCode.SUCCESS?"info":"warn",s[d](e.LogTagId.A_JOIN_CHATROOM_R,JSON.stringify({code:o,timestamp:(new Date).getTime()}),r),o!==e.ErrorCode.SUCCESS?[2,{code:o,msg:Yo[o]}]:[2,{code:o}]}}))}))}))]}))}))},exports.joinExistChatRoom=function(t,n){return o(this,void 0,void 0,(function(){var r=this;return i(this,(function(a){return[2,new e.ValidatorManage(e.LogTagId.A_JOIN_CHATROOM_T,e.LogTagId.A_JOIN_CHATROOM_R).validate("targetId",t,e.AssertRules.STRING,!0).validate("count",null==n?void 0:n.count,e.AssertRules.NUMBER,!0).ifReady((function(a,s){return o(r,void 0,void 0,(function(){var r,o,d,u,c;return i(this,(function(i){switch(i.label){case 0:return r=s.createTraceId(),s.info(e.LogTagId.A_JOIN_CHATROOM_T,JSON.stringify({chatroomId:t,count:n.count,joinExist:!0}),r),[4,a.joinExistChatroom(t,n.count,r)];case 1:return o=i.sent(),d=o.code,u=o.data,c=d===e.ErrorCode.SUCCESS?"info":"warn",s[c](e.LogTagId.A_JOIN_CHATROOM_R,JSON.stringify({code:d,timestamp:(new Date).getTime()}),r),d!==e.ErrorCode.SUCCESS?[2,{code:d,msg:Yo[d]}]:[2,{code:d,data:u}]}}))}))}))]}))}))},exports.modifyMessage=function(t,n){return o(this,void 0,void 0,(function(){var r=this;return i(this,(function(a){return[2,new e.ValidatorManage(qr,qr).validate("content",t,e.AssertRules.OBJECT,!0).validate("message",n,e.AssertRules.OBJECT,!0).ifReady((function(a,s){return o(r,void 0,void 0,(function(){var r,o,d,u,c,l,v,f,g,T,S;return i(this,(function(i){switch(i.label){case 0:return r=n.conversationType,o=n.targetId,d=n.messageUId,u=n.senderUserId,c=n.sentTime,l=n.canIncludeExpansion,v=n.channelId,f=s.createTraceId(),s.info(Yr,JSON.stringify({conversationType:r,targetId:o,messageUId:d,channelId:v}),f),g={targetId:o,channelId:v,conversationType:r,fromUserId:u,sendTime:c,canIncludeExpansion:l,messageUId:d,content:t},[4,a.modifyMessage(g)];case 1:return T=i.sent().code,S=T===e.ErrorCode.SUCCESS?"info":"warn",s[S](qr,JSON.stringify({code:T}),f),T===e.ErrorCode.SUCCESS?[2,{code:e.ErrorCode.SUCCESS}]:[2,{code:T,msg:Yo[T]}]}}))}))}))]}))}))},exports.onceEventListener=function(e,t,n){Lo.once(e,t,n)},exports.quitChatRoom=function(t){return o(this,void 0,void 0,(function(){var n=this;return i(this,(function(r){return[2,new e.ValidatorManage(e.LogTagId.A_QUIT_CHATROOM_T,e.LogTagId.A_QUIT_CHATROOM_R).validate("targetId",t,e.AssertRules.STRING,!0).ifReady((function(r,a){return o(n,void 0,void 0,(function(){var n,o,s;return i(this,(function(i){switch(i.label){case 0:return n=a.createTraceId(),a.info(e.LogTagId.A_QUIT_CHATROOM_T,JSON.stringify({chatroomId:t}),n),[4,r.quitChatroom(t)];case 1:return o=i.sent(),s=o===e.ErrorCode.SUCCESS?"info":"warn",a[s](e.LogTagId.A_QUIT_CHATROOM_R,JSON.stringify({code:o}),n),o!==e.ErrorCode.SUCCESS?[2,{code:o,msg:Yo[o]}]:[2,{code:o}]}}))}))}))]}))}))},exports.recallMessage=function(t,n){return o(this,void 0,void 0,(function(){var r=this;return i(this,(function(a){return[2,new e.ValidatorManage(Cn,mn).validate("conversation",t,e.AssertRules.OBJECT,!0).validate("conversationType",null==t?void 0:t.conversationType,e.AssertRules.CONVERSATION_TYPE,!0).validate("targetId",null==t?void 0:t.targetId,e.AssertRules.STRING,!0).validate("channelId",null==t?void 0:t.channelId,e.AssertRules.CHANNEL_ID).validate("messageUId",n.messageUId,e.AssertRules.STRING,!0).validate("sentTime",n.sentTime,e.AssertRules.NUMBER,!0).validate("disableNotification",null==n?void 0:n.disableNotification,e.AssertRules.BOOLEAN).validate("pushConfig",null==n?void 0:n.pushConfig,e.AssertRules.OBJECT).validate("directionalUserIdList",null==n?void 0:n.directionalUserIdList,e.isLimitedArray({maxLength:300,minLength:1,itemValidator:function(t){return e.isString(t)}})).ifReady((function(a,s){return o(r,void 0,void 0,(function(){var r,o,d,u,c;return i(this,(function(i){switch(i.label){case 0:return r={user:n.user,channelId:t.channelId||"",disableNotification:null==n?void 0:n.disableNotification,pushConfig:null==n?void 0:n.pushConfig,extra:n.extra,isDelete:n.isDelete,directionalUserIdList:n.directionalUserIdList},o=s.createTraceId(),s.info(Cn,JSON.stringify({targetId:t.targetId,conversationType:t.conversationType,messageUId:n.messageUId}),o),[4,a.recallMessage(t.conversationType,t.targetId,n.messageUId,n.sentTime,r)];case 1:return d=i.sent(),u=d.code,c=d.data,u===e.ErrorCode.SUCCESS&&c?(s.info(mn,JSON.stringify({code:u,messageUId:c.messageUId}),o),[2,{code:u,data:W(c)}]):u===e.ErrorCode.SUCCESS?[2,{code:u}]:(s.warn(mn,JSON.stringify({code:u}),o),[2,{code:u,msg:Yo[u]}])}}))}))}))]}))}))},exports.registerMessageType=function(t,n,r,o,i){return Bo((function(a,s){return e.assert("messageType",t,e.AssertRules.STRING,!0),e.assert("isPersited",n,e.AssertRules.BOOLEAN,!0),e.assert("isCounted",r,e.AssertRules.BOOLEAN,!0),e.assert("isStatusMessage",i,e.AssertRules.BOOLEAN,!1),e.assert("searchProps",o,e.AssertRules.ARRAY),s.info(e.LogTagId.A_REGTYP_O,JSON.stringify({messageType:t,isCounted:r,isStatusMessage:i,isPersited:n})),a.registerMessageType(t,n,r,o,i),Qo(t,n,r)}))},exports.removeAllExpansionForUltraGroupMessage=function(t){return o(this,void 0,void 0,(function(){var n=this;return i(this,(function(r){return[2,new e.ValidatorManage(Hr,Fr).validate("message",t,e.AssertRules.OBJECT,!0).ifReady((function(r,a){return o(n,void 0,void 0,(function(){var n,o,s,d,u,c,l,v,f,g;return i(this,(function(i){switch(i.label){case 0:return n=t.conversationType,o=t.targetId,s=t.messageUId,d=t.sentTime,u=t.canIncludeExpansion,c=t.channelId,l=a.createTraceId(),a.info(Hr,JSON.stringify({conversationType:n,targetId:o,messageUId:s,channelId:c}),l),v={targetId:o,channelId:c,conversationType:n,sendTime:d,canIncludeExpansion:u,messageUId:s,removeAll:!0},[4,r.expandUltraMessage(v)];case 1:return f=i.sent().code,g=f===e.ErrorCode.SUCCESS?"info":"warn",a[g](Fr,JSON.stringify({code:f}),l),f===e.ErrorCode.SUCCESS?[2,{code:e.ErrorCode.SUCCESS}]:[2,{code:f,msg:Yo[f]}]}}))}))}))]}))}))},exports.removeChatRoomEntries=function(t,n){return o(this,void 0,void 0,(function(){var r=this;return i(this,(function(a){return[2,new e.ValidatorManage(pe,Ie).validate("targetId",t,e.AssertRules.STRING,!0).validate("entries",null==n?void 0:n.entries,(function(t){return!!e.validate("entry.key",t,e.AssertRules.ARRAY,!0)&&n.entries.every((function(t){return e.validate("key",t,e.AssertRules.STRING,!0)}))}),!0).validate("notificationExtra",null==n?void 0:n.notificationExtra,e.isLimitedString({maxLength:e.MAX_CHATROOM_NOTIFICATION_EXTRA_LENGTH})).ifReady((function(a,s){return o(r,void 0,void 0,(function(){var r,o,d,u,c,l;return i(this,(function(i){switch(i.label){case 0:return r=n.entries.map((function(e){return{key:e}})),o=s.createTraceId(),s.info(pe,JSON.stringify({chatroomId:t,notificationExtra:n.notificationExtra,entries:r}),o),[4,a.removeChatroomEntries(t,{entries:r,notificationExtra:n.notificationExtra})];case 1:return d=i.sent(),u=d.code,c=d.data,l=u===e.ErrorCode.SUCCESS?"info":"warn",s[l](Ie,JSON.stringify({code:u}),o),u!==e.ErrorCode.SUCCESS?[2,{code:u,msg:Yo[u],data:c}]:[2,{code:u}]}}))}))}))]}))}))},exports.removeChatRoomEntry=function(t,n){return o(this,void 0,void 0,(function(){var r=this;return i(this,(function(a){return[2,new e.ValidatorManage(Te,Se).validate("targetId",t,e.AssertRules.STRING,!0).validate("key",null==n?void 0:n.key,e.AssertRules.STRING,!0).validate("isSendNotification",null==n?void 0:n.isSendNotification,e.AssertRules.BOOLEAN).validate("notificationExtra",null==n?void 0:n.notificationExtra,e.isLimitedString({maxLength:e.MAX_CHATROOM_NOTIFICATION_EXTRA_LENGTH})).ifReady((function(a,s){return o(r,void 0,void 0,(function(){var r,o,d;return i(this,(function(i){switch(i.label){case 0:return r=s.createTraceId(),s.info(Te,JSON.stringify({chatroomId:t,key:n.key,isSendNotification:n.isSendNotification,notificationExtra:n.notificationExtra}),r),[4,a.removeChatroomEntry(t,n)];case 1:return o=i.sent(),d=o===e.ErrorCode.SUCCESS?"info":"warn",s[d](Se,JSON.stringify({code:o}),r),o!==e.ErrorCode.SUCCESS?[2,{code:o,msg:Yo[o]}]:[2,{code:o}]}}))}))}))]}))}))},exports.removeConversation=function(t){return o(this,void 0,void 0,(function(){var n=this;return i(this,(function(r){return[2,new e.ValidatorManage(xe,Ge).validate("conversation",t,e.AssertRules.OBJECT,!0).validate("conversationType",null==t?void 0:t.conversationType,e.AssertRules.CONVERSATION_TYPE,!0).validate("targetId",null==t?void 0:t.targetId,e.AssertRules.STRING,!0).validate("channelId",null==t?void 0:t.channelId,e.AssertRules.CHANNEL_ID).ifReady((function(r,a){return o(n,void 0,void 0,(function(){var n,o,s,d,u,c;return i(this,(function(i){switch(i.label){case 0:return n=t.conversationType,o=t.targetId,s=t.channelId,d=a.createTraceId(),a.info(xe,JSON.stringify({conversationType:n,targetId:o,channelId:s}),d),[4,r.removeConversation(n,o,s)];case 1:return u=i.sent(),c=u===e.ErrorCode.SUCCESS?"info":"warn",a[c](Ge,JSON.stringify({code:u}),d),u!==e.ErrorCode.SUCCESS?[2,{code:u,msg:Yo[u]}]:[2,{code:u}]}}))}))}))]}))}))},exports.removeConversationsFromTag=function(t,n){return o(this,void 0,void 0,(function(){var r=this;return i(this,(function(a){return[2,new e.ValidatorManage(hr,_r).validate("tagId",t,e.AssertRules.STRING,!0).validate("conversations",n,(function(t){return!(!e.validate("conversations",t,e.AssertRules.ARRAY,!0)||t.length<=0)&&!t.some((function(t){return!e.validate("conversation",t,e.AssertRules.CONVERSATION,!0)}))}),!0).ifReady((function(a,s){return o(r,void 0,void 0,(function(){var r,o,d;return i(this,(function(i){switch(i.label){case 0:return r=s.createTraceId(),s.info(hr,JSON.stringify({conversations:n.map((function(e){return{conversationType:e.conversationType,targetId:e.targetId}})),tagId:t}),r),[4,a.removeTagForConversations(t,n)];case 1:return o=i.sent().code,d=o===e.ErrorCode.SUCCESS?"info":"warn",s[d](_r,JSON.stringify({code:o}),r),o===e.ErrorCode.SUCCESS?[2,{code:o}]:[2,{code:o,msg:Yo[o]}]}}))}))}))]}))}))},exports.removeEventListener=function(e,t,n){Lo.off(e,t,n)},exports.removeEventListeners=function(e){Lo.removeAll(e)},exports.removeExpansionForUltraGroupMessage=function(t,n){return o(this,void 0,void 0,(function(){var r=this;return i(this,(function(a){return[2,new e.ValidatorManage(Br,kr).validate("expansion",t,e.AssertRules.ARRAY,!0).validate("message",n,e.AssertRules.OBJECT,!0).ifReady((function(a,s){return o(r,void 0,void 0,(function(){var r,o,d,u,c,l,v,f,g,T;return i(this,(function(i){switch(i.label){case 0:return r=n.conversationType,o=n.targetId,d=n.messageUId,u=n.sentTime,c=n.canIncludeExpansion,l=n.channelId,v=s.createTraceId(),s.info(Br,JSON.stringify({conversationType:r,targetId:o,messageUId:d,channelId:l}),v),f={targetId:o,channelId:l,conversationType:r,sendTime:u,canIncludeExpansion:c,messageUId:d,keys:t},[4,a.expandUltraMessage(f)];case 1:return g=i.sent().code,T=g===e.ErrorCode.SUCCESS?"info":"warn",s[T](kr,JSON.stringify({code:g}),v),g===e.ErrorCode.SUCCESS?[2,{code:e.ErrorCode.SUCCESS}]:[2,{code:g,msg:Yo[g]}]}}))}))}))]}))}))},exports.removeFromBlacklist=function(t){return o(this,void 0,void 0,(function(){var n=this;return i(this,(function(r){return[2,new e.ValidatorManage(te,ne).validate("userId",t,e.AssertRules.STRING,!0).ifReady((function(r,a){return o(n,void 0,void 0,(function(){var n,o,s;return i(this,(function(i){switch(i.label){case 0:return n=a.createTraceId(),a.info(te,JSON.stringify({userId:t}),n),[4,r.removeFromBlacklist(t)];case 1:return o=i.sent(),s=o===e.ErrorCode.SUCCESS?"info":"warn",a[s](ne,JSON.stringify({code:o}),n),[2,{code:o}]}}))}))}))]}))}))},exports.removeMessageExpansionForKey=function(t,n){return o(this,void 0,void 0,(function(){var r=this;return i(this,(function(a){return[2,new e.ValidatorManage(wn,Pn).validate("keys",t,e.AssertRules.ARRAY,!0).validate("message",n,e.AssertRules.OBJECT,!0).validate("conversationType",null==n?void 0:n.conversationType,e.AssertRules.NUMBER,!0).validate("targetId",null==n?void 0:n.targetId,e.AssertRules.STRING,!0).validate("channelId",null==n?void 0:n.channelId,e.AssertRules.CHANNEL_ID).validate("messageUId",null==n?void 0:n.messageUId,e.AssertRules.STRING,!0).validate("canIncludeExpansion",null==n?void 0:n.canIncludeExpansion,e.AssertRules.BOOLEAN,!0).ifReady((function(a,s){return o(r,void 0,void 0,(function(){var r,o,d,u,c,l,v,f;return i(this,(function(i){switch(i.label){case 0:return r=n.conversationType,o=n.targetId,d=n.messageUId,u=n.canIncludeExpansion,c=n.channelId,l=s.createTraceId(),s.info(wn,JSON.stringify({targetId:o,channelId:c,conversationType:r,messageUId:d,canIncludeExpansion:u}),l),[4,a.sendExpansionMessage({conversationType:r,targetId:o,messageUId:d,canIncludeExpansion:u,keys:t,channelId:c})];case 1:return v=i.sent().code,f=v===e.ErrorCode.SUCCESS?"info":"warn",s[f](Pn,JSON.stringify({code:v}),l),v!==e.ErrorCode.SUCCESS?[2,{code:v,msg:Yo[v]}]:[2,{code:v}]}}))}))}))]}))}))},exports.removeTag=function(t){return o(this,void 0,void 0,(function(){var n=this;return i(this,(function(r){return[2,new e.ValidatorManage(ur,cr).validate("tagId",t,e.AssertRules.STRING,!0).ifReady((function(r,a){return o(n,void 0,void 0,(function(){var n,o,s;return i(this,(function(i){switch(i.label){case 0:return n=a.createTraceId(),a.info(ur,JSON.stringify({tagId:t}),n),[4,r.removeTag(t)];case 1:return o=i.sent().code,s=o===e.ErrorCode.SUCCESS?"info":"warn",a[s](cr,JSON.stringify({code:o}),n),o===e.ErrorCode.SUCCESS?[2,{code:o}]:[2,{code:o,msg:Yo[o]}]}}))}))}))]}))}))},exports.removeTagFromConversations=function(t,n){return o(this,void 0,void 0,(function(){var r=this;return i(this,(function(a){return[2,new e.ValidatorManage(Cr,mr).validate("tagId",t,e.AssertRules.STRING,!0).validate("conversations",n,(function(t){return!(!e.validate("conversations",t,e.AssertRules.ARRAY,!0)||t.length<=0)&&!t.some((function(t){return!e.validate("conversation",t,e.AssertRules.CONVERSATION,!0)}))}),!0).ifReady((function(a,s){return o(r,void 0,void 0,(function(){var r,o,d;return i(this,(function(i){switch(i.label){case 0:return r=s.createTraceId(),s.info(Cr,JSON.stringify({conversations:n.map((function(e){return{conversationType:e.conversationType,targetId:e.targetId}})),tagId:t}),r),[4,a.removeTagForConversations(t,n)];case 1:return o=i.sent().code,d=o===e.ErrorCode.SUCCESS?"info":"warn",s[d](mr,JSON.stringify({code:o}),r),o===e.ErrorCode.SUCCESS?[2,{code:o}]:[2,{code:o,msg:Yo[o]}]}}))}))}))]}))}))},exports.removeTagsFromConversation=function(t,n){return o(this,void 0,void 0,(function(){var r=this;return i(this,(function(a){return[2,new e.ValidatorManage(Er,Rr).validate("conversation",t,e.AssertRules.OBJECT,!0).validate("conversationType",null==t?void 0:t.conversationType,e.AssertRules.CONVERSATION_TYPE,!0).validate("targetId",null==t?void 0:t.targetId,e.AssertRules.STRING,!0).validate("channelId",null==t?void 0:t.channelId,e.AssertRules.CHANNEL_ID).validate("tagIds",n,(function(t){return!!e.validate("tagIds",t,e.AssertRules.ARRAY,!0)&&!t.some((function(t){return!e.isString(t)}))}),!0).ifReady((function(a,s){return o(r,void 0,void 0,(function(){var r,o,d;return i(this,(function(i){switch(i.label){case 0:return r=s.createTraceId(),s.info(Er,JSON.stringify({tagIds:n,targetId:t.targetId,conversationType:t.conversationType}),r),[4,a.removeTagsForConversation(t,n)];case 1:return o=i.sent().code,d=o===e.ErrorCode.SUCCESS?"info":"warn",s[d](Rr,JSON.stringify({code:o}),r),o===e.ErrorCode.SUCCESS?[2,{code:o}]:[2,{code:o,msg:Yo[o]}]}}))}))}))]}))}))},exports.saveTextMessageDraft=function(t,n){return o(this,void 0,void 0,(function(){var r=this;return i(this,(function(a){return[2,new e.ValidatorManage(Ve,Be).validate("conversation",t,e.AssertRules.OBJECT,!0).validate("conversationType",null==t?void 0:t.conversationType,e.AssertRules.CONVERSATION_TYPE,!0).validate("targetId",null==t?void 0:t.targetId,e.AssertRules.STRING,!0).validate("channelId",null==t?void 0:t.channelId,e.AssertRules.CHANNEL_ID).validate("draft",n,e.AssertRules.STRING,!0).ifReady((function(a,s){return o(r,void 0,void 0,(function(){var r,o,d;return i(this,(function(i){switch(i.label){case 0:return r=s.createTraceId(),s.info(Ve,JSON.stringify({conversationType:t.conversationType,targetId:t.targetId,channelId:t.channelId,draft:n}),r),[4,a.saveConversationMessageDraft(t.conversationType,t.targetId,n,t.channelId)];case 1:return o=i.sent(),d=o===e.ErrorCode.SUCCESS?"info":"warn",s[d](Be,JSON.stringify({code:o}),r),o===e.ErrorCode.SUCCESS?[2,{code:o}]:[2,{code:o,msg:Yo[o]}]}}))}))}))]}))}))},exports.searchConversationByContent=function(t,n,r,a){return o(this,void 0,void 0,(function(){var s=this;return i(this,(function(d){return Q("RongIMLib.searchConversationByContent","RongIMLib.ElectronExtension.searchConversationByContent"),e.usingCppEngine()?[2,new e.ValidatorManage(Wn,Xn).validate("keyword",t,e.AssertRules.STRING,!0).validate("conversationTypes",n,(function(t){return!!e.isArray(t)&&!t.some((function(t){return!e.isValidConversationType(t)}))}),!1).validate("messageTypes",r,(function(t){return!!e.isArray(t)&&!(null==r?void 0:r.some((function(t){return!e.isString(t)})))}),!1).validate("channelId",a,e.AssertRules.STRING).ifReady((function(d,u){return o(s,void 0,void 0,(function(){var o,s,c,l;return i(this,(function(i){switch(i.label){case 0:return o=u.createTraceId(),u.info(Wn,JSON.stringify({keyword:t,conversationTypes:n,messageTypes:r,channelId:a}),o),[4,d.searchConversationByContent(t,r,a,n)];case 1:return s=i.sent(),c=s.code,l=s.data,c===e.ErrorCode.SUCCESS?(u.info(Xn,JSON.stringify({code:c,count:null==l?void 0:l.length}),o),[2,{code:c,data:l}]):(u.warn(Xn,JSON.stringify({code:c}),o),[2,{code:c,msg:Yo[c]}])}}))}))}))]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:Yo[e.ErrorCode.NOT_SUPPORT]}]}))}))},exports.searchMessages=function(t,n,r,a){return o(this,void 0,void 0,(function(){var s=this;return i(this,(function(d){return Q("RongIMLib.searchMessages","RongIMLib.ElectronExtension.searchMessages"),e.usingCppEngine()?[2,new e.ValidatorManage("A-search_messages-T","A-search_messages-R").validate("conversation",t,e.AssertRules.OBJECT,!0).validate("conversationType",null==t?void 0:t.conversationType,e.AssertRules.CONVERSATION_TYPE,!0).validate("targetId",null==t?void 0:t.targetId,e.AssertRules.STRING,!0).validate("channelId",null==t?void 0:t.channelId,e.AssertRules.CHANNEL_ID).validate("keyword",n,e.AssertRules.STRING,!0).validate("timestamp",r,e.AssertRules.NUMBER).validate("count",a,e.AssertRules.NUMBER).ifReady((function(d,u){return o(s,void 0,void 0,(function(){var o,s,c,l;return i(this,(function(i){switch(i.label){case 0:return[4,d.searchMessageByContent(t.conversationType,t.targetId,n,r,a,1,t.channelId)];case 1:return o=i.sent(),s=o.code,c=o.data,s===e.ErrorCode.SUCCESS?(l=[],(null==c?void 0:c.messages)&&c.messages.length&&c.messages.forEach((function(e){return l.push(W(e))})),[2,{code:s,data:{messages:l,count:null==c?void 0:c.count}}]):(u.warn(e.LogTagId.O,"searchMessages ->code:"+s+",targetId:"+t.targetId),[2,{code:s,msg:Yo[s]}])}}))}))}))]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:Yo[e.ErrorCode.NOT_SUPPORT]}]}))}))},exports.searchUserProfileByUniqueId=function(t){var n=this;return new e.ValidatorManage(wo,Po).validate("uniqueId",t,e.AssertRules.STRING,!0).ifReady((function(r,a){return o(n,void 0,void 0,(function(){var n,o,s,d,u;return i(this,(function(i){switch(i.label){case 0:return n=a.createTraceId(),a.info(wo,t,n),[4,r.searchUserProfileByUniqueId(t)];case 1:return o=i.sent(),s=o.code,d=o.data,u=s===e.ErrorCode.SUCCESS?"info":"warn",a[u](Po,JSON.stringify({code:s,data:d}),n),[2,{code:s,data:d}]}}))}))}))},exports.sendFileMessage=Gi,exports.sendGIFMessage=Ji,exports.sendHQVoiceMessage=Vi,exports.sendImageMessage=Di,exports.sendMessage=bi,exports.sendReadReceiptMessage=function(t,n,r,a){return o(this,void 0,void 0,(function(){var s=this;return i(this,(function(d){return[2,new e.ValidatorManage(e.LogTagId.A_SEND_MSG_T,e.LogTagId.A_SEND_MSG_R).validate("targetId",t,e.AssertRules.STRING,!0).validate("messageUId",n,e.AssertRules.STRING,!0).validate("timestamp",r,e.AssertRules.NUMBER,!0).validate("channelId",a,e.AssertRules.CHANNEL_ID).ifReady((function(d){return o(s,void 0,void 0,(function(){var o,s,d,u,c;return i(this,(function(i){switch(i.label){case 0:return o={targetId:t,conversationType:e.ConversationType.PRIVATE,channelId:a},s=new Xo("RC:ReadNtf",{messageUId:n,lastMessageSendTime:r,type:1}),[4,bi(o,s)];case 1:return d=i.sent(),u=d.code,c=d.msg,0===u?[2,{code:u}]:[2,{code:u,msg:c}]}}))}))}))]}))}))},exports.sendReadReceiptMessageV4=function(t,n,r){return void 0===r&&(r=""),o(this,void 0,void 0,(function(){var a=this;return i(this,(function(s){return[2,new e.ValidatorManage(e.LogTagId.A_SEND_MESSAGE_READ_RECEIPT_V4_T,e.LogTagId.A_SEND_MESSAGE_READ_RECEIPT_V4_R).validate("conversation",t,e.AssertRules.OBJECT,!0).validate("conversationType",null==t?void 0:t.conversationType,(function(t){return t===e.ConversationType.GROUP||t===e.ConversationType.PRIVATE}),!0,"It should be ConversationType.GROUP or ConversationType.PRIVATE").validate("targetId",null==t?void 0:t.targetId,e.AssertRules.STRING,!0).validate("channelId",null==t?void 0:t.channelId,e.AssertRules.CHANNEL_ID).validate("startMsgUId",r,e.AssertRules.ONLY_STRING,!0).validate("endMsgUId",n,e.AssertRules.STRING,!0).ifReady((function(s,d){return o(a,void 0,void 0,(function(){var o,a,u,c,l,v;return i(this,(function(i){switch(i.label){case 0:return o=d.createTraceId(),a="conversationType:"+t.conversationType+",targetId:"+t.targetId+",\n channelId: "+t.channelId+", startMsgUId:"+r+", endMsgUId: "+n,d.info(e.LogTagId.A_SEND_MESSAGE_READ_RECEIPT_V4_T,a,o),3!==(null==(u=s.getNaviInfoFromCache())?void 0:u.grpRRVer)?[2,{code:e.ErrorCode.READ_RECEIPT_V4_NOT_SUPPORT}]:[4,s.sendReadReceiptMessageV4(t,r,n)];case 1:return c=i.sent(),l=c.code,v=c.msg,d[l===e.ErrorCode.SUCCESS?"info":"warn"](e.LogTagId.A_SEND_MESSAGE_READ_RECEIPT_V4_R,"code: "+l+", msg: "+v,o),[2,{code:l,msg:v}]}}))}))}))]}))}))},exports.sendReadReceiptRequest=function(t,n,r){return o(this,void 0,void 0,(function(){var a=this;return i(this,(function(s){return[2,new e.ValidatorManage(e.LogTagId.A_SEND_MSG_T,e.LogTagId.A_SEND_MSG_R).validate("targetId",t,e.AssertRules.STRING,!0).validate("messageUId",n,e.AssertRules.STRING,!0).validate("channelId",r,e.AssertRules.CHANNEL_ID).ifReady((function(s,d){return o(a,void 0,void 0,(function(){var o,a,s,u,c;return i(this,(function(i){switch(i.label){case 0:return o="messageUId:"+n+",targetId:"+t,d.debug(e.LogTagId.A_SEND_MSG_T,"send read receipt message ->"+o),a=new Xo("RC:RRReqMsg",{messageUId:n}),[4,bi({targetId:t,conversationType:e.ConversationType.GROUP,channelId:r},a)];case 1:return s=i.sent(),u=s.code,c=s.msg,0===u?[2,{code:u}]:[2,{code:u,msg:c}]}}))}))}))]}))}))},exports.sendReadReceiptResponse=function(e,t,n){return o(this,void 0,void 0,(function(){return i(this,(function(e){throw new Error("This method is deprecated, please use method sendReadReceiptResponseV2.")}))}))},exports.sendReadReceiptResponseV2=function(t,n,r){return o(this,void 0,void 0,(function(){var a=this;return i(this,(function(s){return[2,new e.ValidatorManage(e.LogTagId.A_SEND_MSG_T,e.LogTagId.A_SEND_MSG_R).validate("targetId",t,e.AssertRules.STRING,!0).validate("channelId",r,e.AssertRules.CHANNEL_ID).ifReady((function(s,d){return o(a,void 0,void 0,(function(){var o,a,u,c,l;return i(this,(function(i){switch(i.label){case 0:return o={targetId:t,conversationType:e.ConversationType.GROUP,channelId:r},u=s.getNaviInfoFromCache(),1!==(null==u?void 0:u.grpRRVer)?[3,2]:[4,ki(s,d,o,n)];case 1:return a=i.sent(),[3,4];case 2:return!e.validate("messageList",n,e.AssertRules.OBJECT,!1)||n&&Object.keys(n).some((function(t){return!e.validate(t,n[t],e.AssertRules.ARRAY)}))?[2,{code:e.ErrorCode.MSG_LIMIT_ERROR}]:(c=new Xo("RC:RRRspMsg",{receiptMessageDic:n}),[4,bi(o,c)]);case 3:a=i.sent(),i.label=4;case 4:return(l=a.code)===e.ErrorCode.SUCCESS?[2,{code:l}]:[2,{code:l,msg:Yo[l]}]}}))}))}))]}))}))},exports.sendSightMessage=Bi,exports.sendSyncReadStatusMessage=function(t,n){return o(this,void 0,void 0,(function(){var r=this;return i(this,(function(a){return[2,new e.ValidatorManage(e.LogTagId.A_SYNC_READ_STATUS_T,e.LogTagId.A_SYNC_READ_STATUS_R).validate("timestamp",n,e.AssertRules.NUMBER,!0).validate("conversation",t,e.AssertRules.OBJECT,!0).validate("conversationType",null==t?void 0:t.conversationType,(function(t){return[e.ConversationType.GROUP,e.ConversationType.PRIVATE,e.ConversationType.APP_PUBLIC_SERVICE,e.ConversationType.PUBLIC_SERVICE,e.ConversationType.SYSTEM].includes(t)}),!0).validate("targetId",null==t?void 0:t.targetId,e.AssertRules.STRING,!0).validate("channelId",null==t?void 0:t.channelId,e.AssertRules.CHANNEL_ID).ifReady((function(a,s){return o(r,void 0,void 0,(function(){var r,o,d,u,c,l,v;return i(this,(function(i){switch(i.label){case 0:return r="conversationType:"+t.conversationType+",targetId:"+t.targetId+",\n channelId: "+t.channelId+", timestamp:"+n,o=s.createTraceId(),s.info(e.LogTagId.A_SYNC_READ_STATUS_T,r,o),1!==(null==(d=a.getNaviInfoFromCache())?void 0:d.sesDriven)?[3,2]:[4,a.updateConversationReadTime(t,n)];case 1:return u=i.sent(),[3,4];case 2:return c=new Xo("RC:SRSMsg",{lastMessageSendTime:n}),[4,bi(t,c)];case 3:u=i.sent(),i.label=4;case 4:return l=u.code,v=u.msg,s[l===e.ErrorCode.SUCCESS?"info":"warn"](e.LogTagId.A_SYNC_READ_STATUS_R,"code: "+l+", msg: "+v,o),[2,{code:l,msg:v}]}}))}))}))]}))}))},exports.sendTextMessage=function(e,t,n){return bi(e,new ni(t),n)},exports.sendTypingStatusMessage=function(t,n){return o(this,void 0,void 0,(function(){var r=this;return i(this,(function(a){return[2,new e.ValidatorManage(e.LogTagId.A_SEND_MSG_T,e.LogTagId.A_SEND_MSG_R).validate("conversation",t,e.AssertRules.OBJECT,!0).validate("conversationType",null==t?void 0:t.conversationType,e.AssertRules.CONVERSATION_TYPE,!0).validate("targetId",null==t?void 0:t.targetId,e.AssertRules.STRING,!0).validate("channelId",null==t?void 0:t.channelId,e.AssertRules.CHANNEL_ID).validate("messageType",n,e.AssertRules.STRING,!0).ifReady((function(a,s){return o(r,void 0,void 0,(function(){var r,o,d,u,c,l;return i(this,(function(i){switch(i.label){case 0:return r={messageType:"RC:TypSts",content:{typingContentType:n},isStatusMessage:!0,channelId:t.channelId},o=s.createTraceId(),s.info(e.LogTagId.A_SEND_MSG_T,JSON.stringify({messageType:r.messageType,conversationType:t.conversationType,targetId:t.targetId,channelId:t.channelId}),o),[4,a.sendMessage(t.conversationType,t.targetId,r,void 0,o)];case 1:return d=i.sent(),u=d.code,c=d.data,l=u===e.ErrorCode.SUCCESS?"info":"warn",s[l](e.LogTagId.A_SEND_MSG_R,JSON.stringify({code:u,messageUId:c?c.messageUId:"",messageId:c?c.messageId:""}),o),u===e.ErrorCode.SUCCESS?[2,{code:u,data:W(c)}]:[2,{code:u,msg:Yo[u]}]}}))}))}))]}))}))},exports.sendUltraGroupTypingStatus=function(t){return o(this,void 0,void 0,(function(){var n=this;return i(this,(function(r){return[2,new e.ValidatorManage(br,xr).validate("conversation",t,e.AssertRules.OBJECT,!0).validate("conversationType",null==t?void 0:t.conversationType,e.AssertRules.CONVERSATION_TYPE,!0).validate("targetId",null==t?void 0:t.targetId,e.AssertRules.STRING,!0).validate("channelId",null==t?void 0:t.channelId,e.AssertRules.CHANNEL_ID).ifReady((function(r,a){return o(n,void 0,void 0,(function(){var n,o,s;return i(this,(function(i){switch(i.label){case 0:return n=a.createTraceId(),a.info(br,JSON.stringify({targetId:t.targetId,channelId:t.channelId}),n),[4,r.sendUltraGroupTypingStatus(t)];case 1:return o=i.sent().code,s=o===e.ErrorCode.SUCCESS?"info":"warn",a[s](xr,JSON.stringify({code:o}),n),o===e.ErrorCode.SUCCESS?[2,{code:e.ErrorCode.SUCCESS}]:[2,{code:o,msg:Yo[o]}]}}))}))}))]}))}))},exports.setChatRoomEntries=function(t,n){return o(this,void 0,void 0,(function(){var r=this;return i(this,(function(a){return[2,new e.ValidatorManage(le,ve).validate("targetId",t,e.AssertRules.STRING,!0).validate("entries",null==n?void 0:n.entries,(function(t){return!!e.validate("entry.key",t,e.AssertRules.ARRAY,!0)&&n.entries.every((function(t){return e.validate("entry.key",t.key,e.AssertRules.STRING,!0)&&e.validate("entry.value",t.value,e.AssertRules.STRING,!0)}))}),!0).validate("isAutoDelete",null==n?void 0:n.isAutoDelete,e.AssertRules.BOOLEAN).validate("isForce",null==n?void 0:n.isForce,e.AssertRules.BOOLEAN).validate("notificationExtra",null==n?void 0:n.notificationExtra,e.isLimitedString({maxLength:e.MAX_CHATROOM_NOTIFICATION_EXTRA_LENGTH})).ifReady((function(a,s){return o(r,void 0,void 0,(function(){var r,o,d,u,c;return i(this,(function(i){switch(i.label){case 0:return n.entries.length>10?[2,Fo.CHATROOM_KV_STORE_OUT_LIMIT]:(r=s.createTraceId(),s.info(le,JSON.stringify({chatroomId:t,entries:n.entries.map((function(e){return{key:e.key,value:e.value}})),isAutoDelete:n.isAutoDelete,notificationExtra:n.notificationExtra,isForce:n.isForce}),r),[4,a.setChatroomEntries(t,n)]);case 1:return o=i.sent(),d=o.code,u=o.data,c=d===e.ErrorCode.SUCCESS?"info":"warn",s[c](ve,JSON.stringify({code:d}),r),d!==e.ErrorCode.SUCCESS?[2,{code:d,msg:Yo[d],data:u}]:[2,{code:d}]}}))}))}))]}))}))},exports.setChatRoomEntry=function(t,n){return o(this,void 0,void 0,(function(){var r=this;return i(this,(function(a){return[2,new e.ValidatorManage(ue,ce).validate("targetId",t,e.AssertRules.STRING,!0).validate("key",null==n?void 0:n.key,e.AssertRules.STRING,!0).validate("value",null==n?void 0:n.value,e.AssertRules.STRING,!0).validate("isAutoDelete",null==n?void 0:n.isAutoDelete,e.AssertRules.BOOLEAN).validate("isSendNotification",null==n?void 0:n.isSendNotification,e.AssertRules.BOOLEAN).validate("notificationExtra",null==n?void 0:n.notificationExtra,e.isLimitedString({maxLength:e.MAX_CHATROOM_NOTIFICATION_EXTRA_LENGTH})).ifReady((function(a,s){return o(r,void 0,void 0,(function(){var r,o,d;return i(this,(function(i){switch(i.label){case 0:return r=s.createTraceId(),s.info(ue,JSON.stringify({chatroomId:t,key:n.key,value:n.value,isSendNotification:n.isSendNotification,isAutoDelete:n.isAutoDelete,notificationExtra:n.notificationExtra}),r),[4,a.setChatroomEntry(t,n)];case 1:return o=i.sent(),d=o===e.ErrorCode.SUCCESS?"info":"warn",s[d](ce,JSON.stringify({code:o}),r),o!==e.ErrorCode.SUCCESS?[2,{code:o,msg:Yo[o]}]:[2,{code:o}]}}))}))}))]}))}))},exports.setConversationNotificationLevel=function(t,n){return o(this,void 0,void 0,(function(){return i(this,(function(r){return[2,new e.ValidatorManage(Ze,$e).validate("conversation",t,e.AssertRules.OBJECT,!0).validate("conversationType",null==t?void 0:t.conversationType,e.AssertRules.CONVERSATION_TYPE,!0).validate("targetId",null==t?void 0:t.targetId,e.AssertRules.STRING,!0).validate("channelId",null==t?void 0:t.channelId,e.AssertRules.CHANNEL_ID).validate("notificationLevel",n,(function(t){return void 0!==e.NotificationLevel[t]}),!0).ifReady((function(e,r){return Wo(r,t,(function(){return e.setConversationNotificationLevel(t.conversationType,t.targetId,n,t.channelId)}),"setConversationNotificationLevel")}))]}))}))},exports.setConversationNotificationStatus=function(t,n){return o(this,void 0,void 0,(function(){return i(this,(function(r){return[2,new e.ValidatorManage(st,dt).validate("conversation",t,e.AssertRules.OBJECT,!0).validate("conversationType",null==t?void 0:t.conversationType,e.AssertRules.CONVERSATION_TYPE,!0).validate("targetId",null==t?void 0:t.targetId,e.AssertRules.STRING,!0).validate("channelId",null==t?void 0:t.channelId,e.AssertRules.CHANNEL_ID).validate("notificationStatus",n,(function(e){return 1===e||2===e}),!0).ifReady((function(e,r){return Wo(r,t,(function(){return e.setConversationStatus(t.conversationType,t.targetId,void 0,n,t.channelId)}),"setConversationNotificationStatus")}))]}))}))},exports.setConversationToTop=function(t,n,r){return void 0===n&&(n=!0),void 0===r&&(r=!0),o(this,void 0,void 0,(function(){var a=this;return i(this,(function(s){return[2,new e.ValidatorManage(et,nt).validate("conversation",t,e.AssertRules.OBJECT,!0).validate("conversationType",null==t?void 0:t.conversationType,e.AssertRules.CONVERSATION_TYPE,!0).validate("targetId",null==t?void 0:t.targetId,e.AssertRules.STRING,!0).validate("channelId",null==t?void 0:t.channelId,e.AssertRules.CHANNEL_ID).validate("isTop",n,e.AssertRules.BOOLEAN).validate("isUpdateTime",r,e.AssertRules.BOOLEAN).ifReady((function(s,d){return o(a,void 0,void 0,(function(){var o,a,u,c,l,v;return i(this,(function(i){switch(i.label){case 0:return o=t.conversationType,a=t.targetId,u=t.channelId,c=d.createTraceId(),d.info(et,JSON.stringify({conversationType:o,targetId:a,channelId:u,isTop:n}),c),[4,s.setConversationStatus(t.conversationType,t.targetId,n,void 0,t.channelId,r)];case 1:return l=i.sent(),v=l===e.ErrorCode.SUCCESS?"info":"warn",d[v](nt,JSON.stringify({code:l}),c),l!==e.ErrorCode.SUCCESS?[2,{code:l,msg:Yo[l]}]:[2,{code:l}]}}))}))}))]}))}))},exports.setConversationToTopInTag=function(t,n,r){return o(this,void 0,void 0,(function(){var a=this;return i(this,(function(s){return[2,new e.ValidatorManage(Nr,Or).validate("tagId",t,e.AssertRules.STRING,!0).validate("isTop",r,e.AssertRules.BOOLEAN,!0).validate("conversationType",null==n?void 0:n.conversationType,e.AssertRules.CONVERSATION_TYPE,!0).validate("targetId",null==n?void 0:n.targetId,e.AssertRules.STRING,!0).validate("channelId",null==n?void 0:n.channelId,e.AssertRules.CHANNEL_ID).ifReady((function(s,d){return o(a,void 0,void 0,(function(){var o,a,u;return i(this,(function(i){switch(i.label){case 0:return o=d.createTraceId(),d.info(Nr,JSON.stringify({tagId:t,targetId:n.targetId,conversationType:n.conversationType,isTop:r}),o),[4,s.setConversationStatusInTag(t,n,{isTop:r})];case 1:return a=i.sent().code,u=a===e.ErrorCode.SUCCESS?"info":"warn",d[u](Ur,JSON.stringify({code:a}),o),a===e.ErrorCode.SUCCESS?[2,{code:a}]:[2,{code:a,msg:Yo[a]}]}}))}))}))]}))}))},exports.setConversationTypeNotificationLevel=function(t,n){return o(this,void 0,void 0,(function(){var r=this;return i(this,(function(a){return e.validate("conversationType",t,(function(){return[e.ConversationType.PRIVATE,e.ConversationType.GROUP,e.ConversationType.SYSTEM,e.ConversationType.PUBLIC_SERVICE,e.ConversationType.APP_PUBLIC_SERVICE,e.ConversationType.ULTRA_GROUP].includes(t)}))&&e.validate("level",n,e.isValidNotificationLevel)?[2,ko((function(a,s){return o(r,void 0,void 0,(function(){var r,o,d;return i(this,(function(i){switch(i.label){case 0:return s.info(e.LogTagId.O,"setConversationTypeNotificationLevel ->conversationType:"+t+",level:"+n),[4,a.setConversationTypeNotificationLevel(t,n)];case 1:return r=i.sent(),o=r.code,d=r.data,o===e.ErrorCode.SUCCESS?[2,{code:o,data:d}]:(s.warn(e.LogTagId.O,"setConversationTypeNotificationLevel ->conversationType:"+t+",level:"+n),[2,{code:o,msg:Yo[o]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.setMessageReceivedStatus=function(t,n){return o(this,void 0,void 0,(function(){var r=this;return i(this,(function(a){return Q("RongIMLib.setMessageReceivedStatus","RongIMLib.ElectronExtension.setMessageReceivedStatus"),e.usingCppEngine()?[2,new e.ValidatorManage($n,er).validate("messageId",t,e.AssertRules.NUMBER,!0).validate("receivedStatus",n,e.AssertRules.NUMBER,!0).ifReady((function(a,s){return o(r,void 0,void 0,(function(){var r,o,d;return i(this,(function(i){switch(i.label){case 0:return r=s.createTraceId(),s.info($n,JSON.stringify({messageId:t,receivedStatus:n}),r),[4,a.setMessageReceivedStatus(t,n)];case 1:return o=i.sent(),d=o===e.ErrorCode.SUCCESS?"info":"warn",s[d](er,JSON.stringify({code:o}),r),o===e.ErrorCode.SUCCESS?[2,{code:o}]:[2,{code:o,msg:Yo[o]}]}}))}))}))]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:Yo[e.ErrorCode.NOT_SUPPORT]}]}))}))},exports.setProxy=function(t){return o(this,void 0,void 0,(function(){var n=this;return i(this,(function(r){return[2,new e.ValidatorManage(tr,nr).validate("set.proxy",t,(function(n){return!!(!t||e.validate("proxy.socksHost",t.socksHost,e.AssertRules.STRING,!0)&&e.validate("proxy.socksPort",t.socksPort,e.AssertRules.NUMBER,!0))})).ifReady((function(r,a){return o(n,void 0,void 0,(function(){var n,o,s;return i(this,(function(i){switch(i.label){case 0:return n=a.createTraceId(),a.info(tr,JSON.stringify({socksHost:null==t?void 0:t.socksHost,socksPort:null==t?void 0:t.socksPort}),n),[4,r.setProxy(t)];case 1:return o=i.sent().code,s=o===e.ErrorCode.SUCCESS?"info":"warn",a[s](nr,JSON.stringify({code:o}),n),o===e.ErrorCode.SUCCESS?[2,{code:o}]:[2,{code:o,msg:Yo[o]}]}}))}))}))]}))}))},exports.setUltraGroupDefaultNotificationLevel=function(t,n){return o(this,void 0,void 0,(function(){var r=this;return i(this,(function(a){return t.channelId=t.channelId||"",[2,new e.ValidatorManage(Xr,Qr).validate("targetId",null==t?void 0:t.targetId,e.AssertRules.STRING,!0).validate("channelId",null==t?void 0:t.channelId,e.AssertRules.CHANNEL_ID).validate("notificationLevel",n,(function(t){return void 0!==e.NotificationLevel[t]}),!0).ifReady((function(a,s){return o(r,void 0,void 0,(function(){var r,o,d;return i(this,(function(i){switch(i.label){case 0:return r=s.createTraceId(),s.info(Xr,JSON.stringify({targetId:t.targetId,channelId:t.channelId,notificationLevel:n}),r),[4,a.setUltraGroupDefaultNotificationLevel(t.targetId,n,t.channelId)];case 1:return o=i.sent().code,d=o===e.ErrorCode.SUCCESS?"info":"warn",s[d](Qr,JSON.stringify({code:o}),r),o===e.ErrorCode.SUCCESS?[2,{code:o}]:[2,{code:o,msg:Yo[o]}]}}))}))}))]}))}))},exports.stopUploadTask=function(t){return o(this,void 0,void 0,(function(){return i(this,(function(n){return[2,{code:e.ErrorCode.SUCCESS,data:wi(t)}]}))}))},exports.subscribeUserStatus=function(t,n,r){return o(this,void 0,void 0,(function(){var a=this;return i(this,(function(s){return[2,new e.ValidatorManage(lo,vo).validate("subscribeUserIds",t,e.isLimitedArray({maxLength:200,minLength:1,itemValidator:e.isValidTargetId}),!0).validate("subscribeType",n,(function(t){return[e.SubscribeType.ONLINE_STATUS,e.SubscribeType.USER_PROFILE].includes(t)}),!0).validate("expiry",r,e.isInteger({min:60,max:2592e3}),!0).ifReady((function(s,d){return o(a,void 0,void 0,(function(){var o,a,u,c,l;return i(this,(function(i){switch(i.label){case 0:return o=d.createTraceId(),d.info(lo,JSON.stringify({userIds:t,subscribeType:n,expiry:r}),o),[4,s.subscribeUser(t,n,r)];case 1:return a=i.sent(),u=a.code,c=a.data,l=u===e.ErrorCode.SUCCESS?"info":"warn",d[l](vo,JSON.stringify({code:u,data:c}),o),[2,{code:u,data:c}]}}))}))}))]}))}))},exports.testProxy=function(t,n){return o(this,void 0,void 0,(function(){var r=this;return i(this,(function(a){return[2,new e.ValidatorManage(ir,ar).validate("test.proxy",t,e.AssertRules.OBJECT,!0).validate("test.proxy.socksHost",null==t?void 0:t.socksHost,e.AssertRules.STRING,!0).validate("test.proxy.socksPort",null==t?void 0:t.socksPort,e.AssertRules.NUMBER,!0).ifReady((function(a,s){return o(r,void 0,void 0,(function(){var r,o,d,u;return i(this,(function(i){switch(i.label){case 0:return r=s.createTraceId(),s.info(ir,JSON.stringify({socksHost:null==t?void 0:t.socksHost,socksPort:null==t?void 0:t.socksPort}),r),[4,a.testProxy(t,n)];case 1:return o=i.sent(),d=o.status,u=o.data,d===e.ErrorCode.SUCCESS?[2,{code:d,msg:u}]:(s.warn(ar,JSON.stringify({status:d}),r),[2,{code:d,msg:Yo[d]}])}}))}))}))]}))}))},exports.unSubscribeUserStatus=function(t,n){return o(this,void 0,void 0,(function(){var r=this;return i(this,(function(a){return[2,new e.ValidatorManage(fo,go).validate("subscribeUserIds",t,e.isLimitedArray({maxLength:200,minLength:1,itemValidator:e.isValidTargetId}),!0).validate("subscribeType",n,(function(t){return[e.SubscribeType.ONLINE_STATUS,e.SubscribeType.USER_PROFILE].includes(t)}),!0).ifReady((function(a,s){return o(r,void 0,void 0,(function(){var r,o,d;return i(this,(function(i){switch(i.label){case 0:return r=s.createTraceId(),s.info(fo,JSON.stringify({userIds:t,subscribeType:n}),r),[4,a.unSubscribeUser(t,n)];case 1:return o=i.sent().code,d=o===e.ErrorCode.SUCCESS?"info":"warn",s[d](go,JSON.stringify({code:o}),r),[2,{code:o}]}}))}))}))]}))}))},exports.updateExpansionForUltraGroupMessage=function(t,n){return o(this,void 0,void 0,(function(){var r=this;return i(this,(function(a){return[2,new e.ValidatorManage(Jr,Vr).validate("expansion",t,e.AssertRules.OBJECT,!0).validate("message",n,e.AssertRules.OBJECT,!0).ifReady((function(a,s){return o(r,void 0,void 0,(function(){var r,o,d,u,c,l,v,f,g,T;return i(this,(function(i){switch(i.label){case 0:return r=n.conversationType,o=n.targetId,d=n.messageUId,u=n.sentTime,c=n.canIncludeExpansion,l=n.channelId,v=s.createTraceId(),s.info(Jr,JSON.stringify({conversationType:r,targetId:o,messageUId:d,channelId:l}),v),f={targetId:o,channelId:l,conversationType:r,sendTime:u,canIncludeExpansion:c,messageUId:d,expansion:t},[4,a.expandUltraMessage(f)];case 1:return g=i.sent().code,T=g===e.ErrorCode.SUCCESS?"info":"warn",s[T](Vr,JSON.stringify({code:g}),v),g===e.ErrorCode.SUCCESS?[2,{code:e.ErrorCode.SUCCESS}]:[2,{code:g,msg:Yo[g]}]}}))}))}))]}))}))},exports.updateMessageExpansion=function(t,n){return o(this,void 0,void 0,(function(){var r=this;return i(this,(function(a){return[2,new e.ValidatorManage(Un,Mn).validate("expansion",t,e.AssertRules.OBJECT,!0).validate("message",n,e.AssertRules.OBJECT,!0).validate("conversationType",null==n?void 0:n.conversationType,e.AssertRules.NUMBER,!0).validate("targetId",null==n?void 0:n.targetId,e.AssertRules.STRING,!0).validate("channelId",null==n?void 0:n.channelId,e.AssertRules.CHANNEL_ID).validate("messageUId",null==n?void 0:n.messageUId,e.AssertRules.STRING,!0).validate("expansion",null==n?void 0:n.expansion,e.AssertRules.OBJECT).validate("canIncludeExpansion",null==n?void 0:n.canIncludeExpansion,e.AssertRules.BOOLEAN,!0).ifReady((function(a,s){return o(r,void 0,void 0,(function(){var r,o,d,u,c,l,v,f,g;return i(this,(function(i){switch(i.label){case 0:return r=n.conversationType,o=n.targetId,d=n.messageUId,u=n.canIncludeExpansion,c=n.expansion,l=n.channelId,v=s.createTraceId(),s.info(Un,JSON.stringify({targetId:o,channelId:l,conversationType:r,messageUId:d,canIncludeExpansion:u}),v),[4,a.sendExpansionMessage({conversationType:r,targetId:o,messageUId:d,expansion:t,canIncludeExpansion:u,originExpansion:c,channelId:l})];case 1:return f=i.sent().code,g=f===e.ErrorCode.SUCCESS?"info":"warn",s[g](Mn,JSON.stringify({code:f}),v),f!==e.ErrorCode.SUCCESS?[2,{code:f,msg:Yo[f]}]:[2,{code:f}]}}))}))}))]}))}))},exports.updateMyUserProfile=function(t){var n=this;return new e.ValidatorManage(Eo,Ro).validate("profile",t,e.AssertRules.OBJECT,!0).validate("profile",t.name,e.AssertRules.ONLY_STRING).validate("profile",t.portraitUri,e.AssertRules.ONLY_STRING).validate("profile",t.email,e.AssertRules.ONLY_STRING).validate("profile",t.birthday,e.AssertRules.ONLY_STRING).validate("profile",t.gender,e.AssertRules.NUMBER).validate("profile",t.location,e.AssertRules.ONLY_STRING).validate("profile",t.role,e.AssertRules.NUMBER).validate("profile",t.level,e.AssertRules.NUMBER).validate("profile",t.extraProfile,e.AssertRules.OBJECT).validate("profile",t.extraProfile,(function(e){for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&"string"!=typeof e[t])return!1;return!0})).ifReady((function(a,s){return o(n,void 0,void 0,(function(){var n,o,d,u,c,l,v;return i(this,(function(i){switch(i.label){case 0:return n=s.createTraceId(),s.info(Eo,JSON.stringify({profile:t}),n),o=t.extraProfile,d={},["name","portraitUri","email","birthday","gender","location","role","level"].forEach((function(n){e.isUndefined(t[n])||(d[n]=t[n])})),e.isUndefined(o)||(d.extraProfile=r({},o)),[4,a.updateMyUserProfile(d)];case 1:return u=i.sent(),c=u.code,l=u.data,v=c===e.ErrorCode.SUCCESS?"info":"warn",s[v](Ro,JSON.stringify({code:c,data:l}),n),[2,{code:c,data:l}]}}))}))}))},exports.updateMyUserProfileVisibility=function(t){var n=this;return new e.ValidatorManage(No,Oo).validate("userProfileVisibility",t,(function(t){return[e.UserProfileVisibility.NOT_SET,e.UserProfileVisibility.INVISIBLE,e.UserProfileVisibility.EVERYONE].includes(t)}),!0).ifReady((function(r,a){return o(n,void 0,void 0,(function(){var n,o,s,d,u;return i(this,(function(i){switch(i.label){case 0:return n=a.createTraceId(),a.info(No,t,n),[4,r.updateMyUserProfileVisibility(t)];case 1:return o=i.sent(),s=o.code,d=o.data,u=s===e.ErrorCode.SUCCESS?"info":"warn",a[u](Oo,JSON.stringify({code:s,data:d}),n),[2,{code:s,data:d}]}}))}))}))},exports.updateTag=function(t){return o(this,void 0,void 0,(function(){var n=this;return i(this,(function(r){return[2,new e.ValidatorManage(lr,vr).validate("tagId",null==t?void 0:t.tagId,e.AssertRules.STRING,!0).validate("tagName",null==t?void 0:t.tagName,e.AssertRules.STRING,!0).validate("tagName",null==t?void 0:t.tagName,(function(e){return!!e&&e.length<=15})).ifReady((function(r,a){return o(n,void 0,void 0,(function(){var n,o,s;return i(this,(function(i){switch(i.label){case 0:return n=a.createTraceId(),a.info(lr,JSON.stringify({tagId:t.tagId,tagName:t.tagName}),n),[4,r.updateTag(t)];case 1:return o=i.sent().code,s=o===e.ErrorCode.SUCCESS?"info":"warn",a[s](vr,JSON.stringify({code:o}),n),o===e.ErrorCode.SUCCESS?[2,{code:o}]:[2,{code:o,msg:Yo[o]}]}}))}))}))]}))}))},exports.upload=Li;
|
|
15
|
+
***************************************************************************** */function n(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}var r=function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)};function o(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{d(r.next(e))}catch(e){i(e)}}function s(e){try{d(r.throw(e))}catch(e){i(e)}}function d(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}d((r=r.apply(e,t||[])).next())}))}function i(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}}var a=function(){return!("undefined"==typeof uni||!function(e){for(var t=["request","getSystemInfo"],n=0,r=t.length;n<r;n++)if(!e[t[n]])return!1;return!0}(uni))},s=a();var d=null,u=function(e){return o(void 0,void 0,void 0,(function(){var t;return i(this,(function(n){switch(n.label){case 0:return[4,c.getNetworkType()];case 1:return t=n.sent(),d({status:"online"===e.type,type:t}),[2]}}))}))};var c={tag:"browser",httpReq:function(t){return e.httpRequest(t).result()},localStorage:null===window||void 0===window?void 0:window.localStorage,sessionStorage:null===window||void 0===window?void 0:window.sessionStorage,useNavi:!0,connectPlatform:"",isFromUniapp:s,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,r=t.reason;e(n,r)}},onError:function(e){n.onerror=e},onMessage:function(e){n.onmessage=function(t){e(t.data)}},onOpen:function(e){n.onopen=e},send:function(e){n.send(e)},close:function(e,t){n.close()}}},getNetworkType:function(){var t=navigator.connection||navigator.mozConnection||navigator.webkitConnection||{effectiveType:e.NetworkType.UNKONWN},n=t.type,r=t.effectiveType,o=n||r||e.NetworkType.UNKONWN;return Promise.resolve(o)},setNetworkStatusListener:function(e){d=e,"undefined"!=typeof window&&window&&(window.addEventListener("offline",u),window.addEventListener("online",u))},removeNetworkStatusListener:function(){"undefined"!=typeof window&&window&&(window.removeEventListener("offline",u),window.removeEventListener("online",u)),d=null}},l=a(),v=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)}}},f={setItem:v("setStorageSync"),getItem:v("getStorageSync"),removeItem:v("removeStorageSync"),clear:v("clearStorageSync")},g=null,T=function(e){var t=e.isConnected,n=e.networkType;g({status:t,type:n})};var S={tag:"wechat",httpReq:function(t){var n=t.method||e.HttpMethod.GET,r=t.timeout||e.HTTP_TIMEOUT,o=t.headers,i=t.query,a=t.body,s=e.appendUrl(t.url,i);return new Promise((function(t){wx.request({url:s,method:n,header:o,timeout:r,data:a,success:function(e){t({data:e.data,status:e.statusCode})},fail:function(){t({status:e.ErrorCode.RC_HTTP_REQ_FAIL})}})}))},localStorage:f,sessionStorage:f,useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:l,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.NetworkType.UNKONWN)}})}))},setNetworkStatusListener:function(e){g=e,wx.onNetworkStatusChange(T)},removeNetworkStatusListener:function(){wx.offNetworkStatusChange(T),g=null}},p=a(),I=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 r=my[e]({key:t[0]}).data;return r?JSON.stringify(r):r}catch(e){}}},h={setItem:I("setStorageSync"),getItem:I("getStorageSync"),removeItem:I("removeStorageSync"),clear:I("clearStorageSync")},_=null,E=function(e){var t=e.isConnected,n=e.networkType;_({status:t,type:n})};var R={tag:"alipay",httpReq:function(t){var n=t.method||e.HttpMethod.GET,r=t.timeout||e.HTTP_TIMEOUT,o=t.headers,i=t.query,a=t.body,s=e.appendUrl(t.url,i),d=t.dataType||"json";return new Promise((function(t){my.request({url:s,method:n,headers:o,timeout:r,data:a,dataType:d,success:function(e){t({data:e.data,status:e.status})},fail:function(){t({status:e.ErrorCode.RC_HTTP_REQ_FAIL})}})}))},localStorage:h,sessionStorage:h,useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:p,createWebSocket:function(e){var t=my.connectSocket({url:e,multiple:!0});return{id:Date.now(),onClose:function(e){t.onClose(e)},onError:function(e){t.onError((function(t){e(t.errMsg)}))},onMessage:function(e){t.onMessage((function(t){t.data.isBuffer?e(my.base64ToArrayBuffer(t.data.data)):e(t.data.data)}))},onOpen:function(e){t.onOpen(e)},send:function(e){t.send({data:my.arrayBufferToBase64(e),isBuffer:!0})},close:function(){t.close()}}},getNetworkType:function(){return new Promise((function(t){my.getNetworkType({success:function(e){var n=e.networkType;t(n)},fail:function(){t(e.NetworkType.UNKONWN)}})}))},setNetworkStatusListener:function(e){_=e,my.onNetworkStatusChange(E)},removeNetworkStatusListener:function(){my.offNetworkStatusChange(E),_=null}},C=a(),m=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){}}},y={setItem:m("setStorageSync"),getItem:m("getStorageSync"),removeItem:m("removeStorageSync"),clear:m("clearStorageSync")},A=null,N=function(e){var t=e.isConnected,n=e.networkType;A({status:t,type:n})};var O={tag:"toutiao",useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:C,localStorage:y,sessionStorage:y,httpReq:function(t){return new Promise((function(n){tt.request({url:t.url,data:t.body,header:t.headers,method:t.method,success:function(e){var t=(null==e?void 0:e.data)||{},r={data:JSON.stringify(t),status:e.statusCode};n(r)},fail:function(t){n({status:e.ErrorCode.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.NetworkType.UNKONWN)}})}))},setNetworkStatusListener:function(e){A=e,tt.onNetworkStatusChange(N)},removeNetworkStatusListener:function(){tt.offNetworkStatusChange(N),A=null}},U=a(),M=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return swan[e].apply(swan,t)}catch(e){}}},w={setItem:M("setStorageSync"),getItem:M("getStorageSync"),removeItem:M("removeStorageSync"),clear:M("clearStorageSync")},P=null,L=function(e){var t=e.isConnected,n=e.networkType;P({status:t,type:n})};var b={tag:"baidu",useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:U,localStorage:w,sessionStorage:w,httpReq:function(t){return new Promise((function(n){swan.request({url:t.url,data:t.body,header:t.headers,method:t.method,success:function(e){var t=(null==e?void 0:e.data)||{},r={data:JSON.stringify(t),status:e.statusCode};n(r)},fail:function(t){n({status:e.ErrorCode.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 o(this,void 0,void 0,(function(){return i(this,(function(t){return[2,new Promise((function(t){swan.getNetworkType({success:function(e){var n=e.networkType;t(n)},fail:function(){t(e.NetworkType.UNKONWN)}})}))]}))}))},setNetworkStatusListener:function(e){P=e,swan.onNetworkStatusChange(L)},removeNetworkStatusListener:function(){swan.offNetworkStatusChange(L),P=null}},x=a(),G=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)}}},D={setItem:G("setStorageSync"),getItem:G("getStorageSync"),removeItem:G("removeStorageSync"),clear:G("clearStorageSync")},J=null,V=function(e){var t=e.isConnected,n=e.networkType;J({status:t,type:n})};var B={tag:"jingdong",httpReq:function(t){var n=t.method||e.HttpMethod.GET,r=t.timeout||e.HTTP_TIMEOUT,o=t.headers,i=t.query,a=t.body,s=e.appendUrl(t.url,i);return new Promise((function(t){jd.request({url:s,method:n,header:o,timeout:r,data:a,success:function(e){t({data:e.data,status:e.statusCode})},fail:function(){t({status:e.ErrorCode.RC_HTTP_REQ_FAIL})}})}))},localStorage:D,sessionStorage:D,useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:x,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.NetworkType.UNKONWN)}})}))},setNetworkStatusListener:function(e){J=e,jd.onNetworkStatusChange(V)},removeNetworkStatusListener:function(){jd.offNetworkStatusChange(V),J=null}},k=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)}}},H={setItem:k("setStorageSync"),getItem:k("getStorageSync"),removeItem:k("removeStorageSync"),clear:k("clearStorageSync")},F=null,Y=function(e){var t=e.isConnected,n=e.networkType;F({status:t,type:n})};var q,j={tag:"uniapp",httpReq:function(t){var n=t.method||e.HttpMethod.GET,r=t.timeout||e.HTTP_TIMEOUT,o=t.headers,i=t.query,a=t.body,s=e.appendUrl(t.url,i);return new Promise((function(t){uni.request({url:s,method:n,header:o,timeout:r,data:a,success:function(e){t({data:e.data,status:e.statusCode})},fail:function(){t({status:e.ErrorCode.RC_HTTP_REQ_FAIL})}})}))},localStorage:H,sessionStorage:H,useNavi:!0,connectPlatform:"",isFromUniapp:!0,createWebSocket:function(e,t){var n={complete:function(){},url:e,protocols:t},r=uni.connectSocket(n);return{id:Date.now(),onClose:function(e){r.onClose((function(t){e(t.code,t.reason)}))},onError:function(e){r.onError((function(t){e(t.errMsg)}))},onMessage:function(e){r.onMessage((function(t){e(t.data)}))},onOpen:function(e){r.onOpen(e)},send:function(e){r.send({data:e})},close:function(e,t){r.close({code:e,reason:t})}}},getNetworkType:function(){return new Promise((function(t){uni.getNetworkType({success:function(e){var n=e.networkType;t(n)},fail:function(){t(e.NetworkType.UNKONWN)}})}))},setNetworkStatusListener:function(e){F=e,uni.onNetworkStatusChange(Y)},removeNetworkStatusListener:function(){uni.offNetworkStatusChange(Y),F=null}},K=function(e){return e&&e.request&&e.getSystemInfo},z="undefined"!=typeof uni&&K(uni)?function(){switch(process.env.VUE_APP_PLATFORM){case"app-plus":return j;case"mp-jd":return B;case"mp-baidu":return b;case"mp-toutiao":return O;case"mp-alipay":return R;case"mp-weixin":return S;default:return c}}():"undefined"!=typeof jd&&K(jd)?B:"undefined"!=typeof my&&K(my)?R:"undefined"!=typeof tt&&K(tt)?O:"undefined"!=typeof swan&&K(swan)?b:"undefined"!=typeof wx&&K(wx)?S:c;function W(t){var n=t.conversationType,r=t.channelId,o=t.messageType,i=t.content,a=t.senderUserId,s=t.targetId,d=t.sentTime,u=t.receivedTime,c=t.messageUId,l=t.messageDirection,v=t.isPersited,f=t.isCounted,g=t.isOffLineMessage,T=t.canIncludeExpansion,S=t.expansion,p=t.receivedStatus,I=t.receivedStatusInfo,h=t.disableNotification,_=t.isMentioned,E=t.isStatusMessage,R=t.readReceiptInfo,C=t.pushConfig,m=t.messageId,y=t.isInterrupt,A=t.isModifyMessage,N=t.channelType,O=t.sentStatus,U=t.directedUserIds;return p||(p=e.ReceivedStatus.UNREAD),{messageType:o,channelId:r||"",content:i,senderUserId:a,targetId:s,conversationType:n,sentTime:d,receivedTime:u,messageUId:c,messageDirection:l,isPersited:v,isCounted:f,isMentioned:_,disableNotification:h,isStatusMessage:E,canIncludeExpansion:T,expansion:S,receivedStatus:p,receivedStatusInfo:I,readReceiptInfo:R,pushConfig:C,messageId:m,isInterrupt:y,isModifyMessage:A,sentStatus:O,isOffLineMessage:g,channelType:N,directedUserIds:U}}function X(t){var n=t.conversationType,r=t.targetId,o=t.latestMessage,i=t.unreadMessageCount,a=t.hasMentioned,s=t.mentionedInfo,d=t.lastUnreadTime,u=t.notificationStatus,c=t.notificationLevel,l=t.isTop,v=t.channelId,f=t.unreadMentionedCount,g=t.matchCount,T=t.operationTime,S=t.draft,p={conversationType:n,targetId:r,latestMessage:o&&W(o),unreadMessageCount:i,hasMentioned:a,mentionedInfo:a?{type:null==s?void 0:s.type,userIdList:null==s?void 0:s.userIdList}:void 0,lastUnreadTime:d,notificationStatus:u,notificationLevel:c,isTop:l,channelId:v,unreadMentionedCount:f,matchCount:g,operationTime:T,draft:S||""};return p.conversationType===e.ConversationType.ULTRA_GROUP&&(p.firstUnreadMessage=t.firstUnreadMessage,p.channelType=t.channelType,p.unreadMentionedMeCount=t.unreadMentionedMeCount),p}function Q(e,t){null===console||void 0===console||console.warn("Method '"+e+"' is deprecated, please use '"+t+"' instead")}exports.Events=void 0,(q=exports.Events||(exports.Events={})).CONNECTING="CONNECTING",q.CONNECTED="CONNECTED",q.DISCONNECT="DISCONNECT",q.SUSPEND="SUSPEND",q.MESSAGES="MESSAGES",q.READ_RECEIPT_RECEIVED="READ_RECEIPT_RECEIVED",q.MESSAGE_RECEIPT_REQUEST="MESSAGE_RECEIPT_REQUEST",q.MESSAGE_RECEIPT_RESPONSE="MESSAGE_RECEIPT_RESPONSE",q.MESSAGE_READ_RECEIPT_V4="MESSAGE_READ_RECEIPT_V4",q.SYNC_READ_STATUS="SYNC_READ_STATUS",q.CONVERSATION="CONVERSATION",q.CHATROOM="CHATROOM",q.EXPANSION="EXPANSION",q.PULL_OFFLINE_MESSAGE_FINISHED="PULL_OFFLINE_MESSAGE_FINISHED",q.TAG="TAG",q.CONVERSATION_TAG="CONVERSATION_TAG",q.TYPING_STATUS="TYPING_STATUS",q.MESSAGE_BLOCKED="MESSAGE_BLOCKED",q.ULTRA_GROUP_ENABLE="ULTRA_GROUP_ENABLE",q.OPERATE_STATUS="OPERATE_STATUS",q.ULTRA_GROUP_MESSAGE_EXPANSION_UPDATED="ULTRA_GROUP_MESSAGE_EXPANSION_UPDATED",q.ULTRA_GROUP_MESSAGE_MODIFIED="ULTRA_GROUP_MESSAGE_MODIFIED",q.ULTRA_GROUP_MESSAGE_RECALLED="ULTRA_GROUP_MESSAGE_RECALLED",q.ULTRA_GROUP_CHANNEL_TYPE_CHANGE="ULTRA_GROUP_CHANNEL_TYPE_CHANGE",q.ULTRA_GROUP_CHANNEL_DELETE="ULTRA_GROUP_CHANNEL_DELETE",q.ULTRA_GROUP_CHANNEL_USER_KICKED="ULTRA_GROUP_CHANNEL_USER_KICKED",q.PRIVATE_MESSAGE_DELIVERED="PRIVATE_MESSAGE_DELIVERED",q.GROUP_MESSAGE_DELIVERED="GROUP_MESSAGE_DELIVERED",q.USER_GROUP_STATUS="USER_GROUP_STATUS",q.SUBSCRIBED_USER_STATUS_CHANGE="SUBSCRIBED_USER_STATUS_CHANGE",q.SUBSCRIBED_RELATION_CHANGE="SUBSCRIBED_RELATION_CHANGE",q.SYNC_SUBSCRIBED_USER_STATUS_FINISHED="SYNC_SUBSCRIBED_USER_STATUS_FINISHED",q.OWN_USER_PROFILE_CHANGED="OWN_USER_PROFILE_CHANGED";var Z,$="A-add_to_blacklist-T",ee="A-add_to_blacklist-R",te="A-remove_from_blacklist-T",ne="A-remove_from_blacklist-R",re="A-get_blacklist-T",oe="A-get_blacklist-R",ie="A-get_blacklist_status-T",ae="A-get_blacklist_status-R",se="A-get_chatroom_info-T",de="A-get_chatroom_info-R",ue="A-set_chatroom_entry-T",ce="A-set_chatroom_entry-R",le="A-set_chatroom_entries-T",ve="A-set_chatroom_entries-R",fe="A-force_set_chatroom_entry-T",ge="A-force_set_chatroom_entry-R",Te="A-remove_chatroom_entry-T",Se="A-remove_chatroom_entry-R",pe="A-remove_chatroom_entries-T",Ie="A-remove_chatroom_entries-R",he="A-force_remove_chatroom_entry-T",_e="A-force_remove_chatroom_entry-R",Ee="A-get_chatroom_entry-T",Re="A-get_chatroom_entry-R",Ce="A-get_all_chatroom_entries-T",me="A-get_all_chatroom_entries-R",ye="A-get_chatroom_history_messages-T",Ae="A-get_chatroom_history_messages-R",Ne="A-bind_rtc_room_for_chatroom-T",Oe="A-bind_rtc_room_for_chatroom-R",Ue="A-get_top_conversation_list-R",Me="A-get_top_conversation_list-T",we="A-get_conversation_list-T",Pe="A-get_conversation_list-R",Le="A-get_conversation-T",be="A-get_conversation-R",xe="A-remove_conversation-T",Ge="A-remove_conversation-R",De="A-get_conversation_message_draft-T",Je="A-get_conversation_message_draft-R",Ve="A-save_conversation_message_draft-T",Be="A-save_conversation_message_draft-R",ke="A-clear_conversation_message_draft-T",He="A-clear_conversation_message_draft-R",Fe="A-get_total_unread_count-T",Ye="A-get_total_unread_count-R",qe="A-get_total_unread_count_by_levels-T",je="A-get_total_unread_count_by_levels-R",Ke="A-get_unread_count-T",ze="A-get_unread_count-R",We="A-clear_unread_count-T",Xe="A-clear_unread_count-R",Qe="A-clear_all_unread_count-O",Ze="A-set_conversation_notification_level-T",$e="A-set_conversation_notification_level-R",et="A-set_conversation_status-T",nt="A-set_conversation_status-R",rt="A-get_conversation_notification_level-T",ot="A-get_conversation_notification_level-R",it="A-get_conversation_notification_status-T",at="A-get_conversation_notification_status-R",st="A-set_conversation_notification_status-T",dt="A-set_conversation_notification_status-R",ut="A-get_unread_conversation_list-T",ct="A-get_unread_conversation_list-R",lt="A-get_unread_mentioned_count-T",vt="A-get_unread_mentioned_count-R",ft="A-get_all_unread_mentioned_count-T",gt="A-get_all_unread_mentioned_count-R",Tt="A-get_all_conversation-state-T",St="A-e_get_all_conversation_list-T",pt="A-e_get_all_conversation_list-R",It="A-e_get_conversation_list-T",ht="A-e_get_conversation_list-R",_t="A-e_search_conversation_by_content-T",Et="A-e_search_conversation_by_content-R",Rt="A-get_conversations-T",Ct="A-get_conversations-R",mt="A-e_search_messages-T",yt="A-e_search_messages-R",At="A-e_search_message_in_time_range-T",Nt="A-e_search_message_in_time_range-R",Ot="A-e_search_messages_by_user-T",Ut="A-e_search_messages_by_user-R",Mt="A-e_get_history_messages_by_message_types-T",wt="A-e_get_history_messages_by_message_types-R",Pt="A-e_get_continuous_messages-T",Lt="A-e_get_continuous_messages-R",bt="A-e_set_message_status_to_read-T",xt="A-e_set_message_status_to_read-R",Gt="A-e_set_message_received_status-T",Dt="A-e_set_message_received_status-R",Jt="A-e_set_message_sent_status-T",Vt="A-e_set_message_sent_status-R",Bt="A-e_set_message_sent_status_info-T",kt="A-e_set_message_sent_status_info-R",Ht="A-e_set_message_content-T",Ft="A-e_set_message_content-R",Yt="A-e_delete_messages-T",qt="A-e_delete_messages-R",jt="A-e_clear_messages-T",Kt="A-e_clear_messages-R",zt="A-e_delete_messages_by_timestamp-T",Wt="A-e_delete_messages_by_timestamp-R",Xt="A-e_insert_message-T",Qt="A-e_insert_message-R",Zt="A-e_batch_insert_message-T",$t="A-e_batch_insert_message-R",en="A-e_get_message_count-T",tn="A-e_get_message_count-R",nn="A-e_get_private_message_deliver_time-T",rn="A-e_get_private_message_deliver_time-R",on="A-e_get_group_message_deliver_list-T",an="A-e_get_group_message_deliver_list-R",sn="A-e_set_check_duplicate_message-T",dn="A-e_set_check_duplicate_message-R",un="A-e_set_check_duplicate_message-T",cn="A-e_set_check_duplicate_message-R",ln="A-batch_Remove_conversation-T",vn="A-batch_Remove_conversation-R",fn="A-batch_set_con_notifi_level-T",gn="A-batch_set_con_notifi_level-R",Tn="A-batch_set_con_to_top-T",Sn="A-batch_set_con_to_top-R",pn="A-batch_clear_remote_msg-T",In="A-batch_clear_remote_msg-R",hn="A-batch_clear_msg-T",_n="A-batch_clear_msg-R",En="A-get_remote_history_messages-T",Rn="A-get_remote_history_messages-R",Cn="A-recall_message-T",mn="A-recall_message-R",yn="A-delete_remote_message-T",An="A-delete_remote_message-R",Nn="A-delete_remote_message_by_timestamp-T",On="A-delete_remote_message_by_timestamp-R",Un="A-update_message_expansion-T",Mn="A-update_message_expansion-R",wn="A-remove_message_expansion_for_key-T",Pn="A-remove_message_expansion_for_key-R",Ln="A-get_message_reader-T",bn="A-get_message_reader-R",xn="A-get_first_unread_message-T",Gn="A-get_first_unread_message-R",Dn="A-get_first_unread_message_info-T",Jn="A-get_first_unread_message_info-R",Vn="A-insert_message-T",Bn="A-insert_message-R",kn="A-get_message-T",Hn="A-get_message-R",Fn="A-get_unread_mentioned_messages-T",Yn="A-get_unread_mentioned_messages-R",qn="A-delete_local_messages_by_timestamp-T",jn="A-delete_local_messages_by_timestamp-R",Kn="A-clear_messages-T",zn="A-clear_messages-R",Wn="A-search_conversation_by_content-T",Xn="A-search_conversation_by_content-R",Qn="A-clear_unread_count_by_timestamp-T",Zn="A-clear_unread_count_by_timestamp-R",$n="A-set_message_received_status-T",er="A-set_message_received_status-R",tr="A-set_proxy-T",nr="A-set_proxy-R",rr="A-get_proxy-T",or="A-get_proxy-R",ir="A-test_proxy-T",ar="A-test_proxy-R",sr="A-add_tag-T",dr="A-add_tag-R",ur="A-remove_tag-T",cr="A-remove_tag-R",lr="A-update_tag-T",vr="A-update_tag-R",fr="A-get_tags-T",gr="A-get_tags-R",Tr="A-get_tags_for_conversation-T",Sr="A-get_tags_for_conversation-R",pr="A-add_tag_for_conversations-T",Ir="A-add_tag_for_conversations-R",hr="A-remove_conversations_from_tag-T",_r="A-remove_conversations_from_tag-R",Er="A-remove_tags_from_conversation-T",Rr="A-remove_tags_from_conversation-R",Cr="A-remove_tag_from_conversations-T",mr="A-remove_tag_from_conversations-R",yr="A-get_conversations_from_tag_by_page-T",Ar="A-get_conversations_from_tag_by_page-R",Nr="A-get_unread_count_by_tag-T",Or="A-get_unread_count_by_tag-R",Ur="A-set_conversation_status_in_tag-R",Mr="A-get_ultra_group_list-T",wr="A-get_ultra_group_list-R",Pr="A-get_block_ultra_group_list-T",Lr="A-get_block_ultra_group_list-R",br="A-send_ultra_group_typing_status-T",xr="A-send_ultra_group_typing_status-R",Gr="A-get_ultra_group_message_list_by_message_uid-T",Dr="A-get_ultra_group_message_list_by_message_uid-R",Jr="A-update_expansion_for_ultra_group_message-T",Vr="A-update_expansion_for_ultra_group_message-R",Br="A-remove_expansion_for_ultra_group_message-T",kr="A-remove_expansion_for_ultra_group_message-R",Hr="A-remove_all_expansion_for_ultra_group_message-T",Fr="A-remove_all_expansion_for_ultra_group_message-R",Yr="A-modify_message-T",qr="A-modify_message-R",jr="A-get_ultra_group_unread_mentioned_count_by_target_id-T",Kr="A-get_ultra_group_unread_mentioned_count_by_target_id-R",zr="A-get_ultra_group_default_notification_level-T",Wr="A-get_ultra_group_default_notification_level-R",Xr="A-set_ultra_group_default_notification_level-T",Qr="A-set_ultra_group_default_notification_level-R",Zr="A-get_ultra_group_unread_count_by_target_id-T",$r="A-get_ultra_group_unread_count_by_target_id-R",eo="A-get_all_ultra_group_unread_count-T",to="A-get_all_ultra_group_unread_count-R",no="A-get_all_ultra_group_unread_mentioned_count-T",ro="A-get_all_ultra_group_unread_mentioned_count-R",oo="A-get_ultra_group_unread_mentioned_messages-T",io="A-get_ultra_group_unread_mentioned_messages-R",ao="A-get_ultra_group_first_unread_message_timestamp-T",so="A-get_ultra_group_first_unread_message_timestamp-R",uo="A-get_ultra_group_unread_info_list-T",co="A-get_ultra_group_unread_info_list-R",lo="A-subscribe_user_status-T",vo="A-subscribe_user_status-R",fo="A-unsubscribe_user_status-T",go="A-unsubscribe_user_status-R",To="A-get_subscribe_user_status-T",So="A-get_subscribe_user_status-R",po="A-get_subscribe_user_status_list-T",Io="A-get_subscribe_user_status_list-R",ho="A-get_message_by_timestamp-T",_o="A-get_message_by_timestamp-R",Eo="A-update_my_user_profile-T",Ro="A-update_my_user_profile-R",Co="A-get_user_profiles-T",mo="A-get_user_profiles-R",yo="A-get_my_user_profile-T",Ao="A-get_my_user_profile-R",No="A-update_my_user_profile_visibility-T",Oo="A-update_my_user_profile_visibility-R",Uo="A-get_my_user_profile_visibility-T",Mo="A-get_my_user_profile_visibility-R",wo="A-search_user_profile_by_unique_id-T",Po="A-search_user_profile_by_unique_id-R";exports.MessageAuditType=void 0,(Z=exports.MessageAuditType||(exports.MessageAuditType={}))[Z.DISALLOW=0]="DISALLOW",Z[Z.ALLOW=1]="ALLOW";var Lo=new e.EventEmitter,bo={connection:function(t,n){switch(t){case e.RCConnectionStatus.CONNECTED:Lo.emit(exports.Events.CONNECTED);break;case e.RCConnectionStatus.CONNECTING:Lo.emit(exports.Events.CONNECTING);break;case e.RCConnectionStatus.SUSPENDED:Lo.emit(exports.Events.SUSPEND,n);break;case e.RCConnectionStatus.DISCONNECTED:Lo.emit(exports.Events.DISCONNECT,n)}},batchMessage:function(e){Lo.emit(exports.Events.MESSAGES,{messages:e.map((function(e){return W(e)}))})},typingState:function(e){Lo.emit(exports.Events.TYPING_STATUS,{status:e})},readReceiptReceived:function(e,t,n,r){Lo.emit(exports.Events.READ_RECEIPT_RECEIVED,{conversation:e,messageUId:t,sentTime:n,sendUserId:r})},messageReceiptRequest:function(e,t,n){Lo.emit(exports.Events.MESSAGE_RECEIPT_REQUEST,{conversation:e,messageUId:t,senderUserId:n})},messageReceiptResponse:function(e,t,n){Lo.emit(exports.Events.MESSAGE_RECEIPT_RESPONSE,{conversation:e,receivedUserId:t,messageUIdList:n})},conversationState:function(t){var n=t.map((function(t){var n=t.conversationType,r={conversationType:n,latestMessage:t.latestMessage?W(t.latestMessage):null,targetId:t.targetId,unreadMessageCount:t.unreadMessageCount,unreadMentionedCount:t.unreadMentionedCount,notificationStatus:t.notificationStatus,notificationLevel:t.notificationLevel,lastUnreadTime:t.lastUnreadTime,channelId:t.channelId};return n===e.ConversationType.ULTRA_GROUP?(r.versionTime=t.versionTime,r.unreadMessageCount=xo(t.unreadMessageCount||0),r.unreadMentionedCount=xo(t.unreadMentionedCount||0),r.unreadMentionedMeCount=xo(t.unreadMentionedMeCount||0),{conversation:r}):(r.hasMentioned=t.hasMentioned,r.mentionedInfo=t.mentionedInfo,r.isTop=t.isTop,{conversation:r,updatedItems:t.updatedItems})}));Lo.emit(exports.Events.CONVERSATION,{conversationList:n})},chatroomState:function(e){Lo.emit(exports.Events.CHATROOM,e)},expansion:function(e){Lo.emit(exports.Events.EXPANSION,e)},pullFinished:function(){Lo.emit(exports.Events.PULL_OFFLINE_MESSAGE_FINISHED)},tag:function(){Lo.emit(exports.Events.TAG)},conversationTagChanged:function(){Lo.emit(exports.Events.CONVERSATION_TAG)},messageBlocked:function(e){Lo.emit(exports.Events.MESSAGE_BLOCKED,e)},messageDelivered:function(e){Lo.emit(exports.Events.PRIVATE_MESSAGE_DELIVERED,e)},groupMessageDeliveredStatus:function(e){Lo.emit(exports.Events.GROUP_MESSAGE_DELIVERED,e)},ultraGroupEnable:function(e){Lo.emit(exports.Events.ULTRA_GROUP_ENABLE,e.map((function(e){return X(e)})))},operateStatus:function(e){Lo.emit(exports.Events.OPERATE_STATUS,e)},ultraGroupMessageExpansionUpdated:function(e){Lo.emit(exports.Events.ULTRA_GROUP_MESSAGE_EXPANSION_UPDATED,e.map((function(e){return W(e)})))},ultraGroupMessageModified:function(e){Lo.emit(exports.Events.ULTRA_GROUP_MESSAGE_MODIFIED,e.map((function(e){return W(e)})))},ultraGroupMessageRecalled:function(e){Lo.emit(exports.Events.ULTRA_GROUP_MESSAGE_RECALLED,e.map((function(e){return W(e)})))},ultraGroupChannelChangeType:function(e){Lo.emit(exports.Events.ULTRA_GROUP_CHANNEL_TYPE_CHANGE,e)},ultraGroupChannelUserKicked:function(e){Lo.emit(exports.Events.ULTRA_GROUP_CHANNEL_USER_KICKED,e)},ultraGroupChannelDelete:function(e){Lo.emit(exports.Events.ULTRA_GROUP_CHANNEL_DELETE,e)},userGroupStatus:function(e){Lo.emit(exports.Events.USER_GROUP_STATUS,e)},messageReadReceipt:function(e){Lo.emit(exports.Events.MESSAGE_READ_RECEIPT_V4,e)},syncReadStatus:function(e){Lo.emit(exports.Events.SYNC_READ_STATUS,e)},subscribedUserStatusChange:function(e){Lo.emit(exports.Events.SUBSCRIBED_USER_STATUS_CHANGE,e)},subscribedRelationChange:function(e){Lo.emit(exports.Events.SUBSCRIBED_RELATION_CHANGE,e)},syncSubscribedUserStatusFinished:function(e){Lo.emit(exports.Events.SYNC_SUBSCRIBED_USER_STATUS_FINISHED,e)},ownUserProfileChanged:function(e){Lo.emit(exports.Events.OWN_USER_PROFILE_CHANGED,e)}};function xo(e){return e>999?999:e}e.VersionManage.add("imlib-next","5.10.3");var Go=null,Do=null,Jo=null;function Vo(){return o(this,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return Go?(Jo.info(e.LogTagId.A_DESTROY_O),[4,e.APIContext.destroy()]):[2];case 1:return t.sent(),Do=null,Go=null,Jo=null,[2]}}))}))}function Bo(e){if(!Go)throw new Error("Not initialized yet!");return e(Go,Jo,Do)}function ko(t){return Go?t(Go,Jo,Do):Promise.resolve({code:e.ErrorCode.BIZ_ERROR_CLIENT_NOT_INIT})}function Ho(){Lo.clear()}var Fo={TIMEOUT:{code:-1,msg:"Network timeout"},REJECTED_BY_BLACKLIST:{code:405,msg:"Blacklisted by the other party"},SEND_TOO_FAST:{code:20604,msg:"Sending messages too quickly"},NOT_IN_GROUP:{code:22406,msg:"Not in group"},ULTRA_GROUP_USER_NOT_IN_PRIVATE_CHANNEL:{code:e.ErrorCode.ULTRA_GROUP_USER_NOT_IN_PRIVATE_CHANNEL,msg:"ultra group user not in private channel"},FORBIDDEN_IN_GROUP:{code:22408,msg:"Forbbiden from speaking in the group"},NOT_IN_CHATROOM:{code:23406,msg:"Not in chatRoom"},FORBIDDEN_IN_CHATROOM:{code:23408,msg:"Forbbiden from speaking in the chatRoom"},KICKED_FROM_CHATROOM:{code:23409,msg:"Kicked out and forbbiden from joining the chatRoom"},CHATROOM_NOT_EXIST:{code:23410,msg:"ChatRoom does not exist"},CHATROOM_IS_FULL:{code:23411,msg:"ChatRoom members exceeded"},PARAMETER_INVALID_CHATROOM:{code:23412,msg:"Invalid chatRoom parameters"},ROAMING_SERVICE_UNAVAILABLE_CHATROOM:{code:23414,msg:"ChatRoom message roaming service is not open, Please go to the developer to open this service"},RECALLMESSAGE_PARAMETER_INVALID:{code:25101,msg:"Invalid recall message parameter"},ROAMING_SERVICE_UNAVAILABLE_MESSAGE:{code:25102,msg:"Single group chat roaming service is not open, Please go to the developer to open this service"},PUSHSETTING_PARAMETER_INVALID:{code:26001,msg:"Invalid push parameter"},OPERATION_BLOCKED:{code:20605,msg:"Operation is blocked"},OPERATION_NOT_SUPPORT:{code:20606,msg:"Operation is not supported"},MSG_BLOCKED_SENSITIVE_WORD:{code:21501,msg:"The sent message contains sensitive words"},REPLACED_SENSITIVE_WORD:{code:21502,msg:"Sensitive words in the message have been replaced"},NOT_CONNECTED:{code:30001,msg:"Please connect successfully first"},NAVI_REQUEST_ERROR:{code:30007,msg:"Navigation http request failed"},CMP_REQUEST_ERROR:{code:30010,msg:"CMP sniff http request failed"},CONN_APPKEY_FAKE:{code:31002,msg:"Your appkey is fake"},CONN_MINI_SERVICE_NOT_OPEN:{code:31003,msg:"Mini program service is not open, Please go to the developer to open this service"},CONN_ACK_TIMEOUT:{code:31e3,msg:"Connection ACK timeout"},CONN_TOKEN_INCORRECT:{code:31004,msg:"Your token is not valid or expired"},CONN_NOT_AUTHRORIZED:{code:31005,msg:"AppKey and Token do not match"},CONN_REDIRECTED:{code:31006,msg:"Connection redirection"},CONN_APP_BLOCKED_OR_DELETED:{code:31008,msg:"AppKey is banned or deleted"},CONN_USER_BLOCKED:{code:31009,msg:"User blocked"},CONN_DOMAIN_INCORRECT:{code:31012,msg:"Connect domain error, Please check the set security domain"},ROAMING_SERVICE_UNAVAILABLE:{code:33007,msg:"Roaming service cloud is not open, Please go to the developer to open this service"},RC_CONNECTION_EXIST:{code:34001,msg:"Connection already exists"},CHATROOM_KV_EXCEED:{code:23423,msg:"ChatRoom KV setting exceeds maximum"},CHATROOM_KV_OVERWRITE_INVALID:{code:23424,msg:"ChatRoom KV already exists"},CHATROOM_KV_STORE_NOT_OPEN:{code:23426,msg:"ChatRoom KV storage service is not open, Please go to the developer to open this service"},CHATROOM_KEY_NOT_EXIST:{code:23427,msg:"ChatRoom key does not exist"},MSG_KV_NOT_SUPPORT:{code:34008,msg:"The message cannot be extended"},SEND_MESSAGE_KV_FAIL:{code:34009,msg:"Sending RC expansion message fail"},EXPANSION_LIMIT_EXCEET:{code:34010,msg:"The message expansion size is beyond the limit"},ILLGAL_PARAMS:{code:33003,msg:"Incorrect parameters passed in while calling the interface"},UPLOAD_FILE_FAILED:{code:35020,msg:"File upload failed"},CHATROOM_KV_STORE_NOT_ALL_SUCCESS:{code:23428,msg:"Chatroom kv store not all success"},CHATROOM_KV_STORE_OUT_LIMIT:{code:23429,msg:"Chatroom kv's length is out of limit"},TAG_EXISTS:{code:33101,msg:"The tag already exists"},TAG_NOT_EXIST:{code:33100,msg:"The tag does not exist"},NOT_SUPPORT:{code:e.ErrorCode.NOT_SUPPORT,msg:"The method is not supported in a browser!"}},Yo={},qo={};for(var jo in Fo){var Ko=Fo[jo],zo=Ko.code;Yo[zo]=jo,qo[zo]=Ko}Fo.ROAMING_SERVICE_UNAVAILABLE.code;var Wo=function(t,n,r,a){return void 0===a&&(a=""),o(void 0,void 0,void 0,(function(){var o,s;return i(this,(function(i){switch(i.label){case 0:return o=function(t,n,r){void 0===r&&(r="");var o="conversationType:"+n.conversationType+",targetId:"+n.targetId;return t.debug(e.LogTagId.O,r+" -> "+o),o}(t,n,a),[4,r()];case 1:return(s=i.sent())!==e.ErrorCode.SUCCESS?(t.warn(e.LogTagId.O,a+" fail -> "+s+" : "+Yo[s]+" , "+o),[2,{code:s,msg:Yo[s]}]):[2,{code:s}]}}))}))};var Xo=function(e,t,n,r){void 0===n&&(n=!0),void 0===r&&(r=!0),this.messageType=e,this.content=t,this.isPersited=n,this.isCounted=r};function Qo(e,t,n){void 0===t&&(t=!0),void 0===n&&(n=!0);return function(r){return new Xo(e,r,t,n)}}var Zo,$o=Qo("RC:ImgMsg"),ei=Qo("RC:HQVCMsg"),ti=Qo("RC:SightMsg"),ni=Qo("RC:TxtMsg"),ri=Qo("RC:CombineMsg"),oi=Qo(e.MessageType.COMBINE_V2),ii=Qo("RC:FileMsg"),ai=Qo("RC:GIFMsg"),si=Qo("RC:VcMsg"),di=Qo("RC:LBSMsg"),ui=Qo("RC:ReferenceMsg"),ci=Qo("RC:ImgTextMsg"),li=Qo("RC:CmdMsg"),vi=Qo("RC:InfoNtf"),fi=Qo("RC:GrpNtf");!function(e){e.ALIYUN="aliyun",e.S3="s3",e.STC="stc",e.MINIO="minio",e.QINIU="qiniu",e.BAIDU="baidu",e.RCX="rcx"}(Zo||(Zo={}));var gi=function(){function t(e,t,n){this.isSupportMultipart=!1,this._serverType=0,this._isAbort=!1,this._url=e,this._getFileToken=t,this._serverType=n}return t.prototype.isAbort=function(){return this._isAbort},t.prototype.abort=function(){this._isAbort=!0,this._abortHandler()},t.prototype.upload=function(t){return t.file.size>e.MAX_UPLOAD_FILE_SIZE?Promise.resolve({code:e.ErrorCode.UPLOAD_FAIL,msg:"the file size is over 5GB!"}):t.file.size>e.UPLOAD_FILE_CHUNK_SIZE&&this.isSupportMultipart?this.multipartUpload(t):this.commonUpload(t)},t}();function Ti(e){return e/1024||0}var Si,pi=function(t){function r(){var e=null!==t&&t.apply(this,arguments)||this;return e._promise=null,e}return n(r,t),r.prototype.commonUpload=function(t){return o(this,void 0,void 0,(function(){var n,r,o,a,s,d,u;return i(this,(function(i){switch(i.label){case 0:n=t.file,r=t.onProgress,o=t.fileType,i.label=1;case 1:return i.trys.push([1,3,,4]),[4,this._getFileToken(o,n.name,void 0,void 0,void 0,Ti(n.size))];case 2:return a=i.sent(),[3,4];case 3:return[2,{code:i.sent()}];case 4:return s={},(d=new FormData).set("token",a.token),d.set("key",a.fileName),d.set("file",n),this._promise=e.httpRequest({url:e.fixUrlProtocol(this._url),headers:s,onProgress:function(e){return null==r?void 0:r(e.loaded,e.total)},method:"POST",body:d,timeout:0}),[4,this._promise.result()];case 5:return u=i.sent().status,this._promise=null,200===u||204===u?[2,{code:e.ErrorCode.SUCCESS,data:{uniqueName:a.fileName,uploadMethod:e.UploadMethod.QINIU}}]:[2,{code:e.ErrorCode.UPLOAD_FAIL,msg:u.toString()}]}}))}))},r.prototype.multipartUpload=function(e){return o(this,void 0,void 0,(function(){return i(this,(function(e){throw new Error("Method not implemented.")}))}))},r.prototype._abortHandler=function(){var e;null===(e=this._promise)||void 0===e||e.abort()},r}(gi),Ii=function(t){function r(){var e=null!==t&&t.apply(this,arguments)||this;return e._promise=null,e}return n(r,t),r.prototype.commonUpload=function(t){return o(this,void 0,void 0,(function(){var n,r,o,a,s,d,u;return i(this,(function(i){switch(i.label){case 0:n=t.file,r=t.onProgress,o=t.fileType,i.label=1;case 1:return i.trys.push([1,3,,4]),[4,this._getFileToken(o,void 0,void 0,void 0,void 0,Ti(n.size))];case 2:return a=i.sent(),[3,4];case 3:return[2,{code:i.sent()}];case 4:return s=e.fixUrlProtocol(a.ossBucketName+"."+this._url),(d=new FormData).set("token",a.token),d.set("OSSAccessKeyId",a.osskeyId),d.set("policy",a.ossPolicy),d.set("Signature",a.ossSign),d.set("success_action_status","200"),d.set("key",a.fileName),d.set("file",n),this._promise=e.httpRequest({url:s,onProgress:function(e){return null==r?void 0:r(e.loaded,e.total)},method:"POST",body:d,timeout:0}),[4,this._promise.result()];case 5:return u=i.sent().status,this._promise=null,200===u||204===u?[2,{code:e.ErrorCode.SUCCESS,data:{uniqueName:a.fileName,uploadMethod:e.UploadMethod.ALI}}]:[2,{code:e.ErrorCode.UPLOAD_FAIL,msg:u.toString()}]}}))}))},r.prototype._abortHandler=function(){var e;null===(e=this._promise)||void 0===e||e.abort()},r.prototype.multipartUpload=function(e){throw new Error("Method not implemented.")},r}(gi),hi=function(t){function r(){var e=null!==t&&t.apply(this,arguments)||this;return e._promise=null,e}return n(r,t),r.prototype.commonUpload=function(t){return o(this,void 0,void 0,(function(){var n,r,o,a,s,d,u,c,l;return i(this,(function(i){switch(i.label){case 0:n=t.file,r=t.onProgress,o=t.fileType,a=t.contentDisposition,i.label=1;case 1:return i.trys.push([1,3,,4]),[4,this._getFileToken(o<=e.FileType.FILE?o:e.FileType.FILE)];case 2:return s=i.sent(),[3,4];case 3:return[2,{code:i.sent()}];case 4:return d=a||("text/html"===n.type?"inline":"attachment"),u={authorization:s.bosToken,"x-bce-date":s.bosDate,"Content-Disposition":d+"; filename="+encodeURIComponent(n.name)+";"},c=e.fixUrlProtocol(""+this._url+s.path),this._promise=e.httpRequest({url:c,headers:u,onProgress:function(e){return null==r?void 0:r(e.loaded,e.total)},method:"POST",body:n,timeout:0}),[4,this._promise.result()];case 5:return l=i.sent().status,this._promise=null,200===l||204===l?[2,{code:e.ErrorCode.SUCCESS,data:{uniqueName:s.fileName,downloadUrl:c}}]:[2,{code:e.ErrorCode.UPLOAD_FAIL,msg:l.toString()}]}}))}))},r.prototype.multipartUpload=function(e){throw new Error("Method not implemented.")},r.prototype._abortHandler=function(){var e;null===(e=this._promise)||void 0===e||e.abort()},r}(gi),_i=function(t){function r(){var e=null!==t&&t.apply(this,arguments)||this;return e._promise=null,e.isSupportMultipart=!0,e}return n(r,t),r.prototype.commonUpload=function(t){return o(this,void 0,void 0,(function(){var n,r,o,a,s,d,u;return i(this,(function(i){switch(i.label){case 0:n=t.file,r=t.onProgress,o=t.fileType,i.label=1;case 1:return i.trys.push([1,3,,4]),[4,this._getFileToken(o,void 0,void 0,void 0,void 0,Ti(n.size))];case 2:return a=i.sent(),[3,4];case 3:return[2,{code:i.sent()}];case 4:return s=e.fixUrlProtocol(this._url+"/"+a.minioBucketName+"/"+a.fileName),d=this.getBaseHeaders(n,a,t),this._promise=e.httpRequest({url:s,headers:d,onProgress:function(e){return null==r?void 0:r(e.loaded,e.total)},method:"PUT",body:n,timeout:0}),[4,this._promise.result()];case 5:return u=i.sent().status,this._promise=null,200===u||204===u?[2,{code:e.ErrorCode.SUCCESS,data:{uniqueName:a.fileName,uploadMethod:e.UploadMethod.MINIO}}]:[2,{code:e.ErrorCode.UPLOAD_FAIL,msg:u.toString()}]}}))}))},r.prototype.multipartUpload=function(t){var n;return o(this,void 0,void 0,(function(){var r,o,a,s,d,u,c,l,v,f,g,T,S,p,I,h;return i(this,(function(i){switch(i.label){case 0:r=t.file,o=t.fileType,i.label=1;case 1:return i.trys.push([1,3,,4]),[4,this._getFileToken(o,r.name,"POST","uploads",void 0,Ti(r.size))];case 2:return a=i.sent(),[3,4];case 3:return[2,{code:i.sent()}];case 4:return s=e.fixUrlProtocol(this._url+"/"+a.minioBucketName+"/"+a.fileName),d=this.getBaseHeaders(r,a,t),this._promise=e.httpRequest({url:s+"?uploads",headers:d,method:"POST"}),[4,this._promise.result()];case 5:return u=i.sent(),c=u.status,l=u.data,this._promise=null,v=null===(n=null==l?void 0:l.match(/(?:<UploadId>)(\S*?)(?:<\/UploadId>)/))||void 0===n?void 0:n[1],200!==c&&204!==c||!v?[2,{code:e.ErrorCode.UPLOAD_FAIL,msg:"start upload fail"}]:(f=[],[4,this.requestUploadPart(s,r,v,a.fileName,t,f)]);case 6:if(g=i.sent(),T=g.code,S=g.msg,T!==e.ErrorCode.SUCCESS)return[2,{code:T,msg:S}];i.label=7;case 7:return i.trys.push([7,9,,10]),[4,this._getFileToken(o,a.fileName,"POST","uploadId="+v,void 0,Ti(r.size))];case 8:return a=i.sent(),[3,10];case 9:return[2,{code:i.sent()}];case 10:return p=f.map((function(e,t){return"<Part><PartNumber>"+(t+1)+"</PartNumber><ETag>"+e+"</ETag></Part>"})).join(""),p="<CompleteMultipartUpload xmlns='http://s3.amazonaws.com/doc/2006-03-01/'>"+p+"</CompleteMultipartUpload>",I=this.getBaseHeaders(r,a,t),this._promise=e.httpRequest({url:s+"?uploadId="+v,headers:I,method:"POST",body:p,timeout:0}),[4,this._promise.result()];case 11:return h=i.sent().status,this._promise=null,200===h||204===h?[2,{code:e.ErrorCode.SUCCESS,data:{uniqueName:a.fileName,uploadMethod:e.UploadMethod.MINIO}}]:[2,{code:e.ErrorCode.UPLOAD_FAIL,msg:"end upload fail"}]}}))}))},r.prototype.requestUploadPart=function(t,n,r,a,s,d,u,c){return void 0===u&&(u=1),void 0===c&&(c=0),o(this,void 0,void 0,(function(){var o,l,v,f,g,T,S,p,I;return i(this,(function(i){switch(i.label){case 0:if(c>=5)return[2,{code:e.ErrorCode.UPLOAD_FAIL,msg:"Upload retry times exceeded 5. Procedure"}];o=(u-1)*e.UPLOAD_FILE_CHUNK_SIZE,l=Math.min(e.UPLOAD_FILE_CHUNK_SIZE,n.size-o),v="partNumber="+u+"&uploadId="+r,i.label=1;case 1:return i.trys.push([1,3,,4]),[4,this._getFileToken(s.fileType,a,"PUT",v,void 0,Ti(n.size))];case 2:return f=i.sent(),[3,4];case 3:return[2,{code:i.sent()}];case 4:return g=n.slice(o,u*e.UPLOAD_FILE_CHUNK_SIZE),T=this.getBaseHeaders(n,f,s),this._promise=e.httpRequest({url:t+"?"+v,headers:T,method:"PUT",body:g,timeout:0,onProgress:function(e){var t;return null===(t=null==s?void 0:s.onProgress)||void 0===t?void 0:t.call(s,o+e.loaded,n.size)}}),[4,this._promise.result()];case 5:return S=i.sent(),p=S.status,I=S.xhr,this._promise=null,200===p||204===p?(d.push((null==I?void 0:I.getResponseHeader("ETag"))||""),o+l<n.size?[2,this.requestUploadPart(t,n,r,a,s,d,u+1,0)]:[2,{code:e.ErrorCode.SUCCESS}]):[2,this.requestUploadPart(t,n,r,a,s,d,u,c+1)]}}))}))},r.prototype.getBaseHeaders=function(e,t,n){return{"Content-Disposition":(n.contentDisposition||("text/html"===e.type?"inline":"attachment"))+"; filename="+encodeURIComponent(e.name)+";",Authorization:t.minioAuthorization,"x-amz-content-sha256":t.minioContentSha256,"x-amz-date":t.minioDate,"Content-Type":e.type||"text/plain"}},r.prototype._abortHandler=function(){var e;null===(e=this._promise)||void 0===e||e.abort()},r}(gi),Ei=function(t){function r(){var e=null!==t&&t.apply(this,arguments)||this;return e.isSupportMultipart=!0,e._promise=null,e}return n(r,t),r.prototype.commonUpload=function(t){return o(this,void 0,void 0,(function(){var n,r,o,a,s,d,u,c,l,v,f;return i(this,(function(i){switch(i.label){case 0:n=t.file,r=t.onProgress,o=t.fileType,i.label=1;case 1:return i.trys.push([1,3,,4]),[4,this._getFileToken(o,n.name)];case 2:return a=i.sent(),[3,4];case 3:return[2,{code:i.sent()}];case 4:return s={},(d=new FormData).set("token",a.token),d.set("key",a.fileName),d.set("file",n),u=e.fixUrlProtocol(this._url),this._promise=e.httpRequest({url:u,headers:s,onProgress:function(e){return null==r?void 0:r(e.loaded,e.total)},method:"POST",body:d,timeout:0}),[4,this._promise.result()];case 5:return c=i.sent(),l=c.status,v=c.data,this._promise=null,200!==l&&204!==l||!v?[2,{code:e.ErrorCode.UPLOAD_FAIL,msg:l.toString()}]:(f=JSON.parse(v),[2,{code:e.ErrorCode.SUCCESS,data:{uniqueName:f.rc_url.file_name,downloadUrl:u+"/"+f.rc_url.path}}])}}))}))},r.prototype.multipartUpload=function(t){return o(this,void 0,void 0,(function(){var n,r,o,a,s;return i(this,(function(i){switch(i.label){case 0:n=t.file,r=t.onProgress,o=t.fileType,a=e.getUUID(),i.label=1;case 1:return i.trys.push([1,3,,4]),[4,this._getFileToken(o,n.name)];case 2:return s=i.sent(),[3,4];case 3:return[2,{code:i.sent()}];case 4:return[2,this._requestUploadPart(a,n,s.token,r)]}}))}))},r.prototype._requestUploadPart=function(t,n,r,a,s){return void 0===s&&(s=0),o(this,void 0,void 0,(function(){var o,d,u,c,l,v,f,g,T,S;return i(this,(function(i){switch(i.label){case 0:return o=Math.min(e.UPLOAD_FILE_CHUNK_SIZE,n.size-s),d=t+n.name.substring(n.name.lastIndexOf(".")),u={Range:"bytes="+s+"-"+(s+o),"X-File-TransactionId":d,"X-File-Total-Size":n.size.toString()},c=n.slice(s,s+o),(l=new FormData).set("file",c,n.name),l.set("key",d),l.set("name",d),l.set("token",r),v=e.fixUrlProtocol(this._url),this._promise=e.httpRequest({url:v,headers:u,onProgress:function(e){return null==a?void 0:a(s+e.loaded,n.size)},method:"POST",body:l,timeout:0}),[4,this._promise.result()];case 1:return f=i.sent(),g=f.status,T=f.data,this._promise=null,200===g||204===g?s+o<n.size?[2,this._requestUploadPart(t,n,r,a,s+o)]:(S=JSON.parse(T),[2,{code:e.ErrorCode.SUCCESS,data:{uniqueName:S.rc_url.file_name,downloadUrl:v+"/"+S.rc_url.path}}]):[2,{code:e.ErrorCode.UPLOAD_FAIL,msg:g.toString()}]}}))}))},r.prototype._abortHandler=function(){var e;null===(e=this._promise)||void 0===e||e.abort()},r}(gi),Ri=function(t){function r(){var e=null!==t&&t.apply(this,arguments)||this;return e._promise=null,e}return n(r,t),r.prototype.commonUpload=function(t){return o(this,void 0,void 0,(function(){var n,r,o,a,s,d,u,c,l,v;return i(this,(function(i){switch(i.label){case 0:n=t.file,r=t.onProgress,o=t.fileType,a=t.contentDisposition,i.label=1;case 1:return i.trys.push([1,3,,4]),[4,this._getFileToken(o,n.name,void 0,void 0,void 0,Ti(n.size))];case 2:return s=i.sent(),[3,4];case 3:return[2,{code:i.sent()}];case 4:return d={},u=e.fixUrlProtocol(s.s3BucketName+"."+this._url),c=new FormData,a?c.set("Content-Disposition",a):c.set("Content-Disposition","text/html"===n.type?"inline;":"attachment;"),c.set("Content-Type",n.type),c.set("x-amz-credential",s.s3Credential),c.set("x-amz-algorithm",s.s3Algorithm),c.set("x-amz-date",s.s3Date),c.set("policy",s.s3Policy),c.set("x-amz-signature",s.s3Signature),c.set("key",s.fileName),c.set("file",n),this._promise=e.httpRequest({url:u,headers:d,onProgress:function(e){return null==r?void 0:r(e.loaded,e.total)},method:"POST",body:c,timeout:0}),[4,this._promise.result()];case 5:return l=i.sent(),v=l.status,this._promise=null,200===v||204===v?[2,{code:e.ErrorCode.SUCCESS,data:{uniqueName:s.fileName,uploadMethod:e.UploadMethod.AWS}}]:[2,{code:e.ErrorCode.UPLOAD_FAIL,msg:v.toString()}]}}))}))},r.prototype.multipartUpload=function(e){throw new Error("Method not implemented.")},r.prototype._abortHandler=function(){var e;null===(e=this._promise)||void 0===e||e.abort()},r}(gi),Ci=function(t){function r(){var e=null!==t&&t.apply(this,arguments)||this;return e._promise=null,e.isSupportMultipart=!0,e}return n(r,t),r.prototype.commonUpload=function(t){return o(this,void 0,void 0,(function(){var n,r,o,a,s,d,u;return i(this,(function(i){switch(i.label){case 0:n=t.file,r=t.onProgress,o=t.fileType,i.label=1;case 1:return i.trys.push([1,3,,4]),[4,this._getFileToken(o)];case 2:return a=i.sent(),[3,4];case 3:return[2,{code:i.sent()}];case 4:return s=e.fixUrlProtocol(this._url+"/"+a.stcBucketName+"/"+a.fileName),d=this.getBaseHeaders(n,a,t),this._promise=e.httpRequest({url:s,headers:d,onProgress:function(e){return null==r?void 0:r(e.loaded,e.total)},method:"PUT",body:n,timeout:0}),[4,this._promise.result()];case 5:return u=i.sent().status,this._promise=null,200===u||204===u?[2,{code:e.ErrorCode.SUCCESS,data:{uniqueName:a.fileName,uploadMethod:e.UploadMethod.STC}}]:[2,{code:e.ErrorCode.UPLOAD_FAIL}]}}))}))},r.prototype.multipartUpload=function(t){var n;return o(this,void 0,void 0,(function(){var r,o,a,s,d,u,c,l,v,f,g,T,S,p,I,h;return i(this,(function(i){switch(i.label){case 0:r=t.file,o=t.fileType,i.label=1;case 1:return i.trys.push([1,3,,4]),[4,this._getFileToken(o,r.name,"POST","uploads")];case 2:return a=i.sent(),[3,4];case 3:return[2,{code:i.sent()}];case 4:return s=e.fixUrlProtocol(this._url+"/"+a.stcBucketName+"/"+a.fileName),d=this.getBaseHeaders(r,a,t),this._promise=e.httpRequest({url:s+"?uploads",headers:d,method:"POST"}),[4,this._promise.result()];case 5:return u=i.sent(),c=u.status,l=u.data,this._promise=null,v=null===(n=null==l?void 0:l.match(/(?:<UploadId>)(\S*?)(?:<\/UploadId>)/))||void 0===n?void 0:n[1],200!==c&&204!==c||!v?[2,{code:e.ErrorCode.UPLOAD_FAIL,msg:"start upload fail"}]:(f=[],[4,this.requestUploadPart(s,r,v,a.fileName,t,f)]);case 6:if(g=i.sent(),T=g.code,S=g.msg,T!==e.ErrorCode.SUCCESS)return[2,{code:T,msg:S}];i.label=7;case 7:return i.trys.push([7,9,,10]),[4,this._getFileToken(o,a.fileName,"POST","uploadId="+v)];case 8:return a=i.sent(),[3,10];case 9:return[2,{code:i.sent()}];case 10:return p=f.map((function(e,t){return"<Part><PartNumber>"+(t+1)+"</PartNumber><ETag>"+e+"</ETag></Part>"})).join(""),p="<CompleteMultipartUpload xmlns='http://s3.amazonaws.com/doc/2006-03-01/'>"+p+"</CompleteMultipartUpload>",I=this.getBaseHeaders(r,a,t),this._promise=e.httpRequest({url:s+"?uploadId="+v,headers:I,method:"POST",body:p}),[4,this._promise.result()];case 11:return h=i.sent().status,this._promise=null,200===h||204===h?[2,{code:e.ErrorCode.SUCCESS,data:{uniqueName:a.fileName,uploadMethod:e.UploadMethod.STC}}]:[2,{code:e.ErrorCode.UPLOAD_FAIL,msg:"end upload fail"}]}}))}))},r.prototype.requestUploadPart=function(t,n,r,a,s,d,u,c){return void 0===u&&(u=1),void 0===c&&(c=0),o(this,void 0,void 0,(function(){var o,l,v,f,g,T,S,p,I;return i(this,(function(i){switch(i.label){case 0:if(c>=5)return[2,{code:e.ErrorCode.UPLOAD_FAIL,msg:"Upload retry times exceeded 5. Procedure"}];o=(u-1)*e.UPLOAD_FILE_CHUNK_SIZE,l=Math.min(e.UPLOAD_FILE_CHUNK_SIZE,n.size-o),v="partNumber="+u+"&uploadId="+r,i.label=1;case 1:return i.trys.push([1,3,,4]),[4,this._getFileToken(s.fileType,a,"PUT",v)];case 2:return f=i.sent(),[3,4];case 3:return[2,{code:i.sent()}];case 4:return g=n.slice(o,u*e.UPLOAD_FILE_CHUNK_SIZE),T=this.getBaseHeaders(n,f,s),this._promise=e.httpRequest({url:t+"?"+v,headers:T,method:"PUT",body:g,onProgress:function(e){var t;return null===(t=null==s?void 0:s.onProgress)||void 0===t?void 0:t.call(s,o+e.loaded,n.size)},timeout:0}),[4,this._promise.result()];case 5:return S=i.sent(),p=S.status,I=S.xhr,this._promise=null,200===p||204===p?(d.push((null==I?void 0:I.getResponseHeader("ETag"))||""),o+l<n.size?[2,this.requestUploadPart(t,n,r,a,s,d,u+1,0)]:[2,{code:e.ErrorCode.SUCCESS}]):[2,this.requestUploadPart(t,n,r,a,s,d,u,c+1)]}}))}))},r.prototype.getBaseHeaders=function(e,t,n){return{"Content-Disposition":(n.contentDisposition||("text/html"===e.type?"inline":"attachment"))+"; filename="+encodeURIComponent(e.name)+";",Authorization:t.stcAuthorization,"x-amz-content-sha256":t.stcContentSha256,"x-amz-date":t.stcDate,"Content-Type":e.type||"text/plain"}},r.prototype._abortHandler=function(){var e;null===(e=this._promise)||void 0===e||e.abort()},r}(gi);var mi=((Si={})[Zo.QINIU]=pi,Si[Zo.ALIYUN]=Ii,Si[Zo.BAIDU]=hi,Si[Zo.S3]=Ri,Si[Zo.STC]=Ci,Si[Zo.MINIO]=_i,Si[Zo.RCX]=Ei,Si);function yi(t,n,o,i){var a=document.createElement("canvas"),s=a.getContext("2d"),d=new Image;d.onload=function(n){var u=i||{},c=u.maxHeight,l=void 0===c?160:c,v=u.maxWidth,f=void 0===v?160:v,g=u.quality,T=void 0===g?1:g,S=u.scale,p=void 0===S?1:S,I=Ni(d.width,d.height,{maxHeight:l,maxWidth:f,scale:p});a.width=Math.min(I.w,f),a.height=Math.min(I.h,l),s.drawImage(d,I.x,I.y,I.w,I.h);var h=Ai(a,T);h=h.replace(/data:image\/[^;]+;base64,/,""),t({code:e.ErrorCode.SUCCESS,data:r(r({},o),{thumbnail:h,width:I.w,height:I.h})})},d.onerror=function(n){t({code:e.ErrorCode.UPLOAD_FAIL,msg:"get image info fail:"+JSON.stringify(n)})},d.src=(window.URL||window.webkitURL).createObjectURL(n)}function Ai(t,n){var r=t.toDataURL("image/jpeg",n);return r.length>e.MAX_MESSAGE_CONTENT_BYTES-10240?Ai(t,n-.1):r}var Ni=function(e,t,n){var r,o,i=n.maxHeight,a=void 0===i?160:i,s=n.maxWidth,d=void 0===s?160:s,u=n.scale,c=e<t,l=0,v=0;return(c?t/e:e/t)>(void 0===u?1:u)?(c?(r=160,(o=t/(e/160))>a&&(v=(o-a)/2)):(o=160,(r=e/(t/160))>d&&(l=(r-d)/2)),{w:r,h:o,x:-l,y:-v}):(c?(o=a,r=e/(t/a)):(r=d,o=t/(e/d)),{w:r,h:o,x:-l,y:-v})},Oi=0,Ui=function(){function t(e,t){this._client=null,this.id=++Oi,this._promise=this._handleUpload(e,t)}return t.prototype.abort=function(){var t;this._resolve({code:e.ErrorCode.UPLOAD_FAIL,msg:"upload abort"}),null===(t=this._client)||void 0===t||t.abort()},t.prototype._uploadInLoop=function(t,n,r,a,s){return void 0===s&&(s=[]),o(this,void 0,void 0,(function(){var o,d,u,c,l,v;return i(this,(function(i){switch(i.label){case 0:o=0,i.label=1;case 1:return o<t.length?(d=t[o],this._client=new mi[d.type](d.url,r,a),[4,this._client.upload(n)]):[3,4];case 2:if(u=i.sent(),c=u.code,l=u.data,v=u.msg,c===e.ErrorCode.SUCCESS)return[2,{code:c,data:l}];if(c===e.ErrorCode.RC_FILE_SIZE_EXCEED_LIMIT)return[2,{code:c,msg:"File size exceeds the limit"}];if(c===e.ErrorCode.INVALID_PARAMETER_SIZE_NOT_FOUND)return[2,{code:c,msg:"File size not found"}];if(this._client.isAbort())return this._client=null,[2,{code:c,data:l,msg:v}];this._client=null,s.push({type:d.type,url:d.url,code:c,msg:v}),i.label=3;case 3:return o++,[3,1];case 4:return[2,{code:e.ErrorCode.UPLOAD_FAIL,msg:"Failed to upload all channels, msg: "+JSON.stringify(s)}]}}))}))},t.prototype._handleUpload=function(t,n){return o(this,void 0,void 0,(function(){var a=this;return i(this,(function(s){return[2,new Promise((function(s){return o(a,void 0,void 0,(function(){var o,a,d,u,c,l,v,f,g,T,S,p,I,h,_,E,R,C,m;return i(this,(function(i){switch(i.label){case 0:return this._resolve=s,o=n.getFileToken,a=n.serverType,d=n.customDomain,u=n.ossConfig,c=n.uploadServer,l=n.bosAddr,v=t.file,f=t.fileType,g=t.thumbnailConfig,T=function(e,t,n,r,o){if(n)return[{type:Zo.RCX,url:n,p:"1"}];if(e)return JSON.parse(e).map((function(e){var t={type:Zo.QINIU,url:"",p:""};return Object.keys(e).forEach((function(n){"p"===n?t.p=e[n]:(t.type=n,t.url=e[n])})),t})).sort((function(e,t){return e.p-t.p}));var i=[];return r&&i.push({type:Zo.QINIU,url:r,p:"1"}),o&&i.push({type:Zo.BAIDU,url:o,p:"2"}),i}(u,0,d,c,l),0===T.length?(s({code:e.ErrorCode.INVALID_PARAMETER_MEDIA_URL,msg:"uploadUrlList is empty"}),[2]):[4,this._uploadInLoop(T,t,o,a)];case 1:if(S=i.sent(),p=S.code,I=S.data,h=S.msg,p!==e.ErrorCode.SUCCESS||!I)return s({code:p,msg:h}),[2];if(_=I.downloadUrl)return[3,5];i.label=2;case 2:return i.trys.push([2,4,,5]),[4,n.getFileUrl(f,I.uniqueName,v.name,void 0,I.uploadMethod)];case 3:return E=i.sent(),_=E.downloadUrl,[3,5];case 4:return R=i.sent(),s({code:R,msg:"Get download url fail"}),[3,5];case 5:return _?(C={downloadUrl:_,uniqueName:(null==I?void 0:I.uniqueName)||"",name:v.name,size:v.size,type:v.type},f!==e.FileType.AUDIO?[3,7]:[4,v.arrayBuffer()]):(s({code:e.ErrorCode.UPLOAD_FAIL,msg:"Get download url fail"}),[2]);case 6:return m=i.sent(),function(t,n,o){(new AudioContext).decodeAudioData(n,(function(n){t({code:e.ErrorCode.SUCCESS,data:r(r({},o),{duration:n.duration,length:n.length})})}),(function(n){t({code:e.ErrorCode.UPLOAD_FAIL,msg:"get audio info fail:"+JSON.stringify(n)})}))}(s,m,C),[2];case 7:return f===e.FileType.IMAGE?(yi(s,v,C,g),[2]):(s({code:p,data:C}),[2])}}))}))}))]}))}))},t.prototype.awaitResult=function(){return o(this,void 0,void 0,(function(){return i(this,(function(e){return[2,this._promise]}))}))},t}(),Mi={};function wi(e,t){var n=new Ui(e,t);return function(e){o(this,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return Mi[e.id]=e,[4,e.awaitResult()];case 1:return t.sent(),delete Mi[e.id],[2]}}))}))}(n),n}function Pi(e){var t=Mi[e];return!!t&&(t.abort(),!0)}var Li=function(e,t){var n=e.getNaviInfoFromCache();return{getFileToken:e.getFileToken.bind(e),getFileUrl:e.getFileUrl.bind(e),customDomain:t.uploadDomain||"",serverType:null==n?void 0:n.type,ossConfig:null==n?void 0:n.ossConfig,uploadServer:null==n?void 0:n.uploadServer,bosAddr:null==n?void 0:n.bosAddr}};function bi(t){return o(this,void 0,void 0,(function(){var n,r,a;return i(this,(function(s){return n=t.contentDisposition,r=t.fileType,a=t.file,[2,new e.ValidatorManage("","").validate("contentDisposition",n,(function(e){return"inline"===e||"attachment"===e}),!1).validate("fileType",r,(function(t){return!!e.FileType[t]}),!0).validate("file",a,(function(t){return t instanceof File&&(!(r===e.FileType.IMAGE&&!t.type.match(/^image\//))&&!(r===e.FileType.AUDIO&&!t.type.match(/^audio\//)))}),!0).ifReady((function(e,n,r){return function(e,t){return o(this,void 0,void 0,(function(){return i(this,(function(n){return[2,new Ui(e,t).awaitResult()]}))}))}(t,Li(e,r))}))]}))}))}function xi(t,n,a){return o(this,void 0,void 0,(function(){var s=this;return i(this,(function(d){return[2,new e.ValidatorManage(e.LogTagId.A_SEND_MSG_T,e.LogTagId.A_SEND_MSG_R).validate("message",n,(function(){return n instanceof Xo}),!0).validate("conversation",t,e.AssertRules.OBJECT,!0).validate("conversationType",null==t?void 0:t.conversationType,e.AssertRules.CONVERSATION_TYPE,!0).validate("targetId",null==t?void 0:t.targetId,e.AssertRules.STRING,!0).validate("channelId",null==t?void 0:t.channelId,e.AssertRules.CHANNEL_ID).validate("isStatusMessage",null==a?void 0:a.isStatusMessage,e.AssertRules.BOOLEAN).validate("disableNotification",null==a?void 0:a.disableNotification,e.AssertRules.BOOLEAN).validate("pushContent",null==a?void 0:a.pushContent,e.AssertRules.STRING).validate("pushData",null==a?void 0:a.pushData,e.AssertRules.STRING).validate("isMentioned",null==a?void 0:a.isMentioned,e.AssertRules.BOOLEAN).validate("mentionedType",null==a?void 0:a.mentionedType,e.AssertRules.NUMBER).validate("mentionedUserIdList",null==a?void 0:a.mentionedUserIdList,e.isLimitedArray({itemValidator:e.isValidTargetId})).validate("directionalUserIdList",null==a?void 0:a.directionalUserIdList,e.isLimitedArray({maxLength:300,itemValidator:e.isValidTargetId})).validate("isVoipPush",null==a?void 0:a.isVoipPush,e.AssertRules.BOOLEAN).validate("canIncludeExpansion",null==a?void 0:a.canIncludeExpansion,e.AssertRules.BOOLEAN).validate("expansion",null==a?void 0:a.expansion,e.AssertRules.OBJECT).validate("pushConfig",null==a?void 0:a.pushConfig,e.AssertRules.OBJECT).validate("messageId",null==a?void 0:a.messageId,e.AssertRules.NUMBER).ifReady((function(d,u){return o(s,void 0,void 0,(function(){var o,s,c,l,v,f,g,T,S,p,I,h,_,E,R,C,m,y,A,N,O;return i(this,(function(i){switch(i.label){case 0:return s=(o=a||{}).disableNotification,c=o.isMentioned,l=o.directionalUserIdList,v=o.canIncludeExpansion,f=o.onSendBefore,g=o.expansion,T=o.pushConfig,S=o.isStatusMessage,p=u.createTraceId(),I=t.conversationType,h=t.targetId,_=t.channelId,l&&l.length>0&&![3,10].includes(I)?[2,{code:e.ErrorCode.RC_DIRECTIONAL_MESSAGE_INVALID_CONVERSATION_TYPE}]:(E=function(e,t,n){var o=e.isStatusMessage,i=e.disableNotification,a=e.pushContent,s=e.pushData,d=e.isMentioned,u=e.mentionedType,c=e.mentionedUserIdList,l=e.directionalUserIdList,v=e.isVoipPush,f=e.canIncludeExpansion,g=e.expansion,T=e.isFilerWhiteBlacklist,S=e.pushConfig,p=e.messageId,I=n.channelId;return r({isStatusMessage:o,disableNotification:i,pushContent:a,pushData:s,isMentioned:d,mentionedType:u,mentionedUserIdList:c,directionalUserIdList:l,isVoipPush:v,canIncludeExpansion:f,expansion:g,isFilerWhiteBlacklist:T,pushConfig:S,channelId:I||"",messageId:p},t)}(a||{},n,t),R={isMentioned:!!c,content:n.content,messageType:n.messageType,isPersited:!!n.isPersited,isCounted:!!n.isCounted,disableNotification:!!s,canIncludeExpansion:!!v,expansion:g||null,conversationType:t.conversationType,targetId:t.targetId,channelId:t.channelId,senderUserId:d.getCurrentUserId(),messageUId:"",messageDirection:e.MessageDirection.SEND,receivedTime:0,isStatusMessage:!!S,receivedStatus:e.ReceivedStatus.UNREAD,isOffLineMessage:!1,pushConfig:T,sentStatus:e.SentStatus.SENDING,sentTime:0,directedUserIds:l||[]},I!==e.ConversationType.ULTRA_GROUP&&(R.isOffLineMessage=!1),C=function(t){R.messageId=t;try{f&&f(W(R))}catch(t){u.error(e.LogTagId.A_SEND_MSG_T,'Callback method "onSendBefore" execution error.\n'+(null==t?void 0:t.stack),p)}},u.info(e.LogTagId.A_SEND_MSG_T,JSON.stringify({messageType:n.messageType,conversationType:I,targetId:h,channelId:_}),p),[4,d.sendMessage(I,h,E,C,p)]);case 1:return m=i.sent(),y=m.code,A=m.data,N=m.msg,y===e.ErrorCode.SUCCESS?(u.info(e.LogTagId.A_SEND_MSG_R,JSON.stringify({code:y,messageUId:A.messageUId,messageId:A.messageId}),p),O=W(A),[2,{code:y,data:O}]):(u.warn(e.LogTagId.A_SEND_MSG_R,JSON.stringify({code:y}),p),R.sentTime=(null==A?void 0:A.sentTime)||0,R.sentStatus=null==A?void 0:A.sentStatus,[2,{code:y,msg:N||Yo[y],data:W(R)}])}}))}))}))]}))}))}function Gi(t,n){return function(o,i,a,s){var d;if(!e.validate("sendOptions.contentDisposition",null==s?void 0:s.contentDisposition,(function(e){return["inline","attachment"].includes(e)})))return Promise.resolve({code:e.ErrorCode.INVALID_PARAMETER_SENDOPTIONS});var u={contentDisposition:null==s?void 0:s.contentDisposition};if(s&&"thumbnailConfig"in s){var c=null===(d=s)||void 0===d?void 0:d.thumbnailConfig;if(!(e.validate("sendOptions.maxHeight",null==c?void 0:c.maxHeight,e.AssertRules.NUMBER)&&e.validate("sendOptions.maxWidth",null==c?void 0:c.maxWidth,e.AssertRules.NUMBER)&&e.validate("sendOptions.quality",null==c?void 0:c.quality,e.AssertRules.NUMBER)&&e.validate("sendOptions.scale",null==c?void 0:c.scale,e.AssertRules.NUMBER)))return Promise.resolve({code:e.ErrorCode.INVALID_PARAMETER_SENDOPTIONS});u.thumbnailConfig=c}return ko((function(d,c,l){return new Promise((function(d){var l=c.createTraceId();c.info(e.LogTagId.L_MEDIA_UPLOAD_T,JSON.stringify({filesize:i.file.size,type:t}),l),bi({file:i.file,fileType:t,onProgress:function(e,t){var n;null===(n=null==a?void 0:a.onProgress)||void 0===n||n.call(a,Math.floor(e/t*100))},contentDisposition:u.contentDisposition,thumbnailConfig:u.thumbnailConfig}).then((function(t){var u,v=t.code,f=t.data,g=t.msg;if(v===e.ErrorCode.SUCCESS&&f){var T=(null===(u=null==a?void 0:a.onComplete)||void 0===u?void 0:u.call(a,r({url:f.downloadUrl},f)))||n(f,i);return c.info(e.LogTagId.L_MEDIA_UPLOAD_R,JSON.stringify({downurl:f.downloadUrl,code:e.ErrorCode.SUCCESS}),l),void xi(o,T,s).then(d)}d({code:v,msg:g})}))}))}))}}var Di=Gi(e.FileType.FILE,(function(e,t){var n,r,o={name:e.name,size:t.file.size,type:(n=e.name,r=n.match(/\.(\w+)$/),r?r[1]:"bin"),fileUrl:e.downloadUrl};return t.user&&(o.user=t.user),t.extra&&(o.extra=t.extra),t.mentionedInfo&&(o.mentionedInfo=t.mentionedInfo),new ii(o)})),Ji=Gi(e.FileType.IMAGE,(function(e,t){var n={content:e.thumbnail,imageUri:e.downloadUrl};return t.user&&(n.user=t.user),t.extra&&(n.extra=t.extra),t.mentionedInfo&&(n.mentionedInfo=t.mentionedInfo),t.audit&&(n.audit=t.audit),new $o(n)})),Vi=Gi(e.FileType.IMAGE,(function(e,t){var n={gifDataSize:e.size,remoteUrl:e.downloadUrl,width:e.width,height:e.height};return t.user&&(n.user=t.user),t.extra&&(n.extra=t.extra),t.mentionedInfo&&(n.mentionedInfo=t.mentionedInfo),t.audit&&(n.audit=t.audit),new ai(n)})),Bi=Gi(e.FileType.AUDIO,(function(e,t){var n={remoteUrl:e.downloadUrl,duration:e.duration,type:e.type};return t.user&&(n.user=t.user),t.extra&&(n.extra=t.extra),t.mentionedInfo&&(n.mentionedInfo=t.mentionedInfo),t.audit&&(n.audit=t.audit),new ei(n)})),ki=Gi(e.FileType.SIGHT,(function(e,t){var n={sightUrl:e.downloadUrl,content:t.thumbnail,duration:t.duration,size:t.file.size||e.size,name:t.name||e.name};return t.user&&(n.user=t.user),t.extra&&(n.extra=t.extra),t.mentionedInfo&&(n.mentionedInfo=t.mentionedInfo),t.audit&&(n.audit=t.audit),new ti(n)}));Gi(e.FileType.COMBINE_HTML,(function(e,t){var n={remoteUrl:e.downloadUrl,nameList:t.nameList,summaryList:t.summaryList,conversationType:t.conversationType};return t.user&&(n.user=t.user),t.extra&&(n.extra=t.extra),t.mentionedInfo&&(n.mentionedInfo=t.mentionedInfo),new ri(n)}));var Hi=function(t,n,r,a){return o(void 0,void 0,void 0,(function(){var o,s;return i(this,(function(i){switch(i.label){case 0:return!e.validate("messageList",a,e.AssertRules.OBJECT,!0)||Object.keys(a).some((function(t){return!e.validate(t,a[t],e.AssertRules.ARRAY)}))?[2,Promise.resolve({code:e.ErrorCode.MSG_LIMIT_ERROR})]:(o=[],Object.keys(a).forEach((function(e){a[e].forEach((function(e){-1===o.indexOf(e)&&o.push(e)}))})),o.length?[4,t.sendReadReceiptMessage(r.targetId,o,r.channelId)]:(n.warn(e.LogTagId.A_SEND_MSG_R,JSON.stringify({code:e.ErrorCode.MSG_LIMIT_ERROR,msg:"Error in parameter messageList."})),[2,Promise.resolve({code:e.ErrorCode.MSG_LIMIT_ERROR})]));case 1:return s=i.sent().code,[2,Promise.resolve({code:s})]}}))}))};var Fi=Object.freeze({__proto__:null,getAllConversationList:function(t){return o(this,void 0,void 0,(function(){var n=this;return i(this,(function(r){return e.usingCppEngine()?[2,new e.ValidatorManage(St,pt).validate("channelId",t,e.AssertRules.CHANNEL_ID).ifReady((function(r,a){return o(n,void 0,void 0,(function(){var n,o,s,d,u;return i(this,(function(i){switch(i.label){case 0:return n=a.createTraceId(),a.info(St,JSON.stringify({channelId:t}),n),e.isUndefined(t)?[4,r.getConversationListWithAllChannel()]:[3,2];case 1:return o=i.sent(),[3,4];case 2:return[4,r.getConversationList(void 0,void 0,void 0,void 0,t)];case 3:o=i.sent(),i.label=4;case 4:return s=o.code,d=o.data,a.info(pt,JSON.stringify({code:s,length:null==d?void 0:d.length}),n),s===e.ErrorCode.SUCCESS&&d?(u=d.map((function(e){return X(e)})),[2,{code:s,data:u}]):(a.warn(pt,JSON.stringify({code:s}),n),[2,{code:s,msg:Yo[s]}])}}))}))}))]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:Yo[e.ErrorCode.NOT_SUPPORT]}]}))}))},getConversationList:function(t,n,r,a){return o(this,void 0,void 0,(function(){var s=this;return i(this,(function(d){return e.usingCppEngine()?[2,new e.ValidatorManage(It,ht).validate("startTime",t,e.AssertRules.NUMBER,!0).validate("count",n,e.AssertRules.NUMBER,!0).validate("channelId",r,e.AssertRules.CHANNEL_ID).ifReady((function(d,u){return o(s,void 0,void 0,(function(){var o,s,c,l,v,f;return i(this,(function(i){switch(i.label){case 0:return o=u.createTraceId(),u.info(It,JSON.stringify({startTime:t,count:n,channelId:r}),o),e.isUndefined(r)?[4,d.getConversationListWithAllChannelByPage(t,n)]:[3,2];case 1:return s=i.sent(),[3,4];case 2:return c=[1,2,3,5,6,7,8],[4,d.getConversationsByPage(c,t,n,r,!!a)];case 3:s=i.sent(),i.label=4;case 4:return l=s.code,v=s.data,l===e.ErrorCode.SUCCESS&&v?(f=v.map((function(e){return X(e)})),u.info(ht,JSON.stringify({code:l,length:f.length}),o),[2,{code:l,data:f}]):(u.warn(ht,JSON.stringify({code:l}),o),[2,{code:l,msg:Yo[l]}])}}))}))}))]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:Yo[e.ErrorCode.NOT_SUPPORT]}]}))}))},searchConversationByContent:function(t,n,r){return o(this,void 0,void 0,(function(){var a=this;return i(this,(function(s){return e.usingCppEngine()?[2,new e.ValidatorManage(_t,Et).validate("keyword",t,e.AssertRules.STRING,!0).validate("messageTypes",n,(function(t){return!!e.isArray(t)&&!t.some((function(t){return!e.notEmptyString(t)}))}),!0).validate("channelId",r,e.AssertRules.CHANNEL_ID).ifReady((function(s,d){return o(a,void 0,void 0,(function(){var o,a,u,c,l;return i(this,(function(i){switch(i.label){case 0:return o=d.createTraceId(),d.info(_t,JSON.stringify({keyword:t,messageTypes:n,channelId:r}),o),e.isUndefined(r)?[4,s.searchConversationByContentWithAllChannel(t,n)]:[3,2];case 1:return a=i.sent(),[3,4];case 2:return[4,s.searchConversationByContent(t,n,r)];case 3:a=i.sent(),i.label=4;case 4:return u=a.code,c=a.data,u===e.ErrorCode.SUCCESS&&c?(l=c.map((function(e){return X(e)})),d.info(Et,JSON.stringify({code:u,length:l.length}),o),[2,{code:u,data:l}]):(d.warn(Et,JSON.stringify({code:u}),o),[2,{code:u,msg:Yo[u]}])}}))}))}))]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:Yo[e.ErrorCode.NOT_SUPPORT]}]}))}))},getConversations:function(t){return o(this,void 0,void 0,(function(){var n=this;return i(this,(function(r){return e.usingCppEngine()?[2,new e.ValidatorManage(Rt,Ct).validate("conversationList",t,e.isLimitedArray({maxLength:100,minLength:1,itemValidator:function(t){return e.isValidConversation(t,[e.ConversationType.PRIVATE,e.ConversationType.GROUP,e.ConversationType.SYSTEM])}}),!0).ifReady((function(r,a){return o(n,void 0,void 0,(function(){var n,o,s,d,u;return i(this,(function(i){switch(i.label){case 0:return n=a.createTraceId(),a.info(Rt,JSON.stringify({conversations:t}),n),[4,r.getConversations(t)];case 1:return o=i.sent(),s=o.code,d=o.data,s===e.ErrorCode.SUCCESS&&d?(u=d.map((function(e){return X(e)})),a.info(Ct,JSON.stringify({code:s,length:u.length}),n),[2,{code:s,data:u}]):(a.warn(Ct,JSON.stringify({code:s}),n),[2,{code:s,msg:Yo[s]}])}}))}))}))]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:Yo[e.ErrorCode.NOT_SUPPORT]}]}))}))},searchMessages:function(t,n,r,a,s){return o(this,void 0,void 0,(function(){var d=this;return i(this,(function(u){return e.usingCppEngine()?[2,new e.ValidatorManage(mt,yt).validate("conversation",t,e.AssertRules.OBJECT,!0).validate("conversationType",null==t?void 0:t.conversationType,e.AssertRules.CONVERSATION_TYPE,!0).validate("targetId",null==t?void 0:t.targetId,e.AssertRules.STRING,!0).validate("channelId",null==t?void 0:t.channelId,e.AssertRules.CHANNEL_ID).validate("keyword",n,e.AssertRules.STRING,!0).validate("startTime",r,e.AssertRules.NUMBER,!0).validate("count",a,e.AssertRules.NUMBER,!0).validate("messageTypes",s,e.isLimitedArray({itemValidator:e.notEmptyString})).ifReady((function(u,c){return o(d,void 0,void 0,(function(){var o,d,l,v,f,g,T,S,p,I,h;return i(this,(function(i){switch(i.label){case 0:return o=t.targetId,d=t.conversationType,l=t.channelId,v=c.createTraceId(),c.info(mt,JSON.stringify({targetId:o,conversationType:d,channelId:l,keyword:n,startTime:r,count:a}),v),s?[4,u.searchMessageByContentAndMessageType(d,o,n,r,a,s,l)]:[3,2];case 1:return f=i.sent(),[3,6];case 2:return e.isUndefined(l)?[4,u.searchMessageByContentWithAllChannel(d,o,n,r,a)]:[3,4];case 3:return f=i.sent(),[3,6];case 4:return[4,u.searchMessageByContent(d,o,n,r,a,0,l)];case 5:f=i.sent(),i.label=6;case 6:return g=f.code,T=f.data,g===e.ErrorCode.SUCCESS&&T?(S=T.messages,p=T.count,I=[],h=S.map((function(e){return I.push(e.messageUId),W(e)})),c.info(yt,JSON.stringify({code:g,list:I}),v),[2,{code:g,data:{messages:h,count:p}}]):(c.warn(yt,JSON.stringify({code:g}),v),[2,{code:g,msg:Yo[g]}])}}))}))}))]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:Yo[e.ErrorCode.NOT_SUPPORT]}]}))}))},searchMessageInTimeRange:function(t,n){return o(this,void 0,void 0,(function(){var r=this;return i(this,(function(a){return e.usingCppEngine()?[2,new e.ValidatorManage(At,Nt).validate("conversation",t,e.AssertRules.OBJECT,!0).validate("conversationType",null==t?void 0:t.conversationType,e.AssertRules.CONVERSATION_TYPE,!0).validate("targetId",null==t?void 0:t.targetId,e.AssertRules.STRING,!0).validate("startTime",null==n?void 0:n.startTime,e.AssertRules.NUMBER,!0).validate("endTime",null==n?void 0:n.endTime,e.AssertRules.NUMBER,!0).validate("offset",null==n?void 0:n.offset,e.AssertRules.NUMBER).validate("limit",null==n?void 0:n.limit,e.AssertRules.NUMBER).validate("keyword",null==n?void 0:n.keyword,e.AssertRules.STRING,!0).ifReady((function(a,s){return o(r,void 0,void 0,(function(){var r,o,d,u,c,l,v,f,g,T,S;return i(this,(function(i){switch(i.label){case 0:return r=t.conversationType,o=t.targetId,d=n.keyword,u=n.startTime,c=n.endTime,l=n.offset,v=n.limit,l=l||0,v=v||5,f=s.createTraceId(),s.info(At,JSON.stringify({targetId:o,conversationType:r,keyword:d,startTime:u,endTime:c,offset:l,limit:v}),f),[4,a.searchMessageByContentInTimeRangeWithAllChannel(r,o,d,u,c,l,v)];case 1:return g=i.sent(),T=g.code,S=g.data,T===e.ErrorCode.SUCCESS&&S?[2,{code:T,data:{messages:S.messages.map((function(e){return W(e)}))}}]:(s.warn(Nt,JSON.stringify({code:T}),f),[2,{code:T}])}}))}))}))]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:Yo[e.ErrorCode.NOT_SUPPORT]}]}))}))},searchMessagesByUser:function(t,n,r,a){return o(this,void 0,void 0,(function(){var s=this;return i(this,(function(d){return e.usingCppEngine()?[2,new e.ValidatorManage(Ot,Ut).validate("conversation",t,e.AssertRules.OBJECT,!0).validate("conversationType",null==t?void 0:t.conversationType,e.AssertRules.CONVERSATION_TYPE,!0).validate("targetId",null==t?void 0:t.targetId,e.AssertRules.STRING,!0).validate("channelId",null==t?void 0:t.channelId,e.AssertRules.CHANNEL_ID).validate("userId",n,e.AssertRules.STRING,!0).validate("startTime",r,e.AssertRules.NUMBER,!0).validate("count",a,e.AssertRules.NUMBER,!0).ifReady((function(d,u){return o(s,void 0,void 0,(function(){var o,s,c,l,v,f,g;return i(this,(function(i){switch(i.label){case 0:return o=t.conversationType,s=t.targetId,c=t.channelId,l=u.createTraceId(),u.info(Ot,JSON.stringify({targetId:s,conversationType:o,channelId:c,startTime:r,userId:n,count:a}),l),[4,d.searchMessagesByUser(o,s,n,r,a,c)];case 1:return v=i.sent(),f=v.code,g=v.data,f===e.ErrorCode.SUCCESS&&g?[2,{code:f,data:{messages:g.messages.map((function(e){return W(e)}))}}]:(u.warn(Ut,JSON.stringify({code:f})),[2,{code:f}])}}))}))}))]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:Yo[e.ErrorCode.NOT_SUPPORT]}]}))}))},getHistoryMessagesByMessageTypes:function(t,n){return o(this,void 0,void 0,(function(){var r=this;return i(this,(function(a){return e.usingCppEngine()?[2,new e.ValidatorManage(Mt,wt).validate("conversation",t,e.AssertRules.OBJECT,!0).validate("conversationType",null==t?void 0:t.conversationType,e.AssertRules.CONVERSATION_TYPE,!0).validate("targetId",null==t?void 0:t.targetId,e.AssertRules.STRING,!0).validate("channelId",null==t?void 0:t.channelId,e.AssertRules.CHANNEL_ID).validate("count",null==n?void 0:n.count,e.AssertRules.NUMBER).validate("count",null==n?void 0:n.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})).validate("timestamp",null==n?void 0:n.timestamp,e.AssertRules.NUMBER).validate("order",null==n?void 0:n.order,(function(e){return[0,1].includes(e)})).validate("messageTypes",null==n?void 0:n.messageTypes,(function(t){return!!e.isArray(t)&&!t.some((function(t){return!e.notEmptyString(t)}))}),!0).ifReady((function(a,s){return o(r,void 0,void 0,(function(){var r,o,d,u,c,l,v,f,g,T,S,p,I,h,_,E,R,C,m;return i(this,(function(i){switch(i.label){case 0:return r=n.count,o=void 0===r?20:r,d=n.timestamp,u=void 0===d?0:d,c=n.order,l=void 0===c?0:c,v=n.messageTypes,f=t.conversationType,g=t.targetId,T=t.channelId,S=void 0===T?"":T,p=s.createTraceId(),s.info(Mt,JSON.stringify({targetId:g,conversationType:f,channelId:S,count:o,timestamp:u,messageTypes:v}),p),[4,a.getHistoryMessagesByObjectNames(f,g,u,o,v,l,S)];case 1:return I=i.sent(),h=I.code,_=I.data,h===e.ErrorCode.SUCCESS?(R=(E=_).list,C=E.hasMore,m=R.map((function(e){return W(e)})),[2,{code:h,data:{messages:m,hasMore:C,list:m}}]):(s.warn(wt,JSON.stringify({code:h})),[2,{code:h,msg:Yo[h]}])}}))}))}))]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:Yo[e.ErrorCode.NOT_SUPPORT]}]}))}))},getContinuousMessages:function(t,n){return o(this,void 0,void 0,(function(){var r=this;return i(this,(function(a){return e.usingCppEngine()?[2,new e.ValidatorManage(Pt,Lt).validate("conversation",t,e.AssertRules.OBJECT,!0).validate("conversationType",null==t?void 0:t.conversationType,e.AssertRules.CONVERSATION_TYPE,!0).validate("targetId",null==t?void 0:t.targetId,e.AssertRules.STRING,!0).validate("channelId",null==t?void 0:t.channelId,e.AssertRules.CHANNEL_ID).validate("timestamp",null==n?void 0:n.timestamp,e.AssertRules.NUMBER).validate("count",null==n?void 0:n.count,e.AssertRules.NUMBER).validate("count",null==n?void 0:n.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})).validate("order",null==n?void 0:n.order,(function(e){return 0===e||1===e})).ifReady((function(a,s){return o(r,void 0,void 0,(function(){var r,o,d,u,c,l,v,f,g,T,S,p,I,h,_;return i(this,(function(i){switch(i.label){case 0:return r=n.count,o=n.timestamp,d=n.order,u=t.conversationType,c=t.targetId,l=t.channelId,v=s.createTraceId(),s.info(Pt,JSON.stringify({targetId:c,conversationType:u,channelId:l,count:r,timestamp:o}),v),(a.getNaviInfoFromCache()||{}).historyMsg?[4,a.getContinuousMessages(u,c,o||0,r||20,d||0,l||"")]:[2,{code:e.ErrorCode.MESSAGE_STORAGE_SERVICE_UNAVAILABLE}];case 1:return f=i.sent(),g=f.code,T=f.data,g===e.ErrorCode.SUCCESS?(p=(S=T).list,I=S.timestamp,h=S.hasMore,_=p.map((function(e){return W(e)})),[2,{code:g,data:{list:_,timestamp:I,hasMore:h}}]):(s.warn(Lt,JSON.stringify({code:g})),[2,{code:g,msg:Yo[g]}])}}))}))}))]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:Yo[e.ErrorCode.NOT_SUPPORT]}]}))}))},setMessageStatusToRead:function(t,n){return o(this,void 0,void 0,(function(){var r=this;return i(this,(function(a){return e.usingCppEngine()?[2,new e.ValidatorManage(bt,xt).validate("conversation",t,e.AssertRules.OBJECT,!0).validate("conversationType",null==t?void 0:t.conversationType,e.AssertRules.CONVERSATION_TYPE,!0).validate("targetId",null==t?void 0:t.targetId,e.AssertRules.STRING,!0).validate("channelId",null==t?void 0:t.channelId,e.AssertRules.CHANNEL_ID).validate("timestamp",n,e.AssertRules.NUMBER,!0).ifReady((function(e,a){return o(r,void 0,void 0,(function(){var r,o,s,d,u;return i(this,(function(i){switch(i.label){case 0:return r=t.conversationType,o=t.targetId,s=t.channelId,d=a.createTraceId(),a.info(bt,JSON.stringify({targetId:o,conversationType:r,channelId:s,timestamp:n}),d),[4,e.setMessageStatusToRead(r,o,n,s)];case 1:return u=i.sent(),a.info(xt,JSON.stringify(u),d),[2,u]}}))}))}))]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:Yo[e.ErrorCode.NOT_SUPPORT]}]}))}))},setMessageReceivedStatus:function(t,n){return o(this,void 0,void 0,(function(){var r=this;return i(this,(function(a){return console.warn("`setMessageReceivedStatus` has being deprecated, use `setMessageReceivedStatusInfo` instead."),e.usingCppEngine()?[2,new e.ValidatorManage(Gt,Dt).validate("messageId",t,e.AssertRules.NUMBER,!0).validate("receivedStatus",n,(function(t){return!e.isUndefined(e.ReceivedStatus[t])}),!0).ifReady((function(e,a){return o(r,void 0,void 0,(function(){var r,o;return i(this,(function(i){switch(i.label){case 0:return r=a.createTraceId(),a.info(Gt,JSON.stringify({messageId:t,receivedStatus:n}),r),[4,e.setMessageReceivedStatus(t,n)];case 1:return o=i.sent(),a.info(Dt,JSON.stringify({code:o}),r),[2,{code:o}]}}))}))}))]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:Yo[e.ErrorCode.NOT_SUPPORT]}]}))}))},setMessageReceivedStatusInfo:function(t,n){return o(this,void 0,void 0,(function(){var r=this;return i(this,(function(a){return e.usingCppEngine()?[2,new e.ValidatorManage(Bt,kt).validate("messageId",t,e.AssertRules.NUMBER,!0).validate("receivedStatusInfo",n,e.AssertRules.OBJECT,!0).validate("receivedStatusInfo",null==n?void 0:n.isRead,e.AssertRules.BOOLEAN).validate("receivedStatusInfo",null==n?void 0:n.isListened,e.AssertRules.BOOLEAN).validate("receivedStatusInfo",null==n?void 0:n.isDownload,e.AssertRules.BOOLEAN).validate("receivedStatusInfo",null==n?void 0:n.isRetrieved,e.AssertRules.BOOLEAN).ifReady((function(a,s){return o(r,void 0,void 0,(function(){var r,o,d;return i(this,(function(i){switch(i.label){case 0:return r=e.transformReceivedStatusFlag(n),o=s.createTraceId(),s.info(Bt,JSON.stringify({messageId:t,sentStatus:r}),o),[4,a.setMessageReceivedStatus(t,r)];case 1:return d=i.sent(),s.info(kt,JSON.stringify({code:d}),o),[2,{code:d}]}}))}))}))]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:Yo[e.ErrorCode.NOT_SUPPORT]}]}))}))},setMessageSentStatus:function(t,n){return o(this,void 0,void 0,(function(){var r=this;return i(this,(function(a){return e.usingCppEngine()?[2,new e.ValidatorManage(Jt,Jt).validate("messageId",t,e.AssertRules.NUMBER,!0).validate("sentStatus",n,(function(t){return!e.isUndefined(e.SentStatus[t])}),!0).ifReady((function(e,a){return o(r,void 0,void 0,(function(){var r,o;return i(this,(function(i){switch(i.label){case 0:return r=a.createTraceId(),a.info(Jt,JSON.stringify({messageId:t,sentStatus:n}),r),[4,e.setMessageSentStatus(t,n)];case 1:return o=i.sent(),a.info(Vt,JSON.stringify({code:o}),r),[2,{code:o}]}}))}))}))]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:Yo[e.ErrorCode.NOT_SUPPORT]}]}))}))},setMessageContent:function(t,n,r){return void 0===r&&(r=""),o(this,void 0,void 0,(function(){var a=this;return i(this,(function(s){return e.usingCppEngine()?[2,new e.ValidatorManage(Ht,Ft).validate("messageId",t,e.AssertRules.NUMBER,!0).validate("content",n,e.AssertRules.OBJECT,!0).validate("messageType",r,e.AssertRules.ONLY_STRING,!0).ifReady((function(e,s){return o(a,void 0,void 0,(function(){var o,a;return i(this,(function(i){switch(i.label){case 0:return o=s.createTraceId(),s.info(Ht,JSON.stringify({messageId:t,messageType:r}),o),[4,e.setMessageContent(t,n,r)];case 1:return a=i.sent(),s.info(Ft,JSON.stringify({code:a}),o),[2,{code:a}]}}))}))}))]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:Yo[e.ErrorCode.NOT_SUPPORT]}]}))}))},deleteMessages:function(t){return o(this,void 0,void 0,(function(){var n=this;return i(this,(function(r){return e.usingCppEngine()?[2,new e.ValidatorManage(Yt,qt).validate("messageIds",t,(function(t){return!!e.isArray(t)&&!t.some((function(t){return!e.isNumber(t)}))}),!0).ifReady((function(e,r){return o(n,void 0,void 0,(function(){var n,o;return i(this,(function(i){switch(i.label){case 0:return n=r.createTraceId(),r.info(Yt,JSON.stringify({messageIds:t}),n),[4,e.deleteMessages(t)];case 1:return o=i.sent(),r.info(qt,JSON.stringify({code:o}),n),[2,{code:o}]}}))}))}))]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:Yo[e.ErrorCode.NOT_SUPPORT]}]}))}))},clearMessages:function(t){return o(this,void 0,void 0,(function(){var n=this;return i(this,(function(r){return e.usingCppEngine()?[2,new e.ValidatorManage(jt,Kt).validate("conversation",t,e.AssertRules.OBJECT,!0).validate("conversationType",null==t?void 0:t.conversationType,e.AssertRules.CONVERSATION_TYPE,!0).validate("targetId",null==t?void 0:t.targetId,e.AssertRules.STRING,!0).validate("channelId",null==t?void 0:t.channelId,e.AssertRules.CHANNEL_ID).ifReady((function(e,r){return o(n,void 0,void 0,(function(){var n,o,a,s,d;return i(this,(function(i){switch(i.label){case 0:return n=t.conversationType,o=t.targetId,a=t.channelId,s=r.createTraceId(),r.info(jt,JSON.stringify({conversationType:n,targetId:o,channelId:a}),s),[4,e.clearMessages(n,o,a)];case 1:return d=i.sent(),r.info(Kt,JSON.stringify({code:d}),s),[2,{code:d}]}}))}))}))]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:Yo[e.ErrorCode.NOT_SUPPORT]}]}))}))},deleteMessagesByTimestamp:function(t,n,r){return o(this,void 0,void 0,(function(){var a,s,d,u=this;return i(this,(function(c){return e.usingCppEngine()?(a=t.conversationType,s=t.targetId,d=t.channelId,[2,new e.ValidatorManage(zt,Wt).validate("conversation",t,e.AssertRules.OBJECT,!0).validate("conversationType",null==t?void 0:t.conversationType,e.AssertRules.CONVERSATION_TYPE,!0).validate("targetId",null==t?void 0:t.targetId,e.AssertRules.STRING,!0).validate("channelId",null==t?void 0:t.channelId,e.AssertRules.CHANNEL_ID).validate("timestamp",n,e.AssertRules.NUMBER,!0).validate("cleanSpace",r,e.AssertRules.BOOLEAN).ifReady((function(t,c){return o(u,void 0,void 0,(function(){var o,u,l;return i(this,(function(i){switch(i.label){case 0:return o=c.createTraceId(),c.info(zt,JSON.stringify({conversationType:a,targetId:s,channelId:d,timestamp:n,cleanSpace:r}),o),[4,t.deleteMessagesByTimestamp(a,s,n,r,d)];case 1:return u=i.sent(),l=u===e.ErrorCode.SUCCESS?"info":"warn",c[l](Wt,JSON.stringify({code:u}),o),[2,{code:u}]}}))}))}))]):[2,{code:e.ErrorCode.NOT_SUPPORT,msg:Yo[e.ErrorCode.NOT_SUPPORT]}]}))}))},batchClearMessagesByTimestamp:function(t){return o(this,void 0,void 0,(function(){var n=this;return i(this,(function(r){return e.usingCppEngine()?[2,new e.ValidatorManage(hn,_n).ifReady((function(r,a){return o(n,void 0,void 0,(function(){var n,o,s,d;return i(this,(function(i){switch(i.label){case 0:return n=function(t,n){if(!e.validate("options",t,e.AssertRules.ARRAY,!0)||!e.validate("options",t,(function(e){return!(t.length>20||0===t.length)||(n.error(_n,"conversations length should not be greater than 20 and not be equal to 0"),!1)}),!0))return e.ErrorCode.INVALID_PARAMETER_CLEAR_MESSAGE_OPTION_LIST;for(var r=0,o=t;r<o.length;r++){var i=o[r];if(!(e.validate("options",i,e.AssertRules.OBJECT,!0)&&e.validate("options.targetId",i.targetId,e.AssertRules.STRING,!0)&&e.validate("options.conversationType",i.conversationType,(function(t){var r=[e.ConversationType.PRIVATE,e.ConversationType.GROUP,e.ConversationType.CHATROOM,e.ConversationType.SYSTEM].includes(t);return r||n.error(_n,"conversations.conversationType is invalid, It should be one of the following values:\n ConversationType.PRIVATE,\n ConversationType.GROUP,\n ConversationType.CHATROOM,\n ConversationType.SYSTEM,\n "),r}),!0)&&e.validate("options.timestamp",i.timestamp,e.AssertRules.NUMBER,!0)&&e.validate("options.channelId",i.channelId,e.AssertRules.ONLY_STRING)))return e.ErrorCode.INVALID_PARAMETER_CLEAR_MESSAGE_OPTION_LIST}}(t,a),n?[2,{code:e.ErrorCode.INVALID_PARAMETER_CLEAR_MESSAGE_OPTION_LIST}]:(o=t.map((function(e){return{conversationType:e.conversationType,targetId:e.targetId,timestamp:e.timestamp,channelId:e.channelId||""}})),s=a.createTraceId(),a.info(hn,"options: "+JSON.stringify(o),s),[4,r.batchClearMessagesByTimestamp(o)]);case 1:return d=i.sent(),a[e.ErrorCode.SUCCESS===d?"info":"warn"](_n,"code: "+d,s),[2,{code:d}]}}))}))}))]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:Yo[e.ErrorCode.NOT_SUPPORT]}]}))}))},insertMessage:function(t,n,r){return void 0===r&&(r={}),o(this,void 0,void 0,(function(){var a=this;return i(this,(function(s){return e.usingCppEngine()?[2,new e.ValidatorManage(Xt,Qt).validate("conversation",t,e.AssertRules.OBJECT,!0).validate("conversationType",null==t?void 0:t.conversationType,e.AssertRules.CONVERSATION_TYPE,!0).validate("targetId",null==t?void 0:t.targetId,e.AssertRules.STRING,!0).validate("channelId",null==t?void 0:t.channelId,e.AssertRules.CHANNEL_ID).validate("userId",n,(function(t){return t instanceof Xo||e.validate("message.senderUserId",null==t?void 0:t.senderUserId,e.AssertRules.STRING,!0)}),!0).validate("messageType",null==n?void 0:n.messageType,e.AssertRules.STRING,!0).validate("content",null==n?void 0:n.content,e.AssertRules.OBJECT,!0).validate("messageDirection",n,(function(t){return t instanceof Xo||e.validate("message.messageDirection",null==t?void 0:t.messageDirection,e.AssertRules.NUMBER,!0)}),!0).validate("canIncludeExpansion",n,(function(t){return t instanceof Xo||e.validate("message.canIncludeExpansion",null==t?void 0:t.canIncludeExpansion,e.AssertRules.BOOLEAN)})).validate("expansion",n,(function(t){return t instanceof Xo||e.validate("message.expansion",null==t?void 0:t.expansion,e.AssertRules.OBJECT)})).validate("disableNotification",n,(function(t){return t instanceof Xo||e.validate("message.expansion",null==t?void 0:t.disableNotification,e.AssertRules.BOOLEAN)})).validate("timestamp",n,(function(t){return t instanceof Xo||e.validate("message.sentTime",null==t?void 0:t.sentTime,e.AssertRules.NUMBER)})).validate("sentStatus",n,(function(t){return t instanceof Xo||e.validate("message.sentStatus",null==t?void 0:t.sentStatus,e.AssertRules.NUMBER)})).validate("receivedStatus",n,(function(t){return t instanceof Xo||e.validate("message.receivedStatus",null==t?void 0:t.receivedStatus,e.AssertRules.NUMBER)})).validate("receivedStatusInfo",n,(function(t){return t instanceof Xo||e.validate("message.receivedStatusInfo",null==t?void 0:t.receivedStatusInfo,e.AssertRules.OBJECT)})).validate("directedUserIds",n,(function(t){return t instanceof Xo||!(null==t?void 0:t.directedUserIds)||!(!(null==t?void 0:t.directedUserIds)||!e.isArray(null==t?void 0:t.directedUserIds))&&(!t.directedUserIds.some((function(t){return!e.isString(t)}))&&t.directedUserIds.length<300)})).validate("searchContent",null==r?void 0:r.searchContent,e.AssertRules.STRING).ifReady((function(s,d){return o(a,void 0,void 0,(function(){var o,a,u,c,l,v,f,g,T,S,p,I,h,_,E,R,C,m,y,A;return i(this,(function(i){switch(i.label){case 0:return o="",a=1,v=!1,g=e.ReceivedStatus.UNREAD,p=n.messageType,I=n.content,n instanceof Xo||(o=n.senderUserId,a=n.messageDirection,v=n.canIncludeExpansion,f=n.expansion,l=n.disableNotification,u=n.sentTime,c=n.sentStatus,g=n.receivedStatus,T=n.receivedStatusInfo,S=n.directedUserIds),h=d.createTraceId(),d.info(Xt,JSON.stringify({conversationType:t.conversationType,targetId:t.targetId,messageType:p,sentTime:u}),h),_=r.isUnread,E=r.searchContent,R=g,T&&(R=e.transformReceivedStatusFlag(T)),C={senderUserId:o,messageType:p,content:I,messageDirection:a,sentTime:u,sentStatus:c,searchContent:E,isUnread:!!_,messageUId:"",disableNotification:l,canIncludeExpansion:v,expansionMsg:JSON.stringify(f),channelId:t.channelId||"",readStatus:R,directedUserIds:S},[4,s.insertMessage(t.conversationType,t.targetId,C)];case 1:return m=i.sent(),y=m.code,A=m.data,y===e.ErrorCode.SUCCESS?(d.info(Qt,JSON.stringify({code:y,messageId:null==A?void 0:A.messageId}),h),[2,{code:y,data:W(A)}]):(d.warn(Qt,JSON.stringify({code:y}),h),[2,{code:y,msg:Yo[y]}])}}))}))}))]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:Yo[e.ErrorCode.NOT_SUPPORT]}]}))}))},batchInsertMessage:function(t,n){return o(this,void 0,void 0,(function(){var r=this;return i(this,(function(a){return e.usingCppEngine()?[2,new e.ValidatorManage($t,$t).validate("messages",t,(function(t){var n,r,o,i;if(!e.validate("messages",t,e.AssertRules.ARRAY,!0))return!1;if(t.length<=0||t.length>=500)return!1;for(var a in t)if(!e.validate("message",t[a],e.AssertRules.OBJECT,!0)||!e.validate("message.conversationType",t[a].conversationType,(function(t){return[e.ConversationType.PRIVATE,e.ConversationType.DISCUSSION,e.ConversationType.GROUP,e.ConversationType.CUSTOMER_SERVICE,e.ConversationType.SYSTEM,e.ConversationType.APP_PUBLIC_SERVICE,e.ConversationType.PUBLIC_SERVICE].includes(t)}),!0)||!e.validate("message.targetId",t[a].targetId,e.AssertRules.STRING,!0)||!e.validate("message.senderUserId",t[a].senderUserId,e.AssertRules.STRING,!0)||!e.validate("message.messageType",t[a].messageType,e.AssertRules.STRING,!0)||!e.validate("message.content",t[a].content,e.AssertRules.OBJECT,!0)||!e.validate("message.messageDirection",t[a].messageDirection,e.AssertRules.NUMBER,!0)||!e.validate("message.canIncludeExpansion",t[a].canIncludeExpansion,e.AssertRules.BOOLEAN)||!e.validate("message.expansion",t[a].expansion,e.AssertRules.OBJECT)||!e.validate("message.disableNotification",t[a].disableNotification,e.AssertRules.BOOLEAN)||!e.validate("message.sentTime",t[a].sentTime,e.AssertRules.NUMBER)||!e.validate("message.sentStatus",t[a].sentStatus,e.AssertRules.NUMBER)||!e.validate("options.isUnread",null===(n=t[a])||void 0===n?void 0:n.isUnread,e.AssertRules.BOOLEAN)||!e.validate("options.searchContent",null===(r=t[a])||void 0===r?void 0:r.searchContent,e.AssertRules.STRING)||!e.validate("options.receivedStatus",null===(o=t[a])||void 0===o?void 0:o.receivedStatus,e.AssertRules.NUMBER)||!e.validate("options.receivedStatusInfo",null===(i=t[a])||void 0===i?void 0:i.receivedStatusInfo,e.AssertRules.OBJECT)||t[a].directedUserIds&&t[a].directedUserIds.some((function(t){return!e.validate("userId",t,e.AssertRules.STRING,!0)}))&&t[a].directedUserIds.length<300)return console.warn("then "+a+" index message validation failed"),!1;return!0}),!0).validate("checkDuplicate",n,e.AssertRules.BOOLEAN).ifReady((function(a,s){return o(r,void 0,void 0,(function(){var r,o,d,u;return i(this,(function(i){switch(i.label){case 0:return r=s.createTraceId(),s.info(Zt,JSON.stringify({checkDuplicate:n,length:t.length}),r),[4,a.batchInsertMessage(t,n)];case 1:return o=i.sent(),d=o.code,u=o.data,d===e.ErrorCode.SUCCESS?(s.info($t,JSON.stringify({code:d,data:u}),r),[2,{code:d,data:u}]):(s.warn($t,JSON.stringify({code:d}),r),[2,{code:d,msg:Yo[d]}])}}))}))}))]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:Yo[e.ErrorCode.NOT_SUPPORT]}]}))}))},getMessageCount:function(t){return o(this,void 0,void 0,(function(){var n=this;return i(this,(function(r){return e.usingCppEngine()?[2,new e.ValidatorManage(en,tn).validate("conversation",t,e.AssertRules.OBJECT,!0).validate("conversationType",null==t?void 0:t.conversationType,e.AssertRules.CONVERSATION_TYPE,!0).validate("targetId",null==t?void 0:t.targetId,e.AssertRules.STRING,!0).validate("channelId",null==t?void 0:t.channelId,e.AssertRules.CHANNEL_ID).ifReady((function(e,r){return o(n,void 0,void 0,(function(){var n,o,a,s,d,u,c;return i(this,(function(i){switch(i.label){case 0:return n=t.conversationType,o=t.targetId,a=t.channelId,s=r.createTraceId(),r.info(en,JSON.stringify({conversationType:n,targetId:o,channelId:a}),s),[4,e.getMessageCount(n,o,a)];case 1:return d=i.sent(),u=d.code,c=d.data,r.info(tn,JSON.stringify({code:u,data:c}),s),[2,{code:u,data:c}]}}))}))}))]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:Yo[e.ErrorCode.NOT_SUPPORT]}]}))}))},getPrivateMessageDeliverTime:function(t){return o(this,void 0,void 0,(function(){var n=this;return i(this,(function(r){return e.usingCppEngine()?[2,new e.ValidatorManage(nn,rn).validate("messageUId",t,e.AssertRules.STRING,!0).ifReady((function(r,a){return o(n,void 0,void 0,(function(){var n,o,s,d;return i(this,(function(i){switch(i.label){case 0:return n=a.createTraceId(),a.info(nn,JSON.stringify({messageUId:t}),n),[4,r.getPrivateMessageDeliverTime(t)];case 1:return o=i.sent(),s=o.code,d=o.data,s===e.ErrorCode.SUCCESS?(a.info(rn,JSON.stringify({code:s,data:d}),n),[2,{code:s,data:d}]):(a.warn(rn,JSON.stringify({code:s}),n),[2,{code:s,msg:Yo[s]}])}}))}))}))]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:Yo[e.ErrorCode.NOT_SUPPORT]}]}))}))},getGroupMessageDeliverList:function(t,n){return o(this,void 0,void 0,(function(){var r=this;return i(this,(function(a){return e.usingCppEngine()?[2,new e.ValidatorManage(on,an).validate("targetId",t,e.AssertRules.STRING,!0).validate("messageUId",n,e.AssertRules.STRING,!0).ifReady((function(a,s){return o(r,void 0,void 0,(function(){var r,o,d,u,c;return i(this,(function(i){switch(i.label){case 0:return r=s.createTraceId(),s.info(on,JSON.stringify({targetId:t,messageUId:n}),r),[4,a.getGroupMessageDeliverList(t,n)];case 1:return o=i.sent(),d=o.code,u=o.data,c=d===e.ErrorCode.SUCCESS?"info":"warn",s[c](an,JSON.stringify({code:d}),r),d===e.ErrorCode.SUCCESS?[2,{code:d,data:u}]:[2,{code:d,msg:Yo[d]}]}}))}))}))]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:Yo[e.ErrorCode.NOT_SUPPORT]}]}))}))},setCheckDuplicateMessage:function(t){return o(this,void 0,void 0,(function(){var n=this;return i(this,(function(r){return e.usingCppEngine()?[2,new e.ValidatorManage(sn,dn).validate("checkDuplicate",t,e.AssertRules.BOOLEAN).ifReady((function(e,r){return o(n,void 0,void 0,(function(){var n,o,a,s;return i(this,(function(i){switch(i.label){case 0:return n=r.createTraceId(),r.info(sn,JSON.stringify({checkDuplicate:t}),n),[4,e.setCheckDuplicateMessage(!!t)];case 1:return o=i.sent(),a=o.code,s=o.data,r.info(dn,JSON.stringify({code:a,data:s}),n),[2,{code:a}]}}))}))}))]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:Yo[e.ErrorCode.NOT_SUPPORT]}]}))}))},setCheckChatRoomDuplicateMessage:function(t){return o(this,void 0,void 0,(function(){var n=this;return i(this,(function(r){return e.usingCppEngine()?[2,new e.ValidatorManage(un,cn).validate("checkDuplicate",t,e.AssertRules.BOOLEAN).ifReady((function(e,r){return o(n,void 0,void 0,(function(){var n,o,a,s;return i(this,(function(i){switch(i.label){case 0:return n=r.createTraceId(),r.info(un,JSON.stringify({checkDuplicate:t}),n),[4,e.setCheckChatRoomDuplicateMessage(!!t)];case 1:return o=i.sent(),a=o.code,s=o.data,r.info(cn,JSON.stringify({code:a,data:s}),n),[2,{code:a}]}}))}))}))]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:Yo[e.ErrorCode.NOT_SUPPORT]}]}))}))},getMessagesAroundTimestamp:function(t,n){return o(this,void 0,void 0,(function(){var r=this;return i(this,(function(a){return e.usingCppEngine()?[2,new e.ValidatorManage(ho,_o).validate("conversation",t,e.AssertRules.OBJECT,!0).validate("conversationType",null==t?void 0:t.conversationType,e.AssertRules.CONVERSATION_TYPE,!0).validate("targetId",null==t?void 0:t.targetId,e.isValidTargetId,!0).validate("channelId",null==t?void 0:t.channelId,e.AssertRules.CHANNEL_ID).validate("timestamp",null==n?void 0:n.timestamp,e.isInteger({min:0}),!0).validate("beforeCount",null==n?void 0:n.beforeCount,e.isInteger({min:0}),!0).validate("afterCount",null==n?void 0:n.afterCount,e.isInteger({min:0}),!0).ifReady((function(a,s){return o(r,void 0,void 0,(function(){var r,o,d,u,c,l,v;return i(this,(function(i){switch(i.label){case 0:return r=s.createTraceId(),s.info(ho,JSON.stringify({option:n,conversation:t}),r),o=n.timestamp,d=n.beforeCount,u=n.afterCount,[4,a.getMessagesByTimestamp(t,o,d,u)];case 1:return c=i.sent(),l=c.code,v=c.data,l===e.ErrorCode.SUCCESS?(s.info(_o,JSON.stringify({code:l,data:v}),r),[2,{code:l,data:null==v?void 0:v.map((function(e){return W(e)}))}]):(s.warn(_o,JSON.stringify({code:l}),r),[2,{code:l,msg:Yo[l]}])}}))}))}))]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:Yo[e.ErrorCode.NOT_SUPPORT]}]}))}))},clearLocalData:function(){return o(this,void 0,void 0,(function(){var t=this;return i(this,(function(n){return e.usingCppEngine()?[2,ko((function(n,r){return o(t,void 0,void 0,(function(){var t,o,a,s,d;return i(this,(function(i){switch(i.label){case 0:return t=r.createTraceId(),r.info(sn,"clearLocalData ->",t),[4,n.clearData()];case 1:return o=i.sent(),a=o.code,s=o.data,d=a===e.ErrorCode.SUCCESS?"info":"warn",r[d](dn,JSON.stringify({code:a}),t),[2,{code:a,data:s}]}}))}))}))]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:Yo[e.ErrorCode.NOT_SUPPORT]}]}))}))},enable:function(){return e.usingCppEngine()}});Object.defineProperty(exports,"AreaCode",{enumerable:!0,get:function(){return e.AreaCode}}),Object.defineProperty(exports,"ChatroomEntryType",{enumerable:!0,get:function(){return e.ChatroomEntryType}}),Object.defineProperty(exports,"ChatroomSyncStatusReason",{enumerable:!0,get:function(){return e.ChatroomSyncStatusReason}}),Object.defineProperty(exports,"ChatroomUserChangeType",{enumerable:!0,get:function(){return e.ChatroomUserChangeType}}),Object.defineProperty(exports,"ChrmMemBanType",{enumerable:!0,get:function(){return e.ChrmMemBanType}}),Object.defineProperty(exports,"ChrmMemOperateType",{enumerable:!0,get:function(){return e.ChrmMemOperateType}}),Object.defineProperty(exports,"ChrmSyncStatus",{enumerable:!0,get:function(){return e.ChrmSyncStatus}}),Object.defineProperty(exports,"ConnectionStatus",{enumerable:!0,get:function(){return e.ConnectionStatus}}),Object.defineProperty(exports,"ConversationType",{enumerable:!0,get:function(){return e.ConversationType}}),Object.defineProperty(exports,"ErrorCode",{enumerable:!0,get:function(){return e.ErrorCode}}),Object.defineProperty(exports,"FileType",{enumerable:!0,get:function(){return e.FileType}}),Object.defineProperty(exports,"InterruptionLevel",{enumerable:!0,get:function(){return e.InterruptionLevel}}),Object.defineProperty(exports,"LogL",{enumerable:!0,get:function(){return e.LogL}}),Object.defineProperty(exports,"LogLevel",{enumerable:!0,get:function(){return e.LogLevel}}),Object.defineProperty(exports,"MentionedType",{enumerable:!0,get:function(){return e.MentionedType}}),Object.defineProperty(exports,"MessageBlockSourceType",{enumerable:!0,get:function(){return e.MessageBlockSourceType}}),Object.defineProperty(exports,"MessageBlockType",{enumerable:!0,get:function(){return e.MessageBlockType}}),Object.defineProperty(exports,"MessageDirection",{enumerable:!0,get:function(){return e.MessageDirection}}),Object.defineProperty(exports,"NotificationLevel",{enumerable:!0,get:function(){return e.NotificationLevel}}),Object.defineProperty(exports,"NotificationStatus",{enumerable:!0,get:function(){return e.NotificationStatus}}),Object.defineProperty(exports,"OnlineStatus",{enumerable:!0,get:function(){return e.OnlineStatus}}),Object.defineProperty(exports,"OperateStatus",{enumerable:!0,get:function(){return e.OperateStatus}}),Object.defineProperty(exports,"PlatformInfo",{enumerable:!0,get:function(){return e.PlatformInfo}}),Object.defineProperty(exports,"PushImportanceHonor",{enumerable:!0,get:function(){return e.PushImportanceHonor}}),Object.defineProperty(exports,"RCConnectionStatus",{enumerable:!0,get:function(){return e.RCConnectionStatus}}),Object.defineProperty(exports,"ReceivedStatus",{enumerable:!0,get:function(){return e.ReceivedStatus}}),Object.defineProperty(exports,"SentStatus",{enumerable:!0,get:function(){return e.SentStatus}}),Object.defineProperty(exports,"SubscribeOperationType",{enumerable:!0,get:function(){return e.SubscribeOperationType}}),Object.defineProperty(exports,"SubscribeType",{enumerable:!0,get:function(){return e.SubscribeType}}),Object.defineProperty(exports,"UltraGroupChannelChangeType",{enumerable:!0,get:function(){return e.UltraGroupChannelChangeType}}),Object.defineProperty(exports,"UltraGroupChannelType",{enumerable:!0,get:function(){return e.UltraGroupChannelType}}),Object.defineProperty(exports,"UploadMethod",{enumerable:!0,get:function(){return e.UploadMethod}}),Object.defineProperty(exports,"UserProfileVisibility",{enumerable:!0,get:function(){return e.UserProfileVisibility}}),exports.BaseMessage=Xo,exports.CombineMessage=ri,exports.CombineV2Message=oi,exports.CommandMessage=li,exports.ConnectType={COMET:"comet",WEBSOCKET:"websocket"},exports.FileMessage=ii,exports.GIFMessage=ai,exports.GroupNotificationMessage=fi,exports.HQVoiceMessage=ei,exports.ImageMessage=$o,exports.InformationNotificationMessage=vi,exports.LocationMessage=di,exports.MessageType={TEXT:"RC:TxtMsg",VOICE:"RC:VcMsg",HQ_VOICE:"RC:HQVCMsg",IMAGE:"RC:ImgMsg",GIF:"RC:GIFMsg",RICH_CONTENT:"RC:ImgTextMsg",LOCATION:"RC:LBSMsg",FILE:"RC:FileMsg",SIGHT:"RC:SightMsg",COMBINE:"RC:CombineMsg",COMBINE_V2:"RC:CombineV2Msg",CHRM_KV_NOTIFY:"RC:chrmKVNotiMsg",LOG_COMMAND:"RC:LogCmdMsg",EXPANSION_NOTIFY:"RC:MsgExMsg",REFERENCE:"RC:ReferenceMsg",RECALL_MESSAGE_TYPE:"RC:RcCmd"},exports.ReferenceMessage=ui,exports.RichContentMessage=ci,exports.SightMessage=ti,exports.TextMessage=ni,exports.UploadTask=Ui,exports.VoiceMessage=si,exports.__addSDKVersion=function(t,n){e.VersionManage.add(t,n)},exports.addConversationsToTag=function(t,n){return o(this,void 0,void 0,(function(){var r=this;return i(this,(function(a){return[2,new e.ValidatorManage(pr,Ir).validate("tagId",t,e.AssertRules.STRING,!0).validate("conversations",n,(function(t){return!(!e.validate("conversations",t,e.AssertRules.ARRAY,!0)||t.length<=0)&&!t.some((function(t){return!e.validate("conversation",t,e.AssertRules.CONVERSATION,!0)}))}),!0).ifReady((function(a,s){return o(r,void 0,void 0,(function(){var r,o,d;return i(this,(function(i){switch(i.label){case 0:return r=s.createTraceId(),s.info(pr,JSON.stringify({conversations:n.map((function(e){return{conversationType:e.conversationType,targetId:e.targetId}})),tagId:t}),r),[4,a.addTagForConversations(t,n)];case 1:return o=i.sent().code,d=o===e.ErrorCode.SUCCESS?"info":"warn",s[d](Ir,JSON.stringify({code:o}),r),o===e.ErrorCode.SUCCESS?[2,{code:o}]:[2,{code:o,msg:Yo[o]}]}}))}))}))]}))}))},exports.addEventListener=function(e,t,n){Lo.on(e,t,n)},exports.addTag=function(t){return o(this,void 0,void 0,(function(){var n=this;return i(this,(function(r){return[2,new e.ValidatorManage(sr,dr).validate("tagId",null==t?void 0:t.tagId,e.AssertRules.STRING,!0).validate("tagId",null==t?void 0:t.tagId,(function(e){return!!e&&e.length<=10})).validate("tagName",null==t?void 0:t.tagName,e.AssertRules.STRING,!0).validate("tagName",null==t?void 0:t.tagName,(function(e){return!!e&&e.length<=15})).ifReady((function(r,a){return o(n,void 0,void 0,(function(){var n,o,s;return i(this,(function(i){switch(i.label){case 0:return n=a.createTraceId(),a.info(sr,JSON.stringify({tagId:t.tagId,tagName:t.tagName}),n),[4,r.createTag(t)];case 1:return o=i.sent().code,s=o===e.ErrorCode.SUCCESS?"info":"warn",a[s](dr,JSON.stringify({code:o}),n),o===e.ErrorCode.SUCCESS?[2,{code:o}]:[2,{code:o,msg:Yo[o]}]}}))}))}))]}))}))},exports.addToBlacklist=function(t){return o(this,void 0,void 0,(function(){var n=this;return i(this,(function(r){return[2,new e.ValidatorManage($,ee).validate("userId",t,e.AssertRules.STRING,!0).ifReady((function(r,a){return o(n,void 0,void 0,(function(){var n,o,s;return i(this,(function(i){switch(i.label){case 0:return n=a.createTraceId(),a.info($,JSON.stringify({userId:t}),n),[4,r.addToBlacklist(t)];case 1:return o=i.sent(),s=o===e.ErrorCode.SUCCESS?"info":"warn",a[s](ee,JSON.stringify({code:o}),n),[2,{code:o}]}}))}))}))]}))}))},exports.batchClearRemoteHistoryMessages=function(t,n){return o(this,void 0,void 0,(function(){var r=this;return i(this,(function(a){return[2,new e.ValidatorManage(pn,In).validate("clearMessageOption",t,(function(t){if(!e.validate("clearMessageOption",t,e.AssertRules.ARRAY,!0))return!1;if(t.length>20||0===t.length)return!1;for(var n=0,r=t;n<r.length;n++){var o=r[n];if(!(e.validate("options",o,e.AssertRules.OBJECT,!0)&&e.validate("options.targetId",o.targetId,e.AssertRules.STRING,!0)&&e.validate("options.conversationType",o.conversationType,(function(t){return[e.ConversationType.PRIVATE,e.ConversationType.GROUP,e.ConversationType.CHATROOM,e.ConversationType.SYSTEM].includes(t)}),!0)&&e.validate("options.timestamp",o.timestamp,e.AssertRules.NUMBER,!0)&&e.validate("options.channelId",o.channelId,e.AssertRules.ONLY_STRING)))return!1}return!0}),!0).ifReady((function(a,s){return o(r,void 0,void 0,(function(){var r,o,d;return i(this,(function(i){switch(i.label){case 0:return r=t.map((function(e){return{conversationType:e.conversationType,targetId:e.targetId,timestamp:e.timestamp,channelId:e.channelId||""}})),o=s.createTraceId(),s.info(pn,"options: "+JSON.stringify(r)+", isDeleteLocal: "+!!n,o),[4,a.batchClearRemoteHistoryMessages(r,!!n)];case 1:return d=i.sent(),s[e.ErrorCode.SUCCESS===d?"info":"warn"](In,"code: "+d,o),[2,{code:d}]}}))}))}))]}))}))},exports.batchGetMessageReadReceiptInfoV4=function(t,n){return o(this,void 0,void 0,(function(){var r=this;return i(this,(function(a){return[2,new e.ValidatorManage(e.LogTagId.A_BATCH_GET_MESSAGE_READ_RECEIPT_INFO_V4_T,e.LogTagId.A_BATCH_GET_MESSAGE_READ_RECEIPT_INFO_V4_R).validate("conversation",t,e.AssertRules.OBJECT,!0).validate("conversationType",null==t?void 0:t.conversationType,(function(t){return t===e.ConversationType.GROUP}),!0,"It should be ConversationType.GROUP").validate("targetId",null==t?void 0:t.targetId,e.AssertRules.STRING,!0).validate("channelId",null==t?void 0:t.channelId,e.AssertRules.CHANNEL_ID).validate("messageUId",n,(function(t){return!!e.validate("messageUIds",t,e.AssertRules.ARRAY,!0)&&!t.some((function(t){return!e.isString(t)}))}),!0).ifReady((function(a,s){return o(r,void 0,void 0,(function(){var r,o,d,u,c,l,v;return i(this,(function(i){switch(i.label){case 0:return r="conversationType:"+t.conversationType+",targetId:"+t.targetId+",\n channelId: "+t.channelId+", messageUid:"+n.toString(),o=s.createTraceId(),s.info(e.LogTagId.A_BATCH_GET_MESSAGE_READ_RECEIPT_INFO_V4_T,r,o),3!==(null==(d=a.getNaviInfoFromCache())?void 0:d.grpRRVer)?[2,{code:e.ErrorCode.READ_RECEIPT_V4_NOT_SUPPORT}]:[4,a.batchGetMessageReadReceiptInfoV4(t,n)];case 1:return u=i.sent(),c=u.code,l=u.msg,v=u.data,s[c===e.ErrorCode.SUCCESS?"info":"warn"](e.LogTagId.A_BATCH_GET_MESSAGE_READ_RECEIPT_INFO_V4_R,"code: "+c+", msg: "+l,o),c===e.ErrorCode.SUCCESS?[2,{code:c,data:v}]:[2,{code:c,msg:l}]}}))}))}))]}))}))},exports.batchRemoveConversation=function(t){return o(this,void 0,void 0,(function(){var n=this;return i(this,(function(r){return[2,new e.ValidatorManage(ln,vn).validate("conversations",t,(function(n){if(!e.validate("conversations",n,e.AssertRules.ARRAY,!0))return!1;if(n.length>20||0===n.length)return!1;for(var r=0,o=t;r<o.length;r++){var i=o[r];if(!(e.validate("conversations",i,e.AssertRules.OBJECT,!0)&&e.validate("conversations.targetId",i.targetId,e.AssertRules.STRING,!0)&&e.validate("conversations.conversationType",i.conversationType,(function(t){var n=[e.ConversationType.PRIVATE,e.ConversationType.GROUP,e.ConversationType.SYSTEM].includes(t);return n||console.warn(vn,"conversations.conversationType is invalid, It should be one of the following values:\n ConversationType.PRIVATE,\n ConversationType.GROUP,\n ConversationType.SYSTEM,\n "),n}),!0)&&e.validate("conversations.channelId",i.channelId,e.AssertRules.ONLY_STRING)))return!1}return!0}),!0).ifReady((function(r,a){return o(n,void 0,void 0,(function(){var n,o,s;return i(this,(function(i){switch(i.label){case 0:return n=t.map((function(e){return{conversationType:e.conversationType,targetId:e.targetId,channelId:e.channelId||""}})),o=a.createTraceId(),a.info(ln,"conversations: "+JSON.stringify(n),o),[4,r.batchRemoveConversation(n)];case 1:return s=i.sent(),a[e.ErrorCode.SUCCESS===s?"info":"warn"](vn,"code: "+s,o),[2,{code:s}]}}))}))}))]}))}))},exports.batchSetConversationNotificationLevel=function(t,n){return o(this,void 0,void 0,(function(){var r=this;return i(this,(function(a){return[2,new e.ValidatorManage(fn,gn).validate("conversations",t,(function(t){if(!e.validate("conversations",t,e.AssertRules.ARRAY,!0))return!1;if(t.length>20||0===t.length)return!1;for(var n=0,r=t;n<r.length;n++){var o=r[n];if(!(e.validate("conversations",o,e.AssertRules.OBJECT,!0)&&e.validate("conversations.targetId",o.targetId,e.AssertRules.STRING,!0)&&e.validate("conversations.conversationType",o.conversationType,(function(t){var n=[e.ConversationType.PRIVATE,e.ConversationType.GROUP,e.ConversationType.SYSTEM].includes(t);return n||console.warn(vn,"conversations.conversationType is invalid, It should be one of the following values:\n ConversationType.PRIVATE,\n ConversationType.GROUP,\n ConversationType.SYSTEM,\n "),n}),!0)&&e.validate("conversations.channelId",o.channelId,e.AssertRules.ONLY_STRING)))return!1}return!0}),!0).validate("notificationLevel",n,(function(e){return[-1,0,1,2,3,4,5].includes(e)}),!0).ifReady((function(a,s){return o(r,void 0,void 0,(function(){var r,o,d;return i(this,(function(i){switch(i.label){case 0:return r=t.map((function(e){return{conversationType:e.conversationType,targetId:e.targetId,channelId:e.channelId||""}})),o=s.createTraceId(),s.info(fn,"conversations: "+JSON.stringify(r),o),[4,a.batchSetConversationNotificationLevel(r,n)];case 1:return d=i.sent(),s[e.ErrorCode.SUCCESS===d?"info":"warn"](gn,"code: "+d,o),[2,{code:d}]}}))}))}))]}))}))},exports.batchSetConversationToTop=function(t,n,r){return o(this,void 0,void 0,(function(){var a=this;return i(this,(function(s){return[2,new e.ValidatorManage(Tn,Sn).validate("conversations",t,(function(t){if(!e.validate("conversations",t,e.AssertRules.ARRAY,!0))return!1;if(t.length>20||0===t.length)return!1;for(var n=0,r=t;n<r.length;n++){var o=r[n];if(!(e.validate("conversations",o,e.AssertRules.OBJECT,!0)&&e.validate("conversations.targetId",o.targetId,e.AssertRules.STRING,!0)&&e.validate("conversations.conversationType",o.conversationType,(function(t){var n=[e.ConversationType.PRIVATE,e.ConversationType.GROUP,e.ConversationType.SYSTEM].includes(t);return n||console.warn(vn,"conversations.conversationType is invalid, It should be one of the following values:\n ConversationType.PRIVATE,\n ConversationType.GROUP,\n ConversationType.SYSTEM,\n "),n}),!0)&&e.validate("conversations.channelId",o.channelId,e.AssertRules.ONLY_STRING)))return!1}return!0}),!0).validate("isTop",n,e.AssertRules.BOOLEAN,!0).ifReady((function(s,d){return o(a,void 0,void 0,(function(){var o,a,u;return i(this,(function(i){switch(i.label){case 0:return o=t.map((function(e){return{conversationType:e.conversationType,targetId:e.targetId,channelId:e.channelId||""}})),a=d.createTraceId(),d.info(Tn,"conversations: "+JSON.stringify(o),a),[4,s.batchSetConversationToTop(o,n,r)];case 1:return u=i.sent(),d[e.ErrorCode.SUCCESS===u?"info":"warn"](Sn,"code: "+u,a),[2,{code:u}]}}))}))}))]}))}))},exports.bindRTCRoomForChatroom=function(t){return o(this,void 0,void 0,(function(){var n=this;return i(this,(function(r){return[2,new e.ValidatorManage(Ne,Oe).validate("targetId",null==t?void 0:t.chatRoomId,e.AssertRules.STRING,!0).validate("rtcRoomId",null==t?void 0:t.rtcRoomId,e.AssertRules.STRING,!0).ifReady((function(r,a){return o(n,void 0,void 0,(function(){var n,o,s;return i(this,(function(i){switch(i.label){case 0:return n=a.createTraceId(),a.info(Ne,JSON.stringify({chatRoomId:t.chatRoomId,rtcRoomId:t.rtcRoomId}),n),[4,r.bindRTCRoomForChatroom(t)];case 1:return o=i.sent(),s=o===e.ErrorCode.SUCCESS?"info":"warn",a[s](Oe,JSON.stringify({code:o}),n),[2,{code:o,msg:Yo[o]}]}}))}))}))]}))}))},exports.clearAllMessagesUnreadStatus=function(){return o(this,void 0,void 0,(function(){var t=this;return i(this,(function(n){return[2,new e.ValidatorManage("","").ifReady((function(e,n){return o(t,void 0,void 0,(function(){var t;return i(this,(function(r){switch(r.label){case 0:return t=n.createTraceId(),n.info(Qe,"",t),[4,e.clearAllUnreadCount()];case 1:return[2,{code:r.sent()}]}}))}))}))]}))}))},exports.clearEventListeners=Ho,exports.clearHistoryMessages=function(t,n){return o(this,void 0,void 0,(function(){var r=this;return i(this,(function(a){return[2,new e.ValidatorManage(Nn,On).validate("conversation",t,e.AssertRules.OBJECT,!0).validate("conversationType",null==t?void 0:t.conversationType,e.AssertRules.CONVERSATION_TYPE,!0).validate("targetId",null==t?void 0:t.targetId,e.AssertRules.STRING,!0).validate("channelId",null==t?void 0:t.channelId,e.AssertRules.CHANNEL_ID).validate("timestamp",n,e.AssertRules.NUMBER,!0).ifReady((function(a,s){return o(r,void 0,void 0,(function(){var r,o,d;return i(this,(function(i){switch(i.label){case 0:return r=s.createTraceId(),s.info(Nn,JSON.stringify({targetId:t.targetId,conversationType:t.conversationType,channelId:t.channelId,timestamp:n}),r),[4,a.deleteRemoteMessageByTimestamp(t.conversationType,t.targetId,n,t.channelId)];case 1:return o=i.sent(),d=o===e.ErrorCode.SUCCESS?"info":"warn",s[d](On,JSON.stringify({code:o}),r),o!==e.ErrorCode.SUCCESS?[2,{code:o,msg:Yo[o]}]:[2,{code:e.ErrorCode.SUCCESS}]}}))}))}))]}))}))},exports.clearMessages=function(t){return o(this,void 0,void 0,(function(){var n=this;return i(this,(function(r){return Q("RongIMLib.clearMessages","RongIMLib.ElectronExtension.clearMessages"),e.usingCppEngine()?[2,new e.ValidatorManage(Kn,zn).validate("conversation",t,e.AssertRules.OBJECT,!0).validate("conversationType",null==t?void 0:t.conversationType,e.AssertRules.CONVERSATION_TYPE,!0).validate("targetId",null==t?void 0:t.targetId,e.AssertRules.STRING,!0).validate("channelId",null==t?void 0:t.channelId,e.AssertRules.CHANNEL_ID).ifReady((function(r,a){return o(n,void 0,void 0,(function(){var n,o,s,d,u,c;return i(this,(function(i){switch(i.label){case 0:return n=t.conversationType,o=t.targetId,s=t.channelId,d=a.createTraceId(),a.info(Kn,JSON.stringify({conversationType:n,targetId:o,channelId:s}),d),[4,r.clearMessages(n,o,s)];case 1:return u=i.sent(),c=u===e.ErrorCode.SUCCESS?"info":"warn",a[c](zn,JSON.stringify({code:u}),d),u===e.ErrorCode.SUCCESS?[2,{code:u}]:[2,{code:u,msg:Yo[u]}]}}))}))}))]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:Yo[e.ErrorCode.NOT_SUPPORT]}]}))}))},exports.clearMessagesUnreadStatus=function(t){return o(this,void 0,void 0,(function(){var n=this;return i(this,(function(r){return[2,new e.ValidatorManage(We,Xe).validate("conversation",t,e.AssertRules.OBJECT,!0).validate("conversationType",null==t?void 0:t.conversationType,e.AssertRules.CONVERSATION_TYPE,!0).validate("targetId",null==t?void 0:t.targetId,e.AssertRules.STRING,!0).validate("channelId",null==t?void 0:t.channelId,e.AssertRules.CHANNEL_ID).ifReady((function(r,a){return o(n,void 0,void 0,(function(){var n,o,s,d,u,c;return i(this,(function(i){switch(i.label){case 0:return n=t.conversationType,o=t.targetId,s=t.channelId,d=a.createTraceId(),a.info(We,JSON.stringify({conversationType:n,targetId:o,channelId:s}),d),[4,r.clearUnreadCount(n,o,s)];case 1:return u=i.sent(),c=u===e.ErrorCode.SUCCESS?"info":"warn",a[c](Xe,JSON.stringify({code:u}),d),u!==e.ErrorCode.SUCCESS?[2,{code:u,msg:Yo[u]}]:[2,{code:u}]}}))}))}))]}))}))},exports.clearTextMessageDraft=function(t){return o(this,void 0,void 0,(function(){var n=this;return i(this,(function(r){return[2,new e.ValidatorManage(ke,He).validate("conversation",t,e.AssertRules.OBJECT,!0).validate("conversationType",null==t?void 0:t.conversationType,e.AssertRules.CONVERSATION_TYPE,!0).validate("targetId",null==t?void 0:t.targetId,e.AssertRules.STRING,!0).validate("channelId",null==t?void 0:t.channelId,e.AssertRules.CHANNEL_ID).ifReady((function(r,a){return o(n,void 0,void 0,(function(){var n,o,s,d,u,c;return i(this,(function(i){switch(i.label){case 0:return n=t.conversationType,o=t.targetId,s=t.channelId,d=a.createTraceId(),a.info(ke,JSON.stringify({conversationType:n,targetId:o,channelId:s}),d),[4,r.clearConversationMessageDraft(n,o,s)];case 1:return u=i.sent(),c=u===e.ErrorCode.SUCCESS?"info":"warn",a[c](He,JSON.stringify({code:u}),d),u===e.ErrorCode.SUCCESS?[2,{code:u}]:[2,{code:u,msg:Yo[u]}]}}))}))}))]}))}))},exports.clearUnreadCountByTimestamp=function(t,n){return o(this,void 0,void 0,(function(){var r=this;return i(this,(function(a){return e.usingCppEngine()?[2,new e.ValidatorManage(Qn,Zn).validate("conversation",t,e.AssertRules.OBJECT,!0).validate("conversationType",null==t?void 0:t.conversationType,e.AssertRules.CONVERSATION_TYPE,!0).validate("targetId",null==t?void 0:t.targetId,e.AssertRules.STRING,!0).validate("channelId",null==t?void 0:t.channelId,e.AssertRules.CHANNEL_ID).validate("timestamp",n,e.AssertRules.NUMBER).ifReady((function(a,s){return o(r,void 0,void 0,(function(){var r,o,d,u,c,l;return i(this,(function(i){switch(i.label){case 0:return r=t.conversationType,o=t.targetId,d=t.channelId,u=s.createTraceId(),s.info(Qn,JSON.stringify({conversationType:r,targetId:o,channelId:d,timestamp:n}),u),[4,a.clearUnreadCountByTimestamp(r,o,n,d)];case 1:return c=i.sent(),l=c===e.ErrorCode.SUCCESS?"info":"warn",s[l](Zn,JSON.stringify({code:c}),u),c===e.ErrorCode.SUCCESS?[2,{code:c}]:[2,{code:c,msg:Yo[c]}]}}))}))}))]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:Yo[e.ErrorCode.NOT_SUPPORT]}]}))}))},exports.connect=function(t,n){return o(this,void 0,void 0,(function(){var r=this;return i(this,(function(a){return[2,new e.ValidatorManage(e.LogTagId.A_CONNECT_T,e.LogTagId.A_CONNECT_R).validate("token",t,e.AssertRules.STRING,!0).ifReady((function(a,s){return o(r,void 0,void 0,(function(){var r,o,d;return i(this,(function(i){switch(i.label){case 0:return r=s.createTraceId(),s.info(e.LogTagId.A_CONNECT_T,JSON.stringify({token:t,reconnectKickEnable:n}),r),[4,a.connect(t,!!n,r)];case 1:return o=i.sent(),d=o.code===e.ErrorCode.SUCCESS?"info":"warn",s[d](e.LogTagId.A_CONNECT_R,JSON.stringify({code:o.code,userId:o.userId}),r),o.code===e.ErrorCode.SUCCESS?[2,{code:o.code,data:{userId:o.userId}}]:[2,{code:o.code,msg:Yo[o.code]}]}}))}))}))]}))}))},exports.createUploadTask=function(t){return o(this,void 0,void 0,(function(){var n,r,o;return i(this,(function(i){return n=t.contentDisposition,r=t.fileType,o=t.file,[2,new e.ValidatorManage("","").validate("contentDisposition",n,(function(e){return"inline"===e||"attachment"===e}),!1).validate("fileType",r,(function(t){return!!e.FileType[t]}),!0).validate("file",o,(function(t){return t instanceof File&&(!(r===e.FileType.IMAGE&&!t.type.match(/^image\//))&&!(r===e.FileType.AUDIO&&!t.type.match(/^audio\//)))}),!0).ifReadySync((function(n,r,o){var i=wi(t,Li(n,o));return{code:e.ErrorCode.SUCCESS,data:i}}))]}))}))},exports.deleteLocalMessagesByTimestamp=function(t,n,r){return o(this,void 0,void 0,(function(){var a,s,d,u=this;return i(this,(function(c){return Q("RongIMLib.deleteLocalMessagesByTimestamp","RongIMLib.ElectronExtension.deleteMessagesByTimestamp"),e.usingCppEngine()?(a=t.conversationType,s=t.targetId,d=t.channelId,[2,new e.ValidatorManage(qn,jn).validate("conversation",t,e.AssertRules.OBJECT,!0).validate("conversationType",null==t?void 0:t.conversationType,e.AssertRules.CONVERSATION_TYPE,!0).validate("targetId",null==t?void 0:t.targetId,e.AssertRules.STRING,!0).validate("channelId",null==t?void 0:t.channelId,e.AssertRules.CHANNEL_ID).validate("timestamp",n,e.AssertRules.NUMBER,!0).validate("cleanSpace",r,e.AssertRules.BOOLEAN).ifReady((function(t,c){return o(u,void 0,void 0,(function(){var o,u,l;return i(this,(function(i){switch(i.label){case 0:return o=c.createTraceId(),c.info(qn,JSON.stringify({conversationType:a,targetId:s,channelId:d,timestamp:n,cleanSpace:r}),o),[4,t.deleteMessagesByTimestamp(a,s,n,r,d)];case 1:return u=i.sent(),c.debug(e.LogTagId.A_DELETE_MESSAGES_S,JSON.stringify({code:u,conversationType:a,targetId:s,channelId:d,timestamp:n})),l=u===e.ErrorCode.SUCCESS?"info":"warn",c[l](jn,JSON.stringify({code:u}),o),u===e.ErrorCode.SUCCESS?[2,{code:u}]:[2,{code:u,msg:Yo[u]}]}}))}))}))]):[2,{code:e.ErrorCode.NOT_SUPPORT,msg:Yo[e.ErrorCode.NOT_SUPPORT]}]}))}))},exports.deleteMessages=function(t,n){return o(this,void 0,void 0,(function(){var r=this;return i(this,(function(a){return[2,new e.ValidatorManage(yn,An).validate("conversation",t,e.AssertRules.OBJECT,!0).validate("conversationType",null==t?void 0:t.conversationType,e.AssertRules.CONVERSATION_TYPE,!0).validate("targetId",null==t?void 0:t.targetId,e.AssertRules.STRING,!0).validate("channelId",null==t?void 0:t.channelId,e.AssertRules.CHANNEL_ID).validate("messages",n,(function(t){return e.isArray(t)&&t.length}),!0).validate("messages",n,(function(t){return!(!t||!e.isArray(t))&&!t.some((function(t){return!e.isString(null==t?void 0:t.messageUId)||!e.isNumber(null==t?void 0:t.sentTime)||!e.validate("options.messageDirection",null==t?void 0:t.messageDirection,(function(e){return 1===e||2===e}),!0)}))}),!0).ifReady((function(a,s){return o(r,void 0,void 0,(function(){var r,o,d;return i(this,(function(i){switch(i.label){case 0:return r=s.createTraceId(),s.info(yn,JSON.stringify({targetId:t.targetId,conversationType:t.conversationType,channelId:t.channelId,messages:n.map((function(e){return e.messageUId}))}),r),[4,a.deleteRemoteMessage(t.conversationType,t.targetId,n,t.channelId)];case 1:return o=i.sent(),d=o===e.ErrorCode.SUCCESS?"info":"warn",s[d](An,JSON.stringify({code:o}),r),o!==e.ErrorCode.SUCCESS?[2,{code:o,msg:Yo[o]}]:[2,{code:e.ErrorCode.SUCCESS}]}}))}))}))]}))}))},exports.destroy=function(){return o(this,void 0,void 0,(function(){return i(this,(function(e){return Go?(Ho(),[2,Vo()]):[2]}))}))},exports.disconnect=function(t){return e.logger.info(e.LogTagId.A_DISCONNECT_O,{}),Bo((function(e){return e.disconnect(t)}))},exports.electronExtension=Fi,exports.forceRemoveChatRoomEntry=function(t,n){return o(this,void 0,void 0,(function(){var r=this;return i(this,(function(a){return[2,new e.ValidatorManage(he,_e).validate("targetId",t,e.AssertRules.STRING,!0).validate("key",null==n?void 0:n.key,e.AssertRules.STRING,!0).validate("isSendNotification",null==n?void 0:n.isSendNotification,e.AssertRules.BOOLEAN).validate("notificationExtra",null==n?void 0:n.notificationExtra,e.isLimitedString({maxLength:e.MAX_CHATROOM_NOTIFICATION_EXTRA_LENGTH})).ifReady((function(a,s){return o(r,void 0,void 0,(function(){var r,o,d;return i(this,(function(i){switch(i.label){case 0:return r=s.createTraceId(),s.info(he,JSON.stringify({chatroomId:t,key:n.key,isSendNotification:n.isSendNotification,notificationExtra:n.notificationExtra}),r),[4,a.forceRemoveChatroomEntry(t,n)];case 1:return o=i.sent(),d=o===e.ErrorCode.SUCCESS?"info":"warn",s[d](_e,JSON.stringify({code:o}),r),o!==e.ErrorCode.SUCCESS?[2,{code:o,msg:Yo[o]}]:[2,{code:o}]}}))}))}))]}))}))},exports.forceSetChatRoomEntry=function(t,n){return o(this,void 0,void 0,(function(){var r=this;return i(this,(function(a){return[2,new e.ValidatorManage(fe,ge).validate("targetId",t,e.AssertRules.STRING,!0).validate("key",null==n?void 0:n.key,e.AssertRules.STRING,!0).validate("value",null==n?void 0:n.value,e.AssertRules.STRING,!0).validate("isAutoDelete",null==n?void 0:n.isAutoDelete,e.AssertRules.BOOLEAN).validate("isSendNotification",null==n?void 0:n.isSendNotification,e.AssertRules.BOOLEAN).validate("notificationExtra",null==n?void 0:n.notificationExtra,e.isLimitedString({maxLength:e.MAX_CHATROOM_NOTIFICATION_EXTRA_LENGTH})).ifReady((function(a,s){return o(r,void 0,void 0,(function(){var r,o,d;return i(this,(function(i){switch(i.label){case 0:return r=s.createTraceId(),s.info(fe,JSON.stringify({chatroomId:t,key:n.key,value:n.value,isSendNotification:n.isSendNotification,isAutoDelete:n.isAutoDelete,notificationExtra:n.notificationExtra}),r),[4,a.forceSetChatroomEntry(t,n)];case 1:return o=i.sent(),d=o===e.ErrorCode.SUCCESS?"info":"warn",s[d](ge,JSON.stringify({code:o}),r),o!==e.ErrorCode.SUCCESS?[2,{code:o,msg:Yo[o]}]:[2,{code:o}]}}))}))}))]}))}))},exports.getAllChatRoomEntries=function(t){return o(this,void 0,void 0,(function(){var n=this;return i(this,(function(r){return[2,new e.ValidatorManage(Ce,me).validate("targetId",t,e.AssertRules.STRING,!0).ifReady((function(r,a){return o(n,void 0,void 0,(function(){var n,o,s,d;return i(this,(function(i){switch(i.label){case 0:return n=a.createTraceId(),a.info(Ce,JSON.stringify({chatroomId:t}),n),[4,r.getAllChatroomEntries(t)];case 1:return o=i.sent(),s=o.code,d=o.data,s===e.ErrorCode.SUCCESS&&d?(a.info(me,JSON.stringify({code:s,data:d}),n),[2,{code:s,data:d}]):(a.warn(me,JSON.stringify({code:s}),n),[2,{code:s,msg:Yo[s]}])}}))}))}))]}))}))},exports.getAllConversationState=function(){return o(this,void 0,void 0,(function(){var t=this;return i(this,(function(n){return[2,new e.ValidatorManage("","").ifReady((function(n,r){return o(t,void 0,void 0,(function(){var t,o,a,s,d;return i(this,(function(i){switch(i.label){case 0:return t=r.createTraceId(),r.info(Tt,"",t),[4,n.getAllConversationState()];case 1:return o=i.sent(),a=o.code,s=o.data,d=a===e.ErrorCode.SUCCESS?"info":"warn",r[d](nt,JSON.stringify({code:a}),t),a===e.ErrorCode.SUCCESS?[2,{code:a,data:s}]:[2,{code:a}]}}))}))}))]}))}))},exports.getAllUltraGroupUnreadCount=function(){return o(this,void 0,void 0,(function(){var t=this;return i(this,(function(n){return[2,new e.ValidatorManage(eo,to).ifReady((function(n,r){return o(t,void 0,void 0,(function(){var t,o,a,s,d;return i(this,(function(i){switch(i.label){case 0:return t=r.createTraceId(),r.info(eo,"getAllUltraGroupUnreadCount",t),[4,n.getAllUltraGroupUnreadCount()];case 1:return o=i.sent(),a=o.code,s=o.data,d=a===e.ErrorCode.SUCCESS?"info":"warn",r[d](to,JSON.stringify({code:a,data:s}),t),a===e.ErrorCode.SUCCESS?[2,{code:a,data:s}]:[2,{code:a,msg:Yo[a]}]}}))}))}))]}))}))},exports.getAllUltraGroupUnreadMentionedCount=function(){return o(this,void 0,void 0,(function(){var t=this;return i(this,(function(n){return[2,new e.ValidatorManage(no,ro).ifReady((function(n,r){return o(t,void 0,void 0,(function(){var t,o,a,s,d;return i(this,(function(i){switch(i.label){case 0:return t=r.createTraceId(),r.info(no,"getAllUltraGroupUnreadCount",t),[4,n.getAllUltraGroupUnreadCount(true)];case 1:return o=i.sent(),a=o.code,s=o.data,d=a===e.ErrorCode.SUCCESS?"info":"warn",r[d](ro,JSON.stringify({code:a,data:s}),t),a===e.ErrorCode.SUCCESS?[2,{code:a,data:s}]:[2,{code:a,msg:Yo[a]}]}}))}))}))]}))}))},exports.getAllUnreadMentionedCount=function(){return o(this,void 0,void 0,(function(){var t=this;return i(this,(function(n){return[2,new e.ValidatorManage("","").ifReady((function(n,r){return o(t,void 0,void 0,(function(){var t,o,a,s;return i(this,(function(i){switch(i.label){case 0:return t=r.createTraceId(),r.info(ft,"",t),[4,n.getAllUnreadMentionedCount()];case 1:return o=i.sent(),a=o.code,s=o.data,a===e.ErrorCode.SUCCESS?(r.warn(gt,JSON.stringify({code:a,data:s}),t),[2,{code:a,data:s}]):[2,{code:a}]}}))}))}))]}))}))},exports.getBlacklist=function(){return o(this,void 0,void 0,(function(){var t=this;return i(this,(function(n){return[2,new e.ValidatorManage(re,oe).ifReady((function(n,r){return o(t,void 0,void 0,(function(){var t,o,a,s;return i(this,(function(i){switch(i.label){case 0:return t=r.createTraceId(),r.info(re,"getBlacklist -> ",t),[4,n.getBlacklist()];case 1:return o=i.sent(),a=o.code,s=o.data,a===e.ErrorCode.SUCCESS&&s?(r.info(oe,JSON.stringify({code:a,data:s}),t),[2,{code:a,data:s}]):(r.warn(oe,JSON.stringify({code:a}),t),[2,{code:a}])}}))}))}))]}))}))},exports.getBlacklistStatus=function(t){return o(this,void 0,void 0,(function(){var n=this;return i(this,(function(r){return[2,new e.ValidatorManage(ie,ae).validate("userId",t,e.AssertRules.STRING,!0).ifReady((function(r,a){return o(n,void 0,void 0,(function(){var n,o,s,d;return i(this,(function(i){switch(i.label){case 0:return n=a.createTraceId(),a.info(ie,JSON.stringify({userId:t}),n),[4,r.getBlacklistStatus(t)];case 1:return o=i.sent(),s=o.code,d=o.data,s===e.ErrorCode.SUCCESS?(a.info(ae,JSON.stringify({code:s,data:0===d}),n),[2,{code:s,data:0===d}]):(a.warn(ae,JSON.stringify({code:s}),n),[2,{code:s}])}}))}))}))]}))}))},exports.getBlockUltraGroupList=function(){return o(this,void 0,void 0,(function(){var t=this;return i(this,(function(n){return[2,new e.ValidatorManage("","").ifReady((function(n,r){return o(t,void 0,void 0,(function(){var t,o,a,s;return i(this,(function(i){switch(i.label){case 0:return t=r.createTraceId(),r.info(Pr,"",t),[4,n.getBlockUltraGroupList()];case 1:return o=i.sent(),a=o.code,s=o.data,a===e.ErrorCode.SUCCESS?(r.info(Lr,JSON.stringify({code:a,length:null==s?void 0:s.length}),t),[2,{code:e.ErrorCode.SUCCESS,data:s}]):(r.warn(Lr,JSON.stringify({code:a}),t),[2,{code:a,msg:Yo[a]}])}}))}))}))]}))}))},exports.getBlockedConversationList=function(){return o(this,void 0,void 0,(function(){return i(this,(function(t){return[2,new e.ValidatorManage("","").ifReady((function(e){return e.getBlockConversationList()}))]}))}))},exports.getChatRoomEntry=function(t,n){return o(this,void 0,void 0,(function(){var r=this;return i(this,(function(a){return[2,new e.ValidatorManage(Ee,Re).validate("targetId",t,e.AssertRules.STRING,!0).validate("key",n,(function(t){return e.isString(t)&&/[\w+=-]+/.test(t)&&t.length<=128}),!0).ifReady((function(a,s){return o(r,void 0,void 0,(function(){var r,o,d,u;return i(this,(function(i){switch(i.label){case 0:return r=s.createTraceId(),s.info(Ee,JSON.stringify({chatroomId:t,key:n}),r),[4,a.getChatroomEntry(t,n)];case 1:return o=i.sent(),d=o.code,u=o.data,d===e.ErrorCode.SUCCESS&&u?(s.info(Re,JSON.stringify({code:d,data:u}),r),[2,{code:d,data:u}]):(s.warn(Re,JSON.stringify({code:d}),r),[2,{code:d,msg:Yo[d]}])}}))}))}))]}))}))},exports.getChatRoomInfo=function(t,n){return o(this,void 0,void 0,(function(){var r=this;return i(this,(function(a){return[2,new e.ValidatorManage(e.LogTagId.A_QUIT_CHATROOM_T,e.LogTagId.A_QUIT_CHATROOM_R).validate("targetId",t,e.AssertRules.STRING,!0).validate("count",null==n?void 0:n.count,e.AssertRules.NUMBER).validate("order",null==n?void 0:n.order,(function(e){return[0,1,2].includes(e)})).ifReady((function(a,s){return o(r,void 0,void 0,(function(){var r,o,d,u,c;return i(this,(function(i){switch(i.label){case 0:return r=s.createTraceId(),s.info(se,JSON.stringify({chatroomId:t,count:null==n?void 0:n.count,order:null==n?void 0:n.order}),r),[4,a.getChatroomInfo(t,null==n?void 0:n.count,null==n?void 0:n.order)];case 1:return o=i.sent(),d=o.code,u=o.data,c=d===e.ErrorCode.SUCCESS?"info":"warn",s[c](de,JSON.stringify({code:d}),r),d===e.ErrorCode.SUCCESS&&u?[2,{code:d,data:u}]:[2,{code:d,msg:Yo[d]}]}}))}))}))]}))}))},exports.getChatroomHistoryMessages=function(t,n){return o(this,void 0,void 0,(function(){var r=this;return i(this,(function(a){return[2,new e.ValidatorManage(ye,Ae).validate("targetId",t,e.AssertRules.STRING,!0).validate("timestamp",null==n?void 0:n.timestamp,e.AssertRules.NUMBER).validate("count",null==n?void 0:n.count,e.AssertRules.NUMBER).validate("count",null==n?void 0:n.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})).validate("order",null==n?void 0:n.order,(function(e){return 0===e||1===e})).ifReady((function(a,s){return o(r,void 0,void 0,(function(){var r,o,d,u,c,l;return i(this,(function(i){switch(i.label){case 0:return r=s.createTraceId(),s.info(ye,JSON.stringify({chatroomId:t,timestamp:n.timestamp,count:n.count,order:n.order}),r),[4,a.getChatRoomHistoryMessages(t,n.count,n.order,n.timestamp)];case 1:return o=i.sent(),d=o.code,u=o.data,d===e.ErrorCode.SUCCESS&&u?(c=[],l=u.list.map((function(e){return c.push(e.messageUId),W(e)})),s.info(Ae,JSON.stringify({code:d,data:c}),r),[2,{code:d,data:{list:l,hasMore:!!u.hasMore}}]):(s.warn(Ae,JSON.stringify({code:d}),r),[2,{code:d,msg:Yo[d]}])}}))}))}))]}))}))},exports.getConnectionStatus=function(){return Bo((function(e){return e.getConnectionStatus()}))},exports.getConversation=function(t){return o(this,void 0,void 0,(function(){var n=this;return i(this,(function(r){return[2,new e.ValidatorManage(Le,be).validate("conversation",t,e.AssertRules.OBJECT,!0).validate("conversationType",null==t?void 0:t.conversationType,e.AssertRules.CONVERSATION_TYPE,!0).validate("targetId",null==t?void 0:t.targetId,e.AssertRules.STRING,!0).validate("channelId",null==t?void 0:t.channelId,e.AssertRules.CHANNEL_ID).ifReady((function(r,a){return o(n,void 0,void 0,(function(){var n,o,s,d,u,c,l,v;return i(this,(function(i){switch(i.label){case 0:return n=t.conversationType,o=t.targetId,s=t.channelId,d=a.createTraceId(),a.info(Le,JSON.stringify({conversationType:n,targetId:o,channelId:s}),d),[4,r.getConversation(n,o,s||"")];case 1:return u=i.sent(),c=u.code,l=u.data,v=c===e.ErrorCode.SUCCESS?"info":"warn",a[v](be,JSON.stringify({code:c}),d),c!==e.ErrorCode.SUCCESS?[2,{code:c,msg:Yo[c]}]:[2,{code:c,data:l?X(l):null}]}}))}))}))]}))}))},exports.getConversationList=function(t,n){return o(this,void 0,void 0,(function(){var r=this;return i(this,(function(a){return[2,new e.ValidatorManage(we,Pe).validate("count",null==t?void 0:t.count,e.AssertRules.NUMBER).validate("startTime",null==t?void 0:t.startTime,e.AssertRules.NUMBER).validate("order",null==t?void 0:t.order,e.AssertRules.NUMBER).validate("channelId",n,e.AssertRules.CHANNEL_ID).ifReady((function(a,s){return o(r,void 0,void 0,(function(){var r,o,d,u,c;return i(this,(function(i){switch(i.label){case 0:return r=s.createTraceId(),s.info(we,JSON.stringify({count:null==t?void 0:t.count,startTime:null==t?void 0:t.startTime,order:null==t?void 0:t.order,channelId:n}),r),[4,a.getConversationList(null==t?void 0:t.count,void 0,null==t?void 0:t.startTime,null==t?void 0:t.order,n)];case 1:return o=i.sent(),d=o.code,u=o.data,d===e.ErrorCode.SUCCESS&&u?(c=u.map((function(e){return X(e)})),s.info(Pe,JSON.stringify({code:d,list:c.length}),r),[2,{code:0,data:c}]):(s.warn(Pe,JSON.stringify({code:d})),[2,{code:d,msg:Yo[d]}])}}))}))}))]}))}))},exports.getConversationNotificationLevel=function(t){return o(this,void 0,void 0,(function(){var n=this;return i(this,(function(r){return[2,new e.ValidatorManage(ot,ot).validate("conversation",t,e.AssertRules.OBJECT,!0).validate("conversationType",null==t?void 0:t.conversationType,e.AssertRules.CONVERSATION_TYPE,!0).validate("targetId",null==t?void 0:t.targetId,e.AssertRules.STRING,!0).validate("channelId",null==t?void 0:t.channelId,e.AssertRules.CHANNEL_ID).ifReady((function(r,a){return o(n,void 0,void 0,(function(){var n,o,s,d,u,c,l;return i(this,(function(i){switch(i.label){case 0:return n=t.conversationType,o=t.targetId,s=t.channelId,d=a.createTraceId(),a.info(rt,JSON.stringify({conversationType:n,targetId:o,channelId:s}),d),[4,r.getConversationNotificationLevel(n,o,s)];case 1:return u=i.sent(),c=u.code,l=u.data,c===e.ErrorCode.SUCCESS?(a.info(ot,JSON.stringify({code:c,data:l}),d),[2,{code:c,data:l}]):(a.warn(ot,JSON.stringify({code:c}),d),[2,{code:c,msg:Yo[c]}])}}))}))}))]}))}))},exports.getConversationNotificationStatus=function(t){return o(this,void 0,void 0,(function(){var n=this;return i(this,(function(r){return[2,new e.ValidatorManage(it,at).validate("conversation",t,e.AssertRules.OBJECT,!0).validate("conversationType",null==t?void 0:t.conversationType,e.AssertRules.CONVERSATION_TYPE,!0).validate("targetId",null==t?void 0:t.targetId,e.AssertRules.STRING,!0).validate("channelId",null==t?void 0:t.channelId,e.AssertRules.CHANNEL_ID).ifReady((function(r,a){return o(n,void 0,void 0,(function(){var n,o,s,d,u,c,l;return i(this,(function(i){switch(i.label){case 0:return n=t.conversationType,o=t.targetId,s=t.channelId,d=a.createTraceId(),a.info(it,JSON.stringify({conversationType:n,targetId:o,channelId:s}),d),[4,r.getConversationNotificationStatus(n,o,s)];case 1:return u=i.sent(),c=u.code,l=u.data,c===e.ErrorCode.SUCCESS?(a.info(at,JSON.stringify({code:c,data:l}),d),[2,{code:c,data:l}]):(a.warn(at,JSON.stringify({code:c}),d),[2,{code:c,msg:Yo[c]}])}}))}))}))]}))}))},exports.getConversationTypeNotificationLevel=function(t){return o(this,void 0,void 0,(function(){var n=this;return i(this,(function(r){return e.validate("conversationType",t,(function(){return[e.ConversationType.PRIVATE,e.ConversationType.GROUP,e.ConversationType.SYSTEM,e.ConversationType.PUBLIC_SERVICE,e.ConversationType.APP_PUBLIC_SERVICE,e.ConversationType.ULTRA_GROUP].includes(t)}))?[2,ko((function(r,a){return o(n,void 0,void 0,(function(){var n,o,s;return i(this,(function(i){switch(i.label){case 0:return a.info(e.LogTagId.O,"getConversationTypeNotificationLevel ->conversationType:"+t),[4,r.getConversationTypeNotificationLevel(t)];case 1:return n=i.sent(),o=n.code,s=n.data,o===e.ErrorCode.SUCCESS?[2,{code:o,data:s}]:(a.warn(e.LogTagId.O,"getConversationTypeNotificationLevel ->conversationType:"+t),[2,{code:o,msg:Yo[o]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getConversationsFromTagByPage=function(t,n,a){return o(this,void 0,void 0,(function(){var s=this;return i(this,(function(d){return[2,new e.ValidatorManage(yr,Ar).validate("tagId",t,e.AssertRules.STRING,!0).validate("count",n,e.AssertRules.NUMBER,!0).validate("startTime",a,e.AssertRules.NUMBER,!0).ifReady((function(d,u){return o(s,void 0,void 0,(function(){var o,s,c,l,v;return i(this,(function(i){switch(i.label){case 0:return o=u.createTraceId(),u.info(yr,JSON.stringify({tagId:t,count:n,startTime:a}),o),[4,d.getConversationListByTag(t,a,n)];case 1:return s=i.sent(),c=s.code,l=s.data,c===e.ErrorCode.SUCCESS?(v=null==l?void 0:l.map((function(e){return function(e){return r(r({},X(e)),{isTopInTag:e.isTopInTag})}(e)})),u.info(Ar,JSON.stringify({code:c,length:null==v?void 0:v.length}),o),[2,{code:c,data:v}]):(u.warn(Ar,JSON.stringify({code:c}),o),[2,{code:c,msg:Yo[c]}])}}))}))}))]}))}))},exports.getCurrentUserId=function(){return Bo((function(e){return e.getCurrentUserId()}))},exports.getDeviceId=function(){return Bo((function(e){return e.getDeviceId()}))},exports.getDownloadAuth=function(t){return new e.ValidatorManage("","").validate("mediaUrl",t,e.AssertRules.STRING,!0).ifReady((function(n){return new Promise((function(r){n.getFileToken(1,void 0,void 0,void 0,t).then((function(t){var n=t.token,o=t.downloadAuthInfo,i=t.deadline;r({code:e.ErrorCode.SUCCESS,data:{token:n,downloadAuthInfo:o,deadline:i}})})).catch((function(e){r({code:e,msg:Yo[e]})}))}))}))},exports.getFileToken=function(t,n,r,o){return ko((function(i){return new Promise((function(a){i.getFileToken(t,n,r,o).then((function(t){a({code:e.ErrorCode.SUCCESS,data:t})})).catch((function(e){a({code:e,msg:Yo[e]})}))}))}))},exports.getFileUrl=function(t,n,r,o,i){return new e.ValidatorManage("","").validate("fileType",t,e.isValidFileType,!0).validate("filename",n,e.AssertRules.STRING).validate("saveName",r,e.AssertRules.STRING).validate("serverType",i,e.AssertRules.NUMBER).ifReady((function(a){return new Promise((function(s){a.getFileUrl(t,n,r,o,i).then((function(t){s({code:e.ErrorCode.SUCCESS,data:t})})).catch((function(e){s({code:e})}))}))}))},exports.getFirstUnreadMessage=function(t){return o(this,void 0,void 0,(function(){var n=this;return i(this,(function(r){return e.usingCppEngine()?[2,new e.ValidatorManage(xn,Gn).validate("conversation",t,e.AssertRules.OBJECT,!0).validate("conversationType",null==t?void 0:t.conversationType,e.AssertRules.CONVERSATION_TYPE,!0).validate("targetId",null==t?void 0:t.targetId,e.AssertRules.STRING,!0).validate("channelId",null==t?void 0:t.channelId,e.AssertRules.CHANNEL_ID).ifReady((function(r,a){return o(n,void 0,void 0,(function(){var n,o,s,d,u,c,l,v;return i(this,(function(i){switch(i.label){case 0:return n=t.conversationType,o=t.targetId,s=t.channelId,d=a.createTraceId(),a.info(xn,JSON.stringify({conversationType:n,targetId:o,channelId:s}),d),[4,r.getFirstUnreadMessage(n,o,s)];case 1:return u=i.sent(),c=u.code,l=u.data,c===e.ErrorCode.SUCCESS?(v=l&&W(l)||null,a.info(Gn,JSON.stringify({code:c,messageUId:null==l?void 0:l.messageUId}),d),[2,{code:c,data:v}]):(a.warn(Gn,JSON.stringify({code:c}),d),[2,{code:c,msg:Yo[c]}])}}))}))}))]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:Yo[e.ErrorCode.NOT_SUPPORT]}]}))}))},exports.getFirstUnreadMessageInfo=function(t){return o(this,void 0,void 0,(function(){var n=this;return i(this,(function(r){return[2,new e.ValidatorManage(Dn,Jn).validate("conversation",t,e.AssertRules.OBJECT,!0).validate("conversationType",null==t?void 0:t.conversationType,e.AssertRules.CONVERSATION_TYPE,!0).validate("targetId",null==t?void 0:t.targetId,e.AssertRules.STRING,!0).validate("channelId",null==t?void 0:t.channelId,e.AssertRules.CHANNEL_ID).ifReady((function(r,a){return o(n,void 0,void 0,(function(){var n,o,s,d,u,c,l;return i(this,(function(i){switch(i.label){case 0:return n=t.conversationType,o=t.targetId,s=t.channelId,d=a.createTraceId(),a.info(Dn,JSON.stringify({conversationType:n,targetId:o,channelId:s}),d),[4,r.getFirstUnreadMessageInfo(n,o,s||"")];case 1:return u=i.sent(),c=u.code,l=u.data,c===e.ErrorCode.SUCCESS?(a.info(Jn,JSON.stringify({code:c,messageUId:null==l?void 0:l.messageUId,sentTime:null==l?void 0:l.sentTime}),d),[2,{code:c,data:l}]):(a.warn(Jn,JSON.stringify({code:c}),d),[2,{code:c,msg:Yo[c]}])}}))}))}))]}))}))},exports.getHistoryMessages=function(t,n){return o(this,void 0,void 0,(function(){var r=this;return i(this,(function(a){return[2,new e.ValidatorManage(e.LogTagId.A_GET_HISTORY_MSG_T,e.LogTagId.A_GET_HISTORY_MSG_R).validate("conversation",t,e.AssertRules.OBJECT,!0).validate("conversationType",null==t?void 0:t.conversationType,e.AssertRules.CONVERSATION_TYPE,!0).validate("targetId",null==t?void 0:t.targetId,e.AssertRules.STRING,!0).validate("channelId",null==t?void 0:t.channelId,e.AssertRules.CHANNEL_ID).validate("timestamp",null==n?void 0:n.timestamp,e.AssertRules.NUMBER).validate("count",null==n?void 0:n.count,e.AssertRules.NUMBER).validate("count",null==n?void 0:n.count,(function(t){if(e.usingCppEngine())return!0;var n=t>0&&t<=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})).validate("order",null==n?void 0:n.order,(function(e){return 0===e||1===e})).ifReady((function(a,s){return o(r,void 0,void 0,(function(){var r,o,d,u,c,l;return i(this,(function(i){switch(i.label){case 0:return r=s.createTraceId(),s.info(e.LogTagId.A_GET_HISTORY_MSG_T,JSON.stringify({targetId:t.targetId,conversationType:t.conversationType,channelId:t.channelId,timestamp:null==n?void 0:n.timestamp,count:null==n?void 0:n.count}),r),[4,a.getHistoryMessage(t.conversationType,t.targetId,null==n?void 0:n.timestamp,null==n?void 0:n.count,null==n?void 0:n.order,null==t?void 0:t.channelId,"",r)];case 1:return o=i.sent(),d=o.code,u=o.data,d===e.ErrorCode.SUCCESS&&u?(c=[],l=u.list.map((function(e){return c.push(e.messageUId),W(e)})),s.info(e.LogTagId.A_GET_HISTORY_MSG_R,JSON.stringify({code:d,messageUIds:c}),r),[2,{code:d,data:{list:l,hasMore:u.hasMore}}]):(s.warn(e.LogTagId.A_GET_HISTORY_MSG_R,JSON.stringify({code:d,messageUIds:""}),r),[2,{code:d,msg:Yo[d]}])}}))}))}))]}))}))},exports.getMessage=function(t){return o(this,void 0,void 0,(function(){var n=this;return i(this,(function(r){return e.usingCppEngine()?[2,new e.ValidatorManage(kn,Hn).validate("messageId",t,(function(t){return e.isNumber(t)||e.isString(t)}),!0).ifReady((function(r,a){return o(n,void 0,void 0,(function(){var n,o,s,d;return i(this,(function(i){switch(i.label){case 0:return n=a.createTraceId(),a.info(kn,JSON.stringify({messageId:t}),n),[4,r.getMessage(t)];case 1:return o=i.sent(),s=o.code,d=o.data,s===e.ErrorCode.SUCCESS?(a.info(Hn,JSON.stringify({code:s,messageUId:null==d?void 0:d.messageUId,messageId:null==d?void 0:d.messageId})),[2,{code:s,data:W(d)}]):(a.warn(Hn,JSON.stringify({code:s})),[2,{code:s,msg:Yo[s]}])}}))}))}))]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:Yo[e.ErrorCode.NOT_SUPPORT]}]}))}))},exports.getMessageReadReceiptV4=function(t,n){return o(this,void 0,void 0,(function(){var r=this;return i(this,(function(a){return[2,new e.ValidatorManage(e.LogTagId.A_GET_MESSAGE_READ_RECEIPT_V4_T,e.LogTagId.A_GET_MESSAGE_READ_RECEIPT_V4_R).validate("conversation",t,e.AssertRules.OBJECT,!0).validate("conversationType",null==t?void 0:t.conversationType,(function(t){return t===e.ConversationType.GROUP}),!0,"It should be ConversationType.GROUP").validate("targetId",null==t?void 0:t.targetId,e.AssertRules.STRING,!0).validate("channelId",null==t?void 0:t.channelId,e.AssertRules.CHANNEL_ID).validate("messageUId",n,e.AssertRules.STRING,!0).ifReady((function(a,s){return o(r,void 0,void 0,(function(){var r,o,d,u,c,l,v;return i(this,(function(i){switch(i.label){case 0:return r="conversationType:"+t.conversationType+",targetId:"+t.targetId+",\n channelId: "+t.channelId+", messageUid:"+n,o=s.createTraceId(),s.info(e.LogTagId.A_GET_MESSAGE_READ_RECEIPT_V4_T,r,o),3!==(null==(d=a.getNaviInfoFromCache())?void 0:d.grpRRVer)?[2,{code:e.ErrorCode.READ_RECEIPT_V4_NOT_SUPPORT}]:[4,a.getMessageReadReceiptV4(t,n)];case 1:return u=i.sent(),c=u.code,l=u.msg,v=u.data,s[c===e.ErrorCode.SUCCESS?"info":"warn"](e.LogTagId.A_GET_MESSAGE_READ_RECEIPT_V4_R,"code: "+c+", msg: "+l,o),c===e.ErrorCode.SUCCESS&&v?[2,{code:c,data:v}]:[2,{code:c,msg:l}]}}))}))}))]}))}))},exports.getMessageReader=function(t,n,r){return o(this,void 0,void 0,(function(){var a=this;return i(this,(function(s){return[2,new e.ValidatorManage(Ln,bn).validate("messageUId",n,e.AssertRules.STRING,!0).validate("targetId",t,e.AssertRules.STRING,!0).validate("channelId",r,e.AssertRules.CHANNEL_ID).ifReady((function(s,d){return o(a,void 0,void 0,(function(){var o,a,u,c;return i(this,(function(i){switch(i.label){case 0:return o=d.createTraceId(),d.info(Ln,JSON.stringify({targetId:t,messageUId:n,channelId:r}),o),[4,s.getMessageReader(t,n,r)];case 1:return a=i.sent(),u=a.code,c=a.data,u===e.ErrorCode.SUCCESS?(d.info(bn,JSON.stringify({code:u,totalMemberCount:null==c?void 0:c.totalMemberCount}),o),[2,{code:u,data:c}]):(d.warn(bn,JSON.stringify({code:u})),[2,{code:u,msg:Yo[u]}])}}))}))}))]}))}))},exports.getMyUserProfile=function(){var t=this;return new e.ValidatorManage(yo,Ao).ifReady((function(n,r){return o(t,void 0,void 0,(function(){var t,o,a,s,d;return i(this,(function(i){switch(i.label){case 0:return t=r.createTraceId(),r.info(yo,"",t),[4,n.getMyUserProfile()];case 1:return o=i.sent(),a=o.code,s=o.data,d=a===e.ErrorCode.SUCCESS?"info":"warn",r[d](Ao,JSON.stringify({code:a,data:s}),t),[2,{code:a,data:s}]}}))}))}))},exports.getMyUserProfileVisibility=function(){var t=this;return new e.ValidatorManage(Uo,Mo).ifReady((function(n,r){return o(t,void 0,void 0,(function(){var t,o,a,s,d;return i(this,(function(i){switch(i.label){case 0:return t=r.createTraceId(),r.info(Uo,"",t),[4,n.getMyUserProfileVisibility()];case 1:return o=i.sent(),a=o.code,s=o.data,d=a===e.ErrorCode.SUCCESS?"info":"warn",r[d](Mo,JSON.stringify({code:a,data:s}),t),[2,{code:a,data:s}]}}))}))}))},exports.getProxy=function(){return o(this,void 0,void 0,(function(){var t=this;return i(this,(function(n){return[2,new e.ValidatorManage(rr,or).ifReady((function(n,r){return o(t,void 0,void 0,(function(){var t,o,a,s;return i(this,(function(i){switch(i.label){case 0:return t=r.createTraceId(),r.info(rr,"",t),[4,n.getProxy()];case 1:return o=i.sent(),a=o.code,s=o.data,a===e.ErrorCode.SUCCESS?(r.info(or,JSON.stringify({code:a,data:s}),t),[2,{code:a,data:s}]):(r.warn(or,JSON.stringify({code:a}),t),[2,{code:a,msg:Yo[a]}])}}))}))}))]}))}))},exports.getRemoteHistoryMessages=function(t,n){return o(this,void 0,void 0,(function(){var r=this;return i(this,(function(a){return[2,new e.ValidatorManage(En,Rn).validate("conversation",t,e.AssertRules.OBJECT,!0).validate("conversationType",null==t?void 0:t.conversationType,e.AssertRules.CONVERSATION_TYPE,!0).validate("targetId",null==t?void 0:t.targetId,e.AssertRules.STRING,!0).validate("channelId",null==t?void 0:t.channelId,e.AssertRules.CHANNEL_ID).validate("timestamp",null==n?void 0:n.timestamp,e.AssertRules.NUMBER).validate("count",null==n?void 0:n.count,e.AssertRules.NUMBER).validate("count",null==n?void 0:n.count,(function(e){return e>0&&e<=100})).validate("order",null==n?void 0:n.order,(function(e){return 0===e||1===e})).ifReady((function(a,s){return o(r,void 0,void 0,(function(){var r,o,d,u,c,l;return i(this,(function(i){switch(i.label){case 0:return r=s.createTraceId(),s.info(En,JSON.stringify({targetId:t.targetId,conversationType:t.conversationType,channelId:t.channelId,timestamp:null==n?void 0:n.timestamp,count:null==n?void 0:n.count,order:null==n?void 0:n.order}),r),[4,a.getRemoteHistoryMessages(t.conversationType,t.targetId,(null==n?void 0:n.timestamp)||0,(null==n?void 0:n.count)||20,(null==n?void 0:n.order)||0,t.channelId||"")];case 1:return o=i.sent(),d=o.code,u=o.data,d===e.ErrorCode.SUCCESS&&u?(c=[],l=u.list.map((function(e){return c.push(e.messageUId),W(e)})),s.info(Rn,JSON.stringify({code:d,messageUIds:c})),[2,{code:d,data:{list:l,hasMore:u.hasMore}}]):(s.warn(Rn,JSON.stringify({code:d})),[2,{code:d,msg:Yo[d]}])}}))}))}))]}))}))},exports.getServerTime=function(){return Bo((function(e){return e.getServerTime()}))},exports.getSubscribeUserList=function(t,n,r){return o(this,void 0,void 0,(function(){var a=this;return i(this,(function(s){return[2,new e.ValidatorManage(po,Io).validate("subscribeType",t,(function(t){return[e.SubscribeType.ONLINE_STATUS,e.SubscribeType.USER_PROFILE].includes(t)}),!0).validate("subscribePageSize",n,e.isInteger({min:1,max:200}),!0).validate("offset",r,e.isInteger({min:0}),!0).ifReady((function(s,d){return o(a,void 0,void 0,(function(){var o,a,u,c,l;return i(this,(function(i){switch(i.label){case 0:return o=d.createTraceId(),d.info(po,JSON.stringify({pageSize:n,offset:r}),o),[4,s.getSubscribeUserList(t,n,r)];case 1:return a=i.sent(),u=a.code,c=a.data,l=u===e.ErrorCode.SUCCESS?"info":"warn",d[l](Io,JSON.stringify({code:u,data:c}),o),u===e.ErrorCode.SUCCESS?[2,{code:u,data:c}]:[2,{code:u}]}}))}))}))]}))}))},exports.getSubscribeUserStatus=function(t,n){return o(this,void 0,void 0,(function(){var r=this;return i(this,(function(a){return[2,new e.ValidatorManage(fo,go).validate("subscribeType",t,(function(t){return[e.SubscribeType.ONLINE_STATUS,e.SubscribeType.USER_PROFILE].includes(t)}),!0).validate("subscribeUserIds",n,e.isLimitedArray({maxLength:200,minLength:1,itemValidator:e.isValidTargetId}),!0).ifReady((function(a,s){return o(r,void 0,void 0,(function(){var r,o,d,u,c;return i(this,(function(i){switch(i.label){case 0:return r=s.createTraceId(),s.info(To,JSON.stringify({userIds:n}),r),[4,a.getSubscribeUserStatus(t,n)];case 1:return o=i.sent(),d=o.code,u=o.data,c=d===e.ErrorCode.SUCCESS?"info":"warn",s[c](So,JSON.stringify({code:d}),r),d===e.ErrorCode.SUCCESS?[2,{code:d,data:u}]:[2,{code:d}]}}))}))}))]}))}))},exports.getTags=function(){return o(this,void 0,void 0,(function(){var t=this;return i(this,(function(n){return[2,new e.ValidatorManage("","").ifReady((function(n,r){return o(t,void 0,void 0,(function(){var t,o,a,s,d;return i(this,(function(i){switch(i.label){case 0:return t=r.createTraceId(),r.info(fr,"",t),[4,n.getTagList()];case 1:return o=i.sent(),a=o.code,s=o.data,d=a===e.ErrorCode.SUCCESS?"info":"warn",r[d](gr,JSON.stringify({code:a}),t),[2,{code:e.ErrorCode.SUCCESS,data:s}]}}))}))}))]}))}))},exports.getTagsFromConversation=function(t){return o(this,void 0,void 0,(function(){var n=this;return i(this,(function(r){return[2,new e.ValidatorManage(Tr,Sr).validate("conversation",t,e.AssertRules.OBJECT,!0).validate("conversationType",null==t?void 0:t.conversationType,e.AssertRules.CONVERSATION_TYPE,!0).validate("targetId",null==t?void 0:t.targetId,e.AssertRules.STRING,!0).validate("channelId",null==t?void 0:t.channelId,e.AssertRules.CHANNEL_ID).ifReady((function(r,a){return o(n,void 0,void 0,(function(){var n,o,s,d,u;return i(this,(function(i){switch(i.label){case 0:return n=a.createTraceId(),a.info(Tr,JSON.stringify({conversationType:t.conversationType,targetId:t.targetId,channelId:t.channelId}),n),[4,r.getTagsForConversation(t)];case 1:return o=i.sent(),s=o.code,d=o.data,u=s===e.ErrorCode.SUCCESS?"info":"warn",a[u](Sr,JSON.stringify({code:s}),n),s===e.ErrorCode.SUCCESS?[2,{code:s,data:d}]:[2,{code:s,msg:Yo[s]}]}}))}))}))]}))}))},exports.getTextMessageDraft=function(t){return o(this,void 0,void 0,(function(){var n=this;return i(this,(function(r){return[2,new e.ValidatorManage(De,Je).validate("conversation",t,e.AssertRules.OBJECT,!0).validate("conversationType",null==t?void 0:t.conversationType,e.AssertRules.CONVERSATION_TYPE,!0).validate("targetId",null==t?void 0:t.targetId,e.AssertRules.STRING,!0).validate("channelId",null==t?void 0:t.channelId,e.AssertRules.CHANNEL_ID).ifReady((function(r,a){return o(n,void 0,void 0,(function(){var n,o,s,d,u,c,l,v;return i(this,(function(i){switch(i.label){case 0:return n=t.conversationType,o=t.targetId,s=t.channelId,d=a.createTraceId(),a.info(De,JSON.stringify({conversationType:n,targetId:o,channelId:s}),d),[4,r.getConversationMessageDraft(n,o,s)];case 1:return u=i.sent(),c=u.code,l=u.data,v=c===e.ErrorCode.SUCCESS?"info":"warn",a[v](Je,JSON.stringify({code:c,data:l}),d),c===e.ErrorCode.SUCCESS?[2,{code:c,data:l||""}]:[2,{code:c,msg:Yo[c]}]}}))}))}))]}))}))},exports.getTopConversationList=function(t,n){return o(this,void 0,void 0,(function(){var r=this;return i(this,(function(a){return[2,new e.ValidatorManage(Me,Ue).validate("conversationTypes",t,(function(t){return!!e.isArray(t)&&!t.some((function(t){return!e.isValidConversationType(t)}))})).validate("channelId",n,e.AssertRules.CHANNEL_ID).ifReady((function(a,s){return o(r,void 0,void 0,(function(){var r,o,d,u,c,l;return i(this,(function(i){switch(i.label){case 0:return r=s.createTraceId(),s.info(Me,JSON.stringify({conversationTypes:t,channelId:n}),r),[4,a.getTopConversationList(t,n)];case 1:return o=i.sent(),d=o.code,u=o.data,d===e.ErrorCode.SUCCESS&&u?(c=[],l=u.map((function(e){return c.push({targetId:e.targetId,conversationType:e.conversationType,channelId:e.channelId}),X(e)})),s.info(Ue,JSON.stringify({code:d,list:c}),r),[2,{code:0,data:l}]):(s.warn(e.LogTagId.A_GET_TOP_CONVERSATION_LIST_E,JSON.stringify({code:d}),r),[2,{code:d,msg:Yo[d]}])}}))}))}))]}))}))},exports.getTotalUnreadCount=function(t,n){return o(this,void 0,void 0,(function(){var r=this;return i(this,(function(a){return[2,new e.ValidatorManage(Fe,Ye).validate("conversationTypes",n,(function(t){return!!e.isArray(t)&&!t.some((function(t){return!e.isValidConversationType(t)}))}),!1).ifReady((function(a,s){return o(r,void 0,void 0,(function(){var r,o,d,u;return i(this,(function(i){switch(i.label){case 0:return r=s.createTraceId(),s.info(Fe,JSON.stringify({conversationTypes:n,includeMuted:t}),r),[4,a.getTotalUnreadCount("",n,t)];case 1:return o=i.sent(),d=o.code,u=o.data,d===e.ErrorCode.SUCCESS?(s.info(Ye,JSON.stringify({code:d,data:u}),r),[2,{code:d,data:u}]):(s.warn(Ye,JSON.stringify({code:d}),r),[2,{code:d,msg:Yo[d]}])}}))}))}))]}))}))},exports.getTotalUnreadCountByLevels=function(t,n){return o(this,void 0,void 0,(function(){var r=this;return i(this,(function(a){return[2,new e.ValidatorManage(qe,je).validate("conversationTypes",t,(function(t){return!!e.isArray(t)&&!t.some((function(t){return!e.isValidConversationType(t)}))}),!0).validate("levels",n,(function(t){return!!e.isArray(n)&&!t.some((function(t){return!e.isValidNotificationLevel(t)}))}),!0).ifReady((function(a,s){return o(r,void 0,void 0,(function(){var r,o,d,u;return i(this,(function(i){switch(i.label){case 0:return r=s.createTraceId(),s.info(qe,JSON.stringify({conversationTypes:t,levels:n,isMentioned:!1}),r),[4,a.getTotalUnreadCountByLevels(t,n)];case 1:return o=i.sent(),d=o.code,u=o.data,d===e.ErrorCode.SUCCESS?(s.info(je,JSON.stringify({code:d,data:u}),r),[2,{code:d,data:u}]):(s.warn(je,JSON.stringify({code:d}),r),[2,{code:d,msg:Yo[d]}])}}))}))}))]}))}))},exports.getTotalUnreadMentionedCountByLevels=function(t,n){return o(this,void 0,void 0,(function(){var r=this;return i(this,(function(a){return[2,new e.ValidatorManage(qe,je).validate("conversationTypes",t,(function(t){return!!e.isArray(t)&&!t.some((function(t){return!e.isValidConversationType(t)}))}),!0).validate("levels",n,(function(t){return!!e.isArray(t)&&!t.some((function(t){return!e.isValidNotificationLevel(t)}))}),!0).ifReady((function(a,s){return o(r,void 0,void 0,(function(){var r,o,d,u;return i(this,(function(i){switch(i.label){case 0:return r=s.createTraceId(),s.info(qe,JSON.stringify({conversationTypes:t,levels:n,isMentioned:!0}),r),[4,a.getTotalUnreadCountByLevels(t,n,!0)];case 1:return o=i.sent(),d=o.code,u=o.data,d===e.ErrorCode.SUCCESS?(s.info(je,JSON.stringify({code:d,data:u}),r),[2,{code:d,data:u}]):(s.warn(je,JSON.stringify({code:d}),r),[2,{code:d,msg:Yo[d]}])}}))}))}))]}))}))},exports.getUltraGroupDefaultNotificationLevel=function(t){return o(this,void 0,void 0,(function(){var n=this;return i(this,(function(r){return[2,new e.ValidatorManage(zr,Wr).validate("targetId",null==t?void 0:t.targetId,e.AssertRules.STRING,!0).validate("channelId",null==t?void 0:t.channelId,e.AssertRules.CHANNEL_ID).ifReady((function(r,a){return o(n,void 0,void 0,(function(){var n,o,s,d;return i(this,(function(i){switch(i.label){case 0:return n=a.createTraceId(),a.info(zr,JSON.stringify({targetId:t.targetId,channelId:t.channelId}),n),[4,r.getUltraGroupDefaultNotificationLevel(t.targetId,t.channelId)];case 1:return o=i.sent(),s=o.code,d=o.data,s===e.ErrorCode.SUCCESS?(a.info(Wr,JSON.stringify({code:s,data:d}),n),[2,{code:s,data:d}]):(a.warn(Wr,JSON.stringify({code:s}),n),[2,{code:s,msg:Yo[s]}])}}))}))}))]}))}))},exports.getUltraGroupFirstUnreadMessageTimestamp=function(t){return o(this,void 0,void 0,(function(){var n=this;return i(this,(function(r){return[2,new e.ValidatorManage(oo,io).validate("targetId",null==t?void 0:t.targetId,e.AssertRules.STRING,!0).validate("channelId",null==t?void 0:t.channelId,e.AssertRules.CHANNEL_ID,!0).ifReady((function(r,a){return o(n,void 0,void 0,(function(){var n,o,s,d,u,c,l;return i(this,(function(i){switch(i.label){case 0:return n=t.targetId,o=t.channelId,s={targetId:n,channelId:o},d=a.createTraceId(),a.info(ao,JSON.stringify(s),d),[4,r.getUltraGroupFirstUnreadMessageTimestamp(s)];case 1:return u=i.sent(),c=u.code,l=u.data,c===e.ErrorCode.SUCCESS?(a.info(so,JSON.stringify({code:c,sentTime:null==l?void 0:l.sentTime}),d),[2,{code:c,data:l}]):(a.warn(so,JSON.stringify({code:c}),d),[2,{code:c,msg:Yo[c]}])}}))}))}))]}))}))},exports.getUltraGroupList=function(t){return void 0===t&&(t={}),o(this,void 0,void 0,(function(){var n=this;return i(this,(function(r){return[2,new e.ValidatorManage(Mr,wr).validate("targetId",null==t?void 0:t.targetId,e.AssertRules.STRING,!1).validate("channelType",null==t?void 0:t.channelType,(function(t){return void 0!==e.UltraGroupChannelType[t]}),!1).ifReady((function(r,a){return o(n,void 0,void 0,(function(){var n,o,s,d;return i(this,(function(i){switch(i.label){case 0:return n=a.createTraceId(),a.info(Mr,JSON.stringify({targetId:t.targetId,channelType:t.channelType}),n),[4,r.getUltraGroupList(t)];case 1:return o=i.sent(),s=o.code,d=o.data,s===e.ErrorCode.SUCCESS?(a.info(wr,JSON.stringify({code:s,length:null==d?void 0:d.length}),n),[2,{code:e.ErrorCode.SUCCESS,data:d}]):(a.warn(wr,JSON.stringify({code:s}),n),[2,{code:s,msg:Yo[s]}])}}))}))}))]}))}))},exports.getUltraGroupMessageListByMessageUId=function(t,n){return o(this,void 0,void 0,(function(){var r=this;return i(this,(function(a){return[2,new e.ValidatorManage(Gr,Dr).validate("conversation",t,e.AssertRules.OBJECT,!0).validate("conversationType",null==t?void 0:t.conversationType,e.AssertRules.CONVERSATION_TYPE,!0).validate("targetId",null==t?void 0:t.targetId,e.AssertRules.STRING,!0).validate("channelId",null==t?void 0:t.channelId,e.AssertRules.CHANNEL_ID).validate("messages",n,e.AssertRules.ARRAY,!0).ifReady((function(a,s){return o(r,void 0,void 0,(function(){var r,o,d,u,c,l,v,f,g,T,S,p;return i(this,(function(i){switch(i.label){case 0:return r=t.targetId,o=t.conversationType,d=t.channelId,u=[],n.forEach((function(e){var t=e.sendTime,n=e.messageUId;u.push({sendTime:t,messageUId:n,channelId:d})})),c={targetId:r,conversationType:o,messages:u},l=s.createTraceId(),s.info(Gr,JSON.stringify(c),l),[4,a.getUltraGroupMessageListByMessageUId(c)];case 1:if(v=i.sent(),f=v.code,g=v.data,f===e.ErrorCode.SUCCESS){for(p in T={},S=[],g)S.push(p),T[p]=g[p]?W(g[p]):void 0;return s.info(Dr,JSON.stringify({code:f,messageUIds:S}),l),[2,{code:e.ErrorCode.SUCCESS,data:T}]}return s.warn(Dr,JSON.stringify({code:f}),l),[2,{code:f,msg:Yo[f]}]}}))}))}))]}))}))},exports.getUltraGroupUnreadCountByTargetId=function(t,n){return o(this,void 0,void 0,(function(){var r=this;return i(this,(function(a){return[2,new e.ValidatorManage(Zr,$r).validate("targetId",t,e.AssertRules.STRING,!0).validate("notificationLevels",n,e.AssertRules.ARRAY).validate("notificationLevels",n,(function(t){return!(null==n?void 0:n.some((function(t){return!e.isValidNotificationLevel(t)})))})).ifReady((function(a,s){return o(r,void 0,void 0,(function(){var r,o,d,u,c;return i(this,(function(i){switch(i.label){case 0:return r=s.createTraceId(),s.info(Zr,JSON.stringify({targetId:t,notificationLevels:n}),r),[4,a.getUltraGroupUnreadCountByTargetId(t,n)];case 1:return o=i.sent(),d=o.code,u=o.data,c=d===e.ErrorCode.SUCCESS?"info":"warn",s[c]($r,JSON.stringify({code:d,data:u}),r),[2,{code:d,data:u}]}}))}))}))]}))}))},exports.getUltraGroupUnreadInfoList=function(t){return o(this,void 0,void 0,(function(){var n=this;return i(this,(function(r){return[2,new e.ValidatorManage(uo,co).validate("targetIds",t,(function(n){return!!e.validate("targetIds",t,e.AssertRules.ARRAY,!0)&&(!(n.length<=0||n.length>20)&&!t.some((function(t){return!e.isString(t)})))})).ifReady((function(r,a){return o(n,void 0,void 0,(function(){var n,o,s,d,u,c;return i(this,(function(i){switch(i.label){case 0:return n=t.filter((function(e,n){return t.indexOf(e)===n})),o=a.createTraceId(),a.info(uo,JSON.stringify({targetIds:t}),o),[4,r.getUltraGroupUnreadInfoList(n)];case 1:return s=i.sent(),d=s.code,u=s.data,c=d===e.ErrorCode.SUCCESS?"info":"warn",a[c](co,JSON.stringify({code:d}),o),d===e.ErrorCode.SUCCESS?[2,{code:d,data:u}]:[2,{code:d,msg:Yo[d]}]}}))}))}))]}))}))},exports.getUltraGroupUnreadMentionedCountByTargetId=function(t,n){return o(this,void 0,void 0,(function(){var r=this;return i(this,(function(a){return[2,new e.ValidatorManage(jr,jr).validate("targetId",t,e.AssertRules.STRING,!0).validate("notificationLevels",n,e.AssertRules.ARRAY).validate("notificationLevels",n,(function(t){return!(null==n?void 0:n.some((function(t){return!e.isValidNotificationLevel(t)})))})).ifReady((function(a,s){return o(r,void 0,void 0,(function(){var r,o,d,u;return i(this,(function(i){switch(i.label){case 0:return r=s.createTraceId(),s.info(jr,JSON.stringify({targetId:t,notificationLevels:n}),r),[4,a.getUltraGroupUnreadMentionedCountByTargetId(t,n)];case 1:return o=i.sent(),d=o.code,u=o.data,d===e.ErrorCode.SUCCESS?(s.info(Kr,JSON.stringify({code:d,data:u}),t),[2,{code:e.ErrorCode.SUCCESS,data:u}]):(s.warn(Kr,JSON.stringify({code:d}),r),[2,{code:d,msg:Yo[d]}])}}))}))}))]}))}))},exports.getUltraGroupUnreadMentionedMessages=function(t){return o(this,void 0,void 0,(function(){var n=this;return i(this,(function(r){return t.channelId=t.channelId||"",[2,new e.ValidatorManage(oo,io).validate("targetId",null==t?void 0:t.targetId,e.AssertRules.STRING,!0).validate("channelId",null==t?void 0:t.channelId,e.AssertRules.CHANNEL_ID).validate("sentTime",null==t?void 0:t.sentTime,e.AssertRules.NUMBER,!0).validate("count",null==t?void 0:t.count,(function(t){return e.isNumber(t)&&t>0&&t<=50}),!0).ifReady((function(r,a){return o(n,void 0,void 0,(function(){var n,o,s,d,u,c,l,v,f;return i(this,(function(i){switch(i.label){case 0:return n=t.targetId,o=t.channelId,s=t.sentTime,d=t.count,u={targetId:n,channelId:o,sentTime:s,count:d},c=a.createTraceId(),a.info(oo,JSON.stringify(u),c),[4,r.getUltraGroupUnreadMentionedMessages(u)];case 1:return l=i.sent(),v=l.code,f=l.data,v===e.ErrorCode.SUCCESS?(a.info(io,JSON.stringify({code:v,data:null==f?void 0:f.map((function(e){return e.messageUId}))}),c),[2,{code:v,data:f}]):(a.warn(io,JSON.stringify({code:v}),c),[2,{code:v,msg:Yo[v]}])}}))}))}))]}))}))},exports.getUnreadConversationList=function(t){return o(this,void 0,void 0,(function(){var n=this;return i(this,(function(r){return[2,new e.ValidatorManage(ut,ct).validate("conversationTypes",t,(function(t){return!!e.isArray(t)&&!t.some((function(t){return!e.isValidConversationType(t)}))})).ifReady((function(r,a){return o(n,void 0,void 0,(function(){var n,o,s,d,u,c;return i(this,(function(i){switch(i.label){case 0:return n=a.createTraceId(),a.info(ut,JSON.stringify({conversationTypes:t}),n),[4,r.getUnreadConversationList(t)];case 1:return o=i.sent(),s=o.code,d=o.data,s===e.ErrorCode.SUCCESS&&d?(u=[],c=d.map((function(e){return u.push({targetId:e.targetId,conversationType:e.conversationType,channelId:e.channelId,unreadMessageCount:e.unreadMessageCount}),X(e)})),a.info(ct,JSON.stringify({code:s,list:u}),n),[2,{code:0,data:c}]):(a.warn(ct,JSON.stringify({code:s}),n),[2,{code:s,msg:Yo[s]}])}}))}))}))]}))}))},exports.getUnreadCount=function(t){return o(this,void 0,void 0,(function(){var n=this;return i(this,(function(r){return[2,new e.ValidatorManage(Ke,ze).validate("conversation",t,e.AssertRules.OBJECT,!0).validate("conversationType",null==t?void 0:t.conversationType,e.AssertRules.CONVERSATION_TYPE,!0).validate("targetId",null==t?void 0:t.targetId,e.AssertRules.STRING,!0).validate("channelId",null==t?void 0:t.channelId,e.AssertRules.CHANNEL_ID).ifReady((function(r,a){return o(n,void 0,void 0,(function(){var n,o,s,d,u,c,l;return i(this,(function(i){switch(i.label){case 0:return n=t.conversationType,o=t.targetId,s=t.channelId,d=a.createTraceId(),a.info(Ke,JSON.stringify({conversationType:n,targetId:o,channelId:s}),d),[4,r.getUnreadCount(n,o,s)];case 1:return u=i.sent(),c=u.code,l=u.data,c===e.ErrorCode.SUCCESS?(a.info(ze,JSON.stringify({code:c,data:l})),[2,{code:c,data:l}]):(a.warn(ze,JSON.stringify({code:c})),[2,{code:c,msg:Yo[c]}])}}))}))}))]}))}))},exports.getUnreadCountByTag=function(t,n){return o(this,void 0,void 0,(function(){var r=this;return i(this,(function(a){return[2,new e.ValidatorManage(Nr,Or).validate("tagId",t,e.AssertRules.STRING,!0).validate("containMuted",n,e.AssertRules.BOOLEAN,!0).ifReady((function(a,s){return o(r,void 0,void 0,(function(){var r,o,d,u,c;return i(this,(function(i){switch(i.label){case 0:return r=s.createTraceId(),s.info(Nr,JSON.stringify({tagId:t,containMuted:n}),r),[4,a.getUnreadCountByTag(t,n)];case 1:return o=i.sent(),d=o.code,u=o.data,c=d===e.ErrorCode.SUCCESS?"info":"warn",s[c](Nr,JSON.stringify({code:d,data:u}),r),[2,{code:d,data:u}]}}))}))}))]}))}))},exports.getUnreadMentionedCount=function(t){return o(this,void 0,void 0,(function(){var n=this;return i(this,(function(r){return[2,new e.ValidatorManage(it,at).validate("conversation",t,e.AssertRules.OBJECT,!0).validate("conversationType",null==t?void 0:t.conversationType,e.AssertRules.CONVERSATION_TYPE,!0).validate("targetId",null==t?void 0:t.targetId,e.AssertRules.STRING,!0).validate("channelId",null==t?void 0:t.channelId,e.AssertRules.CHANNEL_ID).ifReady((function(r,a){return o(n,void 0,void 0,(function(){var n,o,s,d;return i(this,(function(i){switch(i.label){case 0:return n=a.createTraceId(),a.info(lt,JSON.stringify({conversationType:t.conversationType,targetId:t.targetId,channelId:t.channelId}),n),[4,r.getUnreadMentionedCount(t)];case 1:return o=i.sent(),s=o.code,d=o.data,s===e.ErrorCode.SUCCESS?(a.info(vt,JSON.stringify({code:s,data:d}),n),[2,{code:s,data:d}]):(a.warn(vt,JSON.stringify({code:s}),n),[2,{code:s}])}}))}))}))]}))}))},exports.getUnreadMentionedMessages=function(t){return e.usingCppEngine()?new e.ValidatorManage(Fn,Yn).validate("conversation",t,e.AssertRules.OBJECT,!0).validate("conversationType",null==t?void 0:t.conversationType,e.AssertRules.CONVERSATION_TYPE,!0).validate("targetId",null==t?void 0:t.targetId,e.AssertRules.STRING,!0).validate("channelId",null==t?void 0:t.channelId,e.AssertRules.CHANNEL_ID).ifReadySync((function(n,r){var o=t.conversationType,i=t.targetId,a=t.channelId,s=r.createTraceId();r.info(Fn,JSON.stringify({conversationType:o,targetId:i,channelId:a}),s);var d=n.getUnreadMentionedMessages(o,i,a),u=[];return d&&d.length&&d.forEach((function(e){return u.push(W(e))})),r.info(Yn,JSON.stringify({code:e.ErrorCode.SUCCESS,count:u.length}),s),{code:e.ErrorCode.SUCCESS,data:u}})):{code:e.ErrorCode.NOT_SUPPORT,msg:Yo[e.ErrorCode.NOT_SUPPORT]}},exports.getUserProfiles=function(t){var n=this;return new e.ValidatorManage(Co,mo).validate("userId",t,e.isLimitedArray({minLength:1,itemValidator:e.notEmptyString}),!0).ifReady((function(r,a){return o(n,void 0,void 0,(function(){var n,o,s,d,u;return i(this,(function(i){switch(i.label){case 0:return n=a.createTraceId(),a.info(Co,JSON.stringify({userIds:t}),n),[4,r.getUserProfiles(t)];case 1:return o=i.sent(),s=o.code,d=o.data,u=s===e.ErrorCode.SUCCESS?"info":"warn",a[u](mo,JSON.stringify({code:s,data:d}),n),[2,{code:s,data:d}]}}))}))}))},exports.init=function(t){!function(t){var n,r,o=t.appkey,i=t.navigators;Go?Jo.warn(e.LogTagId.A_INIT_REPEAT_O):(e.assert("options.appkey",t.appkey,e.AssertRules.STRING,!0),e.assert("options.navigators",t.navigators,(function(t){return e.isArray(t)&&(0===t.length||t.every(e.isHttpUrl))})),Do=t,Go=e.APIContext.init((null===(n=t.__runtimeCreator__)||void 0===n?void 0:n.call(t))||z,{appkey:t.appkey,navigators:t.navigators||[],miniCMPProxy:t.customCMP||[],logOutputLevel:t.logOutputLevel,__reportLogLevel:t.__reportLogLevel,httpInMainProcess:!!t.httpInMainProcess,logExpireTime:t.logExpireTime,areaCode:t.areaCode,logServerUrl:t.logServerUrl,uploadDomain:t.uploadDomain,environment:null!==(r=t.environment)&&void 0!==r?r:"default"}),(Jo=Go.createLogger("RC-IM","IM")).setOutputLevel(t.logOutputLevel),Jo.info(e.LogTagId.A_INIT_O,JSON.stringify({appkey:o,navigators:i,version:"5.10.3",commit:"ea7c36a75044a0edba9e374315f097c09f076679"})),Go.assignWatcher(bo),e.logger.init(Jo))}(t)},exports.insertMessage=function(t,n,r){return void 0===r&&(r={}),o(this,void 0,void 0,(function(){var a=this;return i(this,(function(s){return Q("RongIMLib.insertMessage","RongIMLib.ElectronExtension.insertMessage"),e.usingCppEngine()?[2,new e.ValidatorManage(Vn,Bn).validate("conversation",t,e.AssertRules.OBJECT,!0).validate("conversationType",null==t?void 0:t.conversationType,e.AssertRules.CONVERSATION_TYPE,!0).validate("targetId",null==t?void 0:t.targetId,e.AssertRules.STRING,!0).validate("channelId",null==t?void 0:t.channelId,e.AssertRules.CHANNEL_ID).validate("searchContent",null==r?void 0:r.searchContent,e.AssertRules.STRING).validate("senderUserId",null==n?void 0:n.senderUserId,e.AssertRules.STRING,!0).validate("messageType",null==n?void 0:n.messageType,e.AssertRules.STRING,!0).validate("content",null==n?void 0:n.content,e.AssertRules.OBJECT,!0).validate("messageDirection",null==n?void 0:n.messageDirection,e.AssertRules.NUMBER,!0).validate("canIncludeExpansion",null==n?void 0:n.canIncludeExpansion,e.AssertRules.BOOLEAN).validate("expansion",null==n?void 0:n.expansion,e.AssertRules.OBJECT).validate("disableNotification",null==n?void 0:n.disableNotification,e.AssertRules.BOOLEAN).validate("sentTime",null==n?void 0:n.sentTime,e.AssertRules.NUMBER).validate("sentStatus",null==n?void 0:n.sentStatus,e.AssertRules.NUMBER).ifReady((function(s,d){return o(a,void 0,void 0,(function(){var o,a,u,c,l,v,f,g,T,S,p,I,h,_,E,R,C;return i(this,(function(i){switch(i.label){case 0:return o=n.senderUserId,a=n.messageType,u=n.content,c=n.messageDirection,l=n.messageUId,v=n.canIncludeExpansion,f=n.expansion,g=n.disableNotification,T=n.sentTime,S=n.sentStatus,p=d.createTraceId(),d.info(Vn,JSON.stringify({conversationType:t.conversationType,targetId:t.targetId,channelId:t.channelId}),p),I=r.isUnread,h=r.searchContent,_={senderUserId:o,messageType:a,content:u,messageDirection:c,sentTime:T,sentStatus:S,searchContent:h,isUnread:!!I,messageUId:l,disableNotification:g,canIncludeExpansion:v,expansionMsg:JSON.stringify(f),channelId:t.channelId||""},[4,s.insertMessage(t.conversationType,t.targetId,_)];case 1:return E=i.sent(),R=E.code,C=E.data,R===e.ErrorCode.SUCCESS?(d.info(Bn,JSON.stringify({code:R,messageId:null==C?void 0:C.messageId}),p),[2,{code:R,data:W(C)}]):(d.warn(Bn,JSON.stringify({code:R}),p),[2,{code:R,msg:Yo[R]}])}}))}))}))]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:Yo[e.ErrorCode.NOT_SUPPORT]}]}))}))},exports.installPlugin=function(e,t){return Bo((function(n){return n.install(e,t)}))},exports.joinChatRoom=function(t,n){return o(this,void 0,void 0,(function(){var r=this;return i(this,(function(a){return[2,new e.ValidatorManage(e.LogTagId.A_JOIN_CHATROOM_T,e.LogTagId.A_JOIN_CHATROOM_R).validate("targetId",t,e.AssertRules.STRING,!0).validate("count",n,e.AssertRules.OBJECT,!0).validate("count",null==n?void 0:n.count,e.AssertRules.NUMBER,!0).validate("extra",null==n?void 0:n.extra,e.AssertRules.ONLY_STRING,!1).ifReady((function(a,s){return o(r,void 0,void 0,(function(){var r,o,d;return i(this,(function(i){switch(i.label){case 0:return r=s.createTraceId(),s.info(e.LogTagId.A_JOIN_CHATROOM_T,JSON.stringify({chatroomId:t,count:n.count,joinExist:!1}),r),[4,a.joinChatroom(t,n.count,r,n.extra)];case 1:return o=i.sent(),d=o===e.ErrorCode.SUCCESS?"info":"warn",s[d](e.LogTagId.A_JOIN_CHATROOM_R,JSON.stringify({code:o,timestamp:(new Date).getTime()}),r),o!==e.ErrorCode.SUCCESS?[2,{code:o,msg:Yo[o]}]:[2,{code:o}]}}))}))}))]}))}))},exports.joinExistChatRoom=function(t,n){return o(this,void 0,void 0,(function(){var r=this;return i(this,(function(a){return[2,new e.ValidatorManage(e.LogTagId.A_JOIN_CHATROOM_T,e.LogTagId.A_JOIN_CHATROOM_R).validate("targetId",t,e.AssertRules.STRING,!0).validate("count",null==n?void 0:n.count,e.AssertRules.NUMBER,!0).validate("extra",null==n?void 0:n.extra,e.AssertRules.ONLY_STRING,!1).ifReady((function(a,s){return o(r,void 0,void 0,(function(){var r,o,d,u,c;return i(this,(function(i){switch(i.label){case 0:return r=s.createTraceId(),s.info(e.LogTagId.A_JOIN_CHATROOM_T,JSON.stringify({chatroomId:t,count:n.count,joinExist:!0}),r),[4,a.joinExistChatroom(t,n.count,r,n.extra)];case 1:return o=i.sent(),d=o.code,u=o.data,c=d===e.ErrorCode.SUCCESS?"info":"warn",s[c](e.LogTagId.A_JOIN_CHATROOM_R,JSON.stringify({code:d,timestamp:(new Date).getTime()}),r),d!==e.ErrorCode.SUCCESS?[2,{code:d,msg:Yo[d]}]:[2,{code:d,data:u}]}}))}))}))]}))}))},exports.modifyMessage=function(t,n){return o(this,void 0,void 0,(function(){var r=this;return i(this,(function(a){return[2,new e.ValidatorManage(qr,qr).validate("content",t,e.AssertRules.OBJECT,!0).validate("message",n,e.AssertRules.OBJECT,!0).ifReady((function(a,s){return o(r,void 0,void 0,(function(){var r,o,d,u,c,l,v,f,g,T,S;return i(this,(function(i){switch(i.label){case 0:return r=n.conversationType,o=n.targetId,d=n.messageUId,u=n.senderUserId,c=n.sentTime,l=n.canIncludeExpansion,v=n.channelId,f=s.createTraceId(),s.info(Yr,JSON.stringify({conversationType:r,targetId:o,messageUId:d,channelId:v}),f),g={targetId:o,channelId:v,conversationType:r,fromUserId:u,sendTime:c,canIncludeExpansion:l,messageUId:d,content:t},[4,a.modifyMessage(g)];case 1:return T=i.sent().code,S=T===e.ErrorCode.SUCCESS?"info":"warn",s[S](qr,JSON.stringify({code:T}),f),T===e.ErrorCode.SUCCESS?[2,{code:e.ErrorCode.SUCCESS}]:[2,{code:T,msg:Yo[T]}]}}))}))}))]}))}))},exports.onceEventListener=function(e,t,n){Lo.once(e,t,n)},exports.quitChatRoom=function(t){return o(this,void 0,void 0,(function(){var n=this;return i(this,(function(r){return[2,new e.ValidatorManage(e.LogTagId.A_QUIT_CHATROOM_T,e.LogTagId.A_QUIT_CHATROOM_R).validate("targetId",t,e.AssertRules.STRING,!0).ifReady((function(r,a){return o(n,void 0,void 0,(function(){var n,o,s;return i(this,(function(i){switch(i.label){case 0:return n=a.createTraceId(),a.info(e.LogTagId.A_QUIT_CHATROOM_T,JSON.stringify({chatroomId:t}),n),[4,r.quitChatroom(t)];case 1:return o=i.sent(),s=o===e.ErrorCode.SUCCESS?"info":"warn",a[s](e.LogTagId.A_QUIT_CHATROOM_R,JSON.stringify({code:o}),n),o!==e.ErrorCode.SUCCESS?[2,{code:o,msg:Yo[o]}]:[2,{code:o}]}}))}))}))]}))}))},exports.recallMessage=function(t,n){return o(this,void 0,void 0,(function(){var r=this;return i(this,(function(a){return[2,new e.ValidatorManage(Cn,mn).validate("conversation",t,e.AssertRules.OBJECT,!0).validate("conversationType",null==t?void 0:t.conversationType,e.AssertRules.CONVERSATION_TYPE,!0).validate("targetId",null==t?void 0:t.targetId,e.AssertRules.STRING,!0).validate("channelId",null==t?void 0:t.channelId,e.AssertRules.CHANNEL_ID).validate("messageUId",n.messageUId,e.AssertRules.STRING,!0).validate("sentTime",n.sentTime,e.AssertRules.NUMBER,!0).validate("disableNotification",null==n?void 0:n.disableNotification,e.AssertRules.BOOLEAN).validate("pushConfig",null==n?void 0:n.pushConfig,e.AssertRules.OBJECT).validate("directionalUserIdList",null==n?void 0:n.directionalUserIdList,e.isLimitedArray({maxLength:300,minLength:1,itemValidator:function(t){return e.isString(t)}})).ifReady((function(a,s){return o(r,void 0,void 0,(function(){var r,o,d,u,c;return i(this,(function(i){switch(i.label){case 0:return r={user:n.user,channelId:t.channelId||"",disableNotification:null==n?void 0:n.disableNotification,pushConfig:null==n?void 0:n.pushConfig,extra:n.extra,isDelete:n.isDelete,directionalUserIdList:n.directionalUserIdList},o=s.createTraceId(),s.info(Cn,JSON.stringify({targetId:t.targetId,conversationType:t.conversationType,messageUId:n.messageUId}),o),[4,a.recallMessage(t.conversationType,t.targetId,n.messageUId,n.sentTime,r)];case 1:return d=i.sent(),u=d.code,c=d.data,u===e.ErrorCode.SUCCESS&&c?(s.info(mn,JSON.stringify({code:u,messageUId:c.messageUId}),o),[2,{code:u,data:W(c)}]):u===e.ErrorCode.SUCCESS?[2,{code:u}]:(s.warn(mn,JSON.stringify({code:u}),o),[2,{code:u,msg:Yo[u]}])}}))}))}))]}))}))},exports.registerMessageType=function(t,n,r,o,i){return Bo((function(a,s){return e.assert("messageType",t,e.AssertRules.STRING,!0),e.assert("isPersited",n,e.AssertRules.BOOLEAN,!0),e.assert("isCounted",r,e.AssertRules.BOOLEAN,!0),e.assert("isStatusMessage",i,e.AssertRules.BOOLEAN,!1),e.assert("searchProps",o,e.AssertRules.ARRAY),s.info(e.LogTagId.A_REGTYP_O,JSON.stringify({messageType:t,isCounted:r,isStatusMessage:i,isPersited:n})),a.registerMessageType(t,n,r,o,i),Qo(t,n,r)}))},exports.removeAllExpansionForUltraGroupMessage=function(t){return o(this,void 0,void 0,(function(){var n=this;return i(this,(function(r){return[2,new e.ValidatorManage(Hr,Fr).validate("message",t,e.AssertRules.OBJECT,!0).ifReady((function(r,a){return o(n,void 0,void 0,(function(){var n,o,s,d,u,c,l,v,f,g;return i(this,(function(i){switch(i.label){case 0:return n=t.conversationType,o=t.targetId,s=t.messageUId,d=t.sentTime,u=t.canIncludeExpansion,c=t.channelId,l=a.createTraceId(),a.info(Hr,JSON.stringify({conversationType:n,targetId:o,messageUId:s,channelId:c}),l),v={targetId:o,channelId:c,conversationType:n,sendTime:d,canIncludeExpansion:u,messageUId:s,removeAll:!0},[4,r.expandUltraMessage(v)];case 1:return f=i.sent().code,g=f===e.ErrorCode.SUCCESS?"info":"warn",a[g](Fr,JSON.stringify({code:f}),l),f===e.ErrorCode.SUCCESS?[2,{code:e.ErrorCode.SUCCESS}]:[2,{code:f,msg:Yo[f]}]}}))}))}))]}))}))},exports.removeChatRoomEntries=function(t,n){return o(this,void 0,void 0,(function(){var r=this;return i(this,(function(a){return[2,new e.ValidatorManage(pe,Ie).validate("targetId",t,e.AssertRules.STRING,!0).validate("entries",null==n?void 0:n.entries,(function(t){return!!e.validate("entry.key",t,e.AssertRules.ARRAY,!0)&&n.entries.every((function(t){return e.validate("key",t,e.AssertRules.STRING,!0)}))}),!0).validate("notificationExtra",null==n?void 0:n.notificationExtra,e.isLimitedString({maxLength:e.MAX_CHATROOM_NOTIFICATION_EXTRA_LENGTH})).ifReady((function(a,s){return o(r,void 0,void 0,(function(){var r,o,d,u,c,l;return i(this,(function(i){switch(i.label){case 0:return r=n.entries.map((function(e){return{key:e}})),o=s.createTraceId(),s.info(pe,JSON.stringify({chatroomId:t,notificationExtra:n.notificationExtra,entries:r}),o),[4,a.removeChatroomEntries(t,{entries:r,notificationExtra:n.notificationExtra})];case 1:return d=i.sent(),u=d.code,c=d.data,l=u===e.ErrorCode.SUCCESS?"info":"warn",s[l](Ie,JSON.stringify({code:u}),o),u!==e.ErrorCode.SUCCESS?[2,{code:u,msg:Yo[u],data:c}]:[2,{code:u}]}}))}))}))]}))}))},exports.removeChatRoomEntry=function(t,n){return o(this,void 0,void 0,(function(){var r=this;return i(this,(function(a){return[2,new e.ValidatorManage(Te,Se).validate("targetId",t,e.AssertRules.STRING,!0).validate("key",null==n?void 0:n.key,e.AssertRules.STRING,!0).validate("isSendNotification",null==n?void 0:n.isSendNotification,e.AssertRules.BOOLEAN).validate("notificationExtra",null==n?void 0:n.notificationExtra,e.isLimitedString({maxLength:e.MAX_CHATROOM_NOTIFICATION_EXTRA_LENGTH})).ifReady((function(a,s){return o(r,void 0,void 0,(function(){var r,o,d;return i(this,(function(i){switch(i.label){case 0:return r=s.createTraceId(),s.info(Te,JSON.stringify({chatroomId:t,key:n.key,isSendNotification:n.isSendNotification,notificationExtra:n.notificationExtra}),r),[4,a.removeChatroomEntry(t,n)];case 1:return o=i.sent(),d=o===e.ErrorCode.SUCCESS?"info":"warn",s[d](Se,JSON.stringify({code:o}),r),o!==e.ErrorCode.SUCCESS?[2,{code:o,msg:Yo[o]}]:[2,{code:o}]}}))}))}))]}))}))},exports.removeConversation=function(t){return o(this,void 0,void 0,(function(){var n=this;return i(this,(function(r){return[2,new e.ValidatorManage(xe,Ge).validate("conversation",t,e.AssertRules.OBJECT,!0).validate("conversationType",null==t?void 0:t.conversationType,e.AssertRules.CONVERSATION_TYPE,!0).validate("targetId",null==t?void 0:t.targetId,e.AssertRules.STRING,!0).validate("channelId",null==t?void 0:t.channelId,e.AssertRules.CHANNEL_ID).ifReady((function(r,a){return o(n,void 0,void 0,(function(){var n,o,s,d,u,c;return i(this,(function(i){switch(i.label){case 0:return n=t.conversationType,o=t.targetId,s=t.channelId,d=a.createTraceId(),a.info(xe,JSON.stringify({conversationType:n,targetId:o,channelId:s}),d),[4,r.removeConversation(n,o,s)];case 1:return u=i.sent(),c=u===e.ErrorCode.SUCCESS?"info":"warn",a[c](Ge,JSON.stringify({code:u}),d),u!==e.ErrorCode.SUCCESS?[2,{code:u,msg:Yo[u]}]:[2,{code:u}]}}))}))}))]}))}))},exports.removeConversationsFromTag=function(t,n){return o(this,void 0,void 0,(function(){var r=this;return i(this,(function(a){return[2,new e.ValidatorManage(hr,_r).validate("tagId",t,e.AssertRules.STRING,!0).validate("conversations",n,(function(t){return!(!e.validate("conversations",t,e.AssertRules.ARRAY,!0)||t.length<=0)&&!t.some((function(t){return!e.validate("conversation",t,e.AssertRules.CONVERSATION,!0)}))}),!0).ifReady((function(a,s){return o(r,void 0,void 0,(function(){var r,o,d;return i(this,(function(i){switch(i.label){case 0:return r=s.createTraceId(),s.info(hr,JSON.stringify({conversations:n.map((function(e){return{conversationType:e.conversationType,targetId:e.targetId}})),tagId:t}),r),[4,a.removeTagForConversations(t,n)];case 1:return o=i.sent().code,d=o===e.ErrorCode.SUCCESS?"info":"warn",s[d](_r,JSON.stringify({code:o}),r),o===e.ErrorCode.SUCCESS?[2,{code:o}]:[2,{code:o,msg:Yo[o]}]}}))}))}))]}))}))},exports.removeEventListener=function(e,t,n){Lo.off(e,t,n)},exports.removeEventListeners=function(e){Lo.removeAll(e)},exports.removeExpansionForUltraGroupMessage=function(t,n){return o(this,void 0,void 0,(function(){var r=this;return i(this,(function(a){return[2,new e.ValidatorManage(Br,kr).validate("expansion",t,e.AssertRules.ARRAY,!0).validate("message",n,e.AssertRules.OBJECT,!0).ifReady((function(a,s){return o(r,void 0,void 0,(function(){var r,o,d,u,c,l,v,f,g,T;return i(this,(function(i){switch(i.label){case 0:return r=n.conversationType,o=n.targetId,d=n.messageUId,u=n.sentTime,c=n.canIncludeExpansion,l=n.channelId,v=s.createTraceId(),s.info(Br,JSON.stringify({conversationType:r,targetId:o,messageUId:d,channelId:l}),v),f={targetId:o,channelId:l,conversationType:r,sendTime:u,canIncludeExpansion:c,messageUId:d,keys:t},[4,a.expandUltraMessage(f)];case 1:return g=i.sent().code,T=g===e.ErrorCode.SUCCESS?"info":"warn",s[T](kr,JSON.stringify({code:g}),v),g===e.ErrorCode.SUCCESS?[2,{code:e.ErrorCode.SUCCESS}]:[2,{code:g,msg:Yo[g]}]}}))}))}))]}))}))},exports.removeFromBlacklist=function(t){return o(this,void 0,void 0,(function(){var n=this;return i(this,(function(r){return[2,new e.ValidatorManage(te,ne).validate("userId",t,e.AssertRules.STRING,!0).ifReady((function(r,a){return o(n,void 0,void 0,(function(){var n,o,s;return i(this,(function(i){switch(i.label){case 0:return n=a.createTraceId(),a.info(te,JSON.stringify({userId:t}),n),[4,r.removeFromBlacklist(t)];case 1:return o=i.sent(),s=o===e.ErrorCode.SUCCESS?"info":"warn",a[s](ne,JSON.stringify({code:o}),n),[2,{code:o}]}}))}))}))]}))}))},exports.removeMessageExpansionForKey=function(t,n){return o(this,void 0,void 0,(function(){var r=this;return i(this,(function(a){return[2,new e.ValidatorManage(wn,Pn).validate("keys",t,e.AssertRules.ARRAY,!0).validate("message",n,e.AssertRules.OBJECT,!0).validate("conversationType",null==n?void 0:n.conversationType,e.AssertRules.NUMBER,!0).validate("targetId",null==n?void 0:n.targetId,e.AssertRules.STRING,!0).validate("channelId",null==n?void 0:n.channelId,e.AssertRules.CHANNEL_ID).validate("messageUId",null==n?void 0:n.messageUId,e.AssertRules.STRING,!0).validate("canIncludeExpansion",null==n?void 0:n.canIncludeExpansion,e.AssertRules.BOOLEAN,!0).ifReady((function(a,s){return o(r,void 0,void 0,(function(){var r,o,d,u,c,l,v,f;return i(this,(function(i){switch(i.label){case 0:return r=n.conversationType,o=n.targetId,d=n.messageUId,u=n.canIncludeExpansion,c=n.channelId,l=s.createTraceId(),s.info(wn,JSON.stringify({targetId:o,channelId:c,conversationType:r,messageUId:d,canIncludeExpansion:u}),l),[4,a.sendExpansionMessage({conversationType:r,targetId:o,messageUId:d,canIncludeExpansion:u,keys:t,channelId:c})];case 1:return v=i.sent().code,f=v===e.ErrorCode.SUCCESS?"info":"warn",s[f](Pn,JSON.stringify({code:v}),l),v!==e.ErrorCode.SUCCESS?[2,{code:v,msg:Yo[v]}]:[2,{code:v}]}}))}))}))]}))}))},exports.removeTag=function(t){return o(this,void 0,void 0,(function(){var n=this;return i(this,(function(r){return[2,new e.ValidatorManage(ur,cr).validate("tagId",t,e.AssertRules.STRING,!0).ifReady((function(r,a){return o(n,void 0,void 0,(function(){var n,o,s;return i(this,(function(i){switch(i.label){case 0:return n=a.createTraceId(),a.info(ur,JSON.stringify({tagId:t}),n),[4,r.removeTag(t)];case 1:return o=i.sent().code,s=o===e.ErrorCode.SUCCESS?"info":"warn",a[s](cr,JSON.stringify({code:o}),n),o===e.ErrorCode.SUCCESS?[2,{code:o}]:[2,{code:o,msg:Yo[o]}]}}))}))}))]}))}))},exports.removeTagFromConversations=function(t,n){return o(this,void 0,void 0,(function(){var r=this;return i(this,(function(a){return[2,new e.ValidatorManage(Cr,mr).validate("tagId",t,e.AssertRules.STRING,!0).validate("conversations",n,(function(t){return!(!e.validate("conversations",t,e.AssertRules.ARRAY,!0)||t.length<=0)&&!t.some((function(t){return!e.validate("conversation",t,e.AssertRules.CONVERSATION,!0)}))}),!0).ifReady((function(a,s){return o(r,void 0,void 0,(function(){var r,o,d;return i(this,(function(i){switch(i.label){case 0:return r=s.createTraceId(),s.info(Cr,JSON.stringify({conversations:n.map((function(e){return{conversationType:e.conversationType,targetId:e.targetId}})),tagId:t}),r),[4,a.removeTagForConversations(t,n)];case 1:return o=i.sent().code,d=o===e.ErrorCode.SUCCESS?"info":"warn",s[d](mr,JSON.stringify({code:o}),r),o===e.ErrorCode.SUCCESS?[2,{code:o}]:[2,{code:o,msg:Yo[o]}]}}))}))}))]}))}))},exports.removeTagsFromConversation=function(t,n){return o(this,void 0,void 0,(function(){var r=this;return i(this,(function(a){return[2,new e.ValidatorManage(Er,Rr).validate("conversation",t,e.AssertRules.OBJECT,!0).validate("conversationType",null==t?void 0:t.conversationType,e.AssertRules.CONVERSATION_TYPE,!0).validate("targetId",null==t?void 0:t.targetId,e.AssertRules.STRING,!0).validate("channelId",null==t?void 0:t.channelId,e.AssertRules.CHANNEL_ID).validate("tagIds",n,(function(t){return!!e.validate("tagIds",t,e.AssertRules.ARRAY,!0)&&!t.some((function(t){return!e.isString(t)}))}),!0).ifReady((function(a,s){return o(r,void 0,void 0,(function(){var r,o,d;return i(this,(function(i){switch(i.label){case 0:return r=s.createTraceId(),s.info(Er,JSON.stringify({tagIds:n,targetId:t.targetId,conversationType:t.conversationType}),r),[4,a.removeTagsForConversation(t,n)];case 1:return o=i.sent().code,d=o===e.ErrorCode.SUCCESS?"info":"warn",s[d](Rr,JSON.stringify({code:o}),r),o===e.ErrorCode.SUCCESS?[2,{code:o}]:[2,{code:o,msg:Yo[o]}]}}))}))}))]}))}))},exports.saveTextMessageDraft=function(t,n){return o(this,void 0,void 0,(function(){var r=this;return i(this,(function(a){return[2,new e.ValidatorManage(Ve,Be).validate("conversation",t,e.AssertRules.OBJECT,!0).validate("conversationType",null==t?void 0:t.conversationType,e.AssertRules.CONVERSATION_TYPE,!0).validate("targetId",null==t?void 0:t.targetId,e.AssertRules.STRING,!0).validate("channelId",null==t?void 0:t.channelId,e.AssertRules.CHANNEL_ID).validate("draft",n,e.AssertRules.STRING,!0).ifReady((function(a,s){return o(r,void 0,void 0,(function(){var r,o,d;return i(this,(function(i){switch(i.label){case 0:return r=s.createTraceId(),s.info(Ve,JSON.stringify({conversationType:t.conversationType,targetId:t.targetId,channelId:t.channelId,draft:n}),r),[4,a.saveConversationMessageDraft(t.conversationType,t.targetId,n,t.channelId)];case 1:return o=i.sent(),d=o===e.ErrorCode.SUCCESS?"info":"warn",s[d](Be,JSON.stringify({code:o}),r),o===e.ErrorCode.SUCCESS?[2,{code:o}]:[2,{code:o,msg:Yo[o]}]}}))}))}))]}))}))},exports.searchConversationByContent=function(t,n,r,a){return o(this,void 0,void 0,(function(){var s=this;return i(this,(function(d){return Q("RongIMLib.searchConversationByContent","RongIMLib.ElectronExtension.searchConversationByContent"),e.usingCppEngine()?[2,new e.ValidatorManage(Wn,Xn).validate("keyword",t,e.AssertRules.STRING,!0).validate("conversationTypes",n,(function(t){return!!e.isArray(t)&&!t.some((function(t){return!e.isValidConversationType(t)}))}),!1).validate("messageTypes",r,(function(t){return!!e.isArray(t)&&!(null==r?void 0:r.some((function(t){return!e.isString(t)})))}),!1).validate("channelId",a,e.AssertRules.STRING).ifReady((function(d,u){return o(s,void 0,void 0,(function(){var o,s,c,l;return i(this,(function(i){switch(i.label){case 0:return o=u.createTraceId(),u.info(Wn,JSON.stringify({keyword:t,conversationTypes:n,messageTypes:r,channelId:a}),o),[4,d.searchConversationByContent(t,r,a,n)];case 1:return s=i.sent(),c=s.code,l=s.data,c===e.ErrorCode.SUCCESS?(u.info(Xn,JSON.stringify({code:c,count:null==l?void 0:l.length}),o),[2,{code:c,data:l}]):(u.warn(Xn,JSON.stringify({code:c}),o),[2,{code:c,msg:Yo[c]}])}}))}))}))]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:Yo[e.ErrorCode.NOT_SUPPORT]}]}))}))},exports.searchMessages=function(t,n,r,a){return o(this,void 0,void 0,(function(){var s=this;return i(this,(function(d){return Q("RongIMLib.searchMessages","RongIMLib.ElectronExtension.searchMessages"),e.usingCppEngine()?[2,new e.ValidatorManage("A-search_messages-T","A-search_messages-R").validate("conversation",t,e.AssertRules.OBJECT,!0).validate("conversationType",null==t?void 0:t.conversationType,e.AssertRules.CONVERSATION_TYPE,!0).validate("targetId",null==t?void 0:t.targetId,e.AssertRules.STRING,!0).validate("channelId",null==t?void 0:t.channelId,e.AssertRules.CHANNEL_ID).validate("keyword",n,e.AssertRules.STRING,!0).validate("timestamp",r,e.AssertRules.NUMBER).validate("count",a,e.AssertRules.NUMBER).ifReady((function(d,u){return o(s,void 0,void 0,(function(){var o,s,c,l;return i(this,(function(i){switch(i.label){case 0:return[4,d.searchMessageByContent(t.conversationType,t.targetId,n,r,a,1,t.channelId)];case 1:return o=i.sent(),s=o.code,c=o.data,s===e.ErrorCode.SUCCESS?(l=[],(null==c?void 0:c.messages)&&c.messages.length&&c.messages.forEach((function(e){return l.push(W(e))})),[2,{code:s,data:{messages:l,count:null==c?void 0:c.count}}]):(u.warn(e.LogTagId.O,"searchMessages ->code:"+s+",targetId:"+t.targetId),[2,{code:s,msg:Yo[s]}])}}))}))}))]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:Yo[e.ErrorCode.NOT_SUPPORT]}]}))}))},exports.searchUserProfileByUniqueId=function(t){var n=this;return new e.ValidatorManage(wo,Po).validate("uniqueId",t,e.AssertRules.STRING,!0).ifReady((function(r,a){return o(n,void 0,void 0,(function(){var n,o,s,d,u;return i(this,(function(i){switch(i.label){case 0:return n=a.createTraceId(),a.info(wo,t,n),[4,r.searchUserProfileByUniqueId(t)];case 1:return o=i.sent(),s=o.code,d=o.data,u=s===e.ErrorCode.SUCCESS?"info":"warn",a[u](Po,JSON.stringify({code:s,data:d}),n),[2,{code:s,data:d}]}}))}))}))},exports.sendFileMessage=Di,exports.sendGIFMessage=Vi,exports.sendHQVoiceMessage=Bi,exports.sendImageMessage=Ji,exports.sendMessage=xi,exports.sendReadReceiptMessage=function(t,n,r,a){return o(this,void 0,void 0,(function(){var s=this;return i(this,(function(d){return[2,new e.ValidatorManage(e.LogTagId.A_SEND_MSG_T,e.LogTagId.A_SEND_MSG_R).validate("targetId",t,e.AssertRules.STRING,!0).validate("messageUId",n,e.AssertRules.STRING,!0).validate("timestamp",r,e.AssertRules.NUMBER,!0).validate("channelId",a,e.AssertRules.CHANNEL_ID).ifReady((function(d){return o(s,void 0,void 0,(function(){var o,s,d,u,c;return i(this,(function(i){switch(i.label){case 0:return o={targetId:t,conversationType:e.ConversationType.PRIVATE,channelId:a},s=new Xo("RC:ReadNtf",{messageUId:n,lastMessageSendTime:r,type:1}),[4,xi(o,s)];case 1:return d=i.sent(),u=d.code,c=d.msg,0===u?[2,{code:u}]:[2,{code:u,msg:c}]}}))}))}))]}))}))},exports.sendReadReceiptMessageV4=function(t,n,r){return void 0===r&&(r=""),o(this,void 0,void 0,(function(){var a=this;return i(this,(function(s){return[2,new e.ValidatorManage(e.LogTagId.A_SEND_MESSAGE_READ_RECEIPT_V4_T,e.LogTagId.A_SEND_MESSAGE_READ_RECEIPT_V4_R).validate("conversation",t,e.AssertRules.OBJECT,!0).validate("conversationType",null==t?void 0:t.conversationType,(function(t){return t===e.ConversationType.GROUP||t===e.ConversationType.PRIVATE}),!0,"It should be ConversationType.GROUP or ConversationType.PRIVATE").validate("targetId",null==t?void 0:t.targetId,e.AssertRules.STRING,!0).validate("channelId",null==t?void 0:t.channelId,e.AssertRules.CHANNEL_ID).validate("startMsgUId",r,e.AssertRules.ONLY_STRING,!0).validate("endMsgUId",n,e.AssertRules.STRING,!0).ifReady((function(s,d){return o(a,void 0,void 0,(function(){var o,a,u,c,l,v;return i(this,(function(i){switch(i.label){case 0:return o=d.createTraceId(),a="conversationType:"+t.conversationType+",targetId:"+t.targetId+",\n channelId: "+t.channelId+", startMsgUId:"+r+", endMsgUId: "+n,d.info(e.LogTagId.A_SEND_MESSAGE_READ_RECEIPT_V4_T,a,o),3!==(null==(u=s.getNaviInfoFromCache())?void 0:u.grpRRVer)?[2,{code:e.ErrorCode.READ_RECEIPT_V4_NOT_SUPPORT}]:[4,s.sendReadReceiptMessageV4(t,r,n)];case 1:return c=i.sent(),l=c.code,v=c.msg,d[l===e.ErrorCode.SUCCESS?"info":"warn"](e.LogTagId.A_SEND_MESSAGE_READ_RECEIPT_V4_R,"code: "+l+", msg: "+v,o),[2,{code:l,msg:v}]}}))}))}))]}))}))},exports.sendReadReceiptRequest=function(t,n,r){return o(this,void 0,void 0,(function(){var a=this;return i(this,(function(s){return[2,new e.ValidatorManage(e.LogTagId.A_SEND_MSG_T,e.LogTagId.A_SEND_MSG_R).validate("targetId",t,e.AssertRules.STRING,!0).validate("messageUId",n,e.AssertRules.STRING,!0).validate("channelId",r,e.AssertRules.CHANNEL_ID).ifReady((function(s,d){return o(a,void 0,void 0,(function(){var o,a,s,u,c;return i(this,(function(i){switch(i.label){case 0:return o="messageUId:"+n+",targetId:"+t,d.debug(e.LogTagId.A_SEND_MSG_T,"send read receipt message ->"+o),a=new Xo("RC:RRReqMsg",{messageUId:n}),[4,xi({targetId:t,conversationType:e.ConversationType.GROUP,channelId:r},a)];case 1:return s=i.sent(),u=s.code,c=s.msg,0===u?[2,{code:u}]:[2,{code:u,msg:c}]}}))}))}))]}))}))},exports.sendReadReceiptResponse=function(e,t,n){return o(this,void 0,void 0,(function(){return i(this,(function(e){throw new Error("This method is deprecated, please use method sendReadReceiptResponseV2.")}))}))},exports.sendReadReceiptResponseV2=function(t,n,r){return o(this,void 0,void 0,(function(){var a=this;return i(this,(function(s){return[2,new e.ValidatorManage(e.LogTagId.A_SEND_MSG_T,e.LogTagId.A_SEND_MSG_R).validate("targetId",t,e.AssertRules.STRING,!0).validate("channelId",r,e.AssertRules.CHANNEL_ID).ifReady((function(s,d){return o(a,void 0,void 0,(function(){var o,a,u,c,l;return i(this,(function(i){switch(i.label){case 0:return o={targetId:t,conversationType:e.ConversationType.GROUP,channelId:r},u=s.getNaviInfoFromCache(),1!==(null==u?void 0:u.grpRRVer)?[3,2]:[4,Hi(s,d,o,n)];case 1:return a=i.sent(),[3,4];case 2:return!e.validate("messageList",n,e.AssertRules.OBJECT,!1)||n&&Object.keys(n).some((function(t){return!e.validate(t,n[t],e.AssertRules.ARRAY)}))?[2,{code:e.ErrorCode.MSG_LIMIT_ERROR}]:(c=new Xo("RC:RRRspMsg",{receiptMessageDic:n}),[4,xi(o,c)]);case 3:a=i.sent(),i.label=4;case 4:return(l=a.code)===e.ErrorCode.SUCCESS?[2,{code:l}]:[2,{code:l,msg:Yo[l]}]}}))}))}))]}))}))},exports.sendSightMessage=ki,exports.sendSyncReadStatusMessage=function(t,n){return o(this,void 0,void 0,(function(){var r=this;return i(this,(function(a){return[2,new e.ValidatorManage(e.LogTagId.A_SYNC_READ_STATUS_T,e.LogTagId.A_SYNC_READ_STATUS_R).validate("timestamp",n,e.AssertRules.NUMBER,!0).validate("conversation",t,e.AssertRules.OBJECT,!0).validate("conversationType",null==t?void 0:t.conversationType,(function(t){return[e.ConversationType.GROUP,e.ConversationType.PRIVATE,e.ConversationType.APP_PUBLIC_SERVICE,e.ConversationType.PUBLIC_SERVICE,e.ConversationType.SYSTEM].includes(t)}),!0).validate("targetId",null==t?void 0:t.targetId,e.AssertRules.STRING,!0).validate("channelId",null==t?void 0:t.channelId,e.AssertRules.CHANNEL_ID).ifReady((function(a,s){return o(r,void 0,void 0,(function(){var r,o,d,u,c,l,v;return i(this,(function(i){switch(i.label){case 0:return r="conversationType:"+t.conversationType+",targetId:"+t.targetId+",\n channelId: "+t.channelId+", timestamp:"+n,o=s.createTraceId(),s.info(e.LogTagId.A_SYNC_READ_STATUS_T,r,o),1!==(null==(d=a.getNaviInfoFromCache())?void 0:d.sesDriven)?[3,2]:[4,a.updateConversationReadTime(t,n)];case 1:return u=i.sent(),[3,4];case 2:return c=new Xo("RC:SRSMsg",{lastMessageSendTime:n}),[4,xi(t,c)];case 3:u=i.sent(),i.label=4;case 4:return l=u.code,v=u.msg,s[l===e.ErrorCode.SUCCESS?"info":"warn"](e.LogTagId.A_SYNC_READ_STATUS_R,"code: "+l+", msg: "+v,o),[2,{code:l,msg:v}]}}))}))}))]}))}))},exports.sendTextMessage=function(e,t,n){return xi(e,new ni(t),n)},exports.sendTypingStatusMessage=function(t,n){return o(this,void 0,void 0,(function(){var r=this;return i(this,(function(a){return[2,new e.ValidatorManage(e.LogTagId.A_SEND_MSG_T,e.LogTagId.A_SEND_MSG_R).validate("conversation",t,e.AssertRules.OBJECT,!0).validate("conversationType",null==t?void 0:t.conversationType,e.AssertRules.CONVERSATION_TYPE,!0).validate("targetId",null==t?void 0:t.targetId,e.AssertRules.STRING,!0).validate("channelId",null==t?void 0:t.channelId,e.AssertRules.CHANNEL_ID).validate("messageType",n,e.AssertRules.STRING,!0).ifReady((function(a,s){return o(r,void 0,void 0,(function(){var r,o,d,u,c,l;return i(this,(function(i){switch(i.label){case 0:return r={messageType:"RC:TypSts",content:{typingContentType:n},isStatusMessage:!0,channelId:t.channelId},o=s.createTraceId(),s.info(e.LogTagId.A_SEND_MSG_T,JSON.stringify({messageType:r.messageType,conversationType:t.conversationType,targetId:t.targetId,channelId:t.channelId}),o),[4,a.sendMessage(t.conversationType,t.targetId,r,void 0,o)];case 1:return d=i.sent(),u=d.code,c=d.data,l=u===e.ErrorCode.SUCCESS?"info":"warn",s[l](e.LogTagId.A_SEND_MSG_R,JSON.stringify({code:u,messageUId:c?c.messageUId:"",messageId:c?c.messageId:""}),o),u===e.ErrorCode.SUCCESS?[2,{code:u,data:W(c)}]:[2,{code:u,msg:Yo[u]}]}}))}))}))]}))}))},exports.sendUltraGroupTypingStatus=function(t){return o(this,void 0,void 0,(function(){var n=this;return i(this,(function(r){return[2,new e.ValidatorManage(br,xr).validate("conversation",t,e.AssertRules.OBJECT,!0).validate("conversationType",null==t?void 0:t.conversationType,e.AssertRules.CONVERSATION_TYPE,!0).validate("targetId",null==t?void 0:t.targetId,e.AssertRules.STRING,!0).validate("channelId",null==t?void 0:t.channelId,e.AssertRules.CHANNEL_ID).ifReady((function(r,a){return o(n,void 0,void 0,(function(){var n,o,s;return i(this,(function(i){switch(i.label){case 0:return n=a.createTraceId(),a.info(br,JSON.stringify({targetId:t.targetId,channelId:t.channelId}),n),[4,r.sendUltraGroupTypingStatus(t)];case 1:return o=i.sent().code,s=o===e.ErrorCode.SUCCESS?"info":"warn",a[s](xr,JSON.stringify({code:o}),n),o===e.ErrorCode.SUCCESS?[2,{code:e.ErrorCode.SUCCESS}]:[2,{code:o,msg:Yo[o]}]}}))}))}))]}))}))},exports.setChatRoomEntries=function(t,n){return o(this,void 0,void 0,(function(){var r=this;return i(this,(function(a){return[2,new e.ValidatorManage(le,ve).validate("targetId",t,e.AssertRules.STRING,!0).validate("entries",null==n?void 0:n.entries,(function(t){return!!e.validate("entry.key",t,e.AssertRules.ARRAY,!0)&&n.entries.every((function(t){return e.validate("entry.key",t.key,e.AssertRules.STRING,!0)&&e.validate("entry.value",t.value,e.AssertRules.STRING,!0)}))}),!0).validate("isAutoDelete",null==n?void 0:n.isAutoDelete,e.AssertRules.BOOLEAN).validate("isForce",null==n?void 0:n.isForce,e.AssertRules.BOOLEAN).validate("notificationExtra",null==n?void 0:n.notificationExtra,e.isLimitedString({maxLength:e.MAX_CHATROOM_NOTIFICATION_EXTRA_LENGTH})).ifReady((function(a,s){return o(r,void 0,void 0,(function(){var r,o,d,u,c;return i(this,(function(i){switch(i.label){case 0:return n.entries.length>10?[2,Fo.CHATROOM_KV_STORE_OUT_LIMIT]:(r=s.createTraceId(),s.info(le,JSON.stringify({chatroomId:t,entries:n.entries.map((function(e){return{key:e.key,value:e.value}})),isAutoDelete:n.isAutoDelete,notificationExtra:n.notificationExtra,isForce:n.isForce}),r),[4,a.setChatroomEntries(t,n)]);case 1:return o=i.sent(),d=o.code,u=o.data,c=d===e.ErrorCode.SUCCESS?"info":"warn",s[c](ve,JSON.stringify({code:d}),r),d!==e.ErrorCode.SUCCESS?[2,{code:d,msg:Yo[d],data:u}]:[2,{code:d}]}}))}))}))]}))}))},exports.setChatRoomEntry=function(t,n){return o(this,void 0,void 0,(function(){var r=this;return i(this,(function(a){return[2,new e.ValidatorManage(ue,ce).validate("targetId",t,e.AssertRules.STRING,!0).validate("key",null==n?void 0:n.key,e.AssertRules.STRING,!0).validate("value",null==n?void 0:n.value,e.AssertRules.STRING,!0).validate("isAutoDelete",null==n?void 0:n.isAutoDelete,e.AssertRules.BOOLEAN).validate("isSendNotification",null==n?void 0:n.isSendNotification,e.AssertRules.BOOLEAN).validate("notificationExtra",null==n?void 0:n.notificationExtra,e.isLimitedString({maxLength:e.MAX_CHATROOM_NOTIFICATION_EXTRA_LENGTH})).ifReady((function(a,s){return o(r,void 0,void 0,(function(){var r,o,d;return i(this,(function(i){switch(i.label){case 0:return r=s.createTraceId(),s.info(ue,JSON.stringify({chatroomId:t,key:n.key,value:n.value,isSendNotification:n.isSendNotification,isAutoDelete:n.isAutoDelete,notificationExtra:n.notificationExtra}),r),[4,a.setChatroomEntry(t,n)];case 1:return o=i.sent(),d=o===e.ErrorCode.SUCCESS?"info":"warn",s[d](ce,JSON.stringify({code:o}),r),o!==e.ErrorCode.SUCCESS?[2,{code:o,msg:Yo[o]}]:[2,{code:o}]}}))}))}))]}))}))},exports.setConversationNotificationLevel=function(t,n){return o(this,void 0,void 0,(function(){return i(this,(function(r){return[2,new e.ValidatorManage(Ze,$e).validate("conversation",t,e.AssertRules.OBJECT,!0).validate("conversationType",null==t?void 0:t.conversationType,e.AssertRules.CONVERSATION_TYPE,!0).validate("targetId",null==t?void 0:t.targetId,e.AssertRules.STRING,!0).validate("channelId",null==t?void 0:t.channelId,e.AssertRules.CHANNEL_ID).validate("notificationLevel",n,(function(t){return void 0!==e.NotificationLevel[t]}),!0).ifReady((function(e,r){return Wo(r,t,(function(){return e.setConversationNotificationLevel(t.conversationType,t.targetId,n,t.channelId)}),"setConversationNotificationLevel")}))]}))}))},exports.setConversationNotificationStatus=function(t,n){return o(this,void 0,void 0,(function(){return i(this,(function(r){return[2,new e.ValidatorManage(st,dt).validate("conversation",t,e.AssertRules.OBJECT,!0).validate("conversationType",null==t?void 0:t.conversationType,e.AssertRules.CONVERSATION_TYPE,!0).validate("targetId",null==t?void 0:t.targetId,e.AssertRules.STRING,!0).validate("channelId",null==t?void 0:t.channelId,e.AssertRules.CHANNEL_ID).validate("notificationStatus",n,(function(e){return 1===e||2===e}),!0).ifReady((function(e,r){return Wo(r,t,(function(){return e.setConversationStatus(t.conversationType,t.targetId,void 0,n,t.channelId)}),"setConversationNotificationStatus")}))]}))}))},exports.setConversationToTop=function(t,n,r){return void 0===n&&(n=!0),void 0===r&&(r=!0),o(this,void 0,void 0,(function(){var a=this;return i(this,(function(s){return[2,new e.ValidatorManage(et,nt).validate("conversation",t,e.AssertRules.OBJECT,!0).validate("conversationType",null==t?void 0:t.conversationType,e.AssertRules.CONVERSATION_TYPE,!0).validate("targetId",null==t?void 0:t.targetId,e.AssertRules.STRING,!0).validate("channelId",null==t?void 0:t.channelId,e.AssertRules.CHANNEL_ID).validate("isTop",n,e.AssertRules.BOOLEAN).validate("isUpdateTime",r,e.AssertRules.BOOLEAN).ifReady((function(s,d){return o(a,void 0,void 0,(function(){var o,a,u,c,l,v;return i(this,(function(i){switch(i.label){case 0:return o=t.conversationType,a=t.targetId,u=t.channelId,c=d.createTraceId(),d.info(et,JSON.stringify({conversationType:o,targetId:a,channelId:u,isTop:n}),c),[4,s.setConversationStatus(t.conversationType,t.targetId,n,void 0,t.channelId,r)];case 1:return l=i.sent(),v=l===e.ErrorCode.SUCCESS?"info":"warn",d[v](nt,JSON.stringify({code:l}),c),l!==e.ErrorCode.SUCCESS?[2,{code:l,msg:Yo[l]}]:[2,{code:l}]}}))}))}))]}))}))},exports.setConversationToTopInTag=function(t,n,r){return o(this,void 0,void 0,(function(){var a=this;return i(this,(function(s){return[2,new e.ValidatorManage(Nr,Or).validate("tagId",t,e.AssertRules.STRING,!0).validate("isTop",r,e.AssertRules.BOOLEAN,!0).validate("conversationType",null==n?void 0:n.conversationType,e.AssertRules.CONVERSATION_TYPE,!0).validate("targetId",null==n?void 0:n.targetId,e.AssertRules.STRING,!0).validate("channelId",null==n?void 0:n.channelId,e.AssertRules.CHANNEL_ID).ifReady((function(s,d){return o(a,void 0,void 0,(function(){var o,a,u;return i(this,(function(i){switch(i.label){case 0:return o=d.createTraceId(),d.info(Nr,JSON.stringify({tagId:t,targetId:n.targetId,conversationType:n.conversationType,isTop:r}),o),[4,s.setConversationStatusInTag(t,n,{isTop:r})];case 1:return a=i.sent().code,u=a===e.ErrorCode.SUCCESS?"info":"warn",d[u](Ur,JSON.stringify({code:a}),o),a===e.ErrorCode.SUCCESS?[2,{code:a}]:[2,{code:a,msg:Yo[a]}]}}))}))}))]}))}))},exports.setConversationTypeNotificationLevel=function(t,n){return o(this,void 0,void 0,(function(){var r=this;return i(this,(function(a){return e.validate("conversationType",t,(function(){return[e.ConversationType.PRIVATE,e.ConversationType.GROUP,e.ConversationType.SYSTEM,e.ConversationType.PUBLIC_SERVICE,e.ConversationType.APP_PUBLIC_SERVICE,e.ConversationType.ULTRA_GROUP].includes(t)}))&&e.validate("level",n,e.isValidNotificationLevel)?[2,ko((function(a,s){return o(r,void 0,void 0,(function(){var r,o,d;return i(this,(function(i){switch(i.label){case 0:return s.info(e.LogTagId.O,"setConversationTypeNotificationLevel ->conversationType:"+t+",level:"+n),[4,a.setConversationTypeNotificationLevel(t,n)];case 1:return r=i.sent(),o=r.code,d=r.data,o===e.ErrorCode.SUCCESS?[2,{code:o,data:d}]:(s.warn(e.LogTagId.O,"setConversationTypeNotificationLevel ->conversationType:"+t+",level:"+n),[2,{code:o,msg:Yo[o]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.setMessageReceivedStatus=function(t,n){return o(this,void 0,void 0,(function(){var r=this;return i(this,(function(a){return Q("RongIMLib.setMessageReceivedStatus","RongIMLib.ElectronExtension.setMessageReceivedStatus"),e.usingCppEngine()?[2,new e.ValidatorManage($n,er).validate("messageId",t,e.AssertRules.NUMBER,!0).validate("receivedStatus",n,e.AssertRules.NUMBER,!0).ifReady((function(a,s){return o(r,void 0,void 0,(function(){var r,o,d;return i(this,(function(i){switch(i.label){case 0:return r=s.createTraceId(),s.info($n,JSON.stringify({messageId:t,receivedStatus:n}),r),[4,a.setMessageReceivedStatus(t,n)];case 1:return o=i.sent(),d=o===e.ErrorCode.SUCCESS?"info":"warn",s[d](er,JSON.stringify({code:o}),r),o===e.ErrorCode.SUCCESS?[2,{code:o}]:[2,{code:o,msg:Yo[o]}]}}))}))}))]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:Yo[e.ErrorCode.NOT_SUPPORT]}]}))}))},exports.setProxy=function(t){return o(this,void 0,void 0,(function(){var n=this;return i(this,(function(r){return[2,new e.ValidatorManage(tr,nr).validate("set.proxy",t,(function(n){return!!(!t||e.validate("proxy.socksHost",t.socksHost,e.AssertRules.STRING,!0)&&e.validate("proxy.socksPort",t.socksPort,e.AssertRules.NUMBER,!0))})).ifReady((function(r,a){return o(n,void 0,void 0,(function(){var n,o,s;return i(this,(function(i){switch(i.label){case 0:return n=a.createTraceId(),a.info(tr,JSON.stringify({socksHost:null==t?void 0:t.socksHost,socksPort:null==t?void 0:t.socksPort}),n),[4,r.setProxy(t)];case 1:return o=i.sent().code,s=o===e.ErrorCode.SUCCESS?"info":"warn",a[s](nr,JSON.stringify({code:o}),n),o===e.ErrorCode.SUCCESS?[2,{code:o}]:[2,{code:o,msg:Yo[o]}]}}))}))}))]}))}))},exports.setUltraGroupDefaultNotificationLevel=function(t,n){return o(this,void 0,void 0,(function(){var r=this;return i(this,(function(a){return t.channelId=t.channelId||"",[2,new e.ValidatorManage(Xr,Qr).validate("targetId",null==t?void 0:t.targetId,e.AssertRules.STRING,!0).validate("channelId",null==t?void 0:t.channelId,e.AssertRules.CHANNEL_ID).validate("notificationLevel",n,(function(t){return void 0!==e.NotificationLevel[t]}),!0).ifReady((function(a,s){return o(r,void 0,void 0,(function(){var r,o,d;return i(this,(function(i){switch(i.label){case 0:return r=s.createTraceId(),s.info(Xr,JSON.stringify({targetId:t.targetId,channelId:t.channelId,notificationLevel:n}),r),[4,a.setUltraGroupDefaultNotificationLevel(t.targetId,n,t.channelId)];case 1:return o=i.sent().code,d=o===e.ErrorCode.SUCCESS?"info":"warn",s[d](Qr,JSON.stringify({code:o}),r),o===e.ErrorCode.SUCCESS?[2,{code:o}]:[2,{code:o,msg:Yo[o]}]}}))}))}))]}))}))},exports.stopUploadTask=function(t){return o(this,void 0,void 0,(function(){return i(this,(function(n){return[2,{code:e.ErrorCode.SUCCESS,data:Pi(t)}]}))}))},exports.subscribeUserStatus=function(t,n,r){return o(this,void 0,void 0,(function(){var a=this;return i(this,(function(s){return[2,new e.ValidatorManage(lo,vo).validate("subscribeUserIds",t,e.isLimitedArray({maxLength:200,minLength:1,itemValidator:e.isValidTargetId}),!0).validate("subscribeType",n,(function(t){return[e.SubscribeType.ONLINE_STATUS,e.SubscribeType.USER_PROFILE].includes(t)}),!0).validate("expiry",r,e.isInteger({min:60,max:2592e3}),!0).ifReady((function(s,d){return o(a,void 0,void 0,(function(){var o,a,u,c,l;return i(this,(function(i){switch(i.label){case 0:return o=d.createTraceId(),d.info(lo,JSON.stringify({userIds:t,subscribeType:n,expiry:r}),o),[4,s.subscribeUser(t,n,r)];case 1:return a=i.sent(),u=a.code,c=a.data,l=u===e.ErrorCode.SUCCESS?"info":"warn",d[l](vo,JSON.stringify({code:u,data:c}),o),[2,{code:u,data:c}]}}))}))}))]}))}))},exports.testProxy=function(t,n){return o(this,void 0,void 0,(function(){var r=this;return i(this,(function(a){return[2,new e.ValidatorManage(ir,ar).validate("test.proxy",t,e.AssertRules.OBJECT,!0).validate("test.proxy.socksHost",null==t?void 0:t.socksHost,e.AssertRules.STRING,!0).validate("test.proxy.socksPort",null==t?void 0:t.socksPort,e.AssertRules.NUMBER,!0).ifReady((function(a,s){return o(r,void 0,void 0,(function(){var r,o,d,u;return i(this,(function(i){switch(i.label){case 0:return r=s.createTraceId(),s.info(ir,JSON.stringify({socksHost:null==t?void 0:t.socksHost,socksPort:null==t?void 0:t.socksPort}),r),[4,a.testProxy(t,n)];case 1:return o=i.sent(),d=o.status,u=o.data,d===e.ErrorCode.SUCCESS?[2,{code:d,msg:u}]:(s.warn(ar,JSON.stringify({status:d}),r),[2,{code:d,msg:Yo[d]}])}}))}))}))]}))}))},exports.unSubscribeUserStatus=function(t,n){return o(this,void 0,void 0,(function(){var r=this;return i(this,(function(a){return[2,new e.ValidatorManage(fo,go).validate("subscribeUserIds",t,e.isLimitedArray({maxLength:200,minLength:1,itemValidator:e.isValidTargetId}),!0).validate("subscribeType",n,(function(t){return[e.SubscribeType.ONLINE_STATUS,e.SubscribeType.USER_PROFILE].includes(t)}),!0).ifReady((function(a,s){return o(r,void 0,void 0,(function(){var r,o,d;return i(this,(function(i){switch(i.label){case 0:return r=s.createTraceId(),s.info(fo,JSON.stringify({userIds:t,subscribeType:n}),r),[4,a.unSubscribeUser(t,n)];case 1:return o=i.sent().code,d=o===e.ErrorCode.SUCCESS?"info":"warn",s[d](go,JSON.stringify({code:o}),r),[2,{code:o}]}}))}))}))]}))}))},exports.updateExpansionForUltraGroupMessage=function(t,n){return o(this,void 0,void 0,(function(){var r=this;return i(this,(function(a){return[2,new e.ValidatorManage(Jr,Vr).validate("expansion",t,e.AssertRules.OBJECT,!0).validate("message",n,e.AssertRules.OBJECT,!0).ifReady((function(a,s){return o(r,void 0,void 0,(function(){var r,o,d,u,c,l,v,f,g,T;return i(this,(function(i){switch(i.label){case 0:return r=n.conversationType,o=n.targetId,d=n.messageUId,u=n.sentTime,c=n.canIncludeExpansion,l=n.channelId,v=s.createTraceId(),s.info(Jr,JSON.stringify({conversationType:r,targetId:o,messageUId:d,channelId:l}),v),f={targetId:o,channelId:l,conversationType:r,sendTime:u,canIncludeExpansion:c,messageUId:d,expansion:t},[4,a.expandUltraMessage(f)];case 1:return g=i.sent().code,T=g===e.ErrorCode.SUCCESS?"info":"warn",s[T](Vr,JSON.stringify({code:g}),v),g===e.ErrorCode.SUCCESS?[2,{code:e.ErrorCode.SUCCESS}]:[2,{code:g,msg:Yo[g]}]}}))}))}))]}))}))},exports.updateMessageExpansion=function(t,n){return o(this,void 0,void 0,(function(){var r=this;return i(this,(function(a){return[2,new e.ValidatorManage(Un,Mn).validate("expansion",t,e.AssertRules.OBJECT,!0).validate("message",n,e.AssertRules.OBJECT,!0).validate("conversationType",null==n?void 0:n.conversationType,e.AssertRules.NUMBER,!0).validate("targetId",null==n?void 0:n.targetId,e.AssertRules.STRING,!0).validate("channelId",null==n?void 0:n.channelId,e.AssertRules.CHANNEL_ID).validate("messageUId",null==n?void 0:n.messageUId,e.AssertRules.STRING,!0).validate("expansion",null==n?void 0:n.expansion,e.AssertRules.OBJECT).validate("canIncludeExpansion",null==n?void 0:n.canIncludeExpansion,e.AssertRules.BOOLEAN,!0).ifReady((function(a,s){return o(r,void 0,void 0,(function(){var r,o,d,u,c,l,v,f,g;return i(this,(function(i){switch(i.label){case 0:return r=n.conversationType,o=n.targetId,d=n.messageUId,u=n.canIncludeExpansion,c=n.expansion,l=n.channelId,v=s.createTraceId(),s.info(Un,JSON.stringify({targetId:o,channelId:l,conversationType:r,messageUId:d,canIncludeExpansion:u}),v),[4,a.sendExpansionMessage({conversationType:r,targetId:o,messageUId:d,expansion:t,canIncludeExpansion:u,originExpansion:c,channelId:l})];case 1:return f=i.sent().code,g=f===e.ErrorCode.SUCCESS?"info":"warn",s[g](Mn,JSON.stringify({code:f}),v),f!==e.ErrorCode.SUCCESS?[2,{code:f,msg:Yo[f]}]:[2,{code:f}]}}))}))}))]}))}))},exports.updateMyUserProfile=function(t){var n=this;return new e.ValidatorManage(Eo,Ro).validate("profile",t,e.AssertRules.OBJECT,!0).validate("profile",t.name,e.AssertRules.ONLY_STRING).validate("profile",t.portraitUri,e.AssertRules.ONLY_STRING).validate("profile",t.email,e.AssertRules.ONLY_STRING).validate("profile",t.birthday,e.AssertRules.ONLY_STRING).validate("profile",t.gender,e.AssertRules.NUMBER).validate("profile",t.location,e.AssertRules.ONLY_STRING).validate("profile",t.role,e.AssertRules.NUMBER).validate("profile",t.level,e.AssertRules.NUMBER).validate("profile",t.extraProfile,e.AssertRules.OBJECT).validate("profile",t.extraProfile,(function(e){for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&"string"!=typeof e[t])return!1;return!0})).ifReady((function(a,s){return o(n,void 0,void 0,(function(){var n,o,d,u,c,l,v;return i(this,(function(i){switch(i.label){case 0:return n=s.createTraceId(),s.info(Eo,JSON.stringify({profile:t}),n),o=t.extraProfile,d={},["name","portraitUri","email","birthday","gender","location","role","level"].forEach((function(n){e.isUndefined(t[n])||(d[n]=t[n])})),e.isUndefined(o)||(d.extraProfile=r({},o)),[4,a.updateMyUserProfile(d)];case 1:return u=i.sent(),c=u.code,l=u.data,v=c===e.ErrorCode.SUCCESS?"info":"warn",s[v](Ro,JSON.stringify({code:c,data:l}),n),[2,{code:c,data:l}]}}))}))}))},exports.updateMyUserProfileVisibility=function(t){var n=this;return new e.ValidatorManage(No,Oo).validate("userProfileVisibility",t,(function(t){return[e.UserProfileVisibility.NOT_SET,e.UserProfileVisibility.INVISIBLE,e.UserProfileVisibility.EVERYONE].includes(t)}),!0).ifReady((function(r,a){return o(n,void 0,void 0,(function(){var n,o,s,d,u;return i(this,(function(i){switch(i.label){case 0:return n=a.createTraceId(),a.info(No,t,n),[4,r.updateMyUserProfileVisibility(t)];case 1:return o=i.sent(),s=o.code,d=o.data,u=s===e.ErrorCode.SUCCESS?"info":"warn",a[u](Oo,JSON.stringify({code:s,data:d}),n),[2,{code:s,data:d}]}}))}))}))},exports.updateTag=function(t){return o(this,void 0,void 0,(function(){var n=this;return i(this,(function(r){return[2,new e.ValidatorManage(lr,vr).validate("tagId",null==t?void 0:t.tagId,e.AssertRules.STRING,!0).validate("tagName",null==t?void 0:t.tagName,e.AssertRules.STRING,!0).validate("tagName",null==t?void 0:t.tagName,(function(e){return!!e&&e.length<=15})).ifReady((function(r,a){return o(n,void 0,void 0,(function(){var n,o,s;return i(this,(function(i){switch(i.label){case 0:return n=a.createTraceId(),a.info(lr,JSON.stringify({tagId:t.tagId,tagName:t.tagName}),n),[4,r.updateTag(t)];case 1:return o=i.sent().code,s=o===e.ErrorCode.SUCCESS?"info":"warn",a[s](vr,JSON.stringify({code:o}),n),o===e.ErrorCode.SUCCESS?[2,{code:o}]:[2,{code:o,msg:Yo[o]}]}}))}))}))]}))}))},exports.upload=bi;
|