@rongcloud/electron 5.14.0 → 5.14.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- "use strict";var t=require("os"),e=require("path"),n=require("child_process"),o=require("http"),r=require("https"),i=require("zlib"),s=require("url"),a=require("net"),_=require("events"),c=require("tls"),u=require("fs"),E=require("crypto");function R(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}function l(t){if(t&&t.__esModule)return t;var e=Object.create(null);return t&&Object.keys(t).forEach((function(n){if("default"!==n){var o=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,o.get?o:{enumerable:!0,get:function(){return t[n]}})}})),e.default=t,Object.freeze(e)}var d=l(t),p=R(i),C=function(t,e){return C=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},C(t,e)};function T(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}C(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var I,S,h,N,f,O,A,g,P,v,L,m,y,M,U,D,G,V,b,F,w,x,B,k,H,J,Y,W,K,j,X,Q,q,Z,z,$,tt,et,nt,ot,rt,it,st,at,_t,ct,ut,Et,Rt,lt,dt,pt,Ct,Tt,It,St,ht,Nt,ft,Ot,At,gt,Pt,vt,Lt,mt,yt,Mt,Ut=function(){return Ut=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},Ut.apply(this,arguments)};function Dt(t,e,n,o){return new(n||(n=Promise))((function(r,i){function s(t){try{_(o.next(t))}catch(t){i(t)}}function a(t){try{_(o.throw(t))}catch(t){i(t)}}function _(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}_((o=o.apply(t,e||[])).next())}))}function Gt(t,e){var n,o,r,i,s={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,o&&(r=2&i[0]?o.return:i[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,i[1])).done)return r;switch(o=0,r&&(i=[2&i[0],r.value]),i[0]){case 0:case 1:r=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,o=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(r=s.trys,(r=r.length>0&&r[r.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!r||i[1]>r[0]&&i[1]<r[3])){s.label=i[1];break}if(6===i[0]&&s.label<r[1]){s.label=r[1],r=i;break}if(r&&s.label<r[2]){s.label=r[2],s.ops.push(i);break}r[2]&&s.ops.pop(),s.trys.pop();continue}i=e.call(t,s)}catch(t){i=[6,t],o=0}finally{n=r=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}}function Vt(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],o=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&o>=t.length&&(t=void 0),{value:t&&t[o++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function bt(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var o,r,i=n.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(o=i.next()).done;)s.push(o.value)}catch(t){r={error:t}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return s}function Ft(t,e,n){if(n||2===arguments.length)for(var o,r=0,i=e.length;r<i;r++)!o&&r in e||(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))}!function(t){t[t.QINIU=1]="QINIU",t[t.ALI=2]="ALI",t[t.AWS=3]="AWS",t[t.STC=4]="STC",t[t.MINIO=5]="MINIO"}(I||(I={})),function(t){t.L_IMSDK_VER_O="L-imsdk_ver-O",t.A_INIT_O="A-init-O",t.A_INIT_REPEAT_O="A_INIT_REPEAT_O",t.L_INIT_O="L-init-O",t.A_DESTROY_O="A_DESTROY_O",t.L_DESTROY_O="L_DESTROY_O",t.A_CONNECT_T="A-connect-T",t.A_CONNECT_R="A-connect-R",t.A_CONNECT_S="A-connect-S",t.A_DISCONNECT_O="A-disconnect-O",t.A_RECONNECT_T="A-reconnect-T",t.A_RECONNECT_R="A_RECONNECT_R",t.L_CONNECT_T="L-connect-T",t.L_CONNECT_R="L-connect-R",t.L_CONNECT_S="L-connect-S",t.L_DB_UPGRATE_START_S="L-db_upgrate_start-S",t.L_DB_UPGRATING_S="L-db_upgrating-S",t.L_DB_UPGRATE_COMPLETE_S="L-db_upgrate_complete-S",t.L_NOTIFY_ULTRA_ONLINE_S="L-notify-ultra-online-S",t.L_ULTRA_SYNC_DONE_S="L-ultra-sync-done-S",t.L_BATCH_MESSAGE_O="L-BATCH_MESSAGE-O",t.A_MSG_LISTENER_E="A-MSG_LISTENER-E",t.O="L-original-O",t.T="L-TEST-O",t.L_INSTALL_PLUGIN_T="L-INSTALL_PLUGIN-T",t.L_INSTALL_PLUGIN_R="L-INSTALL_PLUGIN-R",t.L_NAVI_CONF_E="L-NAVI_CONF_ERROR-E",t.L_NAVI_CMP_R="L-NAVI_CPM-R",t.A_SEND_MSG_T="A-send_msg-T",t.A_SEND_MSG_R="A-send_msg-R",t.L_SEND_MSG_T="L-send_msg-T",t.L_SEND_MSG_R="L-send_msg-R",t.L_PULL_MSG_T="L-pull_msg-T",t.L_PULL_MSG_R="L-pull_msg-R",t.L_PULL_MSG_E="L-pull_msg-E",t.L_PULL_MSG_O="L-pull_msg-O",t.L_PULL_ULTRA_MSG_T="L-pull_ultra_msg-T",t.L_PULL_ULTRA_MSG_R="L-pull_ultra_msg-R",t.L_PULL_CHATROOM_KV_T="L-pull_chatroom_kv-T",t.L_PULL_CHATROOM_KV_R="L-pull_chatroom_kv-R",t.L_PULL_CHATROOM_MSG_T="L-pull_chatroom_msg-T",t.L_PULL_CHATROOM_MSG_R="L-pull_chatroom_msg-R",t.L_RECV_MULTI_SYNC_MSG_O="L-recv_multi_sync_msg-O",t.L_RECV_S_MSG_O="L-recv_s_msg-O",t.A_DELETE_MESSAGES_S="A-delete_messages-S",t.P_DELETE_MSG_S="P-delete_msg-S",t.L_PULL_CONVERSATION_S="L-pull_conversation-S",t.L_RECALL_ULTRA_MSG_S="L-recall_ultra_msg-S",t.A_REGTYP_O="A-regtyp-O",t.P_REGTYP_E="P-regtype-E",t.L_GET_NAVI_T="L-get_navi-T",t.L_GET_NAVI_R="L-get_navi-R",t.L_REQUEST_T="L-request-T",t.L_REQUEST_R="L-request-R",t.L_PARSE_NAVI_E="L-parse_navi-E",t.L_ENV_S="L-Env-S",t.L_GET_INDEX_NAVI_S="L-get_index_navi-S",t.A_JOIN_CHATROOM_T="A-join_chatroom-T",t.A_JOIN_CHATROOM_R="A-join_chatroom-R",t.L_JOIN_CHATROOM_T="L-join_chatroom-T",t.L_JOIN_CHATROOM_R="L-join_chatroom-R",t.A_QUIT_CHATROOM_T="A-quit_chatroom-T",t.A_QUIT_CHATROOM_R="A-quit_chatroom-R",t.L_REJOIN_CHATROOM_T="L-rejoin_chatroom-T",t.L_REJOIN_CHATROOM_R="L-rejoin_chatroom-R",t.L_REJOIN_CHATROOM_S="L-rejoin_chatroom-S",t.L_MEDIA_S="L-media-S",t.L_MEDIA_UPLOAD_T="L-media_upload-T",t.L_MEDIA_UPLOAD_R="L-media_upload-R",t.G_UPLOAD_LOG_S="G-upload_log-S",t.G_REPORT_LOG_S="G-report_log-S",t.G_UPLOAD_LOG_E="G-upload_log-E",t.G_GET_REAL_TIMELOG_COMMAND_S="G-get_real_timelog_command-S",t.L_CHECK_ALIVE_IM_T="L-check_alive_im-T",t.L_CHECK_ALIVE_IM_R="L-check_alive_im-R",t.L_CHECK_ALIVE_IM_S="L-check_alive_im-S",t.A_GET_HISTORY_MSG_T="A-get_history_msg-T",t.A_GET_HISTORY_MSG_R="A-get_history_msg-R",t.L_GET_HISTORY_MSG_T="L-get_history_msg-T",t.L_GET_HISTORY_MSG_R="L-get_history_msg-R",t.A_GET_PRIVATE_MESSAGE_DELIVER_TIME_E="A-get_privage_message_deliver_time-E",t.A_GET_GROUP_MESSAGE_DELIVER_LIST_E="A-get_group_message_deliver_list-E",t.A_CALLBACK_O="A-callback-O",t.A_CALLBACK_E="A-callback-E",t.L_CALLBACK_E="L-callback-E",t.A_SEND_MESSAGE_READ_RECEIPT_V4_T="A-send_message_read_receipt_V4-T",t.A_SEND_MESSAGE_READ_RECEIPT_V4_R="A-send_message_read_receipt_V4-R",t.A_GET_MESSAGE_READ_RECEIPT_V4_T="A-get_message_read_receipt_V4-T",t.A_GET_MESSAGE_READ_RECEIPT_V4_R="A-get_message_read_receipt_V4-R",t.A_BATCH_GET_MESSAGE_READ_RECEIPT_INFO_V4_T="A-batch_get_message_read_receipt_info_V4-T",t.A_BATCH_GET_MESSAGE_READ_RECEIPT_INFO_V4_R="A-batch_get_message_read_receipt_info_V4-R",t.A_SYNC_READ_STATUS_T="A-sync_read_status-T",t.A_SYNC_READ_STATUS_R="A-sync_read_status-R",t.A_GET_TOP_CONVERSATION_LIST_E="A-get_top_conversation_list-E",t.L_PB_ENCODE_E="L-pb-encode-E",t.L_PB_DECODE_E="L-pb-decode-E",t.L_NOTIFY_NAVI_CHANGE_E="L-notify_navi_change-E",t.L_REPORT_FULL_LOG_O="L-report_full_log-O",t.L_REPORT_FULL_LOG_T="L-report_full_log-T",t.L_REPORT_FULL_LOG_R="L-report_full_log-R",t.L_REPORT_LOG_POLICY_E="L-parse_navi_logpolicy-E",t.L_UNSUPPORT_INDEXDB_O="L-unsupport_IndexDB-O",t.L_LOGDB_OPEN_FAILED_E="L-logDB_open_failed-E",t.L_LOGDB_CLOSED_S="L-logDB_closed-S",t.L_LOGDB_ERROR_E="L-logDB_error-S",t.L_LOGDB_ABORT_S="L-logDB_abort-S",t.L_REALTIME_LOG_R="L_REALTIME_LOG_R",t.L_REALTIME_LOG_O="L_REALTIME_LOG_O",t.L_REALTIME_LOG_T="L_REALTIME_LOG_T",t.L_STATISTIC_LOG_R="L_STATISTIC_LOG_R",t.L_STATISTIC_LOG_O="L_STATISTIC_LOG_O",t.L_STATISTIC_LOG_T="L_STATISTIC_LOG_T",t.L_UNKNOWN_TOPIC_E="L_UNKNOWN_TOPIC_E",t.L_RECV_RMTP_O="L_RECV_RMTP_O",t.L_RECV_RMTP_E="L_RECV_RMTP_E",t.L_RECV_S_NTF_O="L-recv_s_ntf_O",t.L_VER_REPORT_T="L-VER_REPORT-T",t.L_VER_REPORT_R="L-VER_REPORT-R",t.L_CALL_MAIN_SYNC_O="L_CALL_MAIN_SYNC_O",t.L_UNSUPPORT_NTF_FROM_MAIN_E="L_UNSUPPORT_NTF_FROM_MAIN_E",t.A_SET_MSG_CONTENT_O="A_SET_MSG_CONTENT_O",t.A_REMOVE_PROXY_O="A-remove_proxy-O",t.A_SET_PROXY_O="A-set_proxy-O",t.A_TEST_PROXY_O="A-test_proxy-O",t.L_WEBSOCKET_DISACCORD_E="L-websocket_disaccord-e",t.A_SEARCH_MESSAGE_BY_USER_T="A-search_messages_by_user-T",t.A_SEARCH_MESSAGE_BY_USER_R="A-search_messages_by_user-R",t.L_GET_STATIC_CONF_T="L-get_static_conf-T",t.L_GET_STATIC_CONF_R="L-get_static_conf-R",t.L_GET_STATIC_CONF_E="L-get_static_conf-E",t.L_CLOUD_DISABLED="L-cloud_disabled",t.L_CLOUD_EXPIRE="L-cloud_expire",t.L_CLOUD_OVERCLOCK="L-cloud_overclock",t.L_CLOUD_APPKEY_REGION_E="L-cloud_appkey_region_error",t.L_CLOUD_CONFIG_DATA_E="L-cloud_config_data_error",t.L_CLOUD_SET_CACHE_O="L-cloud_set_cache-O",t.L_CLOUD_GET_CACHE_O="L-cloud_get_cache-O",t.L_CLOUD_MSG_NTF_O="L-cloud_msg_ntf-O",t.L_CLOUD_SET_AREA_CODE_O="L-cloud_set_area_code-O",t.L_CLOUD_SET_MRTR_O="L-cloud_set_mrtr-O",t.L_SYNC_SUBSCRIBED_USER_STATUS_FINISHED_S="L-sync_subscribed_user_status_finished-S",t.L_PULL_SUBSCRIBED_USER_RELATION_T="L-pull_subscribed_user_relation-T",t.L_PULL_SUBSCRIBED_USER_RELATION_R="L-pull_subscribed_user_relation-R",t.L_PULL_SUBSCRIBED_USER_STATUS_T="L-pull_subscribed_user_status-T",t.L_PULL_SUBSCRIBED_USER_STATUS_R="L-pull_subscribed_user_status-R",t.L_OWN_USER_PROFILE_CHANGED_S="L-own_user_profile_changed-S",t.L_QUERY_SUBSCRIBE_DATA_T="L-query_subscribe_data-T",t.L_QUERY_SUBSCRIBE_DATA_R="L-query_subscribe_data-R",t.L_PULL_USER_PROFILE_T="L-pull_user_profile-T",t.L_PULL_USER_PROFILE_R="L-pull_user_profile-R",t.L_PULL_OWN_PROFILE_T="L-pull_own_profile-T",t.L_PULL_OWN_PROFILE_R="L-pull_own_profile-R",t.L_QUERY_FRIEND_LIST_T="L-query_friend_list-T",t.L_QUERY_FRIEND_LIST_R="L-query_friend_list-R",t.L_PULL_USER_PROFILE_REQ_T="L-pull_user_profile_req-T",t.L_PULL_USER_PROFILE_REQ_R="L-pull_user_profile_req-R",t.L_PULL_EVENT_CHANGE_NOTIFY_ULTRA_ONLINE_S="L-pull_event_change_notify_ultra_online-S",t.L_PULL_EVENT_CHANGE_T="L-pull_event_change-T",t.L_PULL_EVENT_CHANGE_R="L-pull_event_change-R",t.L_PARSE_JSON_E="L-parse_json-E"}(S||(S={})),function(t){t[t.BOTH=2]="BOTH"}(h||(h={})),function(t){t[t.BOTH=2]="BOTH"}(N||(N={})),function(t){t[t.FREE=1]="FREE",t[t.NEED_VERIFY=2]="NEED_VERIFY",t[t.NO_ONE_ALLOWED=3]="NO_ONE_ALLOWED"}(f||(f={})),function(t){t[t.NONE=0]="NONE",t[t.IN_MY_FRIEND_LIST=1]="IN_MY_FRIEND_LIST",t[t.IN_OTHER_FRIEND_LIST=2]="IN_OTHER_FRIEND_LIST",t[t.BOTH_WAY=3]="BOTH_WAY"}(O||(O={})),function(t){t[t.SENT=1]="SENT",t[t.RECEIVED=2]="RECEIVED"}(A||(A={})),function(t){t[t.UNHANDLED=0]="UNHANDLED",t[t.ACCEPTED=1]="ACCEPTED",t[t.REFUSED=2]="REFUSED",t[t.EXPIRED=3]="EXPIRED"}(g||(g={})),function(t){t[t.FRIEND_APPLICATION=31]="FRIEND_APPLICATION"}(P||(P={})),function(t){t[t.FRIEND_APPLY=0]="FRIEND_APPLY",t[t.FRIEND_REFUSE=1]="FRIEND_REFUSE",t[t.FRIEND_USER_INFO=2]="FRIEND_USER_INFO",t[t.FRIENDS_INPUT=3]="FRIENDS_INPUT",t[t.FRIEND_CLEAR=4]="FRIEND_CLEAR",t[t.FRIEND_INFO_CHANGE=5]="FRIEND_INFO_CHANGE",t[t.FRIEND_INFO_CHANGE_SYNC=6]="FRIEND_INFO_CHANGE_SYNC"}(v||(v={})),function(t){t[t.OWNER_VERIFY=0]="OWNER_VERIFY",t[t.FREE=1]="FREE",t[t.OWNER_OR_MANAGER_VERIFY=2]="OWNER_OR_MANAGER_VERIFY",t[t.NO_ONE_ALLOWED=3]="NO_ONE_ALLOWED"}(L||(L={})),function(t){t[t.OWNER=0]="OWNER",t[t.OWNER_OR_MANAGER=1]="OWNER_OR_MANAGER",t[t.EVERYONE=2]="EVERYONE"}(m||(m={})),function(t){t[t.OWNER_OR_MANAGER_OR_SELF=0]="OWNER_OR_MANAGER_OR_SELF",t[t.OWNER_OR_SELF=1]="OWNER_OR_SELF",t[t.SELF=2]="SELF"}(y||(y={})),function(t){t[t.FREE=0]="FREE",t[t.INVITEE_VERIFY=1]="INVITEE_VERIFY"}(M||(M={})),function(t){t[t.UNDEF=0]="UNDEF",t[t.NORMAL=1]="NORMAL",t[t.MANAGER=2]="MANAGER",t[t.OWNER=3]="OWNER"}(U||(U={})),function(t){t[t.CREATE=0]="CREATE",t[t.JOIN=1]="JOIN",t[t.KICK=2]="KICK",t[t.QUIT=3]="QUIT",t[t.DISMISS=4]="DISMISS",t[t.ADD_MANAGER=5]="ADD_MANAGER",t[t.REMOVE_MANAGER=6]="REMOVE_MANAGER",t[t.TRANSFER_GROUP_OWNER=7]="TRANSFER_GROUP_OWNER"}(D||(D={})),function(t){t[t.GROUP_INFO_CHANGE=0]="GROUP_INFO_CHANGE",t[t.MEMBER_PROFILE_CHANGE=1]="MEMBER_PROFILE_CHANGE",t[t.GROUP_REMARK_SET=2]="GROUP_REMARK_SET",t[t.GROUP_REMARK_DELETE=3]="GROUP_REMARK_DELETE"}(G||(G={})),function(t){t[t.ADD=1]="ADD",t[t.REMOVE=2]="REMOVE"}(V||(V={})),function(t){t[t.MANAGER_UNHANDLED=0]="MANAGER_UNHANDLED",t[t.MANAGER_REFUSED=1]="MANAGER_REFUSED",t[t.INVITEE_UNHANDLED=2]="INVITEE_UNHANDLED",t[t.INVITEE_REFUSED=3]="INVITEE_REFUSED",t[t.JOINED=4]="JOINED",t[t.EXPIRED=5]="EXPIRED"}(b||(b={})),function(t){t[t.REFUSE=0]="REFUSE",t[t.ACCEPT=1]="ACCEPT"}(F||(F={})),function(t){t[t.APPLICANT=0]="APPLICANT",t[t.MANAGER=1]="MANAGER"}(w||(w={})),function(t){t[t.GROUP_OPERATION=11]="GROUP_OPERATION",t[t.GROUP_PROFILE_CHANGE=12]="GROUP_PROFILE_CHANGE",t[t.GROUP_APPLICATION_INVITATION=13]="GROUP_APPLICATION_INVITATION",t[t.GROUP_FOLLOW_USER_CHANGE=14]="GROUP_FOLLOW_USER_CHANGE"}(x||(x={})),function(t){t[t.APPLICATION=0]="APPLICATION",t[t.INVITATION=1]="INVITATION"}(B||(B={})),function(t){t[t.APPLICATION_SENT=0]="APPLICATION_SENT",t[t.INVITATION_SENT=1]="INVITATION_SENT",t[t.INVITATION_RECEIVED=2]="INVITATION_RECEIVED",t[t.APPLICATION_RECEIVED=3]="APPLICATION_RECEIVED"}(k||(k={})),function(t){t[t.UPDATE=1]="UPDATE",t[t.DELETE=2]="DELETE"}(H||(H={})),function(t){t[t.QUIT=0]="QUIT",t[t.JOIN=1]="JOIN"}(J||(J={})),function(t){t[t.LeaveOnMyOwn=0]="LeaveOnMyOwn",t[t.OtherDeviceLogin=1]="OtherDeviceLogin"}(Y||(Y={})),function(t){t[t.QUIT=0]="QUIT",t[t.JOIN=1]="JOIN"}(W||(W={})),function(t){t[t.UnmuteUsers=0]="UnmuteUsers",t[t.MuteUsers=1]="MuteUsers",t[t.UnmuteAll=2]="UnmuteAll",t[t.MuteAll=3]="MuteAll",t[t.RemoveWhitelist=4]="RemoveWhitelist",t[t.AddWhitelist=5]="AddWhitelist",t[t.UnmuteGloble=6]="UnmuteGloble",t[t.MuteGloble=7]="MuteGloble"}(K||(K={})),function(t){t[t.Deblock=0]="Deblock",t[t.Blocked=1]="Blocked"}(j||(j={})),function(t){t[t.SUCCESS=0]="SUCCESS",t[t.ACTIVE_DISCONNECT=2]="ACTIVE_DISCONNECT",t[t.REJECTED_BY_BLACKLIST=405]="REJECTED_BY_BLACKLIST",t[t.FORBIDDEN_IN_PRIVATE=20106]="FORBIDDEN_IN_PRIVATE",t[t.SYS_CONVERSATION_NOT_SUPPORT_MESSAGE=20109]="SYS_CONVERSATION_NOT_SUPPORT_MESSAGE",t[t.CLOUD_DATA_CENTER_INVALID=20512]="CLOUD_DATA_CENTER_INVALID",t[t.SEND_FREQUENCY_TOO_FAST=20604]="SEND_FREQUENCY_TOO_FAST",t[t.OPERATION_BLOCKED=20605]="OPERATION_BLOCKED",t[t.OPERATION_NOT_SUPPORT=20606]="OPERATION_NOT_SUPPORT",t[t.REQUEST_OVER_FREQUENCY=20607]="REQUEST_OVER_FREQUENCY",t[t.NOT_IN_DISCUSSION=21406]="NOT_IN_DISCUSSION",t[t.SENSITIVE_SHIELD=21501]="SENSITIVE_SHIELD",t[t.SENSITIVE_REPLACE=21502]="SENSITIVE_REPLACE",t[t.MESSAGE_EXPAND_NOT_EXIST=22201]="MESSAGE_EXPAND_NOT_EXIST",t[t.MESSAGE_EXPAND_NOT_SUPPORT=22202]="MESSAGE_EXPAND_NOT_SUPPORT",t[t.MESSAGE_EXPAND_FORMAT_ERROR=22203]="MESSAGE_EXPAND_FORMAT_ERROR",t[t.MESSAGE_EXPAND_NOT_AUTHORIZED=22204]="MESSAGE_EXPAND_NOT_AUTHORIZED",t[t.NOT_IN_GROUP=22406]="NOT_IN_GROUP",t[t.FORBIDDEN_IN_GROUP=22408]="FORBIDDEN_IN_GROUP",t[t.NOT_IN_CHATROOM=23406]="NOT_IN_CHATROOM",t[t.GET_USERINFO_ERROR=23407]="GET_USERINFO_ERROR",t[t.FORBIDDEN_IN_CHATROOM=23408]="FORBIDDEN_IN_CHATROOM",t[t.RC_CHATROOM_USER_KICKED=23409]="RC_CHATROOM_USER_KICKED",t[t.RC_CHATROOM_NOT_EXIST=23410]="RC_CHATROOM_NOT_EXIST",t[t.RC_CHATROOM_IS_FULL=23411]="RC_CHATROOM_IS_FULL",t[t.RC_CHATROOM_PATAMETER_INVALID=23412]="RC_CHATROOM_PATAMETER_INVALID",t[t.CHATROOM_GET_HISTORYMSG_ERROR=23413]="CHATROOM_GET_HISTORYMSG_ERROR",t[t.CHATROOM_NOT_OPEN_HISTORYMSG_STORE=23414]="CHATROOM_NOT_OPEN_HISTORYMSG_STORE",t[t.CHATROOM_KV_EXCEED=23423]="CHATROOM_KV_EXCEED",t[t.CHATROOM_KV_OVERWRITE_INVALID=23424]="CHATROOM_KV_OVERWRITE_INVALID",t[t.CHATROOM_SET_PROPERTY_OVER_FREQUENCY=23425]="CHATROOM_SET_PROPERTY_OVER_FREQUENCY",t[t.CHATROOM_KV_STORE_NOT_OPEN=23426]="CHATROOM_KV_STORE_NOT_OPEN",t[t.CHATROOM_KEY_NOT_EXIST=23427]="CHATROOM_KEY_NOT_EXIST",t[t.CHATROOM_KV_STORE_NOT_ALL_SUCCESS=23428]="CHATROOM_KV_STORE_NOT_ALL_SUCCESS",t[t.CHATROOM_KV_STORE_OUT_LIMIT=23429]="CHATROOM_KV_STORE_OUT_LIMIT",t[t.CHATROOM_KV_SET_ERROR=23431]="CHATROOM_KV_SET_ERROR",t[t.HAVNODEVICEID=24001]="HAVNODEVICEID",t[t.DEVICEIDISHAVE=24002]="DEVICEIDISHAVE",t[t.FEILD=24009]="FEILD",t[t.INTERNALERRROR=24015]="INTERNALERRROR",t[t.RC_USER_PROFILE_KEY_NOT_ALLOW_SDK_SET=24360]="RC_USER_PROFILE_KEY_NOT_ALLOW_SDK_SET",t[t.RC_USER_PROFILE_KEY_NOT_EXIST=24361]="RC_USER_PROFILE_KEY_NOT_EXIST",t[t.RC_USER_PROFILE_EXT_KEY_NOT_EXIST=24362]="RC_USER_PROFILE_EXT_KEY_NOT_EXIST",t[t.RC_USER_PROFILE_EXT_KV_COUNT_EXCEED_LIMIT=24363]="RC_USER_PROFILE_EXT_KV_COUNT_EXCEED_LIMIT",t[t.RC_USER_PROFILE_VALUE_LENGTH_EXCEED_LIMIT=24364]="RC_USER_PROFILE_VALUE_LENGTH_EXCEED_LIMIT",t[t.RC_USER_PROFILE_QUERY_COUNT_EXCEED_LIMIT=24365]="RC_USER_PROFILE_QUERY_COUNT_EXCEED_LIMIT",t[t.RC_USER_PROFILE_USER_NOT_EXIST=24366]="RC_USER_PROFILE_USER_NOT_EXIST",t[t.RC_USER_PROFILE_VALUE_CAN_ONLY_BE_NUMBERS=24367]="RC_USER_PROFILE_VALUE_CAN_ONLY_BE_NUMBERS",t[t.RC_USER_PROFILE_VALUE_EXCEED_RANGE=24368]="RC_USER_PROFILE_VALUE_EXCEED_RANGE",t[t.RC_USER_PROFILE_SERVICE_UNAVAILABLE=24369]="RC_USER_PROFILE_SERVICE_UNAVAILABLE",t[t.ULTRA_GROUP_SERVICE_UNAVAILABLE=24401]="ULTRA_GROUP_SERVICE_UNAVAILABLE",t[t.ULTRA_GROUP_SERVICE_ERROR=24402]="ULTRA_GROUP_SERVICE_ERROR",t[t.ULTRA_GROUP_PARAMETER_ERROR=24403]="ULTRA_GROUP_PARAMETER_ERROR",t[t.ULTRA_GROUP_UNKNOWN_ERROR=24404]="ULTRA_GROUP_UNKNOWN_ERROR",t[t.NOT_IN_ULTRA_GROUP=24406]="NOT_IN_ULTRA_GROUP",t[t.FORBIDDEN_IN_ULTRA_GROUP=24408]="FORBIDDEN_IN_ULTRA_GROUP",t[t.ULTRA_GROUP_NOT_EXIST=24410]="ULTRA_GROUP_NOT_EXIST",t[t.ULTRA_GROUP_MEMBERS_OVERSIZE=24411]="ULTRA_GROUP_MEMBERS_OVERSIZE",t[t.ULTRA_GROUP_JOINED_OVERSIZE=24412]="ULTRA_GROUP_JOINED_OVERSIZE",t[t.ULTRA_GROUP_CHANNELS_OVERSIZE=24413]="ULTRA_GROUP_CHANNELS_OVERSIZE",t[t.ULTRA_GROUP_CHANNEL_ID_NOT_EXIST=24414]="ULTRA_GROUP_CHANNEL_ID_NOT_EXIST",t[t.ULTRA_GROUP_MESSAGE_SENT_OVER_FREQUENCY=24415]="ULTRA_GROUP_MESSAGE_SENT_OVER_FREQUENCY",t[t.ULTRA_GROUP_USER_NOT_IN_PRIVATE_CHANNEL=24416]="ULTRA_GROUP_USER_NOT_IN_PRIVATE_CHANNEL",t[t.RECALL_MESSAGE=25101]="RECALL_MESSAGE",t[t.MESSAGE_STORAGE_SERVICE_UNAVAILABLE=25102]="MESSAGE_STORAGE_SERVICE_UNAVAILABLE",t[t.RC_SERVER_UNKOWN_ERROR=25104]="RC_SERVER_UNKOWN_ERROR",t[t.RECALL_MESSAGE_USER_INVALID=25107]="RECALL_MESSAGE_USER_INVALID",t[t.RC_ENTRUST_SERVER_ERROR=25402]="RC_ENTRUST_SERVER_ERROR",t[t.RC_ENTRUST_SERVER_PARAMETER_ERROR=25403]="RC_ENTRUST_SERVER_PARAMETER_ERROR",t[t.RC_GROUP_ILLEGAL_ERROR=25404]="RC_GROUP_ILLEGAL_ERROR",t[t.RC_GROUP_AUTHORITY_ERROR=25405]="RC_GROUP_AUTHORITY_ERROR",t[t.RC_GROUP_PARAMETER_LENGTH_EXCEED_LIMIT=25406]="RC_GROUP_PARAMETER_LENGTH_EXCEED_LIMIT",t[t.RC_GROUP_PARAMETER_FORMAT_ERROR=25407]="RC_GROUP_PARAMETER_FORMAT_ERROR",t[t.RC_GROUP_PARAMETER_VALUE_CAN_ONLY_BE_NUMBERS=25408]="RC_GROUP_PARAMETER_VALUE_CAN_ONLY_BE_NUMBERS",t[t.RC_GROUP_ID_ALREADY_EXIST=25409]="RC_GROUP_ID_ALREADY_EXIST",t[t.RC_GROUP_ID_NOT_EXIST=25410]="RC_GROUP_ID_NOT_EXIST",t[t.RC_GROUP_MEMBERS_COUNT_EXCEED_LIMIT=25411]="RC_GROUP_MEMBERS_COUNT_EXCEED_LIMIT",t[t.RC_GROUP_MEMBERS_ALREADY_IN_GROUP=25412]="RC_GROUP_MEMBERS_ALREADY_IN_GROUP",t[t.RC_GROUP_NOT_ALLOW_SDK_OPERATION=25413]="RC_GROUP_NOT_ALLOW_SDK_OPERATION",t[t.RC_GROUP_NOT_ALLOW_JOIN=25414]="RC_GROUP_NOT_ALLOW_JOIN",t[t.RC_GROUP_EXT_KEY_NOT_EXIST=25415]="RC_GROUP_EXT_KEY_NOT_EXIST",t[t.RC_GROUP_REQUEST_OVERFREQUENCY=25416]="RC_GROUP_REQUEST_OVERFREQUENCY",t[t.RC_GROUP_OWNER_NOT_ALLOW_QUIT_OR_KICK=25417]="RC_GROUP_OWNER_NOT_ALLOW_QUIT_OR_KICK",t[t.RC_GROUP_USER_NOT_IN_GROUP=25418]="RC_GROUP_USER_NOT_IN_GROUP",t[t.RC_GROUP_MANAGER_OR_FOLLOW_COUNT_EXCEED_LIMIT=25419]="RC_GROUP_MANAGER_OR_FOLLOW_COUNT_EXCEED_LIMIT",t[t.RC_GROUP_USER_IS_NOT_MANAGER_IN_GROUP=25420]="RC_GROUP_USER_IS_NOT_MANAGER_IN_GROUP",t[t.RC_GROUP_APPLICATION_NOT_EXIST=25421]="RC_GROUP_APPLICATION_NOT_EXIST",t[t.RC_GROUP_QUERY_GROUP_COUNT_EXCEED_LIMIT=25422]="RC_GROUP_QUERY_GROUP_COUNT_EXCEED_LIMIT",t[t.RC_GROUP_NAME_INVALID=25423]="RC_GROUP_NAME_INVALID",t[t.RC_GROUP_JOIN_GROUP_NEED_MANAGER_ACCEPT=25424]="RC_GROUP_JOIN_GROUP_NEED_MANAGER_ACCEPT",t[t.RC_GROUP_OWNER_NOT_ALLOW_BE_MANAGER=25425]="RC_GROUP_OWNER_NOT_ALLOW_BE_MANAGER",t[t.RC_GROUP_NO_INVITE_PERMISSION=25426]="RC_GROUP_NO_INVITE_PERMISSION",t[t.RC_GROUP_NEED_INVITEE_ACCEPT=25427]="RC_GROUP_NEED_INVITEE_ACCEPT",t[t.RC_GROUP_APPLICATION_ALREADY_HANDLE=25428]="RC_GROUP_APPLICATION_ALREADY_HANDLE",t[t.RC_GROUP_OLD_GROUP_NOT_ENTRUST=25429]="RC_GROUP_OLD_GROUP_NOT_ENTRUST",t[t.RC_GROUP_ID_INVALID=25430]="RC_GROUP_ID_INVALID",t[t.RC_PAGE_TOKEN_PARSING_FAILED=25432]="RC_PAGE_TOKEN_PARSING_FAILED",t[t.RC_FRIEND_ALREADY_FRIEND=25460]="RC_FRIEND_ALREADY_FRIEND",t[t.RC_FRIEND_NEED_ACCEPT=25461]="RC_FRIEND_NEED_ACCEPT",t[t.RC_FRIEND_IN_OTHER_BLACK_LIST=25462]="RC_FRIEND_IN_OTHER_BLACK_LIST",t[t.RC_FRIEND_NOT_IN_OTHER_WHITE_LIST=25463]="RC_FRIEND_NOT_IN_OTHER_WHITE_LIST",t[t.RC_FRIEND_IN_MY_BLACK_LIST=25464]="RC_FRIEND_IN_MY_BLACK_LIST",t[t.RC_FRIEND_NOT_IN_MY_WHITE_LIST=25465]="RC_FRIEND_NOT_IN_MY_WHITE_LIST",t[t.RC_FRIEND_APPLICATION_NOT_EXIST=25466]="RC_FRIEND_APPLICATION_NOT_EXIST",t[t.RC_FRIEND_MY_FRIEND_COUNT_EXCEED_LIMIT=25467]="RC_FRIEND_MY_FRIEND_COUNT_EXCEED_LIMIT",t[t.RC_FRIEND_OTHER_FRIEND_COUNT_EXCEED_LIMIT=25468]="RC_FRIEND_OTHER_FRIEND_COUNT_EXCEED_LIMIT",t[t.RC_FRIEND_NOT_FRIEND=25469]="RC_FRIEND_NOT_FRIEND",t[t.RC_FRIEND_FIELDS_LENGTH_EXCEED_LIMIT=25470]="RC_FRIEND_FIELDS_LENGTH_EXCEED_LIMIT",t[t.RC_FRIEND_OTHER_NOT_ALLOW_ADD_FRIEND=25471]="RC_FRIEND_OTHER_NOT_ALLOW_ADD_FRIEND",t[t.RC_FRIEND_NOT_EXIST=25472]="RC_FRIEND_NOT_EXIST",t[t.RC_FRIEND_NOT_ALLOW_ADD_SELF=25473]="RC_FRIEND_NOT_ALLOW_ADD_SELF",t[t.PUSH_PARAMETER_INVALID=26001]="PUSH_PARAMETER_INVALID",t[t.USER_SETTING_SYNCED_ERROR=26002]="USER_SETTING_SYNCED_ERROR",t[t.CONVERSATION_TAG_OVERSIZE=26004]="CONVERSATION_TAG_OVERSIZE",t[t.RC_READ_RECEIPT_V4_INVALID=26005]="RC_READ_RECEIPT_V4_INVALID",t[t.RC_SERVER_DRIVE_UNREAD_COUNT_INVALID=26006]="RC_SERVER_DRIVE_UNREAD_COUNT_INVALID",t[t.RC_SERVER_PARAMETER_MESSAGEUIDS_CONFUSED=26007]="RC_SERVER_PARAMETER_MESSAGEUIDS_CONFUSED",t[t.RC_SERVER_PARAMETER_MESSAGEUID_INVALID=26009]="RC_SERVER_PARAMETER_MESSAGEUID_INVALID",t[t.RC_SERVER_PARAMETER_INVALID=26010]="RC_SERVER_PARAMETER_INVALID",t[t.RC_SUBSCRIBE_ONLINE_SERVICE_UNAVAILABLE=26020]="RC_SUBSCRIBE_ONLINE_SERVICE_UNAVAILABLE",t[t.RC_BESUBSCRIBED_USERIDS_COUNT_EXCEED_LIMIT=26021]="RC_BESUBSCRIBED_USERIDS_COUNT_EXCEED_LIMIT",t[t.RC_SUBSCRIBED_USERIDS_EXCEED_LIMIT=26022]="RC_SUBSCRIBED_USERIDS_EXCEED_LIMIT",t[t.RC_FILE_SIZE_EXCEED_LIMIT=26106]="RC_FILE_SIZE_EXCEED_LIMIT",t[t.INVALID_PARAMETER_SIZE_NOT_FOUND=26107]="INVALID_PARAMETER_SIZE_NOT_FOUND",t[t.RC_NET_CHANNEL_INVALID=30001]="RC_NET_CHANNEL_INVALID",t[t.RC_NET_UNAVAILABLE=30002]="RC_NET_UNAVAILABLE",t[t.RC_MSG_RESP_TIMEOUT=30003]="RC_MSG_RESP_TIMEOUT",t[t.RC_HTTP_SEND_FAIL=30004]="RC_HTTP_SEND_FAIL",t[t.RC_HTTP_REQ_FAIL=30005]="RC_HTTP_REQ_FAIL",t[t.RC_HTTP_RECV_FAIL=30006]="RC_HTTP_RECV_FAIL",t[t.RC_NAVI_REQ_FAILED=30007]="RC_NAVI_REQ_FAILED",t[t.RC_NODE_NOT_FOUND=30008]="RC_NODE_NOT_FOUND",t[t.RC_DOMAIN_NOT_RESOLVE=30009]="RC_DOMAIN_NOT_RESOLVE",t[t.RC_SOCKET_NOT_CREATED=30010]="RC_SOCKET_NOT_CREATED",t[t.RC_SOCKET_DISCONNECTED=30011]="RC_SOCKET_DISCONNECTED",t[t.RC_PING_EXCEED_LIMIT=30012]="RC_PING_EXCEED_LIMIT",t[t.PONG_RECEIVED_ERROR=30013]="PONG_RECEIVED_ERROR",t[t.RC_MSG_SEND_FAIL=30014]="RC_MSG_SEND_FAIL",t[t.CONNECT_OVER_FREQUENCY=30015]="CONNECT_OVER_FREQUENCY",t[t.RC_MSG_CONTENT_EXCEED_LIMIT=30016]="RC_MSG_CONTENT_EXCEED_LIMIT",t[t.RC_NETWORK_DOWN=30019]="RC_NETWORK_DOWN",t[t.RC_TCP_DISCONNECTED_NO_RMTP=30021]="RC_TCP_DISCONNECTED_NO_RMTP",t[t.RC_CONN_ACK_TIMEOUT=31e3]="RC_CONN_ACK_TIMEOUT",t[t.RC_CONN_PROTO_VERSION_ERROR=31001]="RC_CONN_PROTO_VERSION_ERROR",t[t.RC_CONN_IDENTIFIER_REJECTED=31002]="RC_CONN_IDENTIFIER_REJECTED",t[t.RC_CONN_SERVER_UNAVAILABLE=31003]="RC_CONN_SERVER_UNAVAILABLE",t[t.RC_CONN_TOKEN_INCORRECT=31004]="RC_CONN_TOKEN_INCORRECT",t[t.RC_CONN_NOT_AUTHRORIZED=31005]="RC_CONN_NOT_AUTHRORIZED",t[t.RC_CONN_REDIRECTED=31006]="RC_CONN_REDIRECTED",t[t.RC_CONN_PACKAGE_NAME_INVALID=31007]="RC_CONN_PACKAGE_NAME_INVALID",t[t.RC_CONN_APP_BLOCKED_OR_DELETED=31008]="RC_CONN_APP_BLOCKED_OR_DELETED",t[t.RC_CONN_USER_BLOCKED=31009]="RC_CONN_USER_BLOCKED",t[t.RC_DISCONN_KICK=31010]="RC_DISCONN_KICK",t[t.RC_DISCONN_EXCEPTION=31011]="RC_DISCONN_EXCEPTION",t[t.CONNECTION_ENCRYPT_AUTHORIZED_ERROR=31012]="CONNECTION_ENCRYPT_AUTHORIZED_ERROR",t[t.RC_CONN_TOKEN_EXPIRED=31020]="RC_CONN_TOKEN_EXPIRED",t[t.RC_CONN_DEVICE_ERROR=31021]="RC_CONN_DEVICE_ERROR",t[t.RC_CONN_HOSTNAME_ERROR=31022]="RC_CONN_HOSTNAME_ERROR",t[t.RC_DISCONN_SAME_CLIENT_ON_LINE=31023]="RC_DISCONN_SAME_CLIENT_ON_LINE",t[t.RC_LISCENSE_COUNT_OUT_OF_LIMIT=31024]="RC_LISCENSE_COUNT_OUT_OF_LIMIT",t[t.RC_CONN_WRONG_CLUSTER=31025]="RC_CONN_WRONG_CLUSTER",t[t.RC_APP_AUTH_NOT_PASS=31026]="RC_APP_AUTH_NOT_PASS",t[t.RC_OTP_USED=31027]="RC_OTP_USED",t[t.RC_PLATFORM_ERROR=31028]="RC_PLATFORM_ERROR",t[t.RC_ACCOUNT_CANCELLATION=31029]="RC_ACCOUNT_CANCELLATION",t[t.RC_LICENSE_EXPIRED=31030]="RC_LICENSE_EXPIRED",t[t.RC_QUERY_ACK_NO_DATA=32001]="RC_QUERY_ACK_NO_DATA",t[t.RC_MSG_DATA_INCOMPLETE=32002]="RC_MSG_DATA_INCOMPLETE",t[t.RC_UDP_DISCONNECTED=32011]="RC_UDP_DISCONNECTED",t[t.RC_TCP_RESET=32054]="RC_TCP_RESET",t[t.CONNECTION_REFUSED=32061]="CONNECTION_REFUSED",t[t.PROTOCOL_MESSAGE_SAVED_ERROR=33e3]="PROTOCOL_MESSAGE_SAVED_ERROR",t[t.BIZ_ERROR_CLIENT_NOT_INIT=33001]="BIZ_ERROR_CLIENT_NOT_INIT",t[t.BIZ_ERROR_DATABASE_ERROR=33002]="BIZ_ERROR_DATABASE_ERROR",t[t.BIZ_ERROR_INVALID_PARAMETER=33003]="BIZ_ERROR_INVALID_PARAMETER",t[t.BIZ_ERROR_NO_CHANNEL=33004]="BIZ_ERROR_NO_CHANNEL",t[t.BIZ_ERROR_RECONNECT_SUCCESS=33005]="BIZ_ERROR_RECONNECT_SUCCESS",t[t.BIZ_ERROR_CONNECTING=33006]="BIZ_ERROR_CONNECTING",t[t.MSG_ROAMING_SERVICE_UNAVAILABLE=33007]="MSG_ROAMING_SERVICE_UNAVAILABLE",t[t.MSG_INSERT_ERROR=33008]="MSG_INSERT_ERROR",t[t.MSG_DEL_ERROR=33009]="MSG_DEL_ERROR",t[t.TAG_NOT_EXIST=33100]="TAG_NOT_EXIST",t[t.TAG_EXISTS=33101]="TAG_EXISTS",t[t.NO_TAG_IN_CONVER=33102]="NO_TAG_IN_CONVER",t[t.RC_CONNECTION_EXIST=34001]="RC_CONNECTION_EXIST",t[t.PACKAGE_ENVIRONMENT_ERROR=34005]="PACKAGE_ENVIRONMENT_ERROR",t[t.CONNECTION_TIMEOUT=34006]="CONNECTION_TIMEOUT",t[t.MESSAGE_KV_NOT_SUPPORT=34008]="MESSAGE_KV_NOT_SUPPORT",t[t.MESSAGE_EXPANDED_ERROR=34009]="MESSAGE_EXPANDED_ERROR",t[t.EXPANSION_LIMIT_EXCEET=34010]="EXPANSION_LIMIT_EXCEET",t[t.UPLOAD_FAIL=34011]="UPLOAD_FAIL",t[t.CONVER_OUT_LIMIT_ERROR=34013]="CONVER_OUT_LIMIT_ERROR",t[t.READ_RECEIPT_ERROR=34014]="READ_RECEIPT_ERROR",t[t.PUSH_CONTENT_CONFIG_SERVICE_UNAVAILABLE=34016]="PUSH_CONTENT_CONFIG_SERVICE_UNAVAILABLE",t[t.MESSAGE_INTERCEPTION_PRODUCED_NULL_MESSAGE=34017]="MESSAGE_INTERCEPTION_PRODUCED_NULL_MESSAGE",t[t.MEDIA_EXCEPTION=34018]="MEDIA_EXCEPTION",t[t.MESSAGE_NOT_REGISTERED=34021]="MESSAGE_NOT_REGISTERED",t[t.METHOD_NOT_SUPPORT=34022]="METHOD_NOT_SUPPORT",t[t.ULTRA_GROUP_CHANNEL_NOT_EXIST=34024]="ULTRA_GROUP_CHANNEL_NOT_EXIST",t[t.INCONSISTENT_CONVERSATION_TYPE=34025]="INCONSISTENT_CONVERSATION_TYPE",t[t.CONVERSATION_TYPE_NOT_SUPPORT=34201]="CONVERSATION_TYPE_NOT_SUPPORT",t[t.INVALID_PARAMETER_TIMESTAMP=34202]="INVALID_PARAMETER_TIMESTAMP",t[t.INVALID_PARAMETER_MESSAGE_UID=34203]="INVALID_PARAMETER_MESSAGE_UID",t[t.INVALID_PARAMETER_MESSAGE_ID=34204]="INVALID_PARAMETER_MESSAGE_ID",t[t.INVALID_PARAMETER_MESSAGE_CONTENT=34205]="INVALID_PARAMETER_MESSAGE_CONTENT",t[t.MSG_LIMIT_ERROR=34206]="MSG_LIMIT_ERROR",t[t.INVALID_PARAMETER_MEDIA_TYPE=34207]="INVALID_PARAMETER_MEDIA_TYPE",t[t.INVALID_PARAMETER_CONVERSATION_TYPE=34209]="INVALID_PARAMETER_CONVERSATION_TYPE",t[t.INVALID_PARAMETER_TARGET_ID=34210]="INVALID_PARAMETER_TARGET_ID",t[t.INVALID_PARAMETER_CHANNEL_ID=34211]="INVALID_PARAMETER_CHANNEL_ID",t[t.INVALID_PARAMETER_TAG_ID=34212]="INVALID_PARAMETER_TAG_ID",t[t.INVALID_PARAMETER_TAG_NAME=34213]="INVALID_PARAMETER_TAG_NAME",t[t.INVALID_PARAMETER_USER_ID=34214]="INVALID_PARAMETER_USER_ID",t[t.INVALID_PARAMETER_USERIDLIST=34215]="INVALID_PARAMETER_USERIDLIST",t[t.INVALID_PARAMETER_DOWNLOADMEDIAFILENAME=34217]="INVALID_PARAMETER_DOWNLOADMEDIAFILENAME",t[t.INVALID_PARAMETER_MESSAGE_EXPANSION=34220]="INVALID_PARAMETER_MESSAGE_EXPANSION",t[t.INVALID_PARAMETER_TIMESTRING=34224]="INVALID_PARAMETER_TIMESTRING",t[t.INVALID_PARAMETER_CONVERSATION=34225]="INVALID_PARAMETER_CONVERSATION",t[t.INVALID_PARAMETER_NOTIFICATION_LEVEL=34228]="INVALID_PARAMETER_NOTIFICATION_LEVEL",t[t.INVALID_PARAMETER_MESSAGE_ARRAY=34229]="INVALID_PARAMETER_MESSAGE_ARRAY",t[t.INVALID_PARAMETER_RECEIVED_STATUS=34230]="INVALID_PARAMETER_RECEIVED_STATUS",t[t.INVALID_PARAMETER_CHANNEL_TYPE=34231]="INVALID_PARAMETER_CHANNEL_TYPE",t[t.INVALID_PARAMETER_COUNT=34232]="INVALID_PARAMETER_COUNT",t[t.INVALID_PARAMETER_MEDIA_URL=34235]="INVALID_PARAMETER_MEDIA_URL",t[t.INVALID_PARAMETER_UNIQUE_ID=34236]="INVALID_PARAMETER_UNIQUE_ID",t[t.INVALID_PARAMETER_PROXY=34238]="INVALID_PARAMETER_PROXY",t[t.INVALID_PARAMETER_TESTHOST=34239]="INVALID_PARAMETER_TESTHOST",t[t.INVALID_CONNECT_TESTHOST_FAILED=34240]="INVALID_CONNECT_TESTHOST_FAILED",t[t.INVALID_PARAMETER_CONVERSATIONS=34242]="INVALID_PARAMETER_CONVERSATIONS",t[t.INVALID_PARAMETER_SENT_STATUS=34244]="INVALID_PARAMETER_SENT_STATUS",t[t.RC_CONN_PROXY_UNAVAILABLE=34245]="RC_CONN_PROXY_UNAVAILABLE",t[t.INVALID_PARAMETER_RTCROOMID=34259]="INVALID_PARAMETER_RTCROOMID",t[t.INVALID_PARAMETER_KEY=34260]="INVALID_PARAMETER_KEY",t[t.INVALID_PARAMETER_KEYS=34261]="INVALID_PARAMETER_KEYS",t[t.INVALID_PARAMETER_VALUE=34262]="INVALID_PARAMETER_VALUE",t[t.INVALID_PARAMETER_ENTRIES=34263]="INVALID_PARAMETER_ENTRIES",t[t.INVALID_PARAMETER_NOTIFICATION_EXTRA=34264]="INVALID_PARAMETER_NOTIFICATION_EXTRA",t[t.INVALID_PARAMETER_MESSAGE_OBJECT_NAME=34271]="INVALID_PARAMETER_MESSAGE_OBJECT_NAME",t[t.INVALID_PARAMETER_BEFORE=34272]="INVALID_PARAMETER_BEFORE",t[t.INVALID_PARAMETER_AFTER=34273]="INVALID_PARAMETER_AFTER",t[t.INVALID_PARAMETER_KEYWORD=34274]="INVALID_PARAMETER_KEYWORD",t[t.INVALID_PARAMETER_MESSAGE_OBJECT_NAME_LIST=34275]="INVALID_PARAMETER_MESSAGE_OBJECT_NAME_LIST",t[t.INVALID_PARAMETER_OFFSET=34276]="INVALID_PARAMETER_OFFSET",t[t.INVALID_PARAMETER_START_TIME=34277]="INVALID_PARAMETER_START_TIME",t[t.INVALID_PARAMETER_END_TIME=34278]="INVALID_PARAMETER_END_TIME",t[t.INVALID_PARAMETER_LIMIT=34279]="INVALID_PARAMETER_LIMIT",t[t.INVALID_MESSAGE_DIRECTION=34280]="INVALID_MESSAGE_DIRECTION",t[t.INVALID_MESSAGE_SENT_STATUS=34281]="INVALID_MESSAGE_SENT_STATUS",t[t.INVALID_PARAMETER_TARGETID_LIST=34282]="INVALID_PARAMETER_TARGETID_LIST",t[t.INVALID_PARAMETER_SPAN_MINUTES=34283]="INVALID_PARAMETER_SPAN_MINUTES",t[t.INVALID_PARAMETER_CONVERSATION_TYPE_LIST=34284]="INVALID_PARAMETER_CONVERSATION_TYPE_LIST",t[t.INVALID_PARAMETER_CONVERSATION_LIST=34287]="INVALID_PARAMETER_CONVERSATION_LIST",t[t.INVALID_PARAMETER_CLEAR_MESSAGE_OPTION_LIST=34288]="INVALID_PARAMETER_CLEAR_MESSAGE_OPTION_LIST",t[t.INVALID_PARAMETER_START_MESSAGE_UID=34289]="INVALID_PARAMETER_START_MESSAGE_UID",t[t.INVALID_PARAMETER_END_MESSAGE_UID=34290]="INVALID_PARAMETER_END_MESSAGE_UID",t[t.READ_RECEIPT_V4_NOT_SUPPORT=34291]="READ_RECEIPT_V4_NOT_SUPPORT",t[t.READ_RECEIPT_V4_UPDATE_NOT_SUPPORT=34292]="READ_RECEIPT_V4_UPDATE_NOT_SUPPORT",t[t.RC_DIRECTIONAL_MESSAGE_INVALID_CONVERSATION_TYPE=34296]="RC_DIRECTIONAL_MESSAGE_INVALID_CONVERSATION_TYPE",t[t.RC_DB_NOT_INIT=34301]="RC_DB_NOT_INIT",t[t.RC_DB_CORRUPT=34302]="RC_DB_CORRUPT",t[t.RC_DB_SQL_ERROR=34303]="RC_DB_SQL_ERROR",t[t.RC_DB_DATA_NOT_FOUND=34304]="RC_DB_DATA_NOT_FOUND",t[t.RC_NET_DATA_ERROR=34305]="RC_NET_DATA_ERROR",t[t.INVALID_PARAMETER_SUBSCRIBE_TYPE=34306]="INVALID_PARAMETER_SUBSCRIBE_TYPE",t[t.INVALID_PARAMETER_SUBSCRIBE_EXPIRY=34307]="INVALID_PARAMETER_SUBSCRIBE_EXPIRY",t[t.INVALID_PARAMETER_SUBSCRIBE_PUBLISHER_USERIDS=34308]="INVALID_PARAMETER_SUBSCRIBE_PUBLISHER_USERIDS",t[t.INVALID_PARAMETER_SUBSCRIBE_PAGESIZE=34309]="INVALID_PARAMETER_SUBSCRIBE_PAGESIZE",t[t.SUB_PROCESS_EXIT=34310]="SUB_PROCESS_EXIT",t[t.ADDON_NOT_EXIST=34311]="ADDON_NOT_EXIST",t[t.INVALID_PARAMETER_USER_PROFILE=34312]="INVALID_PARAMETER_USER_PROFILE",t[t.INVALID_PARAMETER_USER_PROFILE_VISIBILITY=34313]="INVALID_PARAMETER_USER_PROFILE_VISIBILITY",t[t.INVALID_PARAMETER_EXTRA=34314]="INVALID_PARAMETER_EXTRA",t[t.DB_UPGRADE_FAILED=34315]="DB_UPGRADE_FAILED",t[t.INVALID_PARAMETER_GROUP_INFO=34318]="INVALID_PARAMETER_GROUP_INFO",t[t.INVALID_PARAMETER_GROUP_ID=34319]="INVALID_PARAMETER_GROUP_ID",t[t.INVALID_PARAMETER_GROUP_NAME=34320]="INVALID_PARAMETER_GROUP_NAME",t[t.INVALID_PARAMETER_GROUP_IDS=34321]="INVALID_PARAMETER_GROUP_IDS",t[t.INVALID_PARAMETER_GROUP_MEMBER_ROLE=34322]="INVALID_PARAMETER_GROUP_MEMBER_ROLE",t[t.INVALID_PARAMETER_GROUP_APPLICATION_STATUS=34323]="INVALID_PARAMETER_GROUP_APPLICATION_STATUS",t[t.INVALID_PARAMETER_GROUP_APPLICATION_DIRECTION=34324]="INVALID_PARAMETER_GROUP_APPLICATION_DIRECTION",t[t.INVALID_PARAMETER_NICK_NAME=34325]="INVALID_PARAMETER_NICK_NAME",t[t.INVALID_PARAMETER_REASON=34326]="INVALID_PARAMETER_REASON",t[t.INVALID_PARAMETER_REMARK=34327]="INVALID_PARAMETER_REMARK",t[t.INVALID_PARAMETER_PAGING_QUERY_OPTION=34328]="INVALID_PARAMETER_PAGING_QUERY_OPTION",t[t.NET_DATA_IS_SYNCHRONIZING=34329]="NET_DATA_IS_SYNCHRONIZING",t[t.INVALID_PARAMETER_QUERY_FRIENDS_DIRECTION_TYPE=34330]="INVALID_PARAMETER_QUERY_FRIENDS_DIRECTION_TYPE",t[t.INVALID_PARAMETER_DIRECTION_TYPE=34331]="INVALID_PARAMETER_DIRECTION_TYPE",t[t.INVALID_PARAMETER_FRIEND_APPLICATION_TYPE=34332]="INVALID_PARAMETER_FRIEND_APPLICATION_TYPE",t[t.INVALID_PARAMETER_FRIEND_APPLICATION_STATUS=34333]="INVALID_PARAMETER_FRIEND_APPLICATION_STATUS",t[t.INVALID_PARAMETER_FRIEND_ADD_PERMISSION=34334]="INVALID_PARAMETER_FRIEND_ADD_PERMISSION",t[t.INVALID_PARAMETER_FRIEND_INFO_EXT_FIELDS=34335]="INVALID_PARAMETER_FRIEND_INFO_EXT_FIELDS",t[t.RC_REAL_TIME_CONVERSATION_UNAVAILABLE=34336]="RC_REAL_TIME_CONVERSATION_UNAVAILABLE",t[t.GROUP_SYNC_ERROR=35001]="GROUP_SYNC_ERROR",t[t.GROUP_MATCH_ERROR=35002]="GROUP_MATCH_ERROR",t[t.NOT_SUPPORT=35004]="NOT_SUPPORT",t[t.MAIN_PROCESS_ERROR=35005]="MAIN_PROCESS_ERROR",t[t.CAN_NOT_RECONNECT=35007]="CAN_NOT_RECONNECT",t[t.SERVER_UNAVAILABLE=35008]="SERVER_UNAVAILABLE",t[t.HOSTNAME_ERROR=35009]="HOSTNAME_ERROR",t[t.HAS_OHTER_SAME_CLIENT_ON_LINE=35010]="HAS_OHTER_SAME_CLIENT_ON_LINE",t[t.METHOD_NOT_AVAILABLE=35011]="METHOD_NOT_AVAILABLE",t[t.METHOD_ONLY_SUPPORT_ULTRA_GROUP=35014]="METHOD_ONLY_SUPPORT_ULTRA_GROUP",t[t.DRAFT_SAVE_ERROR=35015]="DRAFT_SAVE_ERROR",t[t.DRAFT_REMOVE_ERROR=35016]="DRAFT_REMOVE_ERROR",t[t.CONVER_REMOVE_ERROR=35020]="CONVER_REMOVE_ERROR",t[t.CONVER_GET_ERROR=35021]="CONVER_GET_ERROR",t[t.SEARCH_PROPS_LIMIT_ERROR=35022]="SEARCH_PROPS_LIMIT_ERROR",t[t.INVALID_PARAMETER_MESSAGE_TYPE=35024]="INVALID_PARAMETER_MESSAGE_TYPE",t[t.INVALID_PARAMETER_ORDER=35025]="INVALID_PARAMETER_ORDER",t[t.INVALID_PARAMETER_DRAFT=35028]="INVALID_PARAMETER_DRAFT",t[t.INVALID_PARAMETER_MESSAGE=35029]="INVALID_PARAMETER_MESSAGE",t[t.INVALID_PARAMETER_PUSH_CONTENT=35030]="INVALID_PARAMETER_PUSH_CONTENT",t[t.INVALID_PARAMETER_SENDOPTIONS=35031]="INVALID_PARAMETER_SENDOPTIONS",t[t.INVALID_PARAMETER_CONTENT_DISPOSITION=35032]="INVALID_PARAMETER_CONTENT_DISPOSITION",t[t.INVALID_PARAMETER_SAVE_NAME=35033]="INVALID_PARAMETER_SAVE_NAME",t[t.INVALID_PARAMETER_SERVER_TYPE=35034]="INVALID_PARAMETER_SERVER_TYPE",t[t.INVALID_PARAMETER_CLEAN_SPACE=35035]="INVALID_PARAMETER_CLEAN_SPACE",t[t.INVALID_PARAMETER_CAN_INCLUDE_EXPANSION=35036]="INVALID_PARAMETER_CAN_INCLUDE_EXPANSION",t[t.INVALID_PARAMETER_DISABLE_NOTIFICATION=35037]="INVALID_PARAMETER_DISABLE_NOTIFICATION",t[t.INVALID_PARAMETER_CHECK_DUPLICATE=35038]="INVALID_PARAMETER_CHECK_DUPLICATE",t[t.INVALID_PARAMETER_IS_AUTO_DELETE=35039]="INVALID_PARAMETER_IS_AUTO_DELETE",t[t.INVALID_PARAMETER_IS_SEND_NOTIFICATION=35040]="INVALID_PARAMETER_IS_SEND_NOTIFICATION",t[t.INVALID_PARAMETER_IS_FORCE=35041]="INVALID_PARAMETER_IS_FORCE",t[t.INVALID_PARAMETER_IS_TOP=35042]="INVALID_PARAMETER_IS_TOP",t[t.INVALID_PARAMETER_IS_UPDATE_TIME=35043]="INVALID_PARAMETER_IS_UPDATE_TIME",t[t.INVALID_PARAMETER_CONTAIN_MUTED=35044]="INVALID_PARAMETER_CONTAIN_MUTED",t[t.INVALID_PARAMETER_IS_STATUS_MESSAGE=35045]="INVALID_PARAMETER_IS_STATUS_MESSAGE",t[t.INVALID_PARAMETER_IS_MENTIONED=35046]="INVALID_PARAMETER_IS_MENTIONED",t[t.INVALID_PARAMETER_IS_VOIP_PUSH=35047]="INVALID_PARAMETER_IS_VOIP_PUSH",t[t.INVALID_PARAMETER_MENTIONED_TYPE=35048]="INVALID_PARAMETER_MENTIONED_TYPE",t[t.INVALID_PARAMETER_PUSH_CONFIG=35049]="INVALID_PARAMETER_PUSH_CONFIG",t[t.INVALID_PARAMETER_PUSH_DATA=35050]="INVALID_PARAMETER_PUSH_DATA",t[t.DNS_PROXY_TIMEOUT=35051]="DNS_PROXY_TIMEOUT",t[t.DNS_PROXY_ERROR=35052]="DNS_PROXY_ERROR",t[t.DNS_PROXY_DATA_DESTRUCTUR_ERROR=35053]="DNS_PROXY_DATA_DESTRUCTUR_ERROR",t[t.INVALID_DISABLE_UPDATE_LAST_MESSAGE=35054]="INVALID_DISABLE_UPDATE_LAST_MESSAGE",t[t.CHATROOM_ID_ISNULL=36001]="CHATROOM_ID_ISNULL",t[t.CHARTOOM_JOIN_ERROR=36002]="CHARTOOM_JOIN_ERROR",t[t.CHATROOM_HISMESSAGE_ERROR=36003]="CHATROOM_HISMESSAGE_ERROR",t[t.CHATROOM_KV_NOT_FOUND=36004]="CHATROOM_KV_NOT_FOUND",t[t.BLACK_ADD_ERROR=37001]="BLACK_ADD_ERROR",t[t.BLACK_GETSTATUS_ERROR=37002]="BLACK_GETSTATUS_ERROR",t[t.BLACK_REMOVE_ERROR=37003]="BLACK_REMOVE_ERROR",t[t.DRAF_GET_ERROR=38001]="DRAF_GET_ERROR",t[t.QNTKN_GET_ERROR=41002]="QNTKN_GET_ERROR",t[t.TIMEOUT=-1]="TIMEOUT"}(X||(X={})),function(t){t[t.NONE=0]="NONE",t[t.PRIVATE=1]="PRIVATE",t[t.DISCUSSION=2]="DISCUSSION",t[t.GROUP=3]="GROUP",t[t.CHATROOM=4]="CHATROOM",t[t.CUSTOMER_SERVICE=5]="CUSTOMER_SERVICE",t[t.SYSTEM=6]="SYSTEM",t[t.APP_PUBLIC_SERVICE=7]="APP_PUBLIC_SERVICE",t[t.PUBLIC_SERVICE=8]="PUBLIC_SERVICE",t[t.ULTRA_GROUP=10]="ULTRA_GROUP",t[t.RTC_ROOM=12]="RTC_ROOM"}(Q||(Q={})),function(t){t[t.RMTP=1]="RMTP",t[t.TLS=2]="TLS",t[t.RPP=3]="RPP",t[t.QUIC=4]="QUIC",t[t.WS=5]="WS",t[t.WSS=6]="WSS",t[t.HTTP=11]="HTTP",t[t.HTTPS=12]="HTTPS"}(q||(q={})),function(t){t[t.IMAGE=1]="IMAGE",t[t.AUDIO=2]="AUDIO",t[t.VIDEO=3]="VIDEO",t[t.FILE=4]="FILE",t[t.SIGHT=5]="SIGHT",t[t.COMBINE_HTML=6]="COMBINE_HTML"}(Z||(Z={})),function(t){t[t.ALL=1]="ALL",t[t.SINGAL=2]="SINGAL"}(z||(z={})),function(t){t.TextMessage="RC:TxtMsg",t.VOICE="RC:VcMsg",t.HQ_VOICE="RC:HQVCMsg",t.IMAGE="RC:ImgMsg",t.GIF="RC:GIFMsg",t.RICH_CONTENT="RC:ImgTextMsg",t.LOCATION="RC:LBSMsg",t.FILE="RC:FileMsg",t.SIGHT="RC:SightMsg",t.COMBINE="RC:CombineMsg",t.COMBINE_V2="RC:CombineV2Msg",t.CHRM_KV_NOTIFY="RC:chrmKVNotiMsg",t.LOG_COMMAND="RC:LogCmdMsg",t.EXPANSION_NOTIFY="RC:MsgExMsg",t.REFERENCE="RC:ReferenceMsg",t.RECALL="RC:RcCmd",t.RECALL_NOTIFICATION_MESSAGE="RC:RcNtf",t.READ_RECEIPT="RC:ReadNtf",t.READ_RECEIPT_REQUEST="RC:RRReqMsg",t.READ_RECEIPT_RESPONSE="RC:RRRspMsg",t.SYNC_READ_STATUS="RC:SRSMsg",t.GROUP_READ_RECEIPT_REQUEST="RC:RRMsg",t.READ_STATE="RC:RSMsg",t.DELIVERED="RC:Delivered",t.DELIVERED_MSG="RC:DRMsg",t.CHATROOM_MERGE_CHANGE="RC:ChrmMemChange",t.CHATROOM_SYNC_MSG="RC:ChrmSyncMsg",t.CHATROOM_MERGE_BLOCK="RC:ChrmBlockMsg",t.CHATROOM_MERGE_BAN="RC:ChrmBanMsg",t.TYPING_STATUS="RC:TypSts",t.INTERCEPT="RC:InterceptMsg",t.CLOUD_CONTROL="RC:CCConfigChangeRequestMsg"}($||($={})),function(t){t[t.PUBLIC=0]="PUBLIC",t[t.PRIVATE=1]="PRIVATE"}(tt||(tt={})),function(t){t[t.PUBLIC_TO_PRIVATE=2]="PUBLIC_TO_PRIVATE",t[t.PRIVATE_TO_PUBLIC=3]="PRIVATE_TO_PUBLIC",t[t.PUBLIC_TO_PRIVATE_USER_NOT_IN=6]="PUBLIC_TO_PRIVATE_USER_NOT_IN"}(et||(et={})),function(t){t[t.MSG_EXPANSION=1]="MSG_EXPANSION",t[t.MSG_MODIFY=2]="MSG_MODIFY",t[t.MSG_RECALL=3]="MSG_RECALL",t[t.CHANNEL_CHANGE=4]="CHANNEL_CHANGE",t[t.USER_GROUP_CHANGE=5]="USER_GROUP_CHANGE"}(nt||(nt={})),function(t){t[t.CHANNEL_DELETE=1]="CHANNEL_DELETE",t[t.PUBLIC_TO_PRIVATE=2]="PUBLIC_TO_PRIVATE",t[t.PRIVATE_TO_PUBLIC=3]="PRIVATE_TO_PUBLIC",t[t.PRIVATE_CHANNEL_USER_JOIN_PUBLIC=4]="PRIVATE_CHANNEL_USER_JOIN_PUBLIC",t[t.CHANNEL_USER_KICKED=5]="CHANNEL_USER_KICKED",t[t.PUBLIC_TO_PRIVATE_USER_NOT_IN=6]="PUBLIC_TO_PRIVATE_USER_NOT_IN"}(ot||(ot={})),function(t){t[t.REMOVE_USER_GROUP=1]="REMOVE_USER_GROUP",t[t.JOIN_USER_GROUP=2]="JOIN_USER_GROUP",t[t.EXIT_USER_GROUP=3]="EXIT_USER_GROUP",t[t.CHANNEL_BIND_USER_GROUP=4]="CHANNEL_BIND_USER_GROUP",t[t.CHANNEL_UNBIND_USER_GROUP=5]="CHANNEL_UNBIND_USER_GROUP"}(rt||(rt={})),function(t){t[t.NOT_MENTIONED=0]="NOT_MENTIONED",t[t.ALL=1]="ALL",t[t.ME=2]="ME"}(it||(it={})),function(t){t[t.SENDING=10]="SENDING",t[t.FAILED=20]="FAILED",t[t.SENT=30]="SENT",t[t.RECEIVED=40]="RECEIVED",t[t.READ=50]="READ",t[t.DESTROYED=60]="DESTROYED"}(st||(st={})),function(t){t[t.typing=0]="typing"}(at||(at={})),function(t){t[t.ONLINE=1]="ONLINE",t[t.OFFLINE=0]="OFFLINE"}(_t||(_t={})),function(t){t[t.Other=0]="Other",t[t.iOS=1]="iOS",t[t.Android=2]="Android",t[t.Web=3]="Web",t[t.PC=4]="PC",t[t.Mini=5]="Mini",t[t.HarmonyOS=6]="HarmonyOS"}(ct||(ct={})),function(t){t[t.ONLINE_STATUS=1]="ONLINE_STATUS",t[t.USER_PROFILE=2]="USER_PROFILE",t[t.FRIEND_ONLINE_STATUS=3]="FRIEND_ONLINE_STATUS",t[t.FRIEND_USER_PROFILE=4]="FRIEND_USER_PROFILE"}(ut||(ut={})),function(t){t[t.SUBSCRIBE=0]="SUBSCRIBE",t[t.UNSUBSCRIBE=1]="UNSUBSCRIBE"}(Et||(Et={})),function(t){t[t.NOT_SET=0]="NOT_SET",t[t.INVISIBLE=1]="INVISIBLE",t[t.EVERYONE=2]="EVERYONE",t[t.FriendVisible=3]="FriendVisible"}(Rt||(Rt={})),function(t){t[t.CONNECTED=0]="CONNECTED",t[t.CONNECTING=1]="CONNECTING",t[t.DISCONNECTED=2]="DISCONNECTED",t[t.SUSPENDED=3]="SUSPENDED"}(lt||(lt={})),function(t){t[t.GLOBAL=1]="GLOBAL",t[t.CUSTOM=2]="CUSTOM",t[t.THIRD_PARTY=3]="THIRD_PARTY"}(dt||(dt={})),function(t){t[t.MSG_ORIGINAL=0]="MSG_ORIGINAL",t[t.MSG_EXPANSION=1]="MSG_EXPANSION",t[t.MSG_MODIFY=2]="MSG_MODIFY"}(pt||(pt={})),function(t){t[t.SEND=1]="SEND",t[t.RECEIVE=2]="RECEIVE"}(Ct||(Ct={})),function(t){t.NORMAL="NORMAL",t.LOW="LOW"}(Tt||(Tt={})),function(t){t.IM_NAVI="IM-stats_navi-S",t.IM_WEBSOCKET="IM-stats_websocket-S",t.IM_CONNECTION_DURATION="IM-stats_con_dur-S",t.IM_CMP="IM-stats_cmp-S",t.IM_CMP_RMTP="IM-stats_cmp_rmtp-S",t.IM_STATS_CS="IM-stats_cs-S",t.IM_NETWORK_CHANGE="IM-stats_network_change-S",t.L_CLOUD_INFO_FETCH_T="L-cloud_info_fetch-T",t.L_CLOUD_INFO_FETCH_R="L-cloud_info_fetch-R",t.IM_MSG_SEND="IM-msg_send-S",t.IM_MSG_RECEIVE="IM-msg_receive-S"}(It||(It={})),function(t){t[t.OPEN=1]="OPEN",t[t.CLOSE=2]="CLOSE"}(St||(St={})),function(t){t[t.ALL_MESSAGE=-1]="ALL_MESSAGE",t[t.NOT_SET=0]="NOT_SET",t[t.AT_MESSAGE_NOTIFICATION=1]="AT_MESSAGE_NOTIFICATION",t[t.AT_USER_NOTIFICATION=2]="AT_USER_NOTIFICATION",t[t.AT_GROUP_ALL_USER_NOTIFICATION=4]="AT_GROUP_ALL_USER_NOTIFICATION",t[t.NOT_MESSAGE_NOTIFICATION=5]="NOT_MESSAGE_NOTIFICATION"}(ht||(ht={})),function(t){t[t.READ=1]="READ",t[t.LISTENED=2]="LISTENED",t[t.DOWNLOADED=4]="DOWNLOADED",t[t.RETRIEVED=8]="RETRIEVED",t[t.UNREAD=0]="UNREAD"}(Nt||(Nt={})),function(t){t[t.PRIVATE=1]="PRIVATE",t[t.OPEN=0]="OPEN"}(ft||(ft={})),function(t){t[t.NAVI=1]="NAVI",t[t.TCP=2]="TCP",t[t.WS=3]="WS"}(Ot||(Ot={})),function(t){t[t.REQUEST=0]="REQUEST",t[t.LOCAL=1]="LOCAL"}(At||(At={})),function(t){t[t.CURRENT=2]="CURRENT"}(gt||(gt={})),function(t){t[t.CONNECT=0]="CONNECT",t[t.RECONNECT=1]="RECONNECT"}(Pt||(Pt={})),function(t){t[t.CONNECT=0]="CONNECT",t[t.RECONNECT=1]="RECONNECT",t[t.REDIRECTED=3]="REDIRECTED",t[t.TIMEOUT=4]="TIMEOUT"}(vt||(vt={})),function(t){t.PASSIVE="passive",t.ACTIVE="active",t.TIME_SENSITIVE="time-sensitive",t.CRITICAL="critical"}(Lt||(Lt={})),function(t){t[t.PUSH_NOTIFICATION_QUIET_HOURS_LEVEL_DEFAULT=0]="PUSH_NOTIFICATION_QUIET_HOURS_LEVEL_DEFAULT",t[t.PUSH_NOTIFICATION_QUIET_HOURS_LEVEL_MENTION_MESSAGE=1]="PUSH_NOTIFICATION_QUIET_HOURS_LEVEL_MENTION_MESSAGE",t[t.PUSH_NOTIFICATION_QUIET_HOURS_LEVEL_BLOCKED=5]="PUSH_NOTIFICATION_QUIET_HOURS_LEVEL_BLOCKED"}(mt||(mt={})),function(t){t.WIFI="wifi",t.FOUR_G="4g",t.THREE_G="3g",t.TWO_G="2g",t.FIVE_G="2g",t.THREE_GENT="3gnet",t.UNKONWN="unknown"}(yt||(yt={})),function(t){t.GET="GET",t.POST="POST",t.PUT="PUT"}(Mt||(Mt={}));var wt=72e5,xt={"RC:TxtMsg":{isCounted:!0,isPersited:!0},"RC:ImgMsg":{isCounted:!0,isPersited:!0},"RC:VcMsg":{isCounted:!0,isPersited:!0},"RC:ImgTextMsg":{isCounted:!0,isPersited:!0,searchProps:["content","title"]},"RC:FileMsg":{isCounted:!0,isPersited:!0,searchProps:["name"]},"RC:HQVCMsg":{isCounted:!0,isPersited:!0},"RC:LBSMsg":{isCounted:!0,isPersited:!0},"RC:PSImgTxtMsg":{isCounted:!0,isPersited:!0},"RC:PSMultiImgTxtMsg":{isCounted:!0,isPersited:!0},"RCJrmf:RpMsg":{isCounted:!0,isPersited:!0},"RCJrmf:RpOpendMsg":{isCounted:!0,isPersited:!0},"RC:CombineMsg":{isCounted:!0,isPersited:!0},"RC:CombineV2Msg":{isCounted:!0,isPersited:!0},"RC:ReferenceMsg":{isCounted:!0,isPersited:!0,searchProps:["content"]},"RC:SightMsg":{isCounted:!0,isPersited:!0},"RC:GIFMsg":{isCounted:!0,isPersited:!0},"RC:RLStart":{isCounted:!0,isPersited:!0},"RC:RLEnd":{isCounted:!0,isPersited:!0},"RC:InfoNtf":{isCounted:!1,isPersited:!0},"RC:ContactNtf":{isCounted:!1,isPersited:!0},"RC:ProfileNtf":{isCounted:!1,isPersited:!0},"RC:CmdNtf":{isCounted:!1,isPersited:!0},"RC:GrpNtf":{isCounted:!1,isPersited:!0},"RC:RcCmd":{isCounted:!1,isPersited:!0},"RC:RcNtf":{isCounted:!1,isPersited:!0},"RC:CmdMsg":{isCounted:!1,isPersited:!1},"RC:TypSts":{isCounted:!1,isPersited:!1},"RC:PSCmd":{isCounted:!1,isPersited:!1},"RC:SRSMsg":{isCounted:!1,isPersited:!1},"RC:RRReqMsg":{isCounted:!1,isPersited:!1},"RC:RRRspMsg":{isCounted:!1,isPersited:!1},"RC:CsChaR":{isCounted:!1,isPersited:!1},"RC:CSCha":{isCounted:!1,isPersited:!1},"RC:CsEva":{isCounted:!1,isPersited:!1},"RC:CsContact":{isCounted:!1,isPersited:!1},"RC:CsHs":{isCounted:!1,isPersited:!1},"RC:CsHsR":{isCounted:!1,isPersited:!1},"RC:CsSp":{isCounted:!1,isPersited:!1},"RC:CsEnd":{isCounted:!1,isPersited:!1},"RC:CsUpdate":{isCounted:!1,isPersited:!1},"RC:ReadNtf":{isCounted:!1,isPersited:!1},"RC:chrmKVNotiMsg":{isCounted:!1,isPersited:!1},"RC:VCAccept":{isCounted:!1,isPersited:!1},"RC:VCRinging":{isCounted:!1,isPersited:!1},"RC:VCSummary":{isCounted:!1,isPersited:!1},"RC:VCHangup":{isCounted:!1,isPersited:!1},"RC:VCInvite":{isCounted:!1,isPersited:!1},"RC:VCModifyMedia":{isCounted:!1,isPersited:!1},"RC:VCModifyMem":{isCounted:!1,isPersited:!1},"RC:MsgExMsg":{isCounted:!1,isPersited:!1},"RC:Delivered":{isCounted:!1,isPersited:!1},"RC:RRMsg":{isCounted:!1,isPersited:!1},"RC:LogCmdMsg":{isCounted:!1,isPersited:!1},"RC:InterceptMsg":{isCounted:!1,isPersited:!1},"RC:RLJoin":{isCounted:!1,isPersited:!1},"RC:RLQuit":{isCounted:!1,isPersited:!1},"RC:RL":{isCounted:!1,isPersited:!1},"RC:CCConfigChangeRequestMsg":{isCounted:!1,isPersited:!1}},Bt="5.14.0".replace(/-.+$/,""),kt="rongcloudsystem",Ht="undefined"!=typeof window&&window?(window.__RCVersionInfo||(window.__RCVersionInfo={}),window.__RCVersionInfo):{};Ht.engine="5.14.0";var Jt=function(){function t(){}return t.add=function(t,e){Ht[t]=e},t.validEngine=function(t){var e=t.match(/\d+\.\d+\.\d+/);if(!e)return!1;var n=e[0].split(".").map((function(t){return t.padStart(3,"0")})).join("");return Ht.engine.match(/\d+\.\d+\.\d+/)[0].split(".").map((function(t){return t.padStart(3,"0")})).join("")>=n},t.getInfo=function(){return Ht},t}();var Yt=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(t){var e=Math.floor(36*Math.random());return("x"===t?e:3&e|8).toString(36)}))},Wt=function(t){void 0===t&&(t=22);var e,n=Date.now(),o=n.toString(36),r=Math.floor(Math.random()*n).toString(36),i=t-o.length-r.length;return[r,o,i>0?(e=i,Array.from({length:e}).map((function(){return Math.floor(36*Math.random()).toString(36)})).join("")):""].join("").slice(0,t)}(22),Kt=Date.now(),jt=function(t){return-1!==Object.prototype.toString.call(t).indexOf("Array")},Xt=function(t){return"[object Object]"===Object.prototype.toString.call(t)},Qt=function(t){return void 0===t||"[object Undefined]"===Object.prototype.toString.call(t)},qt=function(t){return function(t){return"string"==typeof t}(t)&&/https?:\/\//.test(t)},Zt=function(t){for(var e in t)if(Object.prototype.hasOwnProperty.call(t,e))return!0;return!1},zt=function(t){return{isRead:(t&Nt.READ)===Nt.READ,isListened:(t&Nt.LISTENED)===Nt.LISTENED,isDownload:(t&Nt.DOWNLOADED)===Nt.DOWNLOADED,isRetrieved:(t&Nt.RETRIEVED)===Nt.RETRIEVED}},$t=function(t){return[ct.Android,ct.iOS,ct.Web,ct.PC,ct.Mini,ct.HarmonyOS].map((function(e){var n=t.findIndex((function(t){return t.platform===e}));return-1===n?{platform:e,changeTime:0,eventValue:0}:t[n]}))},te=function(t,e,n){return e?1===n?q.TLS:q.RMTP:"http"===t?q.WS:q.WSS},ee=function(t,e){var n=t.server,o=t.backupServer,r=t.bs,i=t.serverAddr,s=t.protocol,a=t.openTLS;if(i)return Ft([],bt(i.filter((function(t){return t.addr}))),!1);var _=[],c=[];return n&&c.push(n),(o||r||"").split(",").forEach((function(t){c.indexOf(t)<0&&c.push(t)})),c.forEach((function(t,o){t&&_.push({addr:t,protocol:te(s,e,a),weight:n.length-o,race:!1})})),Ft([],bt(_),!1)},ne=function(t){return t.reduce((function(t,e){return t[e.key]=e.value,t}),{})},oe=function(t,e){var n=Math.floor(1e3*Math.random()%1e4),o=Yt(),r=function(t){t=t||"-";var e=new Date,n=e.getFullYear(),o=e.getMonth()+1,r=e.getDate();return"".concat(n).concat(t).concat(o).concat(t).concat(r)}(),i=(new Date).getTime(),s="";if(e){var a=e.split(".");s=".".concat(a[a.length-1])}return"".concat(t,"__RC-").concat(r,"_").concat(n,"_").concat(i).concat(o).concat(s)},re=function(t,e,n){void 0===t&&(t={}),void 0===e&&(e={}),void 0===n&&(n={});var o=e.channelIdMi,r=e.channelIdHW,i=e.channelIdOPPO,s=e.typeVivo,a=e.importanceHW,_=e.categoryHW,c=e.imageUrlHW,u=e.categoryVivo,E=e.importanceHonor,R=e.imageUrlHonor,l=function(t,e){void 0===t&&(t={}),void 0===e&&(e={});var n=t.threadId,o=t.apnsCollapseId,r=t.category,i=t.richMediaUri,s=t.interruptionLevel,a=e.googleConfig,_={};_["thread-id"]=n||"",_["apns-collapse-id"]=o||"",_.category=r||"",_.richMediaUri=i||"",_["interruption-level"]=s||"active";var c={};c.collapse_key=null==a?void 0:a.collapseKey,c.imageUrl=null==a?void 0:a.imageUrl;var u=null==a?void 0:a.priority;return u&&!["high","normal"].includes(u)&&(u="normal"),c.priority=u,{APNS:_,FCM:c}}(t,e),d=[{HW:{channelId:r||"",importance:a||"NORMAL",image:c||"",category:_||""}},{MI:{channelId:o||""}},{OPPO:{channelId:i||""}},{VIVO:{classification:s||"",category:u||""}},{APNS:l.APNS},{FCM:l.FCM},{HONOR:{importance:E||Tt.NORMAL,image:R||""}},{OHOS:{category:n.category||null,image:n.image||""}}];return JSON.stringify(d)},ie=function(){var t=Jt.getInfo(),e="electron";for(var n in t)"engine"!==n&&(e=["imlib-v2-adapter","imlib-v4-adapter","imlib-next"].includes(n)?n:"electron");return e};function se(t,e){var n;if(!t)return"";var o="undefined"!=typeof window&&"https:"===(null===(n=null===window||void 0===window?void 0:window.location)||void 0===n?void 0:n.protocol);return/^https?:\/\//.test(t)?o?t.replace(/^https?:\/\//i,"https://"):t:e!==q.HTTP||o?"https://".concat(t):"http://".concat(t)}var ae=function(t,e){if(!t)return"";var n=t.ossConfig,o=void 0===n?"":n,r="";try{var i=JSON.parse(o);if(i.length>0){var s=i.find((function(t){return t.minio}));s&&(r=s.minio)}}catch(t){e.warn(S.L_PARSE_JSON_E,JSON.stringify({ossConfig:o,error:t}))}return r};!function(t){function e(e){var n=t.call(this,e)||this;return n.name="CMSYError",n}T(e,t),e.InvalidParameters=function(t){return(null==t?void 0:t.length)?new e("Invalid parameter -> ".concat(t)):new e("Invalid parameters.")},e.ParameterTypeError=function(){return new e("Wrong parameter type")}}(Error);var _e=function(){function t(){this._map=new Map,this._piped=new Set}return t.prototype._addItem=function(t,e,n,o,r){void 0===r&&(r=0);var i=Symbol(),s=this._map.get(t)||this._map.set(t,[]).get(t),a={symbol:i,priority:Math.min(r,100),listener:e.bind(o),once:n},_=s.findIndex((function(t){return t.priority>r}));return-1===_?s.push(a):s.splice(_,0,a),i},t.prototype.on=function(t,e,n,o){return void 0===o&&(o=0),this._addItem(t,e,!1,n,o)},t.prototype.once=function(t,e,n,o){return void 0===o&&(o=0),this._addItem(t,e,!0,n,o)},t.prototype.off=function(t){var e,n;try{for(var o=Vt(this._map),r=o.next();!r.done;r=o.next()){var i=bt(r.value,2),s=(i[0],i[1]),a=s.findIndex((function(e){return e.symbol===t}));if(-1!==a)return void s.splice(a,1)}}catch(t){e={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(e)throw e.error}}},t.prototype.emit=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];var o=this._map.get(t);if(o&&o.length>0)for(var r=o.length-1;r>=0;r-=1){var i=o[r],s=i.once,a=i.listener;s&&o.splice(r,1);try{a.apply(void 0,Ft([],bt(e),!1))}catch(t){null===console||void 0===console||console.error(t)}}Ft([],bt(this._piped.values()),!1).forEach((function(n){return n.emit.apply(n,Ft([t],bt(e),!1))}))},t.prototype.removeAll=function(t){this._map.delete(t)},t.prototype.clear=function(){this._piped.clear(),this._map.clear()},t.prototype.pipe=function(t){this._piped.add(t)},t}();!function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._versionQueue=[],e._isPulling=null,e._dataVersion=0,e._invervalTimer=-1,e._intervalGap=0,e}T(e,t),e.prototype.setInitVersion=function(t,e){return Dt(this,void 0,void 0,(function(){return Gt(this,(function(n){switch(n.label){case 0:return 0!==this._dataVersion?[2]:(this._dataVersion=t,e?[4,this._execPulling()]:[3,2]);case 1:n.sent(),n.label=2;case 2:return[2]}}))}))},e.prototype.push=function(t){t<this._dataVersion||(this._versionQueue.push(t),0!==this._dataVersion&&this._execPulling())},e.prototype._execPulling=function(){return Dt(this,void 0,void 0,(function(){var t,e,n,o,r;return Gt(this,(function(i){switch(i.label){case 0:return this._isPulling?[4,this._isPulling]:[3,2];case 1:return i.sent(),[2];case 2:return this._isPulling=this._sendRequest(this._dataVersion),[4,this._isPulling];case 3:if(t=i.sent(),e=t.code,n=t.version,o=t.hasNext,this._isPulling=null,0!==e)return[2];if(void 0===n||n<this._dataVersion)throw new Error("version error, please check: lastVersion: ".concat(this._dataVersion,", newVersion: ").concat(n));return r=this._versionQueue.filter((function(t){return t>n})),this._versionQueue=Ft([],bt(r),!1),this._dataVersion=n,this._resetIntervalTimer(),o?(this._execPulling(),[2]):(this._versionQueue.length>0&&(this._versionQueue.length=0,this._execPulling()),[2])}}))}))},e.prototype.startInterval=function(t){var e=this;-1===this._invervalTimer&&(this._intervalGap=t,this._invervalTimer=setInterval((function(){return e._execPulling()}),t))},e.prototype._resetIntervalTimer=function(){var t=this;-1!==this._invervalTimer&&(clearInterval(this._invervalTimer),this._invervalTimer=setInterval((function(){return t._execPulling()}),this._intervalGap))},e.prototype.stopInterval=function(){-1!==this._invervalTimer&&clearInterval(this._invervalTimer)},e.prototype.reset=function(){this.stopInterval(),this._versionQueue.length=0,this._dataVersion=0}}(_e);var ce,ue,Ee,Re=function(){function t(t,e,n){this.code=t,this.msg=e,this.data=n,this.isOk=0===t}return t.prototype.next=function(t){return Dt(this,void 0,void 0,(function(){return Gt(this,(function(e){return this.isOk?[2,t(this.data)]:[2,this.wipe()]}))}))},t.prototype.trans=function(t){return this.isOk?le(t(this.data)):this.wipe()},t.prototype.tryTrans=function(t){return this.isOk?t(this.data):this.wipe()},t.prototype.wipe=function(){return this.isOk?le(void 0,this.msg):pe(this.code,this.msg)},t.ok=function(e,n){return new t(0,n||"success",e)},t.unknown=function(t,e,n){return 0===t?le(e,n):pe(t,n)},t.fail=function(e,n,o){return new t(e,n||"fail: ".concat(e),o)},t}(),le=Re.ok,de=Re.unknown,pe=Re.fail,Ce="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function Te(t){var e,n,o,r,i,s,a="",_=0;for(t=t.replace(/[^A-Za-z0-9+/=]/g,"");_<t.length;)e=Ce.indexOf(t.charAt(_++))<<2|(r=Ce.indexOf(t.charAt(_++)))>>4,n=(15&r)<<4|(i=Ce.indexOf(t.charAt(_++)))>>2,o=(3&i)<<6|(s=Ce.indexOf(t.charAt(_++))),a+=String.fromCharCode(e),64!==i&&(a+=String.fromCharCode(n)),64!==s&&(a+=String.fromCharCode(o));return a}!function(t){t[t.add=1]="add",t[t.update=2]="update",t[t.delete=3]="delete"}(ce||(ce={})),function(t){t[t.BJ=1]="BJ",t[t.SG=2]="SG",t[t.NA=3]="NA",t[t.SG_A=4]="SG_A",t[t.SG_B=4]="SG_B",t[t.SA=5]="SA"}(Ee||(Ee={}));var Ie=((ue={})[Ee.BJ]={naviUrlBase64:["bmF2LnJvbmctZWRnZS5jb20=","bmF2LWIucm9uZy1lZGdlLmNvbQ=="],logUrlBase64:[{addr:"Y29sbGVjdGlvbi5yb25nLWVkZ2UuY29t",protocol:q.HTTPS,weight:-1}],miniCmpBase64:["d3Mucm9uZy1lZGdlLmNvbQ==","d3MtYi5yb25nLWVkZ2UuY29t"],staticConfigUrlBase64:["aHR0cHM6Ly9ib290c3RyYXBwcm9maWxlLWMtMS5vc3MtY24tYmVpamluZy5hbGl5dW5jcy5jb20="],cloudControllerUrlBase64:["Y2xvdWRjb250cm9sLnJvbmctZWRnZS5jb20=","Y2xvdWRjb250cm9sLWIucm9uZy1lZGdlLmNvbQ=="]},ue[Ee.SG]={naviUrlBase64:["bmF2LnNnLWxpZ2h0LWVkZ2UuY29t","bmF2LWIuc2ctbGlnaHQtZWRnZS5jb20="],logUrlBase64:[{addr:"Y29sbGVjdGlvbi5zZy1saWdodC1lZGdlLmNvbQ==",protocol:q.HTTPS,weight:-1}],miniCmpBase64:["d3Muc2ctbGlnaHQtZWRnZS5jb20=","d3MtYi5zZy1saWdodC1lZGdlLmNvbQ=="],staticConfigUrlBase64:["aHR0cHM6Ly9ib290c3RyYXBwcm9maWxlLWItMi5zMy5hcC1zb3V0aGVhc3QtMS5hbWF6b25hd3MuY29t"],cloudControllerUrlBase64:["Y2xvdWRjb250cm9sLnNnLWxpZ2h0LWVkZ2UuY29t","Y2xvdWRjb250cm9sLWIuc2ctbGlnaHQtZWRnZS5jb20="]},ue[Ee.NA]={naviUrlBase64:["bmF2LnVzLWxpZ2h0LWVkZ2UuY29t","bmF2LWIudXMtbGlnaHQtZWRnZS5jb20="],logUrlBase64:[{addr:"Y29sbGVjdGlvbi51cy1saWdodC1lZGdlLmNvbQ==",protocol:q.HTTPS,weight:-1}],miniCmpBase64:["d3MudXMtbGlnaHQtZWRnZS5jb20=","d3MtYi51cy1saWdodC1lZGdlLmNvbQ=="],staticConfigUrlBase64:[],cloudControllerUrlBase64:["Y2xvdWRjb250cm9sLnVzLWxpZ2h0LWVkZ2UuY29t","Y2xvdWRjb250cm9sLWIudXMtbGlnaHQtZWRnZS5jb20="]},ue[Ee.SG_B]={naviUrlBase64:["bmF2LnNnLWItbGlnaHQtZWRnZS5jb20=","bmF2LWIuc2ctYi1saWdodC1lZGdlLmNvbQ=="],logUrlBase64:[{addr:"Y29sbGVjdGlvbi5zZy1iLWxpZ2h0LWVkZ2UuY29t",protocol:q.HTTPS,weight:-1}],miniCmpBase64:["d3Muc2ctYi1saWdodC1lZGdlLmNvbQ==","d3MtYi5zZy1iLWxpZ2h0LWVkZ2UuY29t"],staticConfigUrlBase64:[],cloudControllerUrlBase64:["Y2xvdWRjb250cm9sLnNnLWItbGlnaHQtZWRnZS5jb20=","Y2xvdWRjb250cm9sLWIuc2ctYi1saWdodC1lZGdlLmNvbQ=="]},ue[Ee.SA]={naviUrlBase64:["bmF2LnNhdS1saWdodC1lZGdlLmNvbQ==","bmF2LWIuc2F1LWxpZ2h0LWVkZ2UuY29t"],logUrlBase64:[{addr:"Y29sbGVjdGlvbi5zYXUtbGlnaHQtZWRnZS5jb20=",protocol:q.HTTPS,weight:-1}],miniCmpBase64:["d3Muc2F1LWxpZ2h0LWVkZ2UuY29t","d3MtYi5zYXUtbGlnaHQtZWRnZS5jb20="],staticConfigUrlBase64:[],cloudControllerUrlBase64:["Y2xvdWRjb250cm9sLnNhdS1saWdodC1lZGdlLmNvbQ==","Y2xvdWRjb250cm9sLWIuc2F1LWxpZ2h0LWVkZ2UuY29t"]},ue);function Se(t){return Ee[t]?t:Ee.BJ}var he,Ne=function(){function t(){this.initOption={}}return t.prototype.init=function(t){this.initOption=t},t.prototype.getNaviUrlList=function(t,e){var n,o=this.initOption||{},r=o.areaCode,i=o.navigators,s=(n=r,void 0===n&&(n=Ee.BJ),Ie[Se(n)].naviUrlBase64).map((function(t){return Te(t)})),a=[],_=bt(t.split("@"),2)[1];e&&(a=_?_.split(";"):[]);var c=i&&i.length>0?Ft(Ft([],bt(a),!1),bt(i),!1):Ft(Ft([],bt(a),!1),bt(s),!1);return c.filter((function(t,e){return c.indexOf(t)===e})).map((function(t){return se(t)}))},t.prototype.getLogUrlPolicyList=function(t,e){var n,o=t||{},r=o.log,i=o.logPolicy,s=this.initOption||{},a=s.areaCode,_=s.logServerUrl,c=(n=a,void 0===n&&(n=Ee.BJ),Ie[Se(n)].logUrlBase64).map((function(t){return Ut(Ut({},t),{addr:Te(t.addr)})})),u=[],E={level:1,itv:6,times:5};if(r)u.push.apply(u,Ft([],bt(r.addrs),!1)),Object.assign(E,r.policy);else if(i)try{var R=JSON.parse(i);u.push({addr:R.url,protocol:q.HTTPS,weight:1}),E.level=R.level,E.itv=R.itv,E.times=R.times}catch(n){e.warn(S.L_REPORT_LOG_POLICY_E,JSON.stringify({policy:t.logPolicy}))}var l=_?Ft([{addr:_,protocol:q.HTTPS,weight:101}],bt(u),!1):Ft(Ft([],bt(u),!1),bt(c),!1);return{policy:E,addrs:l.filter((function(t,e){return l.findIndex((function(e){return e.addr===t.addr&&e.protocol===t.protocol}))===e})).map((function(t){return Ut(Ut({},t),{addr:se(t.addr,t.protocol)})})).sort((function(t,e){return e.weight-t.weight}))}},t.prototype.getMiniCmpUrlList=function(){var t,e,n=(e=null===(t=this.initOption)||void 0===t?void 0:t.areaCode,void 0===e&&(e=Ee.BJ),Ie[Se(e)].miniCmpBase64).map((function(t){return Te(t)})),o=(this.initOption||{}).miniCMPProxy;return o&&o.length>0?o:n},t.prototype.getStaticConfigUrl=function(){var t,e;return(e=null===(t=this.initOption)||void 0===t?void 0:t.areaCode,void 0===e&&(e=Ee.BJ),Ie[Se(e)].staticConfigUrlBase64).map((function(t){return Te(t)}))},t.prototype.getCloudControllerUrl=function(t){var e,n,o=null!=t?t:null===(e=this.initOption)||void 0===e?void 0:e.areaCode;return(n=o,void 0===n&&(n=Ee.BJ),Ie[Se(n)].cloudControllerUrlBase64).map((function(t){return Te(t)}))},t.prototype.getAreaCode=function(){var t,e;return null!==(e=null===(t=this.initOption)||void 0===t?void 0:t.areaCode)&&void 0!==e?e:Ee.BJ},t.prototype.setAreaCode=function(t){return!(!t||!Ee[t]||t===this.initOption.areaCode)&&(this.initOption.areaCode=t,!0)},t}(),fe=new Ne,Oe=function(){function t(t,e){this.appkey=t,this.logger=e,this.staticUrls=[]}return t.prototype.getStaticConfig=function(){var t;return Dt(this,void 0,void 0,(function(){var e,n,o,r,i,s,a,_;return Gt(this,(function(c){switch(c.label){case 0:if(!(e=this.getCache()))return[3,6];c.label=1;case 1:return c.trys.push([1,4,,5]),n=JSON.parse(e),Date.now()-(null==n?void 0:n.time)<18e5?[4,this.decryptData(n.val)]:[3,3];case 2:return o=c.sent(),(r=o.resources.navi.slice()).sort((function(t,e){return e.weight-t.weight})),[2,{navi:r.map((function(t){return se(t.addr,t.protocol)}))||[]}];case 3:return[3,5];case 4:return i=c.sent(),this.logger.error(S.L_GET_STATIC_CONF_E,JSON.stringify({error:null==i?void 0:i.stack})),[3,5];case 5:this.clearCache(),c.label=6;case 6:return[4,this._requestHandle()];case 7:return(s=c.sent())?[4,this.decryptData(s)]:[2];case 8:return(null==(a=c.sent())?void 0:a.areaCode)!==fe.getAreaCode()?[2]:(this.setCache(JSON.stringify({time:Date.now(),val:s})),this.staticUrls=(null==a?void 0:a.bootstrap)||[],(_=null===(t=null==a?void 0:a.resources)||void 0===t?void 0:t.navi.slice()).sort((function(t,e){return e.weight-t.weight})),[2,{navi:_.map((function(t){return se(t.addr,t.protocol)}))||[]}])}}))}))},t.prototype._requestHandle=function(){return Dt(this,void 0,void 0,(function(){var t,e,n,o,r,i,s,a,_,c,u;return Gt(this,(function(E){switch(E.label){case 0:t=(t=Ft(Ft([],bt(this.staticUrls),!1),bt(fe.getStaticConfigUrl()),!1).map((function(t){return se(t)}))).filter((function(e,n){return t.indexOf(e)===n})),E.label=1;case 1:E.trys.push([1,6,7,8]),e=Vt(t),n=e.next(),E.label=2;case 2:return n.done?[3,5]:(o=n.value,this.logger.info(S.L_GET_STATIC_CONF_T,JSON.stringify({url:o})),r=Date.now(),[4,this.sendRequest("".concat(o,"/").concat(this.appkey))]);case 3:if(i=E.sent(),s=i.code,a=i.data,200===s)return this.logger.info(S.L_GET_STATIC_CONF_R,JSON.stringify({url:o,code:s,duration:Date.now()-r})),[2,a];this.logger.warn(S.L_GET_STATIC_CONF_R,JSON.stringify({url:o,code:s,duration:Date.now()-r})),E.label=4;case 4:return n=e.next(),[3,2];case 5:return[3,8];case 6:return _=E.sent(),c={error:_},[3,8];case 7:try{n&&!n.done&&(u=e.return)&&u.call(e)}finally{if(c)throw c.error}return[7];case 8:return[2]}}))}))},t}();!function(t){t[t.STATISTICS=-2]="STATISTICS",t[t.RECORD=-1]="RECORD",t[t.FATAL=0]="FATAL",t[t.ERROR=1]="ERROR",t[t.WARN=2]="WARN",t[t.INFO=3]="INFO",t[t.DEBUG=4]="DEBUG"}(he||(he={}));var Ae,ge=function(){function t(t,e,n){this._appkey=t,this._id=e,this._type=n,this.outputLevel=he.WARN,this.debug=this._log.bind(this,he.DEBUG),this.info=this._log.bind(this,he.INFO),this.warn=this._log.bind(this,he.WARN),this.error=this._log.bind(this,he.ERROR),this.__statistics=this._log.bind(this,he.STATISTICS),this.record=this.__statistics}return t.prototype._writer=function(t,e,n,o){var r=new Date;/^[\w-]+$/.test(e)?t!==he.DEBUG&&this.flush({time:+r,sessionId:Wt,type:this._type,loggerId:this._id,tag:e,level:t,content:n,traceId:o}):console.error("".concat((new Date).toISOString(),"[").concat(this._id,"]['ERROR']: ").concat(e," | ").concat(n," | ").concat(o))},t.prototype.createTraceId=function(){return"".concat(++t._traceIdCount)},t.prototype.getSessionId=function(){return Wt},t.prototype._stdout=function(t,e,n,o,r){var i;if(!(t<=he.FATAL)&&console&&!(t>this.outputLevel)){var s=["error","warn","info","debug"][t-1];null===(i=console)||void 0===i||i[s]("".concat(n,"[").concat(this._id,"][").concat(s.toUpperCase(),"]: ").concat(e," | ").concat(o," | ").concat(r))}},t.prototype.setOutputLevel=function(t){(function(t){return[he.DEBUG,he.INFO,he.WARN,he.ERROR].some((function(e){return e===t}))})(t)&&(this.outputLevel=t)},t.prototype._log=function(t,e,n,o){this._stdout(t,e,(new Date).toISOString(),n,o),this._writer(t,e,n,o)},t._traceIdCount=0,t}(),Pe=function(){function t(t,e,n,o,r,i){void 0===i&&(i=!1),this.appkey=t,this.deviceId=e,this.deviceInfo=n,this.logDB=o,this.logger=r,this.disableLogReport=i,this.userId="",this.timer=null,this.started=!1,this.reportFailedNumber=0,this.itvByNavi=6,this.timesByNavi=5}return t.prototype.checkStart=function(t,e){return Dt(this,void 0,void 0,(function(){var n,o,r;return Gt(this,(function(i){return this.started?[2]:(this.userId=t.userId,!t.logSwitch||this.disableLogReport||(n=fe.getLogUrlPolicyList(t,this.logger),o=n.policy,r=n.addrs,this.started=!0,this.itvByNavi=o.itv,this.timesByNavi=o.times,r.length>0&&this.realtimeReport(r[0].addr,o.level,o.itv,e)),[2])}))}))},t.prototype._sendLogs2Realtime=function(t,e,n,o){return Dt(this,void 0,void 0,(function(){var r,i,s,a,_,c,u,E,R,l,d;return Gt(this,(function(p){switch(p.label){case 0:return this.logger.debug(S.L_REALTIME_LOG_O,JSON.stringify({count:t.length}),e),r=o,[4,this.compressLogs(t)];case 1:return a=p.sent(),_=a.success,c=a.data,_||this.logger.warn(S.L_REALTIME_LOG_O,"compress failed",e),this.logger.debug(S.L_REALTIME_LOG_O,"compress done",e),u=qt(n)?n:"https://".concat(n),u+="?version=".concat("5.14.0","&appkey=").concat(this.appkey,"&userId=").concat(encodeURIComponent(this.userId),"&deviceId=").concat(this.deviceId,"&deviceInfo=").concat(this.deviceInfo,"&platform=Web"),[4,this.send({url:u,body:c,method:"POST"})];case 2:if(E=p.sent(),R=E.status,l=E.data,this.logger.debug(S.L_REALTIME_LOG_R,JSON.stringify({status:R,data:l}),e),200===R){if(this.reportFailedNumber=0,l)try{(d=JSON.parse(l)).nextTime&&(r=d.nextTime),i=d.level,s=d.logSwitch}catch(t){this.logger.warn(S.L_PARSE_JSON_E,JSON.stringify({error:null==t?void 0:t.stack}),e)}this.logDB.setTimestamp4RealtimeLog(t[t.length-1].time+1)}else this.reportFailedNumber>this.timesByNavi&&this.itvByNavi<60&&(r+=r),this.reportFailedNumber++;return[2,{itv:r,level:i,logSwitch:s}]}}))}))},t.prototype.realtimeReport=function(t,e,n,o){return Dt(this,void 0,void 0,(function(){var r,i,s,a,_,c,u,E,R,l,d,p=this;return Gt(this,(function(C){switch(C.label){case 0:return r=Date.now(),i=this.logDB.getTimestamp4RealtimeLog()||Kt,s=Math.max(r-5e3,i),a=this.logger.createTraceId(),this.logger.debug(S.L_REALTIME_LOG_T,JSON.stringify({startTime:i,endTime:s,level:e,itv:n}),a),[4,this.logDB.getLogs(i,s,e,!0,o)];case 1:return _=C.sent(),c=_.dbReady,u=_.logs,c?[3,2]:(this.logger.warn(S.L_REALTIME_LOG_R,"db error",a),[3,4]);case 2:return u.length>0?[4,this._sendLogs2Realtime(u,a,t,n)]:[3,4];case 3:if(E=C.sent(),R=E.itv,l=E.level,d=E.logSwitch,n=R,void 0!==l&&(e=l),0===d)return[2];C.label=4;case 4:return this.started&&(this.timer&&clearTimeout(this.timer),n>=60&&this.itvByNavi<60&&(n=60),this.timer=setTimeout((function(){return p.realtimeReport(t,e,n,o)}),1e3*n)),[2]}}))}))},t.prototype.report=function(t,e,n,o,r,i,s){return void 0===s&&(s=!1),Dt(this,void 0,void 0,(function(){var a,_,c,u,E,R,l,d,p,C;return Gt(this,(function(T){switch(T.label){case 0:return"web"!==n.toLowerCase()||this.disableLogReport?[2]:(a=this.logger.createTraceId(),this.logger.info(S.L_REPORT_FULL_LOG_T,JSON.stringify({startTime:t,endTime:e,logId:r,messageUId:i,isCloudControl:s}),a),[4,this.logDB.getLogs(t,e,he.DEBUG,!1)]);case 1:return _=T.sent(),c=_.dbReady,u=_.logs,this.logger.info(S.L_REPORT_FULL_LOG_O,JSON.stringify({count:u.length}),a),E=qt(o)?o:"https://".concat(o),E+="?version=".concat("5.14.0","&appkey=").concat(this.appkey,"&userId=").concat(encodeURIComponent(this.userId),"&deviceId=").concat(this.deviceId,"&deviceInfo=").concat(this.deviceInfo,"&platform=Web&logId=").concat(r),c?u.length>0?[4,this.compressLogs(u)]:[3,3]:[3,5];case 2:return l=T.sent(),d=l.success,p=l.data,R=d?p:"compress failed",[3,4];case 3:R="no data",T.label=4;case 4:return[3,6];case 5:R="no database",T.label=6;case 6:return this.logger.debug(S.L_REPORT_FULL_LOG_O,"compress done",a),s&&(E+="&source=cloud"),[4,this.send({url:E,body:R,method:"POST"})];case 7:return C=T.sent().status,this.logger.info(S.L_REPORT_FULL_LOG_R,JSON.stringify({status:C}),a),[2]}}))}))},t.prototype.stop=function(){this.timer&&(clearTimeout(this.timer),this.timer=null),this.started=!1},t}();!function(t){t[t.init=1]="init",t[t.newWorkChange=2]="newWorkChange",t[t.other=3]="other"}(Ae||(Ae={}));var ve=function(){function t(t){this.reporter=t,this.logId="",this.uploadTask=[],this.taskLock=!0}return t.prototype.uploadLogCmdTask=function(t){this.uploadTask.push(t),this.enqueueTask()},t.prototype.reportLogCmdTask=function(t){var e,n,o,r,i=this;this.taskLock=!1;var s=null!==(e=t.startTime)&&void 0!==e?e:0,a=null!==(n=t.endTime)&&void 0!==n?n:0,_=null!==(o=t.platform)&&void 0!==o?o:"",c=null!==(r=t.uri)&&void 0!==r?r:"";t.logId!==this.logId&&""!==c&&(this.logId=t.logId,this.reporter.report(s,a,_,c,t.logId,"",!0).finally((function(){i.taskLock=!0,i.uploadTask.length>0&&i.enqueueTask()})))},t.prototype.enqueueTask=function(){if(this.taskLock){var t=this.uploadTask.shift();t&&this.reportLogCmdTask(t)}},t}();var Le,me,ye=function(){function t(t,e,n){this.logger=t,this.appkey=e,this.reporter=n,this.isEable=!0,this.expire=0,this.interval=0,this.timestamp=0,this.lastRequestTime=0,this.changeAreaCode=0,this._cache=null,this.uploadTaskManage=new ve(n)}return t.prototype.init=function(){try{var t=this.getLocalCloudControllerCache();this._cache=t?JSON.parse(t):{timestamp:0,lastRequestTime:0,cc:{temporary:!1,enable:!0,expire:72e5,interval:6e5},uploadLog:{temporary:!0,tasks:[]},mrtr:{chatroom:0,group:0,private:0,ultraGroup:0,temporary:!1}}}catch(t){this._cache={timestamp:0,lastRequestTime:0,cc:{temporary:!1,enable:!0,expire:72e5,interval:6e5},uploadLog:{temporary:!0,tasks:[]},mrtr:{chatroom:0,group:0,private:0,ultraGroup:0,temporary:!1}}}this._cache&&(this.interval=this._cache.cc.interval,this.expire=this._cache.cc.expire,this.timestamp=this._cache.timestamp||0,this.isEable=this._cache.cc.enable,this.lastRequestTime=this._cache.lastRequestTime,this.logCmdMsgTasks(this._cache),this.setMRTRConfig(this._handleMrtrData(this._cache.mrtr)))},t.prototype.isExire=function(){return(new Date).getTime()-this.timestamp<this.expire},t.prototype.isOverclock=function(){return(new Date).getTime()-this.lastRequestTime<this.interval},t.prototype.logCmdMsgTasks=function(t){var e=this;t.uploadLog&&t.uploadLog.tasks.forEach((function(t){t.objectName===$.LOG_COMMAND&&e.uploadTaskManage.uploadLogCmdTask(t)}))},t.prototype.dataHandle=function(t){var e=this._cache;e.lastRequestTime=this.lastRequestTime,Zt(t)&&(e.timestamp=t.timestamp,t.uploadLog&&!t.uploadLog.temporary&&(e.uploadLog=t.uploadLog),t.cc&&!t.cc.temporary&&(e.cc=t.cc),t.mrtr&&!t.mrtr.temporary&&(e.mrtr=this._handleMrtrData(t.mrtr)),t.mrtr&&this.setMRTRConfig(this._handleMrtrData(t.mrtr))),this.setCloudControllerCache(e),this.expire=e.cc.expire,this.interval=e.cc.interval,this.timestamp=e.timestamp,this.logCmdMsgTasks(t)},t.prototype.request=function(t,e,n){return Dt(this,void 0,void 0,(function(){var o,r,i,s,a,_,c,u,E,R;return Gt(this,(function(l){switch(l.label){case 0:return!this.isEable&&e===Ae.init&&this.isExire()?(this.logger.info(S.L_CLOUD_DISABLED,JSON.stringify({msg:"cloud controller is disabled"})),[2,this.timestamp]):!this.isEable&&e===Ae.newWorkChange&&this.isOverclock()?(this.logger.info(S.L_CLOUD_OVERCLOCK,JSON.stringify({msg:"cloud controller is overclock"})),[2,this.timestamp]):(o=se(t),this.lastRequestTime=(new Date).getTime(),r="".concat(o,"/v1/config"),i={"Content-Type":"application/json","RC-App-Key":this.appkey},n&&(i["RC-Token"]=n),s={platform:"web",version:"5.14.0",timestamp:this.timestamp},this.logger.record(It.L_CLOUD_INFO_FETCH_T,JSON.stringify({appKey:this.appkey,timestamp:this.timestamp,token:!!n,uri:r})),[4,this.httpRequest(r,Mt.POST,i,s)]);case 1:return a=l.sent(),_=a.code,c=a.data,this.logger.record(It.L_CLOUD_INFO_FETCH_R,JSON.stringify({appkey:this.appkey,info:c})),_===X.CLOUD_DATA_CENTER_INVALID&&c&&c.targetRegion?(u=c.targetRegion,this.changeAreaCode===u?[2,this.timestamp]:(E=fe.setAreaCode(u),this.logger.info(S.L_CLOUD_SET_AREA_CODE_O,JSON.stringify({isChangeSuccess:E,originAreaCode:fe.getAreaCode(),newAreaCode:u})),this.changeAreaCode=u,(R=fe.getCloudControllerUrl(u))[0]?[2,this.request(R[0],Ae.other)]:(this.logger.info(S.L_CLOUD_APPKEY_REGION_E,JSON.stringify({appkey:this.appkey,uri:r,msg:"appkey region error"})),[2,this.timestamp]))):(c&&this.dataHandle(c),[2,this.timestamp||this.lastRequestTime])}}))}))},t.prototype._handleMrtrData=function(t){return{chatroom:(null==t?void 0:t.chatroom)||0,group:(null==t?void 0:t.group)||0,private:(null==t?void 0:t.private)||0,ultraGroup:(null==t?void 0:t.ultraGroup)||0,temporary:!!(null==t?void 0:t.temporary)}},t}(),Me=function(t){return t===X.RC_CONN_REDIRECTED},Ue=function(){function t(t,e,n,o){this.appkey=t,this.navi=e,this.logger=n,this.listener=o,this.token="",this.curCmpUrl="",this.reconnectKick=!1,this._connectDurSwitch=!1,this.retryCount=0,this.uuid="",this.reason=0,this.connectedTime=0,this._network={status:!0,type:yt.UNKONWN},this._checkAliveTimer=null,this._crtConnectionStatus=lt.DISCONNECTED,this._crtUserId="",this._openCallPlus=!1,this._crtConnectionTask=null,this.reconnectTimer=null,this._failedCount=0,this.ALLOW_FAILED_TIMES=2}return t.prototype.getToken=function(){return this.token},t.prototype.getCurrentUserId=function(){return this._crtUserId},t.prototype.setConnectionStatus=function(t,e){if(this._crtConnectionStatus!==t){if(this._crtConnectionStatus=t,this._connectDurSwitch&&t!==lt.CONNECTED&&t!==lt.CONNECTING){var n={bid:ie(),cod:e,net:this.getNetwork().type,dur:Date.now()-this.connectedTime,cid:"".concat(this.uuid,"_").concat(this.retryCount)};this.logger.record(It.IM_CONNECTION_DURATION,JSON.stringify(n)),this._connectDurSwitch=!1}switch(t){case lt.CONNECTED:this.logger.info(S.L_CONNECT_S,t),this.checkAlive(),this.listener.onConnected();break;case lt.CONNECTING:this.logger.warn(S.L_CONNECT_S,"status: ".concat(t,", code: ").concat(e)),this.listener.onConnecting();break;case lt.SUSPENDED:this.logger.warn(S.L_CONNECT_S,"status: ".concat(t,", code: ").concat(e)),Me(e)&&this.clearCmpWeightCache(),this._checkAliveTimer&&clearTimeout(this._checkAliveTimer),this.listener.onSuspend(e);break;default:this.logger.warn(S.L_CONNECT_S,"status: ".concat(t,", code: ").concat(e)),this.clearCmpWeightCache(),this._checkAliveTimer&&clearTimeout(this._checkAliveTimer),this.listener.onDisconnected(e)}}},t.prototype.getConnectionStatus=function(){return this._crtConnectionStatus},t.prototype.setNetwork=function(t,e){if(!e){var n={cid:"".concat(this.uuid,"_").concat(this.retryCount),cn:t.type,on:this._network.type};this.logger.record(It.IM_NETWORK_CHANGE,JSON.stringify(n))}this._network=t},t.prototype.getNetwork=function(){return this._network},t.prototype.connect=function(t,e,n,o){return Dt(this,void 0,void 0,(function(){var r,i,s,a;return Gt(this,(function(_){switch(_.label){case 0:return this._crtConnectionStatus===lt.CONNECTED?[2,le(this._crtUserId)]:this._crtConnectionTask?[2,this._crtConnectionTask]:(this._openCallPlus=n,this.retryCount=0,this.uuid=Yt(),this.token=t,this.reconnectKick=e,this.setConnectionStatus(lt.CONNECTING),r={cid:"".concat(this.uuid,"_").concat(this.retryCount),reason:vt.CONNECT,net:this.getNetwork().type,spr:0},this.logger.record(It.IM_STATS_CS,JSON.stringify(r),o),[4,this.try2Connect(t,e,!1,o,!0)]);case 1:return i=_.sent(),s=i.code,a=i.data,s!==X.SUCCESS?(this.setConnectionStatus(lt.DISCONNECTED,s),[2,pe(s)]):(this.setConnectionStatus(lt.CONNECTED),[2,le(a)])}}))}))},t.prototype.try2Connect=function(t,e,n,o,r){return Dt(this,void 0,void 0,(function(){var i;return Gt(this,(function(s){switch(s.label){case 0:return this._crtConnectionTask?[2,this._crtConnectionTask]:(this._crtConnectionTask=this.createConnectionTask(t,e,n,o,r),[4,this._crtConnectionTask]);case 1:return i=s.sent(),this._crtConnectionTask=null,[2,i]}}))}))},t.prototype.createConnectionTask=function(t,e,n,o,r){return Dt(this,void 0,void 0,(function(){var i,s,a,_,c,u,E,R,l;return Gt(this,(function(d){switch(d.label){case 0:return i={retryCount:this.retryCount,uuid:this.uuid,type:this.getNetwork().type,reason:this.reason},[4,this.navi.request(t,n,!1,o,i)];case 1:return s=d.sent(),a=s.code,_=s.data,a!==X.SUCCESS?[2,pe(a)]:1===(c=_).type?[2,pe(X.PACKAGE_ENVIRONMENT_ERROR)]:(this.logger.info(S.L_CONNECT_T,JSON.stringify({token:t,reconnectKickEnable:e}),o),[4,this.connectWithToken(t.replace(/@.+$/,"@"),c,e,o)]);case 2:return u=d.sent(),E=u.code,R=u.data,Me(E)?(this.logger.warn(S.L_CONNECT_R,"redirect code: ".concat(E),o),this.clearCmpWeightCache(),[2,this.createConnectionTask(t,e,!0,o,r)]):[X.RC_TCP_RESET,X.RC_CONN_ACK_TIMEOUT,X.RC_TCP_DISCONNECTED_NO_RMTP].includes(E)&&this.cmpWeightCache&&this.cmpWeightCache.length>1?(this.updateCmpWeight(this.curCmpUrl,!1),l=this.cmpWeightCache.every((function(t){return t.failed})),r&&l?(this.logger.warn(S.L_CONNECT_R,"cpp code:".concat(E,",reture code:").concat(X.SERVER_UNAVAILABLE),o),[2,pe(X.SERVER_UNAVAILABLE)]):(this.logger.warn(S.L_CONNECT_R,"cmp ack timeout, code: ".concat(E),o),this.setConnectionStatus(lt.SUSPENDED,E),this.setConnectionStatus(lt.CONNECTING),[2,this.createConnectionTask(t,e,!1,o,r)])):E!==X.SUCCESS?(this.logger.warn(S.L_CONNECT_R,"code: ".concat(E),o),[2,pe(E)]):(this.logger.info(S.L_CONNECT_R,"userId: ".concat(R),o),this._connectDurSwitch=!0,this._crtUserId=R,[2,le(R)])}}))}))},t.prototype.setReconnectReason=function(t){switch(t){case X.TIMEOUT:return void(this.reason=vt.TIMEOUT);case X.RC_CONN_REDIRECTED:return void(this.reason=vt.REDIRECTED);default:this.reason=vt.RECONNECT}},t.prototype.try2Reconnect=function(t,e){return Dt(this,void 0,void 0,(function(){var n,o,r=this;return Gt(this,(function(i){return n=this.logger.createTraceId(),this.logger.debug(S.T,"try2Reconnect -> ignoreNaviCache: ".concat(t,", reason: ").concat(e),n),this.stopReconnectTimer(),o=function(){return Dt(r,void 0,void 0,(function(){var r,i;return Gt(this,(function(s){switch(s.label){case 0:return this._crtConnectionStatus!==lt.SUSPENDED?[2]:(this.setConnectionStatus(lt.CONNECTING,e),this.setReconnectReason(e),this.retryCount+=1,r={cid:"".concat(this.uuid,"_").concat(this.retryCount),reason:this.reason,net:this.getNetwork().type,spr:0},this.logger.record(It.IM_STATS_CS,JSON.stringify(r)),[4,this.try2Connect(this.token,!0,t,n,!1)]);case 1:return i=s.sent().code,this.reconnectTimer=null,i===X.SUCCESS?(this.setConnectionStatus(lt.CONNECTED),[2]):[X.SERVER_UNAVAILABLE,X.TIMEOUT,X.RC_SOCKET_DISCONNECTED,X.RC_SOCKET_NOT_CREATED,X.RC_CONN_ACK_TIMEOUT,X.RC_TCP_RESET,X.RC_NAVI_REQ_FAILED,X.RC_NETWORK_DOWN,X.RC_TCP_DISCONNECTED_NO_RMTP].includes(i)?(this._crtConnectionStatus!==lt.CONNECTING||(this.setConnectionStatus(lt.SUSPENDED,i),this.reconnectTimer=setTimeout(o,5e3)),[2]):(this.setConnectionStatus(lt.DISCONNECTED,i),[2])}}))}))},o(),[2]}))}))},t.prototype.onDisconnectByServer=function(t,e){var n=this;return Me(t)?(this.setConnectionStatus(lt.SUSPENDED,t),void this.try2Reconnect(!0,t)):t===X.RC_UDP_DISCONNECTED?(this.setConnectionStatus(lt.SUSPENDED,t),void setTimeout((function(){n.try2Reconnect(!0,t)}),1e3*(e||0))):void this.setConnectionStatus(lt.DISCONNECTED,t)},t.prototype.onDisconenctUnusual=function(t){this.setConnectionStatus(lt.SUSPENDED,t),this.try2Reconnect(!1,t)},t.prototype.checkAlive=function(){return Dt(this,void 0,void 0,(function(){var t,e,n=this;return Gt(this,(function(o){switch(o.label){case 0:return this._crtConnectionStatus!==lt.CONNECTED?(this._failedCount=0,this.logger.debug(S.L_CHECK_ALIVE_IM_S,"stop ping because of no connection"),[2]):(t=this.logger.createTraceId(),this.logger.info(S.L_CHECK_ALIVE_IM_T,null,t),[4,this.sendPing(15e3)]);case 1:return(e=o.sent())===X.SUCCESS?(this.logger.info(S.L_CHECK_ALIVE_IM_R,e,t),this._failedCount=0,this._checkAliveTimer=setTimeout((function(){return n.checkAlive()}),15e3),[2]):this._crtConnectionStatus!==lt.CONNECTED?[2]:(this._failedCount+=1,this.logger.info(S.L_CHECK_ALIVE_IM_R,"code: ".concat(e,", count: ").concat(this._failedCount),t),this._failedCount<this.ALLOW_FAILED_TIMES?[2,this.checkAlive()]:(this._failedCount=0,this.logger.warn(S.L_CHECK_ALIVE_IM_S,"ping timeout, close connection to reconnect!"),this.close(!0,!1),this.setConnectionStatus(lt.SUSPENDED,X.RC_PING_EXCEED_LIMIT),this.try2Reconnect(!1,X.RC_PING_EXCEED_LIMIT),[2]))}}))}))},t.prototype.disconnect=function(t){return Dt(this,void 0,void 0,(function(){return Gt(this,(function(e){switch(e.label){case 0:return this.stopReconnectTimer(),this._crtConnectionTask?[4,this._crtConnectionTask]:[3,2];case 1:e.sent(),e.label=2;case 2:return this.setConnectionStatus(lt.DISCONNECTED,X.ACTIVE_DISCONNECT),this.close(!1,t),[2]}}))}))},t.prototype.stopReconnectTimer=function(){this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null)},t.prototype.getCmpList=function(t,e){if(this.cmpWeightCache&&this.cmpWeightCache.length>0)return Ft([],bt(this.cmpWeightCache),!1);var n=ee(t,e);return this.cmpWeightCache=Ft([],bt(n),!1),Ft([],bt(n),!1)},t.prototype.updateCmpWeight=function(t,e,n){if(this.cmpWeightCache){var o=this.cmpWeightCache.find((function(e){return n?e.addr===t&&e.protocol===q.QUIC:e.addr===t}));if(o)if(e){var r=Math.max.apply(Math,Ft([],bt(this.cmpWeightCache.map((function(t){return t.weight}))),!1));o.weight!==r&&(o.weight=r+1)}else{var i=Math.min.apply(Math,Ft([],bt(this.cmpWeightCache.map((function(t){return t.weight}))),!1));o.weight!==i&&(o.weight=i-1),o.failed=!0}}},t.prototype.clearCmpWeightCache=function(){this.cmpWeightCache=void 0},t.prototype.reconnect=function(t,e,n,o){this.token=t,this.reconnectKick=e,this._openCallPlus=n,this.onDisconenctUnusual(o)},t}(),De=function(t){return t.replace(/@.+$/,"@")},Ge=function(){function t(t,e,n,o,r){void 0===o&&(o=!0),void 0===r&&(r=!0),this.appkey=t,this.logger=e,this.staticConfigManager=n,this.isRequestProfile=o,this.isUseDynamicNaviUrl=r,this.crtRequest=null,this._environment="default"}return t.prototype.getCatchKey=function(t){return t+(this._environment?"-".concat(this._environment):"")},t.prototype.request=function(t,e,n,o,r){return Dt(this,void 0,void 0,(function(){var i;return Gt(this,(function(s){switch(s.label){case 0:return this.crtRequest?[2,this.crtRequest]:(this.crtRequest=this.sendRequest(t,e,n,o,r),[4,this.crtRequest]);case 1:return i=s.sent(),this.crtRequest=null,[2,i]}}))}))},t.prototype.sendRequest=function(t,e,n,o,r){var i;return Dt(this,void 0,void 0,(function(){var s,a,_,c,u,E,R,l,d,p,C,T,I,h;return Gt(this,(function(N){switch(N.label){case 0:return s=De(t),a=this.getNaviCache(s),!e&&a&&(_=a.timestamp,c=a.naviInfo,n||Date.now()-_<wt)?(this.logger.info(S.L_REQUEST_T,JSON.stringify({fromCache:!0,naviInfo:c}),o),u={bid:ie(),ptc:Ot.NAVI,cod:X.SUCCESS,net:null==r?void 0:r.type,dur:0,spr:0,pr:null!==(i=c.type)&&void 0!==i?i:0,hos:"",cache:At.LOCAL,v:gt.CURRENT,rsn:null==r?void 0:r.reason,cid:"".concat(null==r?void 0:r.uuid,"_").concat(null==r?void 0:r.retryCount),count:null==r?void 0:r.retryCount},this.logger.record(It.IM_NAVI,JSON.stringify(u),o),[2,le(c)]):(E=fe.getNaviUrlList(t,this.isUseDynamicNaviUrl),this.logger.info(S.L_GET_NAVI_T,JSON.stringify({token:t,uris:E}),o),[4,this.requestHandler(E,t,o,r)]);case 1:return R=N.sent(),l=R.code,d=R.data,l===X.RC_NAVI_REQ_FAILED&&this.isRequestProfile?[4,this.staticConfigManager.getStaticConfig()]:[3,4];case 2:return(null==(p=N.sent())?void 0:p.navi)&&(null==p?void 0:p.navi.length)>0?(C=p.navi,[4,this.requestHandler(C,t,o,r)]):[3,4];case 3:T=N.sent(),l=T.code,d=T.data,N.label=4;case 4:return l!==X.SUCCESS?(this.logger.warn(S.L_GET_NAVI_R,l,o),[2,pe(l)]):(I=d).code&&200!==I.code?(this.logger.warn(S.L_GET_NAVI_R,I.code,o),[2,pe(this.transHttpCode(I.code))]):ee(I).length>0?(this.logger.info(S.L_GET_NAVI_R,JSON.stringify({naviInfo:I}),o),this.setNaviCache(s,I),[2,de(l,I)]):(h={server:I.server,backupServer:I.backupServer,serverAddr:I.serverAddr,bs:I.bs},this.logger.warn(S.L_GET_NAVI_R,"navi server address invalid: ".concat(JSON.stringify(h)),o),[2,pe(X.SERVER_UNAVAILABLE)])}}))}))},t.prototype.requestHandler=function(t,e,n,o){return Dt(this,void 0,void 0,(function(){var r,i,s,a,_,c,u,E,R;return Gt(this,(function(l){switch(l.label){case 0:r=0,i=t.length,l.label=1;case 1:return r<i?(s=r===t.length-1,a=this.useV2Navi()?this.httpRequestV2:this.httpRequest,_=Date.now(),[4,a.call(this,t[r],this.appkey,e,n,s)]):[3,4];case 2:if(c=l.sent(),u=c.code,E=c.data,R={bid:ie(),ptc:Ot.NAVI,cod:u,net:null==o?void 0:o.type,dur:Date.now()-_,spr:0,pr:(null==E?void 0:E.type)||0,hos:t[r],cache:At.REQUEST,v:gt.CURRENT,rsn:null==o?void 0:o.reason,cid:"".concat(null==o?void 0:o.uuid,"_").concat(null==o?void 0:o.retryCount),count:null==o?void 0:o.retryCount},this.logger.record(It.IM_NAVI,JSON.stringify(R),n),[X.SUCCESS,X.RC_CONN_TOKEN_INCORRECT,X.RC_LICENSE_EXPIRED].includes(u))return[2,de(u,E)];l.label=3;case 3:return r+=1,[3,1];case 4:return[2,pe(X.RC_NAVI_REQ_FAILED)]}}))}))},t.prototype.transHttpCode=function(t){switch(t){case 401:case 403:return X.RC_CONN_TOKEN_INCORRECT;case 416:return X.RC_LICENSE_EXPIRED;default:return X.RC_NAVI_REQ_FAILED}},t.prototype.getNaviInfoFromCache=function(t){var e=this.getNaviCache(De(t));return e?e.naviInfo:null},t.prototype.updateVoipCallInfo=function(t,e){var n=this.getNaviInfoFromCache(t);n&&this.setNaviCache(De(t),Ut(Ut({},n),{voipCallInfo:e}))},t.prototype.getNaviV2RequestOption=function(t){var e,n=t.uri,o=t.token,r=t.platform,i=t.protocol,s=t.mac;e="".concat(n,"/v2/navi.json?cloud=").concat(0);var a="token=".concat(encodeURIComponent(o),"&version=").concat("5.14.0","&platfrom=").concat(r);return s&&(a+="&m=".concat(s)),{method:"POST",headers:{"RC-Appkey":this.appkey,"Content-Type":"Application/x-www-form-urlencoded","RC-Negotiate":"conn=".concat(i,";rtc=4;log=2")},body:a,url:e,timeout:1e4}},t.prototype.useV2Navi=function(){return!0},t}();!function(t){t.P_INIT_O="P-init-O",t.P_DB_OPEN_O="P-db_open-O",t.P_DB_UPGRATE_START_S="P-db_upgrate_start-S",t.P_DB_UPGRATING_S="P-db_upgrating-S",t.P_DB_UPGRATE_COMPLETE_S="P-db_upgrate_complete-S",t.P_CALL_MAIN_SYNC_E="P-call_main_sync-E",t.P_CALL_MAIN_E="P-call_main-E",t.P_SEND_2_MAIN_E="P-send_2_main-E",t.P_REGTYP_O="P-regtype-O",t.P_CALL_ADDON_E="P-call_addon-E",t.P_CALL_ADDON_T="P-call_addon-T",t.P_CALL_ADDON_O="P-call_addon-O",t.P_CALL_ADDON_R="P-call_addon-R",t.P_CALL_EXTRA_E="P-call_extra-E",t.P_CONNECT_S="P-connect-S",t.P_CONNECT_T="P-connect-T",t.P_CONNECT_O="P-connect-O",t.P_CONNECT_ENTRY_S="P-connect_entry-S",t.P_REPORT_VER_O="P-report_version-O",t.P_PARSE_JSON_MSGS_E="P-parse_json_messsages-E",t.P_PARSE_JSON_MSGS_R="P-parse_json_messsages-R",t.P_RECEIVE_MESSAGE_E="P-receive_message-E",t.P_HTTP_REQ_E="P-http_request-E",t.P_SET_MSG_EXTEN_O="P-set_msg_extension-O",t.P_SEND_MSG_T="P-send_msg-T",t.P_SEND_MSG_R="P-send_msg-R",t.P_PARSE_JSON_SUBSCRIBE_DATA_E="P-parse_json_subscribe_data-E",t.P_PARSE_JSON_USER_PROFILE_E="P-parse_json_user_profile-E",t.P_PARSE_JSON_USER_PROFILE_LIST_E="P-parse_json_user_profile_list-E",t.P_WRITE_LOG_T="P_WRITE_LOG_T",t.P_WRITE_LOG_R="P_WRITE_LOG_R",t.P_PARSE_JSON_E="P-parse_json-E"}(Le||(Le={})),function(t){t[t.ERROR=-1]="ERROR",t[t.RESPONSE=0]="RESPONSE",t[t.EVENT=1]="EVENT",t[t.CALLBACK=2]="CALLBACK"}(me||(me={}));var Ve=function(t){return{sendError:function(e){t.send({type:me.ERROR,data:{msg:e}})},sendEvent:function(e){for(var n=[],o=1;o<arguments.length;o++)n[o-1]=arguments[o];t.send({type:me.EVENT,data:{eventName:e,data:n}})},sendResponse:function(e){t.send({type:me.RESPONSE,data:e})},sendCallback:function(e){t.send({type:me.CALLBACK,data:e})}}},be=e.resolve(__dirname,"binding","electron-".concat(t.platform(),"-").concat(t.arch(),".node")),Fe={addon:null},we=Ve(process).sendError;try{Fe.addon=require(be)}catch(t){console.error("error ->",be,"\n",t),we(t.toString())}Fe.addon||console.error("error -> cannot find module: ",be);var xe,Be=Fe.addon,ke={flushTimestamp:Date.now(),queue:[],locked:!1};function He(){xe&&clearInterval(xe)}function Je(t){He(),xe=setInterval((function(){return Ke(t)}),1e4)}function Ye(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];(t=ke.queue).push.apply(t,Ft([],bt(e),!1))}var We=200;function Ke(t){var e=ke.queue,n=ke.flushTimestamp;if(!(ke.locked||0===e.length||Date.now()-n<3e4&&e.length<We)){ke.locked=!0;var o=t.createTraceId(),r=t.getSessionId(),i=e.splice(0,We).map((function(t){var e=t.sessionId,n=t.level,o=t.time,i=t.type,s=t.tag,a=t.loggerId,_=t.content,c=t.traceId;return{level:n,time:o,type:i,tag:s,sessionId:"".concat(r,":").concat(e),content:{loggerId:a,content:_,traceId:c}}}));t.debug(Le.P_WRITE_LOG_T,"writingLen: ".concat(i.length,", queueLen: ").concat(e.length),o);var s=JSON.stringify(i);Be.writeLog(s),t.debug(Le.P_WRITE_LOG_R,"write done, queueLen: ".concat(e.length),o),ke.flushTimestamp=Date.now(),ke.locked=!1,setTimeout((function(){return Ke(t)}))}}var je=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return T(e,t),e.prototype.flush=function(t){Ye(t)},e}(ge),Xe=function(t,e){var n,o=Buffer.from(t),r=o.length;for(e.push(r),n=0;n<r;n++)e.push(o[n])},Qe=function(t){return"string"==typeof t},qe=function(t){return Qe(t)?t.toUpperCase():""},Ze=function(t,e){var n="";return 2!==t.length?n="Unexpected number of bytes received.":5!==t[0]?n="Unexpected SOCKS version number: ".concat(t[0],"."):255===t[1]?n="No acceptable authentication methods were offered.":-1===e.indexOf(t[1])&&(n="Unexpected SOCKS authentication method: ".concat(t[1],".")),n},ze=function(t){var e="";return 2!==t.length?e="Unexpected number of bytes received.":1!==t[0]?e="Unexpected authentication method code: ".concat(t[0],"."):0!==t[1]&&(e="Username and password authentication failure: ".concat(t[1],".")),e},$e=function(t){var e=qe(t.method)||"GET",n=t.pathname||"/",o=t.headers||{},r=t.search||"";o.Host=t.host||"loclahost";var i="";for(var s in i="".concat(e," ").concat(n+r," HTTP/1.1\n"),o)if(Object.hasOwnProperty.call(o,s)){var a=o[s];i+="".concat(s,": ").concat(a,"\n")}return t.body&&(i+="Content-Length: ".concat(t.body.length,"\n")),i+="\n","POST"===e&&t.body&&(i+="".concat(t.body)),i},tn=function(t){return new Promise((function(e){var n,o;t.socket.once("data",(function(o){var r,i=Ze(o,n);if(!i)return 2===o[1]?(t.socket.once("data",(function(n){var o=ze(n);o?t.emit("error",new Error("SOCKS authentication failed. ".concat(o))):e()})),r=[1],Xe(t.socksUsername,r),Xe(t.socksPassword,r),void t.write(Buffer.from(r))):void e();t.emit("error",new Error("SOCKS authentication failed. ".concat(i)))})),n=[0],t.socksUsername&&n.push(2),(o=Buffer.alloc(2+n.length))[0]=5,o[1]=n.length,n.forEach((function(t,e){o[2+e]=t})),t.write(o)}))},en=function(t,e,n){return new Promise((function(o){var r,i;switch(t.socket.once("data",(function(e){var n;5!==e[0]?n="Unexpected SOCKS version number: ".concat(e[0],"."):0!==e[1]?n="".concat(function(t){switch(t){case 1:return"General SOCKS server failure";case 2:return"Connection not allowed by ruleset";case 3:return"Network unreachable";case 4:return"Host unreachable";case 5:return"Connection refused";case 6:return"TTL expired";case 7:return"Command not supported";case 8:return"Address type not supported";default:return"Unknown status code ".concat(t)}}(e[1]),"."):0!==e[2]&&(n="The reserved byte must be 0x00."),n?t.emit("error",new Error("SOCKS connection failed. ".concat(n))):o()})),(r=[]).push(5),r.push(1),r.push(0),a.isIP(e)){case 0:r.push(3),Xe(e,r);break;case 4:r.push(1),function(t,e){var n,o,r=t.split(".");for(n=0;n<4;n++)o=parseInt(r[n],10),e.push(o)}(e,r);break;case 6:t.emit("error",new Error("Does not support IPV6"))}r.length+=2,(i=Buffer.from(r)).writeUInt16BE(n,i.length-2),t.write(i)}))},nn=function(t){function e(e){var n=t.call(this)||this;return n.readable=!0,n.socket=new a.Socket,n.options=e,n.socksHost=e.socksHost||"localhost",n.socksPort=e.socksPort||1080,n.socksUsername=e.socksUsername||"",n.socksPassword=e.socksPassword||"",n.socket.on("error",(function(t){n.emit("error",t)})),n.on("error",(function(){n.socket.destroyed||n.socket.destroy()})),n.on("end",n.end),n}return T(e,t),e.prototype.ref=function(){return this.socket.ref()},e.prototype.unref=function(){return this.socket.unref()},e.prototype.setTimeout=function(t,e){return this.socket.setTimeout(t,e)},e.prototype.setNoDelay=function(t){return this.socket.setNoDelay(t)},e.prototype.setKeepAlive=function(t,e){return this.socket.setKeepAlive(t,e)},e.prototype.address=function(){return this.socket.address()},e.prototype.cork=function(){return this.socket.cork()},e.prototype.uncork=function(){return this.socket.uncork()},e.prototype.pause=function(){return this.socket.pause()},e.prototype.resume=function(){return this.socket.resume()},e.prototype.pipe=function(t){return this.socket.pipe(t)},e.prototype.end=function(t,e){var n=this.socket.end(t,e);return this.writable=this.socket.writable,n},e.prototype.destroy=function(t){return this.socket.destroy(t)},e.prototype.setEncoding=function(t){return this.socket.setEncoding(t)},e.prototype.write=function(t,e,n){return this.socket.write(t,e,n)},e.prototype.read=function(t){return this.socket.read(t)},e.prototype.connect=function(t,e){var n=this;if("string"==typeof t&&/^\d+$/.test(t)&&(t=parseInt(t,10)),!Number.isInteger(t)||t<1||t>65535)throw new TypeError("Invalid port: ".concat(t));if(!e||"string"!=typeof e)throw new TypeError("Invalid host: ".concat(e));return this.socket.connect({port:this.socksPort,host:this.socksHost},(function(){return Dt(n,void 0,void 0,(function(){var n;return Gt(this,(function(o){switch(o.label){case 0:return[4,tn(this)];case 1:return o.sent(),[4,en(this,e,t)];case 2:return o.sent(),this.onProxied(),n=$e(this.options),this.socket.write(Buffer.from(n)),[2]}}))}))})),this},e.prototype.onProxied=function(){var t=this;this.socket.on("close",(function(e){t.emit("close",e)})),this.socket.on("end",(function(){t.emit("end")})),this.socket.on("data",(function(e){t.emit("data",e)})),this.writable=!0,this.readable=!0,this.emit("connect")},e}(_.EventEmitter),on=function(t){var e,n=t.hostname,o=t.port;return!t.host||n&&o||(e=t.host.split(":")),!o&&e&&(o=parseInt(e[1],10)||0),!n&&e&&(n=bt(e,1)[0]),new nn(t).connect(o,n)},rn=function(t){function e(e){var n=t.call(this)||this;return n.createConnection=on,n}return T(e,t),e}(o.Agent),sn=function(t,e,n){return(e=Ut(Ut({},e),s.parse(t))).port||(e.port=80),e.agent=new rn(e),o.request(e,n)},an=function(t){var e,n;return e=on(t),n=e.onProxied,e.onProxied=function(){var o;t.socket=e.socket,t.hostname?t.servername=t.hostname:t.host&&(o=bt(t.host.split(":"),1),t.servername=o[0]),e.socket=c.connect(t,(function(){e.authorized=e.socket.authorized,n.call(e)})),e.socket.on("error",(function(t){e.emit("error",t)}))},e},_n=function(t){function e(e,n){var o=t.call(this,n)||this;return o.url=e,o.socksHost=n.socksHost||"localhost",o.socksPort=n.socksPort||1080,o.createConnection=an,o}return T(e,t),e}(r.Agent),cn=function(t,e,n,o){var i,s;return e.protocol="https:",!e.port&&e.host&&(i=bt(e.host.split(":"),2),e.port=i[0],e.port=i[1]),e.port||(e.port=443),s=new _n(t,e),e.agent=s,r.request(t,e,n)},un=null;function En(t,e,n){void 0===n&&(n=!1);var i=e.url,s=e.headers,a=e.body,_=e.method,c=e.query,u=e.timeout,E=void 0===u?6e4:u;return new Promise((function(e){var u=/^https/.test(i),R={headers:Ut(Ut({},s),{"Accept-Encoding":"gzip, br"}),method:_};u&&(R.rejectUnauthorized=n);var l=null;un?((R=Ut(Ut({},R),un)).body=a,l=u?cn:sn):(l=o.request,u&&(R.agent=new r.Agent(R),l=r.request));var d=l(function(t,e){if(t=t.replace(/\?$/,""),!e)return t;var n=Object.keys(e).map((function(t){return"".concat(t,"=").concat(e[t])})).filter((function(t){return!!t}));return n.length?[t,n.join("&")].join("?"):t}(i,c),R,(function(t){var n,o,r=t.statusCode,i="";if("gzip"===(null===(n=t.headers)||void 0===n?void 0:n["content-encoding"])){var s=p.default.createGunzip();t.pipe(s),s.on("data",(function(t){i+=t})),s.on("end",(function(){e({status:r,data:i})}))}else if("br"===(null===(o=t.headers)||void 0===o?void 0:o["content-encoding"])){var a=p.default.createBrotliDecompress();t.pipe(a),a.on("data",(function(t){i+=t})),a.on("end",(function(){e({status:r,data:i})}))}else t.setEncoding("utf8"),t.on("data",(function(t){i+=t})),t.once("end",(function(){e({status:r||0,data:i})}))}));d.once("timeout",(function(){t.warn(Le.P_HTTP_REQ_E,JSON.stringify({msg:"timeout",url:i,method:_,query:c,timeout:E})),e({status:0})})),d.setTimeout(E),d.once("error",(function(n){t.warn(Le.P_HTTP_REQ_E,JSON.stringify({msg:n.stack,url:i,method:_,query:c,timeout:E})),e({status:0})})),d.write(a),d.end()}))}function Rn(t,e){return t?(un=Ut(Ut({},un),t),e.info(S.A_SET_PROXY_O,JSON.stringify({msg:"set proxy",data:un})),{code:X.SUCCESS}):(un=null,e.info(S.A_REMOVE_PROXY_O,JSON.stringify({msg:"remove proxy"})),{code:X.SUCCESS})}function ln(){var t=un||void 0;return{code:X.SUCCESS,data:t}}var dn=function(){function t(t,e,n,o){var r=this;this.p=t,this.emit=e,this.callback=n,this.errorHandle=o,this.count=0,this.maps={},this.p.on("message",(function(t){var i=t.type,s=t.data;switch(i){case me.EVENT:var a=s,_=a.eventName,c=a.data;null==e||e.apply(void 0,Ft([_],bt(c),!1));break;case me.RESPONSE:var u=s,E=u.reqId,R=u.success,l=u.data,d=r.maps[E];if(!d)return;d({success:R,data:l}),delete r.maps[E];break;case me.CALLBACK:null==n||n(s);break;case me.ERROR:var p=s.msg;null==o||o(p)}})),this.p.on("error",(function(t){null==o||o("SubProcessProxy error ".concat(t))})),this.p.on("exit",(function(t,e){if(0!==t){for(var n in r.maps){if(Object.prototype.hasOwnProperty.call(r.maps,n))(0,r.maps[n])({success:!0,data:{code:X.SUB_PROCESS_EXIT,msg:"sub process exit"}})}null==o||o("SubProcessProxy exit ".concat(t," ").concat(e),!0)}})),this.p.on("close",(function(t,e){console.log("SubProcessProxy close",t,e)}))}return t.prototype.call=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return Dt(this,void 0,void 0,(function(){var n=this;return Gt(this,(function(o){return this.p.killed||this.p.exitCode?[2,Promise.resolve({success:!1,data:{code:X.SUB_PROCESS_EXIT,msg:"sub process exit"}})]:[2,new Promise((function(o){var r=++n.count;n.maps[r]=o;var i={reqId:r,method:t,args:e,hasResponse:!0};n.p.send(i)}))]}))}))},t.prototype.send=function(t){for(var e,n=[],o=1;o<arguments.length;o++)n[o-1]=arguments[o];return Dt(this,void 0,void 0,(function(){var o;return Gt(this,(function(r){return(this.p.killed||this.p.exitCode)&&(null===(e=this.errorHandle)||void 0===e||e.call(this,"sub process exit")),o={reqId:-1,method:t,args:n},this.p.send(o),[2]}))}))},t.prototype.destroy=function(){this.send("destroy")},t}(),pn="rc-realtime-log-timestamp",Cn=[],Tn=!1,In=function(){return Dt(void 0,void 0,void 0,(function(){var t,e,n,o,r,i,s,a,_,c,u,E;return Gt(this,(function(R){return Tn||0===Cn.length||(Tn=!0,t=Cn.shift(),e=t.args,n=t.resolve,o=e.startTime,r=e.endTime,i=e.level,s=e.realtimeReport,a=0,_=0,c=[],u=function(t){a+=t.length;var e=bt(t.split(",")),o=e[0],r=e[1],u=e[2],E=e[3],R=e[4],l=e.slice(5);if(a>20971520&&parseInt(r,10)!==_)n(c);else{_=parseInt(r,10);try{if(!s&&i<0)return;var d={time:parseInt(r,10),level:parseInt(E,10),sessionId:o,type:u,tag:R,content:l.join(",")};c.push(d)}catch(t){console.error(t)}}},E=function(t){n(c),Tn=!1,In()},Be.getFullLog(i,o,r,!1,u,E)),[2]}))}))},Sn=function(t){function o(e,n,o,r){void 0===r&&(r=!1);var i,s=process.versions.electron,a="Electron|".concat(s,"|").concat(process.arch,"|").concat(process.platform);return i=t.call(this,e,n,a,{getLogs:function(t,e,n,o){return Dt(this,void 0,void 0,(function(){return Gt(this,(function(r){switch(r.label){case 0:return[4,(i={startTime:t,endTime:e,level:n,realtimeReport:o},Dt(void 0,void 0,void 0,(function(){return Gt(this,(function(t){return[2,new Promise((function(t){Cn.push({resolve:t,args:i}),In()}))]}))})))];case 1:return[2,{logs:r.sent(),dbReady:!0}]}var i}))}))},getTimestamp4RealtimeLog:function(){var t=Be.getStoreValue(pn);return parseInt(t,10)||0},setTimestamp4RealtimeLog:function(t){Be.setStoreValue(pn,t.toString())}},o,r)||this,i}return T(o,t),o.prototype.send=function(t){return En(this.logger,t)},o.prototype.stop=function(){this._subProcess&&this._subProcess.destroy(),t.prototype.stop.call(this)},o.prototype.compressLogs=function(t){return Dt(this,void 0,void 0,(function(){var o,r,i,s;return Gt(this,(function(a){switch(a.label){case 0:return this._subProcess||(o=n.fork(e.resolve(__dirname,"sub-process.js")),this._subProcess=new dn(o)),[4,this._subProcess.call("compressLogs",t)];case 1:return r=a.sent(),i=r.success,s=r.data,i?[2,{success:i,data:s.data}]:[2,{success:i,data:""}]}}))}))},o}(Pe),hn=[q.RMTP,q.TLS];"darwin"===process.platform&&hn.push(q.QUIC);var Nn=function(t){return"RongCloud/navis/".concat(t,"/navi-cache.json")},fn="deviceId",On=function(t){return"RongCloud/caches/".concat(t,"/staticConfig.json")},An=function(t){return"RongCloud/cloudControl/".concat(t,"/cloudControl.json")},gn=null,Pn=function(){var e,n=Date.now(),o=[t.arch(),t.platform(),process.pid,n,Math.floor(Math.random()*n)].join("__");return e=o,E.createHash("md5").update(e).digest("hex")},vn=function(t){if(gn)return gn;var n=e.resolve(t,fn);return u.existsSync(n)?gn=u.readFileSync(n).toString():(gn=Pn(),u.writeFileSync(n,gn),gn)},Ln=function(){function t(t){this._callCppProxy=t,this._setTime=15962112e5}return t.prototype._setToProtocol=function(t,e,n,o,r,i){var s=JSON.stringify(r);"{}"!==s&&t.info(Le.P_SET_MSG_EXTEN_O,JSON.stringify({messageUId:o,ext:r})),this._callCppProxy("setMessageExtension",e,n,o,s,i)},t.prototype.setLocalFromReceiveMsg=function(t,e){var n=e.channelId,o=e.conversationType,r=e.targetId,i=e.messageUId,s=e.expansion,a=e.sentTime;if(s&&0!==Object.keys(s).length){var _={};for(var c in s)_[c]={v:"",ts:0},_[c].v=s[c],_[c].ts=a;this._setToProtocol(t,o,r,i,_,n||"")}},t.prototype.setLocalFromExtMsg=function(t,e){var n=e.channelId,o=e.conversationType,r=e.targetId,i=e.content,s=e.sentTime,a=i,_=a.put,c=this._callCppProxy("getMessage",a.mid),u=JSON.parse(c).extMsg,E=JSON.parse(u||"{}");if(_)for(var R in _){var l=E[R];l&&l.ts<s-this._setTime?(l.v=_[R],l.ts=s-this._setTime):(E[R]={v:"",ts:0},E[R].v=_[R],E[R].ts=s-this._setTime)}a.del&&a.del.forEach((function(t){delete E[t]})),this._setToProtocol(t,o,r,a.mid,E,n||"")},t.prototype.parseReceiveExpansion=function(t){var e=JSON.parse(t.extMsg||"{}"),n={};for(var o in e)n[o]=e[o].v;return n},t.prototype.parseConverOrHisExpansion=function(t){var e=JSON.parse(t.extMsg),n=JSON.parse(e||"{}"),o={};for(var r in n)o[r]=n[r].v;return o},t}();function mn(e){var n,o;void 0===e&&(e="IPv4");var r=t.networkInterfaces(),i=[];try{for(var s=Vt(Object.values(r)),a=s.next();!a.done;a=s.next()){var _=a.value;if(_&&-1!==Object.prototype.toString.call(_).indexOf("Array")){var c=_.filter((function(t){return!(t.internal||(n=t.mac,/^(0{1,2}[:-]){5}0{1,2}$/.test(n))||t.family&&t.family!==e);var n})).map((function(t){return t.mac}));i.push.apply(i,Ft([],bt(c),!1))}}}catch(t){n={error:t}}finally{try{a&&!a.done&&(o=s.return)&&o.call(s)}finally{if(n)throw n.error}}return i.length?Ft([],bt(i),!1).sort()[0]:""}var yn,Mn=function(t,e,n){return Dt(void 0,void 0,void 0,(function(){var o,r;return Gt(this,(function(i){return o=E.createDecipheriv("aes-256-cbc",e,n),r=o.update(t,"base64","utf-8"),[2,r+=o.final("utf8")]}))}))},Un=function(t){if(!u.existsSync(t)){var n=e.resolve(t,"..");u.existsSync(n)||Un(n),u.mkdirSync(t)}},Dn=function(t){return Object.entries(t).map((function(t){var e=bt(t,2),n=e[0],o=e[1];return{key:n,value:String(o)}}))},Gn=function(t){return{removeMute:!!(null==t?void 0:t.removeMuteStatus),removeWhiteList:!!(null==t?void 0:t.removeWhiteList),removeFavoriteMembers:!!(null==t?void 0:t.removeFollow)}},Vn=function(t){function n(n,o,r,i){var s=t.call(this,n,o,i)||this;s.naviPath="",s._caches={},s.naviPath="".concat(r,"/").concat(Nn(n));var a=e.dirname(s.naviPath);return u.existsSync(a)||Un(a),s}return T(n,t),n.prototype.httpRequest=function(t,e,n,o){return Dt(this,void 0,void 0,(function(){var r,i,s,a,_;return Gt(this,(function(c){switch(c.label){case 0:return r="token=".concat(encodeURIComponent(n),"&v=").concat(Bt,"&p=PC&ev=").concat("5.14.0","&m=").concat(mn()),i="".concat(t,"/navi.json?r=").concat(Date.now(),"&env=").concat(this._environment),this.logger.info(S.L_REQUEST_T,JSON.stringify({url:i,body:r}),o),[4,En(this.logger,{method:"POST",headers:{appId:e},body:r,url:i,timeout:1e4})];case 1:if(200!==(s=c.sent()).status)return this.logger.warn(S.L_REQUEST_R,JSON.stringify({url:i,code:s.status}),o),[2,pe(this.transHttpCode(s.status))];this.logger.info(S.L_REQUEST_R,JSON.stringify({url:i,data:s.data}),o);try{return a=JSON.parse(s.data),_=/^https/.test(i)?"https":"http",a.protocol=_,a.code&&200!==a.code?[2,pe(this.transHttpCode(a.code))]:[2,le(a)]}catch(t){return this.logger.error(S.L_PARSE_NAVI_E,s.data,o),[2,pe(X.RC_NAVI_REQ_FAILED)]}return[2]}}))}))},n.prototype.httpRequestV2=function(t,e,n,o){return Dt(this,void 0,void 0,(function(){var r,i,s,a;return Gt(this,(function(_){switch(_.label){case 0:return r=this.getNaviV2RequestOption({appkey:e,token:n,uri:t,platform:"electron",protocol:hn.join(","),mac:mn()}),this.logger.info(S.L_REQUEST_T,JSON.stringify({url:r.url,body:r.body,headers:r.headers}),o),[4,En(this.logger,r)];case 1:if(200!==(i=_.sent()).status)return this.logger.warn(S.L_REQUEST_R,JSON.stringify({url:r.url,code:i.status}),o),[2,pe(this.transHttpCode(i.status))];this.logger.info(S.L_REQUEST_R,JSON.stringify({url:r.url,data:i.data}),o);try{return s=JSON.parse(i.data),a=/^https/.test(r.url)?"https":"http",s.protocol=a,[2,le(s)]}catch(t){return this.logger.error(S.L_PARSE_NAVI_E,i.data,o),[2,pe(X.RC_NAVI_REQ_FAILED)]}return[2]}}))}))},n.prototype.getNaviCache=function(t){var e=this.getCatchKey(t),n=this._caches[e];if(n)return n;if(!u.existsSync(this.naviPath))return null;var o=u.readFileSync(this.naviPath,{encoding:"utf8"});try{return this._caches=JSON.parse(o),this._caches[e]}catch(t){this.logger.error(S.L_PARSE_NAVI_E,o)}return null},n.prototype.setNaviCache=function(t,e){var n=Date.now(),o=this.getCatchKey(t);if(Zt(this._caches))for(var r in this._caches){(n-this._caches[r].timestamp>wt||o===r)&&delete this._caches[r]}this._caches[o]={token:t,naviInfo:e,timestamp:Date.now(),environment:this._environment},u.writeFileSync(this.naviPath,JSON.stringify(this._caches))},n.prototype.setEnvironment=function(t){this._environment=t},n}(Ge);!function(t){t[t.SUCCESS=0]="SUCCESS",t[t.NOT_INIT=-1]="NOT_INIT",t[t.CANCELED=-2]="CANCELED",t[t.REPEAT=-3]="REPEAT"}(yn||(yn={}));var bn,Fn=function(t){function e(e,n,o,r,i){var s=t.call(this,e,o,r,i)||this;return s.callCppProxy=n,s._connectedTime=0,s._naviInfo=null,s._excludeLogTag=["P-API_RCGetValueForKey-T","P-API_RCGetValueForKey-E","P-API_RCGetValueForKey-R","P-API_RCSetValueForKey-T","P-API_RCSetValueForKey-E","P-API_RCSetValueForKey-R"],s.connectResolve=null,s._startTime=0,s._tcpDuration=0,s.pingResolve=null,s.callCppProxy("setConnectionStatusListener",s._onConnectionStatusChange.bind(s),(function(t){s.logger.info(Le.P_DB_OPEN_O,t)}),(function(){return s.recvPong(X.SUCCESS)}),s._onConnectionStatusChange.bind(s),s._onTcpConnectResponse.bind(s),(function(){var t;s.logger.info(Le.P_DB_UPGRATE_START_S),null===(t=i.onDBUpgrateStart)||void 0===t||t.call(i)}),(function(t){var e;s.logger.info(Le.P_DB_UPGRATING_S,t),null===(e=i.onDBUpgrading)||void 0===e||e.call(i,t)}),(function(t){var e;s.logger.info(Le.P_DB_UPGRATE_COMPLETE_S,t),null===(e=i.onDBUpgradeComplete)||void 0===e||e.call(i,t)})),s}return T(e,t),e.prototype.getConnectedTime=function(){return this._connectedTime},e.prototype.connectWithToken=function(t,e,n,o){var r=this;return new Promise((function(i){r._naviInfo=e,r.connectResolve={resolve:i,traceId:o,userId:e.userId};var s={},a=ln().data;a&&(s={proxy_passwd:a.socksPassword||"",proxy_name:a.socksUsername||"",proxy_port:a.socksPort||1082,proxy_host:a.socksHost||"localhost",proxy_type:0});var _=JSON.stringify(Ut(Ut({},s),{call_plus:r._openCallPlus})),c=r.getCmpList(e,!0).filter((function(t){return hn.includes(t.protocol)})).sort((function(t,e){return t.weight>e.weight?-1:1})),u=[];c.forEach((function(t){var e=u.find((function(e){return e.addr===t.addr}));e?e.protocol!==q.QUIC&&t.protocol!==q.QUIC||(e.race=!0,e.protocol=q.QUIC):(t.race=!1,u.push(t))})),r.logger.info(Le.P_CONNECT_O,JSON.stringify({use:u,catche:r.cmpWeightCache,proxy:s,FORMATED_VERSION:Bt,reconnectKickEnable:n}),o),r._startTime=Date.now();try{r.callCppProxy("connectWithToken",t,Bt,JSON.stringify(Ut(Ut({},e),{serverAddr:u,tagBlacklist:r._excludeLogTag.join(",")})),n,_)}catch(t){r.logger.error(Le.P_CALL_ADDON_E,null==t?void 0:t.stack,o),r.recvConnectRes(X.RC_SOCKET_NOT_CREATED)}}))},e.prototype.close=function(t,e){void 0===e&&(e=!0),t||this.callCppProxy("disconnect",e)},e.prototype.sendPing=function(t){var e=this;return new Promise((function(n){e.pingResolve=n,e.callCppProxy("sendHeartbeat"),setTimeout((function(){return e.recvPong(X.TIMEOUT)}),t)}))},e.prototype.recvPong=function(t){this.pingResolve&&(this.pingResolve(t),this.pingResolve=null)},e.prototype._onConnectionStatusChange=function(t,e){switch(this.logger.info(Le.P_CONNECT_S,JSON.stringify({status:t,delay:e})),t){case X.SUCCESS:this.recvConnectRes(X.SUCCESS);break;case X.RC_CONN_REDIRECTED:case 32061:this.recvConnectRes(X.RC_CONN_REDIRECTED,!0);break;case 11:case 10:case 12:break;case X.RC_SOCKET_DISCONNECTED:this.recvConnectRes(t,!1);break;case X.RC_SOCKET_NOT_CREATED:case X.RC_CONN_ACK_TIMEOUT:case X.RC_TCP_RESET:this.recvConnectRes(t);break;case X.RC_UDP_DISCONNECTED:this.recvConnectRes(t,!0,e);break;default:this.recvConnectRes(t,!0)}},e.prototype.recvConnectRes=function(t,e,n){if(this.connectResolve){var o=this.connectResolve,r=o.resolve,i=o.userId,s=Date.now()-(this._startTime+this._tcpDuration),a={bid:ie(),cod:t,net:this.getNetwork().type,dur:s,spr:0,cid:"".concat(this.uuid,"_").concat(this.retryCount),v:gt.CURRENT,count:this.retryCount};return this.logger.record(It.IM_CMP_RMTP,JSON.stringify(a)),t===X.SUCCESS&&(this._connectedTime=Date.now()-this.callCppProxy("getDeltaTime")),r(de(t,i)),void(this.connectResolve=null)}if(e)this.onDisconnectByServer(t,n);else{if(t===X.RC_SOCKET_DISCONNECTED)if(this.getConnectionStatus()!==lt.CONNECTED)return;this.onDisconenctUnusual(t)}},e.prototype._onTcpConnectResponse=function(t,e,n,o,r,i,s){var a,_=this.cmpWeightCache.findIndex((function(t){return t.addr==="".concat(e,":").concat(n)})),c={bid:ie(),ptc:Ot.TCP,cod:t,net:this.getNetwork().type,dur:o,spr:0,pr:(null===(a=this._naviInfo)||void 0===a?void 0:a.type)||0,hos:"".concat(e,":").concat(n),idx:_,rct:this.retryCount?Pt.RECONNECT:Pt.CONNECT,cid:"".concat(this.uuid,"_").concat(this.retryCount),v:gt.CURRENT,rsn:this.reason,ddu:r,count:this.retryCount,weight:_>=0?this.cmpWeightCache[_].weight:-1};if(this.logger.record(It.IM_CMP,JSON.stringify(c)),this.logger.info(Le.P_CONNECT_ENTRY_S,JSON.stringify({code:t,host:e,port:n,duration:o,dnsDuration:r,index:i,isQuic:s})),t===yn.SUCCESS)this.curCmpUrl="".concat(e,":").concat(n),this.updateCmpWeight("".concat(e,":").concat(n),!0,s);else if(t!==yn.NOT_INIT){var u=n&&0!==n?"".concat(e,":").concat(n):"".concat(e);this.updateCmpWeight(u,!1)}},e}(Ue),wn=function(t){function n(n,o,r){var i=t.call(this,n,o)||this;i.appkey=n,i.logger=o,i.dbpath=r,i._cachePath="",i._cachePath="".concat(r,"/").concat(On(n));var s=e.dirname(i._cachePath);return u.existsSync(s)||Un(s),i}return T(n,t),n.prototype.getCache=function(){return u.existsSync(this._cachePath)&&u.readFileSync(this._cachePath,{encoding:"utf8"})||null},n.prototype.setCache=function(t){u.writeFileSync(this._cachePath,t)},n.prototype.clearCache=function(){u.writeFileSync(this._cachePath,"")},n.prototype.sendRequest=function(t){return Dt(this,void 0,void 0,(function(){var e,n,o;return Gt(this,(function(r){switch(r.label){case 0:return[4,En(this.logger,{url:t,body:""})];case 1:return e=r.sent(),n=e.status,o=e.data,[2,{code:n,data:o}]}}))}))},n.prototype.decryptData=function(t){return Dt(this,void 0,void 0,(function(){var e,n;return Gt(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,Mn(t,"cd4936151214ce45dc1d12673a59d94c","51ad078e5eb17a91")];case 1:return e=o.sent(),[2,JSON.parse(e)];case 2:return n=o.sent(),this.logger.error(S.L_GET_STATIC_CONF_E,JSON.stringify({error:null==n?void 0:n.stack})),[3,3];case 3:return[2]}}))}))},n}(Oe),xn=function(t){function n(n,o,r,i,s){var a=t.call(this,o,n,r)||this;a.deviceId=i,a.model="",a.catchFilePath="",a.model="Electron|".concat(process.platform,"|").concat(process.arch),a.catchFilePath="".concat(s,"/").concat(An(n));var _=e.dirname(a.catchFilePath);return u.existsSync(_)||Un(_),a.init(),a}return T(n,t),n.prototype.httpRequest=function(t,e,n,o){return Dt(this,void 0,void 0,(function(){var r,i,s,a,_,c,u,E;return Gt(this,(function(R){switch(R.label){case 0:return(r=o).deviceId=this.deviceId,r.model=this.model,i={url:t,method:e,headers:n,body:JSON.stringify(r)},this.logger.info(S.L_REQUEST_T,JSON.stringify(i)),[4,En(this.logger,i)];case 1:s=R.sent(),a=s.status,_=s.data,c=void 0===_?"":_,this.logger.info(S.L_REQUEST_R,JSON.stringify({status:a,data:c}));try{return u=JSON.parse(c),E=u.data,[2,{code:a,data:E}]}catch(t){return this.logger.warn(S.L_CLOUD_CONFIG_DATA_E,JSON.stringify({status:a,data:c,error:t})),[2,{code:a,msg:t}]}return[2]}}))}))},n.prototype.setCloudControllerCache=function(t){u.writeFileSync(this.catchFilePath,JSON.stringify(t)),this.logger.info(S.L_CLOUD_SET_CACHE_O,JSON.stringify(t))},n.prototype.getLocalCloudControllerCache=function(){if(!u.existsSync(this.catchFilePath))return null;var t=u.readFileSync(this.catchFilePath,{encoding:"utf8"});return this.logger.info(S.L_CLOUD_GET_CACHE_O,JSON.stringify({appkey:this.appkey,data:t})),t},n.prototype.setMRTRConfig=function(t){var e={mrtrChatroom:t.chatroom,mrtrGroup:t.group,mrtrPrivate:t.private,mrtrUltraGroup:t.ultraGroup};this.logger.info(S.L_CLOUD_SET_MRTR_O,JSON.stringify(e)),Be.setCloudConfig(JSON.stringify(e))},n}(ye),Bn=function(){function t(t,e){var n=this;this._logger=t,this._method=e,this._traceId=this._logger.createTraceId(),this._promise=new Promise((function(t){n._resolve=t}))}return t.create=function(e,n){return new t(e,n)},t.prototype.invoke=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var o=this,r=o._method,i=o._traceId,s=o._logger;s.debug(Le.P_CALL_ADDON_T,JSON.stringify({method:r,params:e}),i);try{t=Be[r].apply(Be,Ft([],bt(e),!1))}catch(t){throw s.error(Le.P_CALL_ADDON_E,JSON.stringify({stack:null==t?void 0:t.stack,method:r}),i),t}return t!==X.SUCCESS&&this.fail(t),this},t.prototype.ok=function(t){this._logger.debug(Le.P_CALL_ADDON_R,"success",this._traceId),this._flush(le(t))},t.prototype.fail=function(t){this._logger.warn(Le.P_CALL_ADDON_R,"faile: ".concat(t),this._traceId),this._flush(pe(t))},t.prototype._flush=function(t){var e=this;setTimeout((function(){return e._resolve(t)}),0)},t.prototype.result=function(){return this._promise},t}();!function(t){t[t.cuid=1]="cuid",t[t.uid=2]="uid",t[t.all=4]="all"}(bn||(bn={}));var kn=function(){function t(t,e,n,o,r,i){var s=this;this._appkey=t,this._dbpath=e,this._dispatchEvent=n,this._enableSyncEmptyTopConversation=o,this._logOutputLevel=r,this._customMessageType={},this.cloudControllerUri="",this.cloudControllerLock=!0,this.cloudControllerMsgs=[],this._buildSubscribeEventData=function(t){var e=[];try{JSON.parse(t).list.forEach((function(t){var n=JSON.parse(t.obj),o=n.userId,r=n.subscribeType,i=n.subscribeTime,a=n.duration,_=n.operationType,c=n.details,u=void 0===c?[]:c,E=n.userProfile,R={userId:o,subscribeType:r,subscribeTime:i,expiry:a,operationType:_};[ut.ONLINE_STATUS,ut.FRIEND_ONLINE_STATUS].includes(r)&&(R.details=u.map((function(t){var e=JSON.parse(t);return{changeTime:e.changeTime,eventValue:e.changeValue,platform:e.platform}}))),[ut.USER_PROFILE,ut.FRIEND_USER_PROFILE].includes(r)&&(R.userProfile=s._string2userProfileInfo(E)),e.push(R)}))}catch(e){s.logger.error(Le.P_PARSE_JSON_SUBSCRIBE_DATA_E,JSON.stringify({error:null==e?void 0:e.stack,data:t}))}return e},this._chatroomCache=[],this.rtcHeartbeatResolves={};var a=this._dbpath,_=vn(a);this.logger=new je(this._appkey,"RC-M","IM"),Be.initWithAppkey(t,a,Bt,this.logger.getSessionId()),Be.setConsoleLogLevel((this._logOutputLevel||he.WARN)+1),this.logger.setOutputLevel(this._logOutputLevel),Je(this.logger),this.reporter=new Sn(t,_,this.logger,i),this.logger.info(Le.P_INIT_O,JSON.stringify({appkey:t,dbpath:a,proto_commit:Be.getNodeVersion(),deviceId:_,commit:"06a72f5bcd8bece97ac41ef1ebdb817e57484d7f",processName:process.title,processPId:process.pid,disableLogReport:i})),this._callCppProxy("setDeviceId",_),this._staticConfigManager=new wn(t,this.logger,a),this.navi=new Vn(t,this.logger,a,this._staticConfigManager),this.tcpMgr=new Fn(t,this._callCppProxy.bind(this),this.navi,this.logger,{onConnected:this.onConnected.bind(this),onSuspend:this.onSuspend.bind(this),onDisconnected:this.onDisconnected.bind(this),onConnecting:this.onConnecting.bind(this),onDBUpgrateStart:this.dbUpgradeStart.bind(this),onDBUpgrading:this.dbUpgrading.bind(this),onDBUpgradeComplete:this.dbUpgradeComplete.bind(this)}),this._enableCreateEmptyTopConversation(this._enableSyncEmptyTopConversation),this._initCloudController(_,a),this._registerMsgTypes(),this._setOnReceiveMessageListener(),this._setConversationStatusListener(),this._setPushNotificationListener(),this._setRTCHeartbeatListener(),this._setRTCLivingRoomEventListener(),this._setChatroomEventListener(),this._setCallInfoListener(),this._setSubscribeEventListener(),this._setUserProfileListener(),this._setEntrustGroupListener(),this._setFriendEventListener(),this._msgExpansionHandler=new Ln(this._callCppProxy.bind(this))}return t.prototype._initCloudController=function(t,e){var n;n=bt(fe.getCloudControllerUrl(),1),this.cloudControllerUri=n[0],this.cloudController=new xn(this._appkey,this.logger,this.reporter,t,e),this.cloudControllerUri&&this.cloudController.request(this.cloudControllerUri,Ae.init)},t.prototype.callProxy=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return Dt(this,void 0,void 0,(function(){var n,o,r;return Gt(this,(function(i){switch(i.label){case 0:if(!(n=this[t]))return this.logger.warn(Le.P_CALL_MAIN_E,JSON.stringify({method:t,error:"not found"})),[2,Promise.resolve({code:X.NOT_SUPPORT})];o="",i.label=1;case 1:return i.trys.push([1,3,,4]),[4,n.call.apply(n,Ft([this],bt(e),!1))];case 2:return[2,i.sent()];case 3:return r=i.sent(),o=JSON.stringify({error:null==r?void 0:r.stack,method:t}),this.logger.error(Le.P_CALL_MAIN_E,o),[3,4];case 4:return[2,{code:X.MAIN_PROCESS_ERROR,msg:o}]}}))}))},t.prototype.sendProxy=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return Dt(this,void 0,void 0,(function(){var n;return Gt(this,(function(o){if(!(n=this[t]))return this.logger.warn(Le.P_CALL_MAIN_E,JSON.stringify({method:t,error:"not found"})),[2];try{n.call.apply(n,Ft([this],bt(e),!1))}catch(e){this.logger.error(Le.P_CALL_MAIN_E,JSON.stringify({error:null==e?void 0:e.stack,method:t}))}return[2]}))}))},t.prototype.registerRenderers=function(t){var e=t.navigators,n=t.areaCode,o=t.logServerUrl,r=t.environment;this._environment=r||"default",this.navi.setEnvironment(r),fe.init({areaCode:n,navigators:e,logServerUrl:o})},t.prototype.onConnected=function(){return Dt(this,void 0,void 0,(function(){var t,e,n;return Gt(this,(function(o){switch(o.label){case 0:return t=this.getNaviInfoFromCache(),this.reporter.checkStart(t,""),this._try2RejoinChatroom(),e=this._dispatchEvent,n=["onConnected"],[4,this.getMainProcessCache()];case 1:return e.apply(this,n.concat([o.sent()])),[2]}}))}))},t.prototype.onConnecting=function(){this._dispatchEvent("onConnecting",void 0)},t.prototype.onSuspend=function(t){this._dispatchEvent("onSuspend",t)},t.prototype.onDisconnected=function(t){this._dispatchEvent("onDisconnected",t)},t.prototype.dbUpgradeStart=function(){this._dispatchEvent("databaseUpgradeWillStart")},t.prototype.dbUpgrading=function(t){this._dispatchEvent("databaseUpgrading",t)},t.prototype.dbUpgradeComplete=function(t){this._dispatchEvent("databaseUpgradeDidComplete",t)},t.prototype._callCppProxy=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];var o=this.logger.createTraceId();try{return this.logger.debug(Le.P_CALL_ADDON_O,JSON.stringify({method:t,content:e}),o),Be[t].apply(Be,Ft([],bt(e),!1))}catch(e){throw this.logger.error(Le.P_CALL_ADDON_E,JSON.stringify({stack:null==e?void 0:e.stack,method:t}),o),e}},t.prototype.refetchNaviInfo=function(){return this.navi.request(this.tcpMgr.getToken(),!0,!0,this.logger.createTraceId())},t.prototype.sendHTTPRequest=function(t){return En(this.logger,t)},t.prototype.onRendererLogsReceived=function(t){Ye.apply(void 0,Ft([],bt(t),!1))},t.prototype.setNetwork=function(t,e){if(this.tcpMgr.setNetwork(t,e),t.status&&this.cloudController){var n=this.tcpMgr.getToken();this.cloudController.request(this.cloudControllerUri,Ae.newWorkChange,n)}},t.prototype.destroy=function(){this.reporter.stop(),He(),Be.destroy(),process.exit(0)},t.prototype.callExtra=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];var o=this[t];if(!o)return this.logger.warn(Le.P_CALL_EXTRA_E,JSON.stringify({method:t,error:"not found"})),Promise.resolve({code:X.NOT_SUPPORT});try{return o.call.apply(o,Ft([this],bt(e),!1))}catch(e){this.logger.error(Le.P_CALL_EXTRA_E,JSON.stringify({error:null==e?void 0:e.stack,method:t}))}return Promise.resolve({code:X.MAIN_PROCESS_ERROR})},t.prototype.getConversationsByPage=function(t,e,n,o,r){var i,s=this,a=this._callCppProxy("getConversationListByPageWithTopPriority",t,e,n,r||!1,o||"");try{i=JSON.parse(a).list.map((function(t){return s._buildConversation(t.obj)}))}catch(t){return Promise.resolve({code:X.MAIN_PROCESS_ERROR})}return Promise.resolve({code:X.SUCCESS,data:i})},t.prototype.getUnreadConversationList=function(t){var e,n=this,o=this._callCppProxy("getUnreadConversationList",t);try{e=JSON.parse(o).list.map((function(t){return n._buildConversation(t.obj)}))}catch(t){return Promise.resolve({code:X.MAIN_PROCESS_ERROR})}return Promise.resolve({code:X.SUCCESS,data:e})},t.prototype.getConversationListWithAllChannel=function(){var t,e=this,n=[Q.PRIVATE,Q.GROUP,Q.SYSTEM,Q.APP_PUBLIC_SERVICE,Q.PUBLIC_SERVICE],o=this._callCppProxy("getConversationListWithAllChannel",n);try{t=JSON.parse(o).list.map((function(t){return e._buildConversation(t.obj)}))}catch(t){return Promise.resolve({code:X.MAIN_PROCESS_ERROR})}return Promise.resolve({code:X.SUCCESS,data:t})},t.prototype.getConversationListWithAllChannelByPage=function(t,e){var n,o=this,r=[Q.PRIVATE,Q.GROUP,Q.SYSTEM,Q.APP_PUBLIC_SERVICE,Q.PUBLIC_SERVICE],i=this._callCppProxy("getConversationListWithAllChannelByPage",r,t,e);try{n=JSON.parse(i).list.map((function(t){return o._buildConversation(t.obj)}))}catch(t){return Promise.resolve({code:X.MAIN_PROCESS_ERROR})}return Promise.resolve({code:X.SUCCESS,data:n})},t.prototype.getHistoryMessagesByObjectNames=function(t,e,n,o,r,i,s){var a=0===i,_=o+1,c=this._callCppProxy("getHistoryMessagesByObjectNames",t,e,n,_,r,a,s||""),u=[];try{var E=JSON.parse(c).list;E.reverse();for(var R=0;R<E.length;R++){var l=this._buildMessage(E[R].obj);u[R]=l}}catch(t){return Promise.resolve({code:X.MAIN_PROCESS_ERROR})}return Promise.resolve({code:X.SUCCESS,data:{list:_===u.length?u.slice(1,_):u,hasMore:o<u.length}})},t.prototype.updateMessageReceiptStatus=function(t,e,n,o){void 0===o&&(o="");var r=this._callCppProxy("updateMessageReceiptStatus",t,e,n,o);return Promise.resolve({code:X.SUCCESS,data:r})},t.prototype.getNaviInfoFromCache=function(){return this.tcpMgr.getConnectionStatus()!==lt.CONNECTED?null:this.navi.getNaviInfoFromCache(this.tcpMgr.getToken())},t.prototype.createLogger=function(t,e){return/^RC/.test(t)?null:new je(this._appkey,t,e)},t.prototype.getConnectedTime=function(){return this.tcpMgr.getConnectedTime()},t.prototype.getServerTime=function(){return Date.now()-Be.getDeltaTime()},t.prototype.getCurrentUserId=function(){return this.tcpMgr.getCurrentUserId()},t.prototype.getMainProcessCache=function(){var t=this.tcpMgr.getConnectedTime(),e=this.tcpMgr.getConnectionStatus(),n=this.getNaviInfoFromCache(),o=this.tcpMgr.getCurrentUserId(),r=this.getDeviceId(),i=Be.getDeltaTime();return Promise.resolve({connectedTime:t,deviceId:r,crtUserId:o,naviInfo:n,connectionStatus:e,deltaTime:i})},t.prototype._enableCreateEmptyTopConversation=function(t){this._callCppProxy("enableCreateEmptyTopConversation",t)},t.prototype._registerMsgTypes=function(){for(var t in xt["RC:RcCmd"]={isCounted:!1,isPersited:!1},xt){var e=xt[t],n=e.isCounted,o=e.isPersited,r=e.searchProps,i=0;o&&(i|=1),n&&(i|=2),"RC:TypSts"===t&&(i=16),this._callCppProxy("registerMessageType",t,i,r||[])}},t.prototype._buildIsMentioned=function(t,e){var n,o=!1;if(Xt(t))n=t;else try{n=t?JSON.parse(t):t}catch(e){n=t,this.logger.error(Le.P_PARSE_JSON_MSGS_E,JSON.stringify({content:t}))}return Xt(n)&&(o=!!n.mentionedInfo),{isMentioned:o,msgContent:n}},t.prototype._buildMsgOption=function(t){var e={isCounted:!1,isPersited:!1};return t in xt?e=xt[t]:t in this._customMessageType&&(e=this._customMessageType[t]),e},t.prototype._buildSupportExt=function(t,e,n){var o=null;return t&&(o=this._msgExpansionHandler.parseReceiveExpansion(n),"conversation"!==e&&"history"!==e||(o=this._msgExpansionHandler.parseConverOrHisExpansion(n))),o},t.prototype._handleReadReceiptRequest=function(t){var e=JSON.parse(t),n=this.getNaviInfoFromCache();if(!(null==n?void 0:n.grpRRVer))return e;var o=e,r=o.hasRespond,i=o.readerInfo,s=void 0===i?{}:i,a=o.readCount,_=o.totalCount,c=o.readerList,u=void 0===c?[]:c,E={readCount:a,totalCount:_};if(1===(null==n?void 0:n.grpRRVer)){var R=[];for(var l in s)R.push({userId:l,readTime:s[l]});E.readerList=R,E.hasRespond=r}return 3===(null==n?void 0:n.grpRRVer)&&(E.readerList=u),E},t.prototype._buildMessage=function(t,e){var n;void 0===e&&(e={});var o=e.isOffLineMessage,r=e.buildFrom,i=JSON.parse(t),s=i.channelId,a=i.conversationType,_=i.targetId,c=i.senderUserId,u=i.content,E=i.objectName,R=i.messageUid,l=i.direction,d=i.status,p=i.messageId,C=i.sentTime,T=i.readReceiptRequest,I=i.supportExt,h=i.pushContent,N=i.pushTitle,f=i.pushId,O=i.pushConfig,A=i.templateId,g=i.disableTitle,P=i.forcePushDetail,v=i.hasMore,L=i.directedUsers,m=i.noNotification,y=i.disableUpdateLastMessage,M=this._buildIsMentioned(u,p),U=M.isMentioned,D=M.msgContent,G=this._buildMsgOption(E),V=this._buildSupportExt(I,r,i),b=Qt(o)?C<this.tcpMgr.getConnectedTime():o,F={};O&&(F=function(t,e,n){var o={},r={notificationId:n||""},i={};if(!e)return{iOSConfig:o,androidConfig:r,harmonyOSConfig:i};try{var s=JSON.parse(e);null==s||s.forEach((function(t){var e,n,s,a,_,c,u,E,R,l,d,p,C=Object.keys(t);if(0!==C.length){var T=C[0];switch(T){case"HW":return r.channelIdHW=null===(e=t[T])||void 0===e?void 0:e.channelId,r.importanceHW=null===(n=t[T])||void 0===n?void 0:n.importance,r.imageUrlHW=null===(s=t[T])||void 0===s?void 0:s.image,void(r.categoryHW=null===(a=t[T])||void 0===a?void 0:a.category);case"MI":return void(r.channelIdMi=null===(_=t[T])||void 0===_?void 0:_.channelId);case"OPPO":return void(r.channelIdOPPO=null===(c=t[T])||void 0===c?void 0:c.channelId);case"VIVO":return r.typeVivo=null===(u=t[T])||void 0===u?void 0:u.classification,void(r.categoryVivo=null===(E=t[T])||void 0===E?void 0:E.category);case"APNS":return o.threadId=t[T]["thread-id"],o.apnsCollapseId=t[T]["apns-collapse-id"],o.category=t[T].category,o.richMediaUri=t[T].richMediaUri,void(o.interruptionLevel=t[T]["interruption-level"]);case"FCM":return void(r.googleConfig={collapseKey:t[T].collapse_key||"",imageUrl:t[T].imageUrl||"",priority:t[T].priority||""});case"HONOR":return r.importanceHonor=null===(R=t[T])||void 0===R?void 0:R.importance,void(r.imageUrlHonor=null===(l=t[T])||void 0===l?void 0:l.image);case"OHOS":i.category=null===(d=t[T])||void 0===d?void 0:d.category,i.image=null===(p=t[T])||void 0===p?void 0:p.image}}}))}catch(n){t.error(S.O,"Wrong format for pushConfigs field! content: ".concat(e))}return{iOSConfig:o,androidConfig:r,harmonyOSConfig:i}}(this.logger,O,f));var w=Ut(Ut({},F),{pushTitle:N,pushContent:h,pushData:h,disablePushTitle:g,forceShowDetailContent:P,templateId:A}),x={channelId:s,conversationType:a,targetId:_,senderUserId:c,content:D||{},messageType:E,messageUId:R||"",messageDirection:l,isOffLineMessage:b,sentTime:C,receivedTime:0,isPersited:G.isPersited,isCounted:G.isCounted,isMentioned:U,disableNotification:m,isStatusMessage:(null===(n=this._customMessageType[E])||void 0===n?void 0:n.isStatusMessage)||!1,canIncludeExpansion:I,expansion:I?V:null,receivedStatus:d,receivedStatusInfo:zt(d),messageId:p,pushConfig:w,hasMore:v,directedUserIds:L||[],disableUpdateLastMessage:y};if(l===Ct.RECEIVE?x.receivedStatus=this._compatibleReceivedStatus(x.receivedStatusInfo):l===Ct.SEND&&(x.sentStatus=d),T){var B=this._handleReadReceiptRequest(T);x.readReceiptInfo=B}return x},t.prototype._compatibleReceivedStatus=function(t){var e=Nt.UNREAD;return t.isRead?e=Nt.READ:t.isListened?e=Nt.LISTENED:t.isDownload?e=Nt.DOWNLOADED:t.isRetrieved&&(e=Nt.RETRIEVED),e},t.prototype._updateReadReceiptInfo=function(t,e){var n=this._callCppProxy("getMessage",t),o=JSON.parse(n),r=o.readReceiptRequest?JSON.parse(o.readReceiptRequest):{},i=Ut(Ut({},r),e);this._callCppProxy("updateReadReceiptRequestInfo",t,JSON.stringify(i))},t.prototype._processRRRspMsg=function(t,e,n){var o,r,i,s;if(e!==this.getCurrentUserId()){var a=t[this.getCurrentUserId()]||[];try{for(var _=Vt(a),c=_.next();!c.done;c=_.next()){h=c.value;var u=this._callCppProxy("getMessage",h),E=JSON.parse(u),R=E.readReceiptRequest?JSON.parse(E.readReceiptRequest):{},l=R.isReceiptRequestMessage,d=R.readerList,p=void 0===d?[]:d;l&&!p.includes(e)&&(p.push(e),this._callCppProxy("updateReadReceiptRequestInfo",h,JSON.stringify({isReceiptRequestMessage:l,readerList:p})))}}catch(t){i={error:t}}finally{try{c&&!c.done&&(s=_.return)&&s.call(_)}finally{if(i)throw i.error}}}else for(var C in t){var T=t[C];try{for(var I=(o=void 0,Vt(T)),S=I.next();!S.done;S=I.next()){var h=S.value;this._callCppProxy("updateReadReceiptRequestInfo",h,JSON.stringify({isReceiptRequestMessage:!0,hasRespond:!0}))}}catch(t){o={error:t}}finally{try{S&&!S.done&&(r=I.return)&&r.call(I)}finally{if(o)throw o.error}}}},t.prototype._processRSMsg=function(t){var e=t.conversationType,n=t.targetId,o=t.content,r=t.channelId,i=o.msgId,s=o.rrn,a=o.tmn,_=o.endMsgTime;e===Q.PRIVATE?this.updateMessageReceiptStatus(e,n,_,r||""):this._updateReadReceiptInfo(i,{readCount:s,totalCount:a});var c={conversationType:e,targetId:n,channelId:r};this._sendMessageReadReceipt(e===Q.PRIVATE?{privateReadReceipt:Ut(Ut({},c),{endMsgTime:o.endMsgTime})}:{groupReadReceipt:Ut(Ut({},c),{totalCount:o.tmn,readedCount:o.rrn,messageUId:o.msgId})})},t.prototype._processSRSMsg=function(t){var e=this.getNaviInfoFromCache(),n=t.conversationType,o=t.targetId,r=t.content,i=t.channelId,s=t.senderUserId,a=t.sentTime;return s===this.tcpMgr.getCurrentUserId()&&(this._callCppProxy("clearUnreadCountByTimestamp",n,o,r.lastMessageSendTime,i||""),1!==(null==e?void 0:e.sesDriven)||(a>this.tcpMgr.getConnectedTime()||this._sendsyncReadStatus({conversationType:n,targetId:o,channelId:i,timestamp:r.lastMessageSendTime}),!1))},t.prototype._buildConversation=function(t){var e=JSON.parse(t),n=e.channelId,o=e.conversationType,r=e.targetId,i=e.unreadCount,s=e.lastestMsg,a=e.isTop,_=e.blockStatus,c=e.matchCount,u=e.hasUnreadMention,E=e.conversationTime,R=e.draft,l=_>0?St.OPEN:St.CLOSE;return{channelId:n,conversationType:o,targetId:r,unreadMessageCount:i,latestMessage:-1===JSON.parse(s).messageId?null:this._buildMessage(s),hasMentioned:u,mentionedInfo:null,notificationStatus:l,isTop:a,lastUnreadTime:0,matchCount:c,operationTime:E,notificationLevel:_,draft:R}},t.prototype._convertResultList=function(t,e){var n=JSON.parse(t).list;return n=n.map((function(t){var n=JSON.parse(t.obj);return e?e(n):n}))},t.prototype._handleNotNotificationMessage=function(t){var e,n=t.messageType,o=t.senderUserId,r=t.content;if(n===$.LOG_COMMAND&&t.senderUserId===kt){var i=t.content,s=i.startTime,a=i.endTime,_=i.platform,c=i.logId,u=i.uri;return this.reporter.report(parseInt(s,10),parseInt(a,10),_,u,c,t.messageUId),!0}if(n===$.CLOUD_CONTROL&&o===kt)return this.cloudControllerMsgs.push(t),this._ccMsgHandler(),!0;if(n===$.READ_STATE)return this._processRSMsg(t),!0;if("RC:MsgExMsg"===n)return this._msgExpansionHandler.setLocalFromExtMsg(this.logger,t),this._sendMessageExpansion(t),!0;if(n===$.SYNC_READ_STATUS&&!this._processSRSMsg(t))return!0;if(n===$.DELIVERED)return this._callCppProxy("setMessageDeliverTime",JSON.stringify(r)),this._sendMessageDelivered(t.content.map((function(t){return{deliverTime:t.time,messageUId:t.messageUId,objectName:t.objectName,targetId:t.targetId}}))),!0;if(n===$.DELIVERED_MSG){var E={totalCount:t.content.tmn,list:null===(e=t.content.dl)||void 0===e?void 0:e.map((function(t){return{MessageUId:t.msgId,deliveryCount:t.drn}}))};return this._sendGroupMessageDeliveredStatus(E),!0}return!1},t.prototype._setOnReceiveMessageListener=function(){var t=this;Be.setOnReceiveMessageListener((function(e,n,o,r){try{var i=t._buildMessage(e,{isOffLineMessage:o}),s=i.messageType,a=i.channelId,_=void 0===a?"":a,c=i.senderUserId,u=i.content,E=i.sentTime,R=i.conversationType,l=i.targetId;if(t._handleNotNotificationMessage(i))return;if(s===$.READ_RECEIPT_REQUEST&&u.messageUId&&t._updateReadReceiptInfo(u.messageUId,{isReceiptRequestMessage:!0,hasRespond:!1}),s===$.READ_RECEIPT_RESPONSE&&u.receiptMessageDic&&t._processRRRspMsg(u.receiptMessageDic,c,E),s===$.GROUP_READ_RECEIPT_REQUEST){var d=u.msgId,p=u.rrn,C=u.tmn;t._updateReadReceiptInfo(d,{readCount:p,totalCount:C})}i.canIncludeExpansion&&t._msgExpansionHandler.setLocalFromReceiveMsg(t.logger,i),s===$.READ_RECEIPT&&c===t.tcpMgr.getCurrentUserId()&&t._callCppProxy("clearUnreadCountByTimestamp",R,l,u.lastMessageSendTime,_);var T=!0;if(0!==n||r||(T=!1),s===$.RECALL){if(!t.handleRecalledMessage(i))return;var I=t._fixRecallContentInfo(i);R=I.conversationType,l=I.targetId}t._sendMessageNotification(Object.assign(i,{hasMoreMsg:T,conversationType:R,targetId:l}))}catch(n){t.logger.error(Le.P_RECEIVE_MESSAGE_E,JSON.stringify({error:null==n?void 0:n.stack,message:e}))}}),(function(){t._sendPullOfflineFinished()}))},t.prototype._ccMsgHandler=function(){var t;return Dt(this,void 0,void 0,(function(){var e,n;return Gt(this,(function(o){switch(o.label){case 0:return this.cloudControllerLock?(this.cloudControllerLock=!1,this.cloudControllerMsgs.shift()?(e=this.tcpMgr.getToken(),[4,null===(t=this.cloudController)||void 0===t?void 0:t.request(this.cloudControllerUri,Ae.other,e)]):[3,2]):[2];case 1:n=o.sent()||0,this.cloudControllerMsgs=this.cloudControllerMsgs.filter((function(t){return t.sentTime>n})),this.cloudControllerLock=!0,this._ccMsgHandler(),o.label=2;case 2:return[2]}}))}))},t.prototype._fixRecallContentInfo=function(t){var e=t.conversationType,n=t.targetId;return t.senderUserId===this.tcpMgr.getCurrentUserId()&&(e=t.content.conversationType||e,n=t.content.targetId||n),{conversationType:e,targetId:n}},t.prototype.handleRecalledMessage=function(t){var e=t.content,n=e.messageUId,o=e.sentTime;if(!n)return!0;var r=this._callCppProxy("getMessage",n),i=this._buildMessage(r,{isOffLineMessage:!1});if(t.content.isDelete)return-1===i.messageId||this._callCppProxy("deleteMessages",[i.messageId]),!0;if(i.messageType===$.RECALL_NOTIFICATION_MESSAGE)return!1;var s={recallTime:Date.now(),admin:!!t.content.isAdmin,originalObjectName:i.messageType,originalMessageContent:i.content,recallActionTime:t.sentTime,operatorId:t.senderUserId};if(t.content.user&&(s.user=t.content.user),t.content.extra&&(s.extra=t.content.extra),i.messageType===$.TextMessage&&(s.recallContent=i.content.content),-1===i.messageId){var a=t.conversationType,_=t.targetId,c=t.senderUserId,u=t.channelId,E=t.messageDirection;return this._callCppProxy("insertMessage",a,_,c,$.RECALL_NOTIFICATION_MESSAGE,JSON.stringify(s),(function(){}),(function(){}),E,1,30,o,"",0,n,!1,!0,JSON.stringify({}),u||""),!0}return i.receivedStatus||this.setMessageReceivedStatus(i.messageId,1),this._callCppProxy("setMessageContent",i.messageId,JSON.stringify(s),$.RECALL_NOTIFICATION_MESSAGE),!0},t.prototype._sendMessageExpansion=function(t){var e=t.channelId,n=void 0===e?"":e,o=t.content,r=t.conversationType,i=t.targetId,s=o,a=s.put,_=s.del,c=s.mid,u={};a&&(u.updatedExpansion={channelId:n,messageUId:c,expansion:a,conversationType:r,targetId:i}),_&&(u.deletedExpansion={channelId:n,messageUId:c,deletedKeys:_,conversationType:r,targetId:i}),this._dispatchEvent("expansion",u)},t.prototype._sendMessageNotification=function(t){this._dispatchEvent("batchMessage",t)},t.prototype._sendPullOfflineFinished=function(){this._dispatchEvent("pullFinished",null)},t.prototype._sendMessageDelivered=function(t){this._dispatchEvent("messageDelivered",t)},t.prototype._sendGroupMessageDeliveredStatus=function(t){this._dispatchEvent("groupMessageDeliveredStatus",t)},t.prototype._sendChatroomStatus=function(t){this._dispatchEvent("chatroom",t)},t.prototype._sendMessageReadReceipt=function(t){this._dispatchEvent("messageReadReceipt",t)},t.prototype._sendsyncReadStatus=function(t){this._dispatchEvent("syncReadStatus",t)},t.prototype._setConversationStatusListener=function(){var t=this;Be.setConversationStatusListener((function(e){var n=JSON.parse(e).list,o=[];n.forEach((function(t){var e=JSON.parse(t.obj),n=e.conversationType,r=e.targetId,i=e.status,s=e.channelId,a={notificationStatus:2,isTop:!1};i.forEach((function(t){var e=JSON.parse(t.item);1===e.type?a.notificationStatus=1===Number(e.value)?St.OPEN:St.CLOSE:a.isTop=1===Number(e.value)})),o.push({channelId:s,conversationType:n,targetId:r,updatedItems:{notificationStatus:{val:a.notificationStatus,time:0},isTop:{val:a.isTop,time:0}}})})),t._dispatchEvent("conversation",o)}),(function(e){t._dispatchEvent("conversationTag",e)}),(function(e,n,o,r){t._callCppProxy("clearUnreadCountByTimestamp",e,n,r,o||""),t._sendsyncReadStatus({conversationType:e,targetId:n,channelId:o,timestamp:r})}))},t.prototype._setPushNotificationListener=function(){var t=this;Be.setPushNotificationListener((function(){}),(function(e){t._dispatchEvent("tag",e),t._getRTCProfile()}))},t.prototype._getRTCProfile=function(){var t=this._callCppProxy("getRTCProfile");if(t){var e=this.tcpMgr.getToken();this.navi.updateVoipCallInfo(e,t);var n=this.navi.getNaviInfoFromCache(e);this._dispatchEvent("onNaviDataChange",n)}},t.prototype._setRTCLivingRoomEventListener=function(){var t=this;Be.setRTCRoomEventListener((function(e){t._dispatchEvent("onRTCDataChange",Array.prototype.slice.call(e))}))},t.prototype._setChatroomEventListener=function(){var t=this;Be.setChatroomEventListener((function(e,n){t._sendChatroomStatus({chatroomDestroyed:e})}))},t.prototype._setCallInfoListener=function(){var t=this;Be.setCallInfoListener((function(e){var n=[];try{JSON.parse(e).list.forEach((function(t){Object.entries(t).forEach((function(t){var e=bt(t,2),o=e[0],r=e[1];n.push({key:o,value:r})}))}))}catch(e){t.logger.error(Le.P_PARSE_JSON_E,JSON.stringify({error:e}))}t._dispatchEvent("callInfo",JSON.stringify({list:n}))}))},t.prototype._setSubscribeEventListener=function(){var t=this;Be.setSubscribeEventListener((function(){}),(function(e){t._dispatchEvent("syncSubscribedUserStatusFinished",e)}),(function(e){var n=t._buildSubscribeEventData(e).map((function(t){return{userId:t.userId,subscribeType:t.subscribeType,subscribeTime:t.subscribeTime,expiry:t.expiry,operationType:t.operationType}}));t._dispatchEvent("subscribedRelationChange",n)}),(function(e){var n=t._buildSubscribeEventData(e).map((function(t){var e=t.userId,n=t.subscribeType,o=t.subscribeTime,r=t.expiry,i=t.details,s=t.userProfile,a={userId:e,subscribeType:n,subscribeTime:o,expiry:r};return[ut.ONLINE_STATUS,ut.FRIEND_ONLINE_STATUS].includes(n)?a.details=i:[ut.USER_PROFILE,ut.FRIEND_USER_PROFILE].includes(n)&&(a.userProfile=s),a}));t._dispatchEvent("subscribedUserStatusChange",n)}))},t.prototype._setUserProfileListener=function(){var t=this;Be.setUserProfileListener((function(e){t._dispatchEvent("syncSubscribedUserStatusFinished",e)}),(function(e){t._dispatchEvent("ownUserProfileChanged",t._string2userProfileInfo(e))}))},t.prototype._onGroupOperationChanged=function(t,e,n,o,r){var i,s,a,_=[];try{s=JSON.parse(o),_=JSON.parse(r),a=JSON.parse(t);var c={groupId:s[0]?s[0].groupId:"",operatorInfo:this._convertGroupMemberInfoList([a])[0],operation:e,operationTime:n};0===e?(i=bt(this._convertGroupInfoList(s),1),c.groupInfo=i[0]):c.memberInfos=this._convertGroupMemberInfoList(_),this._dispatchEvent("groupOperation",c)}catch(e){this.logger.error(Le.P_PARSE_JSON_E,JSON.stringify({error:e,groupInfoJson:o,membersJson:r,operatorInfo:t}))}},t.prototype._onGroupInfoChanged=function(t,e,n,o,r,i){try{var s=JSON.parse(n),a=this._convertUpdateGroupInfoList(JSON.parse(r))[0];switch(t){case G.GROUP_INFO_CHANGE:this._dispatchEvent("groupInfoChanged",{operatorInfo:this._convertGroupMemberInfoList([s])[0],operationTime:i,groupInfo:a,changedGroupInfo:a,fullGroupInfo:o?this._convertUpdateGroupInfoList(JSON.parse(o))[0]:void 0});break;case G.GROUP_REMARK_DELETE:case G.GROUP_REMARK_SET:var _=t===G.GROUP_REMARK_SET?V.ADD:V.REMOVE;this._dispatchEvent("groupRemarkChangedSync",{groupId:e,operationType:_,operationTime:i,groupRemark:(null==a?void 0:a.remark)||""})}}catch(t){this.logger.error(Le.P_PARSE_JSON_E,JSON.stringify({error:t,groupInfoJson:r,operatorInfoJson:n}))}},t.prototype._onGroupMemberInfoChanged=function(t,e,n,o){try{var r=JSON.parse(e),i=JSON.parse(n),s={groupId:t,operatorInfo:this._convertGroupMemberInfoList([r])[0],memberInfo:this._convertGroupMemberInfoList([i])[0],operationTime:o};this._dispatchEvent("groupMemberInfoChanged",s)}catch(t){this.logger.error(Le.P_PARSE_JSON_E,JSON.stringify({error:t,operatorInfoJson:e,updateMemberInfoJson:n}))}},t.prototype._onGroupRequestChanged=function(t,e,n,o){try{var r=JSON.parse(n),i=r.groupId,s=r.joinUser,a=r.approverUser,_=r.inviterUser,c=r.type,u=r.status,E=r.direction,R=r.remark,l=Ut(Ut(Ut(Ut({groupId:i},s&&{joinMemberInfo:this._convertGroupMemberInfoList([s])[0]}),_&&_.userId&&{inviterInfo:this._convertGroupMemberInfoList([_])[0]}),a&&a.userId&&{operatorInfo:this._convertGroupMemberInfoList([a])[0]}),{status:u,direction:E,type:c,operationTime:o,reason:R});this._dispatchEvent("groupApplicationEvent",l)}catch(t){this.logger.error(Le.P_PARSE_JSON_E,JSON.stringify({error:t,groupInfo:e,requestInfoJson:n}))}},t.prototype._onFavoriteMembersChanged=function(t,e,n,o){try{var r=JSON.parse(n),i=[];r&&jt(r.list)&&(i=r.list.map((function(t){return t.value}))),this._dispatchEvent("groupFollowsChangedSync",{groupId:t,operationType:e,operationTime:o,userIds:i})}catch(t){this.logger.error(Le.P_PARSE_JSON_E,JSON.stringify({error:t,memberIds:n}))}},t.prototype._setEntrustGroupListener=function(){Be.setEntrustGroupListener(this._onGroupOperationChanged.bind(this),this._onGroupInfoChanged.bind(this),this._onGroupMemberInfoChanged.bind(this),this._onGroupRequestChanged.bind(this),this._onFavoriteMembersChanged.bind(this))},t.prototype._onFriendApplicationStatusChanged=function(t,e,n,o,r,i){this._dispatchEvent("friendApplicationStatusChanged",{userId:t,applicationType:e,applicationStatus:n,directionType:o,operationTime:r,extra:null!=i?i:""})},t.prototype._onFriendAdd=function(t,e,n,o,r){this._dispatchEvent("friendAdd",{userId:e,name:n,portraitUri:o,directionType:t,operationTime:r})},t.prototype._onFriendDelete=function(t,e,n){this._dispatchEvent("friendDelete",{userIds:e,directionType:t,operationTime:n})},t.prototype._onFriendsClearedFromServer=function(t){this._dispatchEvent("friendCleared",t)},t.prototype._onFriendInfoChangedSync=function(t,e,n){try{var o=JSON.parse(n);this._dispatchEvent("friendInfoChangedSync",{userId:t,remark:e,extProfile:o.list})}catch(t){this.logger.error(Le.P_PARSE_JSON_E,JSON.stringify({error:t,profiles:n}))}},t.prototype._setFriendEventListener=function(){Be.setFriendEventListener(this._onFriendApplicationStatusChanged.bind(this),this._onFriendAdd.bind(this),this._onFriendDelete.bind(this),this._onFriendsClearedFromServer.bind(this),this._onFriendInfoChangedSync.bind(this))},t.prototype.registerMessageType=function(t,e,n,o,r){var i=0;e&&(i|=1),n&&(i|=2),r&&(i=16),this._customMessageType[t]={isCounted:n,isPersited:e,isStatusMessage:r},this.logger.info(Le.P_REGTYP_O,JSON.stringify({type:t,opt:i,search:o})),this._callCppProxy("registerMessageType",t,i,o||[])},t.prototype.connect=function(t,e,n,o){return this.tcpMgr.connect(t,e,n,o)},t.prototype.reconnect=function(t,e,n){var o=X.RC_SOCKET_DISCONNECTED;return this.tcpMgr.reconnect(t,e,n,o)},t.prototype.reportSDKInfo=function(t){var e=JSON.stringify(Ut(Ut({},t),{"electron-main":"5.14.0"}));this.logger.info(Le.P_REPORT_VER_O,e),this._callCppProxy("uploadSDKVersion",e,"")},t.prototype.disconnect=function(t){t=t||!0,this._chatroomCache.length=0,this.reporter.stop(),Rn(null,this.logger),this.tcpMgr.disconnect(t)},t.prototype.logout=function(){this.disconnect()},t.prototype.setUserStatusListener=function(t,e){Be.setOnReceiveStatusListener((function(t,n){e({userId:t,status:n})}));var n=t.userIds||[];n.length&&this.subscribeUserStatus(n)},t.prototype.subscribeUserStatus=function(t){var e=this;return new Promise((function(n){e._callCppProxy("subscribeUserStatus",t,(function(){setTimeout((function(){n(X.SUCCESS)}),0)}),(function(t){setTimeout((function(){n(t)}),0)}))}))},t.prototype.setUserStatus=function(t){var e=this;return new Promise((function(n){e._callCppProxy("setUserStatus",t,(function(){setTimeout((function(){n(X.SUCCESS)}),0)}),(function(t){setTimeout((function(){n(t)}),0)}))}))},t.prototype.getUserStatus=function(t){var e=this;return new Promise((function(n){e._callCppProxy("getUserStatus",t,(function(t){setTimeout((function(){n({code:X.SUCCESS,data:{status:t}})}),0)}),(function(t){setTimeout((function(){n({code:t})}),0)}))}))},t.prototype._handleDirectionalUserIdList=function(t,e){var n=t.messageType,o=t.content,r=t.directionalUserIdList,i=void 0===r?[]:r,s=e===Q.GROUP;if(n===$.READ_RECEIPT_RESPONSE&&o.receiptMessageDic&&s)for(var a in o.receiptMessageDic)i.push(a);return n===$.SYNC_READ_STATUS&&function(t){return[Q.GROUP,Q.DISCUSSION,Q.ULTRA_GROUP,Q.PUBLIC_SERVICE,Q.APP_PUBLIC_SERVICE].includes(t)}(e)&&(i=[this.getCurrentUserId()]),i},t.prototype._handleMessage2Callback=function(t,e){var n=this;if("RC:MsgExMsg"===t.messageType&&this._msgExpansionHandler.setLocalFromExtMsg(this.logger,t),t.messageType===$.READ_RECEIPT_REQUEST)this._updateReadReceiptInfo(e.content.messageUId,{isReceiptRequestMessage:!0,readerList:[]});else if(t.messageType===$.READ_RECEIPT_RESPONSE){var o=e.content.receiptMessageDic;if(!o)return;for(var r in o)o[r].forEach((function(t){n._updateReadReceiptInfo(t,{isReceiptRequestMessage:!0,hasRespond:!0})}))}},t.prototype.sendMessage=function(t,e,n,o,r){var i=this;void 0===r&&(r=this.logger.createTraceId());var s=n.messageType,a=n.content,_=n.expansion,c=n.pushConfig,u=n.pushContent,E=void 0===u?"":u,R=n.pushData,l=void 0===R?"":R,d=n.directionalUserIdList,p=void 0===d?[]:d,C=n.disableNotification,T=void 0!==C&&C,I=n.canIncludeExpansion,S=void 0!==I&&I,h=n.isVoipPush,N=void 0!==h&&h,f=n.channelId,O=void 0===f?"":f,A=n.messageId,g=void 0===A?0:A,P=n.disableUpdateLastMessage,v=void 0!==P&&P,L=c||{},m=L.iOSConfig,y=L.androidConfig,M=L.harmonyOSConfig,U=L.templateId,D=void 0===U?"":U,G=L.pushTitle,V=void 0===G?"":G,b=L.pushContent,F=void 0===b?E:b,w=L.pushData,x=void 0===w?l:w,B=L.disablePushTitle,k=void 0!==B&&B,H=L.forceShowDetailContent,J=void 0!==H&&H,Y=re(m,y,M);return new Promise((function(c){E=F,l=x;var u=(null==y?void 0:y.notificationId)||"";p=i._handleDirectionalUserIdList(n,t);var R={};for(var d in _)R[d]={v:""},R[d].v=_[d];var C=D;i.logger.info(Le.P_SEND_MSG_T,JSON.stringify({messageType:s,conversationType:t,targetId:e,channelId:O}),r);var I=i._callCppProxy("sendMessage",(function(t,e){var o=i._buildMessage(t,{isOffLineMessage:!1});if(i.logger.info(Le.P_SEND_MSG_R,JSON.stringify({code:e,messageUId:o.messageUId}),r),e===X.SENSITIVE_REPLACE)return setTimeout((function(){c({code:e})}),0);[$.READ_RECEIPT_REQUEST,$.READ_RECEIPT_RESPONSE,$.EXPANSION_NOTIFY].findIndex((function(t){return t===o.messageType}))>-1&&i._handleMessage2Callback(o,n),o.canIncludeExpansion&&i._msgExpansionHandler.setLocalFromReceiveMsg(i.logger,o),setTimeout((function(){c({code:X.SUCCESS,data:o})}),0)}),(function(t,e){var n=i._buildMessage(t,{isOffLineMessage:!1});i.logger.warn(Le.P_SEND_MSG_R,JSON.stringify({code:e,messageId:n.messageId}),r),n.sentTime=Date.now()-Be.getDeltaTime(),setTimeout((function(){c({code:e,data:n})}),0)}),t,e,s,JSON.stringify(a),p,T,k,J,E,l,u,V,Y,C,S,JSON.stringify(R),N,O,g,v),h=JSON.parse(I);null==o||o(h.messageId)}))},t.prototype.recallMsg=function(t,e,n,o,r){var i=this;return new Promise((function(s){var a,_=r.user,c=r.pushContent,u=r.channelId,E=r.extra,R=r.pushConfig,l=r.disableNotification,d=r.isDelete,p=r.directionalUserIdList,C=r.disableUpdateLastMessage,T={conversationType:t,targetId:e,messageUId:n,sentTime:o,user:_,extra:E,channelId:u,isDelete:d||!1};_&&(T.user=_),E&&(T.extra=E);var I={conversationType:t,targetId:e,senderUserId:i.tcpMgr.getCurrentUserId(),content:T,objectName:$.RECALL,messageUid:n,direction:Ct.SEND,status:Nt.UNREAD,sentTime:o,channelId:u},S=i._buildMessage(JSON.stringify(I),{isOffLineMessage:!1});i._callCppProxy("recallMessage",(function(){i.handleRecalledMessage(S),S.pushConfig=R,setTimeout((function(){s({code:X.SUCCESS,data:S})}),0)}),(function(t){setTimeout((function(){s({code:t})}),0)}),$.RECALL,JSON.stringify(T),l||!1,(null==R?void 0:R.disablePushTitle)||!1,(null==R?void 0:R.forceShowDetailContent)||!1,c||"",(null==R?void 0:R.pushData)||"",(null===(a=null==R?void 0:R.androidConfig)||void 0===a?void 0:a.notificationId)||"",(null==R?void 0:R.pushTitle)||"",re(null==R?void 0:R.iOSConfig,null==R?void 0:R.androidConfig,null==R?void 0:R.harmonyOSConfig),(null==R?void 0:R.templateId)||"",u,p||[],n,null!=C&&C)}))},t.prototype.getHistoryMessage=function(t,e,n,o,r,i,s){var a=this;return new Promise((function(_){n=n||0;var c=0===r,u=o+1,E=a._callCppProxy("getHistoryMessages",t,e,n,u,s,c,i),R=JSON.parse(E).list,l=[];R.reverse();for(var d=0;d<R.length;d++){var p=a._buildMessage(R[d].obj);l[d]=p}_({code:X.SUCCESS,data:{list:u===l.length?l.slice(1,u):l,hasMore:o<l.length}})}))},t.prototype.getMessages=function(t,e,n,o,r,i){var s=this;return new Promise((function(a){var _=0===r,c=n,u=0!==n,E=o+1;u&&(c+=_?1:-1,E++);for(var R=s._callCppProxy("getMessages",t,e,c,E,_,i),l=JSON.parse(R).list,d=[],p=0;p<l.length;p++){var C=s._buildMessage(l[p].obj);d[p]=C}var T=s._computeRepairInfo(d,_,n,c,E),I=T.isNeedRepair,S=void 0!==I&&I,h=T.repairTime,N=void 0===h?0:h;if(!S)return u&&(d.shift(),E--),d.reverse(),void a({code:X.SUCCESS,data:{list:E===d.length?d.slice(1,E):d,hasMore:o<d.length}});s._processRepairHisMsg(t,e,n,o,r,i,N,a)}))},t.prototype._computeRepairInfo=function(t,e,n,o,r){var i=!1,s=0,a=this.getNaviInfoFromCache()||{},_=a.repairHisMsg,c=void 0===_?0:_,u=a.historyMsg;if(1!==c||!u)return{isNeedRepair:i,repairTime:s};var E=t.findIndex((function(t){return t.hasMore||0===Object.keys(t.content).length}));return e&&E>=0?(i=!0,s=t[E].hasMore?t[E].sentTime:t[E].sentTime+1):!e&&E>=1?(i=!0,s=t[E-1].sentTime):t.length<r||0===n?(i=!0,s=n):t.length>0&&t[0].sentTime!==n&&(i=!0,s=o),{isNeedRepair:i,repairTime:s}},t.prototype._processRepairHisMsg=function(t,e,n,o,r,i,s,a){var _=this,c=function(s){for(var c=0===r,u=o+1,E=_._callCppProxy("getMessages",t,e,n,u,c,i),R=JSON.parse(E).list,l=[],d=0;d<R.length;d++){var p=_._buildMessage(R[d].obj);l[d]=p}l.reverse(),a({code:s,data:{list:u<=l.length?l.slice(1,u):l,hasMore:o<l.length}})},u=o+10>100?100:o+10;this._callCppProxy("getRemoteHistoryMessages",t,e,s,u,(function(){return c(0)}),(function(t){c(t)}),r,!0,i,!1)},t.prototype.getContinuousMessages=function(t,e,n,o,r,i){var s=this;return new Promise((function(a){n=n||0;var _=0===r;s._callCppProxy("getContinuousMessages",t,e,n,o,(function(t,e,n){var o=JSON.parse(t).list,r=[];o.reverse();for(var i=0;i<o.length;i++){var _=s._buildMessage(o[i].obj);r[i]=_}setTimeout((function(){a({code:X.SUCCESS,data:{list:r,timestamp:e,hasMore:n}})}))}),(function(t){setTimeout((function(){a({code:t})}),0)}),_,i)}))},t.prototype.getRemoteHistoryMessages=function(t,e,n,o,r,i){var s=this;return new Promise((function(a){n=n||0;s._callCppProxy("getRemoteHistoryMessages",t,e,n,o,(function(t,e){var n=JSON.parse(t).list,o=[];n.reverse();for(var r=0;r<n.length;r++){var i=s._buildMessage(n[r].obj);o[r]=i}setTimeout((function(){a({code:X.SUCCESS,data:{list:o,hasMore:!!e}})}),0)}),(function(t){setTimeout((function(){a({code:t})}),0)}),r,!0,i,!0)}))},t.prototype.deleteRemoteMessage=function(t,e,n,o){var r=this;return new Promise((function(i){var s=JSON.stringify(n);r._callCppProxy("deleteRemoteHistoryMessages",t,e,s,!1,o,(function(){setTimeout((function(){i(X.SUCCESS)}),0)}),i)}))},t.prototype.deleteRemoteMessageByTimestamp=function(t,e,n,o){var r=this;return new Promise((function(i){r._callCppProxy("clearRemoteHistoryMessages",t,e,n,(function(){setTimeout((function(){i(X.SUCCESS)}),0)}),(function(t){setTimeout((function(){i(t)}),0)}),o)}))},t.prototype.clearMessages=function(t,e,n){var o=this;return new Promise((function(r){o._callCppProxy("clearMessages",t,e,n),r(X.SUCCESS)}))},t.prototype.getConversationList=function(t,e,n,o,r){var i=this;return void 0===r&&(r=""),new Promise((function(t){for(var e=i._callCppProxy("getConversationList",[1,3,6,7],r),n=JSON.parse(e).list,o=[],s=0;s<n.length;s++)o.push(i._buildConversation(n[s].obj));t({code:X.SUCCESS,data:o})}))},t.prototype.getConversation=function(t,e,n){var o=this;return new Promise((function(r){var i=o._callCppProxy("getConversation",t,e,n);if(i)r({code:X.SUCCESS,data:o._buildConversation(i)});else{var s=o._callCppProxy("getHistoryMessages",t,e,0,1,"",!0,n),a=void 0;try{a=JSON.parse(s).list}catch(t){o.logger.error(Le.P_PARSE_JSON_MSGS_E,null==t?void 0:t.stack),a=[]}var _=null;a.length>0&&(_=o._buildMessage(a[0].obj));var c=o._callCppProxy("getConversationNotificationStatus",t,e,n),u=o._callCppProxy("getConversationTopStatus",t,e,n);r({code:X.SUCCESS,data:{conversationType:t,targetId:e,channelId:n,unreadMessageCount:0,latestMessage:_,notificationStatus:c?St.OPEN:St.CLOSE,isTop:Boolean(u),lastUnreadTime:0}})}}))},t.prototype.removeConversation=function(t,e,n){var o=this._callCppProxy("removeConversation",t,e,n);return Promise.resolve(o?X.SUCCESS:X.CONVER_REMOVE_ERROR)},t.prototype.batchRemoveConversation=function(t){var e=t.map((function(t){return{conversation_type:t.conversationType,target_id:t.targetId,channel_id:t.channelId}})),n=this._callCppProxy("removeConversationInBatches",JSON.stringify(e));return Promise.resolve(n?X.SUCCESS:X.CONVER_REMOVE_ERROR)},t.prototype.clearConversations=function(t,e){var n=this;return new Promise((function(o){var r=[];r=jt(t)?t:[Q.PRIVATE,Q.GROUP,Q.SYSTEM,Q.PUBLIC_SERVICE],n._callCppProxy("clearConversations",r,e||""),o(X.SUCCESS)}))},t.prototype.getAllConversationUnreadCount=function(t,e,n){var o=this._callCppProxy("getTotalUnreadCount",e,n,t);return Promise.resolve({code:X.SUCCESS,data:o})},t.prototype.getConversationUnreadCount=function(t,e,n){var o=this;return void 0===n&&(n=""),new Promise((function(r){var i=o._callCppProxy("getUnreadCount",t,e,n);r({code:X.SUCCESS,data:i})}))},t.prototype.clearConversationUnreadCount=function(t,e,n){var o=this;return void 0===n&&(n=""),new Promise((function(r){o._callCppProxy("clearUnreadCount",t,e,n),r(X.SUCCESS)}))},t.prototype.clearUnreadCountByTimestamp=function(t,e,n,o){var r=this;return new Promise((function(i){r._callCppProxy("clearUnreadCountByTimestamp",t,e,n,o),i(X.SUCCESS)}))},t.prototype.getFirstUnreadMessage=function(t,e,n){var o=this;return new Promise((function(r){var i=o._callCppProxy("getTheFirstUnreadMessage",t,e,n),s=o._buildMessage(i);r({code:X.SUCCESS,data:-1!==s.messageId?s:null})}))},t.prototype.getFirstUnreadMessageInfo=function(t,e,n){var o=this;return new Promise((function(r,i){var s=o._callCppProxy("getTheFirstUnreadMessage",t,e,n),a=o._buildMessage(s);r({code:X.SUCCESS,data:-1!==a.messageId?{messageUId:a.messageUId,sentTime:a.sentTime}:null})}))},t.prototype.batchSetConversationToTop=function(t,e,n){var o=this;return new Promise((function(r,i){var s=t.map((function(t){return{conversation_type:t.conversationType,target_id:t.targetId,channel_id:t.channelId,is_top:e}}));o._callCppProxy("setIsTopInBatches",JSON.stringify(s),n||!1),r(X.SUCCESS)}))},t.prototype.setConversationStatus=function(t,e,n,o,r,i){var s=this;return new Promise((function(i){s._callCppProxy("setConversationStatus",t,e,n,o,(function(){setTimeout((function(){i(X.SUCCESS)}),0)}),(function(t){setTimeout((function(){i(t)}),0)}),r,!0)}))},t.prototype.setConversationToTop=function(t,e,n,o,r){var i=this;return new Promise((function(r){r(i._callCppProxy("setConversationToTop",t,e,n,o,!0,!0)?X.SUCCESS:X.RC_MSG_DATA_INCOMPLETE)}))},t.prototype.getConversationNotificationStatus=function(t,e,n){var o=this;return new Promise((function(r){var i=o._callCppProxy("getConversationNotificationStatus",t,e,n);r({code:X.SUCCESS,data:i?St.OPEN:St.CLOSE})}))},t.prototype.setConversationTypeNotificationLevel=function(t,e){var n=this;return new Promise((function(o,r){n._callCppProxy("setBlockPushLevelForType",t,e,(function(){o({code:X.SUCCESS})}),(function(t){o({code:t})}))}))},t.prototype.getConversationTypeNotificationLevel=function(t){var e=this;return new Promise((function(n,o){var r=e._callCppProxy("getBlockPushLevelForType",t);n({code:X.SUCCESS,data:r})}))},t.prototype.searchConversationByContent=function(t,e,n,o){var r=this;return new Promise((function(i){o=o||[1,3,6,7];for(var s=r._callCppProxy("searchConversationByContent",o,t,e,n),a=JSON.parse(s).list,_=[],c=0;c<a.length;c++)_[c]=r._buildConversation(a[c].obj);i({code:X.SUCCESS,data:_})}))},t.prototype.searchConversationByContentWithAllChannel=function(t,e,n){var o=this;return new Promise((function(r){n=n||[1,3,6,7];for(var i=o._callCppProxy("searchConversationByContentWithAllChannel",n,t,e),s=JSON.parse(i).list,a=[],_=0;_<s.length;_++)a[_]=o._buildConversation(s[_].obj);r({code:X.SUCCESS,data:a})}))},t.prototype.searchMessageByContent=function(t,e,n,o,r,i,s){var a=this;return new Promise((function(i){a._callCppProxy("searchMessageByContent",t,e,n,o,r,1,(function(t,e){for(var n=t?JSON.parse(t).list:[],o=[],r=0;r<n.length;r++)o[r]=a._buildMessage(n[r].obj);setTimeout((function(){i({code:X.SUCCESS,data:{messages:o,count:e}})}),0)}),s)}))},t.prototype.searchMessageByContentAndMessageType=function(t,e,n,o,r,i,s){var a=this;return new Promise((function(_){a._callCppProxy("searchMessageByContentAndObjectName",e,t,s||"",void 0===s,n,i,r,o,1,(function(t,e){for(var n=t?JSON.parse(t).list:[],o=[],r=0;r<n.length;r++)o[r]=a._buildMessage(n[r].obj);setTimeout((function(){_({code:X.SUCCESS,data:{messages:o,count:e}})}),0)}))}))},t.prototype.searchMessagesByUser=function(t,e,n,o,r,i){var s=this;return new Promise((function(a){s._callCppProxy("getMessageBySender",t,e,n,o,r,i,(function(t){for(var e=t?JSON.parse(t).list:[],n=[],o=0;o<e.length;o++)n[o]=s._buildMessage(e[o].obj);setTimeout((function(){a({code:X.SUCCESS,data:{messages:n}})}),0)}))}))},t.prototype.searchMessageByContentWithAllChannel=function(t,e,n,o,r){var i=this;return new Promise((function(s){i._callCppProxy("searchMessageByContentWithAllChannel",t,e,n,o,r,1,(function(t,e){for(var n=t?JSON.parse(t).list:[],o=[],r=0;r<n.length;r++)o[r]=i._buildMessage(n[r].obj);setTimeout((function(){s({code:X.SUCCESS,data:{messages:o,count:e}})}),0)}))}))},t.prototype.searchMessageByContentInTimeRangeWithAllChannel=function(t,e,n,o,r,i,s){var a=this;return new Promise((function(_){a._callCppProxy("searchMessageByTimestampWithAllChannel",t,e,n,o,r,i,s,(function(t){for(var e=t?JSON.parse(t).list:[],n=[],o=0;o<e.length;o++)n[o]=a._buildMessage(e[o].obj);setTimeout((function(){_({code:X.SUCCESS,data:{messages:n}})}),0)}))}))},t.prototype.getUnreadMentionedMessages=function(t,e,n){for(var o=JSON.parse(this._callCppProxy("getUnreadMentionedMessages",t,e,n)).list,r=0;r<o.length;r++)o[r]=this._buildMessage(o[r].obj);return o},t.prototype.addToBlacklist=function(t){var e=this;return new Promise((function(n){e._callCppProxy("addToBlacklist",t,(function(){setTimeout((function(){n(X.SUCCESS)}),0)}),(function(t){setTimeout((function(){n(t)}),0)}))}))},t.prototype.removeFromBlacklist=function(t){var e=this;return new Promise((function(n){e._callCppProxy("removeFromBlacklist",t,(function(){setTimeout((function(){n(X.SUCCESS)}),0)}),(function(t){setTimeout((function(){n(t)}),0)}))}))},t.prototype.getBlacklist=function(){var t=this;return new Promise((function(e){t._callCppProxy("getBlacklist",(function(t){setTimeout((function(){e({code:X.SUCCESS,data:t})}),0)}),(function(t){setTimeout((function(){e({code:t})}),0)}))}))},t.prototype.getBlacklistStatus=function(t){var e=this;return new Promise((function(n){e._callCppProxy("getBlacklistStatus",t,(function(t){setTimeout((function(){n({code:X.SUCCESS,data:t})}),0)}),(function(t){setTimeout((function(){n({code:t})}),0)}))}))},t.prototype.insertMessage=function(t,e,n){var o=this,r=n.content,i=n.senderUserId,s=n.messageType,a=n.messageDirection,_=n.readStatus,c=n.sentStatus,u=n.sentTime,E=n.searchContent,R=n.isUnread,l=n.messageUId,d=n.disableNotification,p=n.canIncludeExpansion,C=n.expansionMsg,T=n.channelId,I=n.directedUserIds,S=n.disableUpdateLastMessage;r=JSON.stringify(r);var h={};if(u=u||0,C){var N=JSON.parse(C);for(var f in N)h[f]={v:"",ts:0},h[f].v=N[f],h[f].ts=u}return new Promise((function(n){var C=R?0:1,N=o._callCppProxy("insertMessage",t,e,i,s,r,(function(){}),(function(t){setTimeout((function(){n({code:t})}),0)}),a,_||0,c||10,u,E||"",C,l||"",!!d,!!p,JSON.stringify(h),T||"",I||[],S||!1),f=o._buildMessage(N,{isOffLineMessage:!1});f.messageUId=l,f.sentTime=u,n({code:-1===f.messageId?X.MSG_INSERT_ERROR:X.SUCCESS,data:f})}))},t.prototype.batchInsertMessage=function(t,e){var n=this;return void 0===e&&(e=!1),new Promise((function(o){var r=t.map((function(t){var e=t.content,n=t.senderUserId,o=t.messageType,r=t.messageDirection,i=t.receivedStatus,s=void 0===i?0:i,a=t.sentStatus,_=t.sentTime,c=t.searchContent,u=t.isUnread,E=t.messageUId,R=t.disableNotification,l=t.canIncludeExpansion,d=t.expansion,p=t.channelId,C=t.conversationType,T=t.targetId,I=t.source,S=t.isMentioned,h=t.receivedStatusInfo,N=t.directedUserIds,f=t.disableUpdateLastMessage,O=s;h&&(O=function(t){var e=Nt.UNREAD;return(null==t?void 0:t.isRead)&&(e|=Nt.READ),(null==t?void 0:t.isListened)&&(e|=Nt.LISTENED),(null==t?void 0:t.isDownload)&&(e|=Nt.DOWNLOADED),(null==t?void 0:t.isRetrieved)&&(e|=Nt.RETRIEVED),e}(h));var A={};if(_=_||0,d)for(var g in d)A[g]={v:"",ts:0},A[g].v=d[g],A[g].ts=_;return{conversationType:C,targetId:T,channelId:p||"",direction:r,senderUserId:n,status:a||10,sentTime:_,objectName:o,content:JSON.stringify(e),messageUid:E||"",noNotification:!!R,supportExt:!!l,extMsg:JSON.stringify(A),readStatus:O,searchContent:c||"",isUnread:!!u,source:I||"",isMention:S,directedUsers:N,disableUpdateLastMessage:f||!1}})),i=n._callCppProxy("insertMessages",JSON.stringify(r),e);o({code:i?X.SUCCESS:X.MSG_INSERT_ERROR,data:i||!1})}))},t.prototype.getMessageCount=function(t,e,n){var o=this;return new Promise((function(r){var i=o._callCppProxy("getMessageCount",t,e,n);r({code:X.SUCCESS,data:i})}))},t.prototype.deleteMessages=function(t){var e=this;return new Promise((function(n){e._callCppProxy("deleteMessages",t),n(X.SUCCESS)}))},t.prototype.deleteMessagesByTimestamp=function(t,e,n,o,r){var i=this;return new Promise((function(s){i._callCppProxy("deleteMessagesByTimestamp",t,e,n,o,r),s(X.SUCCESS)}))},t.prototype.batchClearMessagesByTimestamp=function(t){var e=this;return new Promise((function(n,o){var r=t.map((function(t){return{conversation_type:t.conversationType,target_id:t.targetId,channel_id:t.channelId||"",send_time:t.timestamp}}));e._callCppProxy("deleteMessageBySendTimeInBatches",JSON.stringify(r)),n(X.SUCCESS)}))},t.prototype.batchClearRemoteHistoryMessages=function(t,e){var n=this;return new Promise((function(o,r){var i=t.map((function(t){return{conversation_type:t.conversationType,target_id:t.targetId,channel_id:t.channelId||"",send_time:t.timestamp}}));n._callCppProxy("deleteRemoteMessageBySendTimeInBatches",JSON.stringify(i),e||!1,(function(){setTimeout((function(){o(X.SUCCESS)}),0)}),(function(t){setTimeout((function(){o(t)}),0)}))}))},t.prototype.getMessage=function(t){var e=this;return new Promise((function(n){var o=e._callCppProxy("getMessage",t),r=e._buildMessage(o,{isOffLineMessage:!1});n({code:X.SUCCESS,data:r})}))},t.prototype.setMessageContent=function(t,e,n){var o=this;return new Promise((function(r){e=JSON.stringify(e),o._callCppProxy("setMessageContent",t,e,n),r(X.SUCCESS)}))},t.prototype.setMessageSearchField=function(t,e,n){var o=this;return new Promise((function(r){o._callCppProxy("setMessageSearchField",t,e,n),r(X.SUCCESS)}))},t.prototype.setMessageSentStatus=function(t,e){var n=this;return new Promise((function(o){n._callCppProxy("setMessageSentStatus",t,e),o(X.SUCCESS)}))},t.prototype.setMessageReceivedStatus=function(t,e){var n=this;return new Promise((function(o){n._callCppProxy("setMessageReceivedStatus",t,e),o(X.SUCCESS)}))},t.prototype.saveConversationMessageDraft=function(t,e,n,o){var r=this;return new Promise((function(i){r._callCppProxy("saveTextMessageDraft",t,e,n,o||"")&&i(X.SUCCESS),i(X.DRAFT_SAVE_ERROR)}))},t.prototype.getConversationMessageDraft=function(t,e,n){var o=this;return new Promise((function(r){var i=o._callCppProxy("getTextMessageDraft",t,e,n||"");r({code:X.SUCCESS,data:i})}))},t.prototype.clearConversationMessageDraft=function(t,e,n){var o=this;return new Promise((function(r){o._callCppProxy("clearTextMessageDraft",t,e,n||"")&&r(X.SUCCESS),r(X.DRAFT_REMOVE_ERROR)}))},t.prototype.pullConversationStatus=function(t){throw new Error("Method not implemented.")},t.prototype.batchSetConversationStatus=function(t){var e=t[0],n=e.conversationType,o=e.targetId,r=e.isTop,i=e.notificationStatus,s=e.channelId,a=e.isUpdateTime,_=void 0===a||a,c=this._callCppProxy("getConversationNotificationStatus",n,o,s||""),u=this._callCppProxy("getConversationTopStatus",n,o,s||""),E=Qt(i)?Boolean(c):i===St.OPEN,R=Qt(r)?Boolean(u):r;return this.setConversationStatus(n,o,E,R,s,_)},t.prototype.getConversationNotificationLevel=function(t,e,n){return Dt(this,void 0,void 0,(function(){var o;return Gt(this,(function(r){return o=this._callCppProxy("getBlockPushLevelForConversation",e,n,t),[2,Promise.resolve({code:X.SUCCESS,data:o})]}))}))},t.prototype.setConversationNotificationLevel=function(t,e,n,o){var r=this;return void 0===o&&(o=""),new Promise((function(i){r._callCppProxy("setBlockPushLevelForConversation",e,o,t,n,(function(){setTimeout((function(){i(X.SUCCESS)}),0)}),(function(t){setTimeout((function(){i(t)}),0)}))}))},t.prototype.batchSetConversationNotificationLevel=function(t,e){var n=this;return new Promise((function(o,r){var i=t.map((function(t){return{conversation_type:t.conversationType,target_id:t.targetId,channel_id:t.channelId,level:e}}));n._callCppProxy("setBlockPushLevelInBatches",JSON.stringify(i),(function(){setTimeout((function(){o(X.SUCCESS)}),0)}),(function(t){setTimeout((function(){o(t)}),0)}))}))},t.prototype.getTotalUnreadCountByLevels=function(t,e,n){if(n){var o=this._callCppProxy("getUnreadMentionedCountByLevel",t,e);return Promise.resolve({code:X.SUCCESS,data:o})}var r=this._callCppProxy("getUnreadCountByLevel",t,e);return Promise.resolve({code:X.SUCCESS,data:r})},t.prototype.pullUserSettings=function(t){throw new Error("Method not implemented.")},t.prototype.sendReadReceiptMessage=function(t,e,n){var o=this;return new Promise((function(r){o._callCppProxy("sendReadReceipt",t,n||"",e,(function(){e.forEach((function(t){o._updateReadReceiptInfo(t,{hasRespond:!0});try{var e=JSON.parse(o._callCppProxy("getMessage",t)).messageId;o.setMessageReceivedStatus(e,1)}catch(e){o.logger.error(Le.P_PARSE_JSON_MSGS_E,JSON.stringify({messageUId:t,error:null==e?void 0:e.stack}))}})),setTimeout((function(){r({code:X.SUCCESS})}),0)}),(function(t){setTimeout((function(){r({code:t})}),0)}))}))},t.prototype.getMessageReader=function(t,e,n){var o=this;return new Promise((function(r){o._callCppProxy("getMessageReader",t,n,e,(function(t,n){var i=[],s={};(t=JSON.parse(t)).list.forEach((function(t){var e=JSON.parse(t.obj),n=e.id,o=e.time;i.push({userId:n,readTime:o}),s[n]=o}));var a={readerInfo:s,readCount:i.length,totalCount:n};o._updateReadReceiptInfo(e,a),setTimeout((function(){r({code:X.SUCCESS,data:{list:i,totalMemberCount:n}})}),0)}),(function(t){setTimeout((function(){r({code:t})}),0)}))}))},t.prototype.sendReadReceiptMessageV4=function(t,e,n){var o=this;return new Promise((function(r){var i=t.conversationType,s=t.targetId,a=t.channelId;o._callCppProxy("sendMessageReadReceipt",i,s,a||"",e,n,(function(){setTimeout((function(){r({code:X.SUCCESS})}),0)}),(function(t){setTimeout((function(){r({code:t})}),0)}))}))},t.prototype.getMessageReadReceiptV4=function(t,e){var n=this;return new Promise((function(o){var r=t.targetId,i=t.channelId;n._callCppProxy("getMessageReadReceipt",r,i||"",e,(function(t,r,i){var s=[],a=n._callCppProxy("getMessage",e),_=JSON.parse(a);try{JSON.parse(i).list.forEach((function(t){var e=JSON.parse(t.obj),n=e.id,o=e.time;s.push({userId:n,readTime:o})}))}catch(t){n.logger.error(Le.P_PARSE_JSON_E,"method: getMessageReadReceipt, info: ".concat(i,", error: ").concat(t))}var c=JSON.parse(_.readReceiptRequest||"{}"),u=c.readerList,E=void 0===u?[]:u,R=c.readCount,l=void 0===R?0:R,d=!1;E.length<s.length&&(E=s,d=!0),l<r&&(l=r,d=!0),d&&n._callCppProxy("updateReadReceiptRequestInfo",e,JSON.stringify({readerList:E,readCount:l,totalCount:t})),setTimeout((function(){o({code:X.SUCCESS,data:{list:s,totalCount:t,readCount:l}})}),0)}),(function(t){setTimeout((function(){o({code:t})}),0)}))}))},t.prototype.updateConversationReadTime=function(t,e){var n=this;return new Promise((function(o){var r=t.conversationType,i=t.targetId,s=t.channelId;n._callCppProxy("updateConversationReadTime",r,i,s||"",e,(function(){setTimeout((function(){o({code:X.SUCCESS})}),0)}),(function(t){setTimeout((function(){o({code:t})}),0)}))}))},t.prototype._addChatroomCache=function(t,e,n,o){this._rmChatroomCache(t),this._chatroomCache.push({chatroomId:t,joinExist:n,count:e,extra:o})},t.prototype._rmChatroomCache=function(t){this._chatroomCache=this._chatroomCache.filter((function(e){return e.chatroomId!==t}))},t.prototype._try2RejoinChatroom=function(){var t=this;if(0!==this._chatroomCache.length){var e=this.logger.createTraceId();this._chatroomCache.forEach((function(n){return Dt(t,void 0,void 0,(function(){var t,o,r,i,s,a,_;return Gt(this,(function(c){switch(c.label){case 0:return t=n.chatroomId,o=n.joinExist,r=n.count,i=n.extra,this.logger.info(S.L_REJOIN_CHATROOM_T,t,e),[4,this._joinChrm(t,r,o,!1,i)];case 1:return s=c.sent(),a=s.code,_=s.data,a===X.SUCCESS?(this.logger.info(S.L_REJOIN_CHATROOM_R,t,e),this._sendChatroomStatus({rejoinedRoom:Ut({chatroomId:t,count:r},_)}),[2]):(a===X.RC_CHATROOM_USER_KICKED&&this._rmChatroomCache(t),this._sendChatroomStatus({rejoinedRoom:{chatroomId:t,errorCode:a}}),this.logger.warn(S.L_REJOIN_CHATROOM_R,"chrmId: ".concat(t,", code: ").concat(a),e),[2])}}))}))}))}},t.prototype._joinChrm=function(t,e,n,o,r){var i=this,s=n?"joinExistChatRoom":"joinChatRoom";return new Promise((function(a){o&&i._callCppProxy("clearMessages",Q.CHATROOM,t,""),i._callCppProxy(s,t,e,(function(o,s,_,c,u,E,R){i._addChatroomCache(t,e,n,r||""),setTimeout((function(){a({code:X.SUCCESS,data:{createTime:Number(o),memberCount:s,isAllChatroomBanned:_,isCurrentUserBanned:c,isCurrentChatroomBanned:u,isCurrentChatroomInWhitelist:E,joinTime:R}})}),0)}),(function(t){setTimeout((function(){a({code:t})}),0)}),r||"")}))},t.prototype.joinChatroom=function(t,e,n){return Dt(this,void 0,void 0,(function(){return Gt(this,(function(o){switch(o.label){case 0:return[4,this._joinChrm(t,e,!1,!0,n)];case 1:return[2,o.sent().code]}}))}))},t.prototype.joinExistChatroom=function(t,e,n){return this._joinChrm(t,e,!0,!0,n)},t.prototype.quitChatroom=function(t){var e=this;return this._rmChatroomCache(t),new Promise((function(n){e._callCppProxy("quitChatRoom",t,(function(){setTimeout((function(){n(X.SUCCESS)}),0)}),(function(t){setTimeout((function(){n(t)}),0)}))}))},t.prototype.getChatroomInfo=function(t,e,n){var o=this;return new Promise((function(r){o._callCppProxy("getChatroomInfo",t,e,n,(function(t,e){var n=t?JSON.parse(t).list:[],o=[];if(n.length>0)for(var i=0;i<n.length;i++)o.push(JSON.parse(n[i].obj));setTimeout((function(){r({code:X.SUCCESS,data:{userInfos:o,userCount:e}})}),0)}),(function(t){setTimeout((function(){r({code:t})}),0)}))}))},t.prototype.getChatroomHistoryMessages=function(t,e,n,o){var r=this;return new Promise((function(i){r._callCppProxy("getChatroomHistoryMessage",t,e,n,o,(function(t){var e;try{e=JSON.parse(t)}catch(t){e={list:[],hasMore:!1}}var n=e.list;if(n&&n.length)try{e.list=n.map((function(t){return r._buildMessage(t.obj)}))}catch(t){e.list=[]}setTimeout((function(){i({code:X.SUCCESS,data:e})}),0)}),(function(t){setTimeout((function(){i({code:t})}),0)}),"")}))},t.prototype.setChatroomEntry=function(t,e){var n=this;return new Promise((function(o){var r='[{"key":"'.concat(e.key,'", "value":"').concat(e.value,'"}]');n._callCppProxy("setChatroomKV",t,r,!!e.isAutoDelete,!!e.isOverwrite,(function(){setTimeout((function(){o(X.SUCCESS)}),0)}),(function(t){setTimeout((function(){o(t)}),0)}))}))},t.prototype.setChatroomEntries=function(t,e){var n=this;return new Promise((function(o){n._callCppProxy("setChatroomKV",t,JSON.stringify(e.entries),!!e.isAutoDelete,!!e.isOverwrite,(function(){o({code:X.SUCCESS})}),(function(t){o({code:t})}))}))},t.prototype.forceSetChatroomEntry=function(t,e){return e.isOverwrite=!0,e.userId=e.userId||this.tcpMgr.getCurrentUserId(),this.setChatroomEntry(t,e)},t.prototype.removeChatroomEntry=function(t,e){var n=this,o=[e.key];return new Promise((function(r){n._callCppProxy("deleteChatroomKV",t,o,!!e.isOverwrite,(function(){r(X.SUCCESS)}),(function(t){r(t)}))}))},t.prototype.forceRemoveChatroomEntry=function(t,e){return e.isOverwrite=!0,e.userId=e.userId||this.tcpMgr.getCurrentUserId(),this.removeChatroomEntry(t,e)},t.prototype.removeChatroomEntries=function(t,e){var n=this;return new Promise((function(o){var r=e.entries.map((function(t){return t.key}));n._callCppProxy("deleteChatroomKV",t,r,!!e.isOverwrite,(function(){o({code:X.SUCCESS})}),(function(t){o({code:t})}))}))},t.prototype.getChatroomEntry=function(t,e){return Dt(this,void 0,void 0,(function(){var n,o,r;return Gt(this,(function(i){switch(i.label){case 0:return[4,this.getAllChatroomEntry(t)];case 1:return n=i.sent(),o=n.code,r=n.data,o!==X.SUCCESS?[2,{code:o}]:r&&r[e]?[2,{code:o,data:r[e]}]:[2,{code:X.CHATROOM_KEY_NOT_EXIST}]}}))}))},t.prototype.getAllChatroomEntry=function(t){var e=this;return new Promise((function(n){e._callCppProxy("getChatroomKV",t,(function(t){var e={};try{(t?JSON.parse(t):{list:[]}).list.map((function(t){return JSON.parse(t.obj)})).forEach((function(t){e[t.key]=t.value?t.value:""}))}catch(t){}setTimeout((function(){n({code:X.SUCCESS,data:e})}),0)}),(function(t){setTimeout((function(){n({code:t})}),0)}))}))},t.prototype.removeChatroomFromCatch=function(t){this._rmChatroomCache(t)},t.prototype.getFileToken=function(t,e,n,o,r,i){var s=this;return n=n||"",o=o||"",r=r||"",new Promise((function(a){var _;_=o&&"uploads"!==o?e||"":oe(t,e);var c=s.getNaviInfoFromCache(),u={uploadDomain:ae(c,s.logger),env:s._environment};i=i?Math.ceil(i):0,s._callCppProxy("getUploadToken",t,_,n,o,r,JSON.stringify(u),i,(function(t,e,n,o,r,i,s,c,u,E,R,l,d,p,C,T,I,S,h,N,f,O,A){setTimeout((function(){a({code:X.SUCCESS,data:{token:t,deadline:0,bosToken:e,bosDate:n,path:o,osskeyId:r,ossPolicy:i,ossSign:s,ossBucketName:c,fileName:_,s3Credential:u,s3Algorithm:E,s3Date:R,s3Policy:l,s3Signature:d,s3BucketName:p,stcAuthorization:C,stcContentSha256:T,stcDate:I,stcBucketName:S,minioAuthorization:h,minioContentSha256:N,minioDate:f,minioBucketName:O,downloadAuthInfo:A?JSON.parse(A):null}})}),0)}),(function(t){setTimeout((function(){a({code:t})}),0)}))}))},t.prototype.getFileUrl=function(t,e,n,o){var r=this;return new Promise((function(i){var s=r.getNaviInfoFromCache(),a={url:ae(s,r.logger)};r._callCppProxy("getDownloadUrl",t,n,o,e-1,JSON.stringify(a),-1,(function(t){setTimeout((function(){i({code:X.SUCCESS,data:{downloadUrl:t}})}),0)}),(function(t){setTimeout((function(){i({code:t})}),0)}))}))},t.prototype.clearData=function(){var t=this;return new Promise((function(e){var n=t._callCppProxy("clearData");e({code:X.SUCCESS,data:n})}))},t.prototype.getDeviceId=function(){var t=this._dbpath;return vn(t)},t.prototype.getVoIPKey=function(t,e){var n=this;return new Promise((function(o){n._callCppProxy("getVoIPKey",t,e,"",(function(t){setTimeout((function(){o({code:X.SUCCESS,data:t})}),0)}),(function(t){setTimeout((function(){o({code:t})}),0)}))}))},t.prototype.bindRTCRoomForChatroom=function(t){var e=this;return new Promise((function(n){var o=t.chatRoomId,r=t.rtcRoomId;e._callCppProxy("bindRTCRoomForChatroom",o,r,(function(){setTimeout((function(){n(X.SUCCESS)}),0)}),(function(t){setTimeout((function(){n(t)}),0)}))}))},t.prototype.getGroupMessageDeliverList=function(t,e,n){var o=this;return new Promise((function(r){o._callCppProxy("getGroupMessageDeliverList",t,n,e,(function(t,e){var n=JSON.parse(t).list.map((function(t){return{time:JSON.parse(t.obj).time,userId:JSON.parse(t.obj).id}}));setTimeout((function(){r({code:X.SUCCESS,data:{totalCount:e,list:n}})}),0)}),(function(t){setTimeout((function(){r({code:t})}),0)}))}))},t.prototype.getPrivateMessageDeliverTime=function(t,e){var n=this;return new Promise((function(o){var r=n._callCppProxy("getMessageDeliverTime",t);if(r)o({code:X.SUCCESS,data:r});else{n._callCppProxy("getPrivateMessageDeliverList",e,t,(function(t){var e=0,n=JSON.parse(t).list;if(n.length>0){var r=JSON.parse(n[0].obj).time;e=r}setTimeout((function(){o({code:X.SUCCESS,data:e})}),0)}),(function(t){setTimeout((function(){o({code:t})}),0)}))}}))},t.prototype.rtcSignaling=function(t,e,n,o){var r=this;return new Promise((function(i){r._callCppProxy("rtcSignaling",t,e,n,o,(function(t){var e=Array.prototype.slice.call(t);i({code:X.SUCCESS,buffer:e})}),(function(t){i({code:t})}),30)}))},t.prototype._setRTCHeartbeatListener=function(){var t=this;Be.setRTCHeartbeatListener((function(e,n){var o=t.rtcHeartbeatResolves[e];if(o){var r=o.find((function(t){return""===t.seqId}));r&&(r.seqId=n)}}),(function(e,n,o,r){var i=t.rtcHeartbeatResolves[e];if(i){var s=i.findIndex((function(t){return t.seqId===o}));-1!==s&&i.splice(s,1)[0].resolve({code:n,data:{version:Number(r)}})}}))},t.prototype.rtcPing=function(t,e,n){var o=this;return new Promise((function(e){var n={resolve:e,seqId:""},r=o.rtcHeartbeatResolves[t];r?r.push(n):o.rtcHeartbeatResolves[t]=[n],o._callCppProxy("sendRTCHeartbeat",[t],30)}))},t.prototype.createTag=function(t){var e=this;return new Promise((function(n){e._callCppProxy("addTag",t.tagId,t.tagName,(function(){setTimeout((function(){n({code:X.SUCCESS})}),0)}),(function(t){setTimeout((function(){n({code:t})}),0)}))}))},t.prototype.removeTag=function(t){var e=this;return new Promise((function(n){e._callCppProxy("deleteTag",t,(function(){setTimeout((function(){n({code:X.SUCCESS})}),0)}),(function(t){setTimeout((function(){n({code:t})}),0)}))}))},t.prototype.updateTag=function(t){var e=this;return new Promise((function(n){e._callCppProxy("renameTag",t.tagId,t.tagName,(function(){setTimeout((function(){n({code:X.SUCCESS})}),0)}),(function(t){setTimeout((function(){n({code:t})}),0)}))}))},t.prototype.getTagList=function(){var t=this;return new Promise((function(e){var n=t._callCppProxy("getTags"),o=t._convertResultList(n,(function(t){return{tagId:t.tagId,tagName:t.tagName,conversationCount:t.conversationCount,createdTime:t.tagTime}}));e({code:X.SUCCESS,data:o})}))},t.prototype.addTagForConversations=function(t,e){var n=this;return new Promise((function(o){e.forEach((function(t){t.conversationType&&(t.type=t.conversationType)}));n._callCppProxy("addConversationsForTag",t,JSON.stringify(e),(function(){setTimeout((function(){o({code:X.SUCCESS})}),0)}),(function(t){setTimeout((function(){o({code:t})}),0)}))}))},t.prototype.removeTagForConversations=function(t,e){var n=this;return new Promise((function(o){e.forEach((function(t){t.conversationType&&(t.type=t.conversationType)})),n._callCppProxy("removeConversationsForTag",t,JSON.stringify(e),(function(){setTimeout((function(){o({code:X.SUCCESS})}),0)}),(function(t){setTimeout((function(){o({code:t})}),0)}))}))},t.prototype.removeTagsForConversation=function(t,e){var n=this;return new Promise((function(o){n._callCppProxy("removeTagsForConversation",t.conversationType,t.targetId,t.channelId||"",e,(function(){setTimeout((function(){o({code:X.SUCCESS})}),0)}),(function(t){setTimeout((function(){o({code:t})}),0)}))}))},t.prototype.getConversationListByTag=function(t,e,n,o){var r=this;return new Promise((function(i){var s=r._callCppProxy("getConversationsForTagByPage",t,e,n||20,o||""),a=r._convertResultList(s,(function(t){return Ut(Ut({},r._buildConversation(JSON.stringify(t))),{isTopInTag:t.topForTag})}));i({code:X.SUCCESS,data:a})}))},t.prototype.getUnreadCountByTag=function(t,e){var n=this;return new Promise((function(o){var r=n._callCppProxy("getConversationUnreadCountForTag",t,e);o({code:X.SUCCESS,data:r})}))},t.prototype.setConversationStatusInTag=function(t,e,n){var o=this;return new Promise((function(r){o._callCppProxy("setConversationToTopForTag",t,e.conversationType,e.targetId,e.channelId||"",n.isTop||!1,(function(){setTimeout((function(){r({code:X.SUCCESS})}),0)}),(function(t){setTimeout((function(){r({code:t})}),0)}))}))},t.prototype.getTagsForConversation=function(t){var e=this;return new Promise((function(n){var o=e._callCppProxy("getTagsForConversation",t.conversationType,t.targetId,t.channelId||""),r=e._convertResultList(o,(function(t){return{tagId:t.tagId,tagName:t.tagName,isTop:t.isTop,createdTime:t.tagTime}}));n({code:X.SUCCESS,data:r})}))},t.prototype.getBlockConversationList=function(){throw new Error("Method not implemented.")},t.prototype.getTopConversationList=function(t,e){var n=this;return new Promise((function(o){var r=Qt(e)?n._callCppProxy("getTopConversations",t):n._callCppProxy("getTopConversations",t,e),i=JSON.parse(r).list.map((function(t){return n._buildConversation(t.obj)}));o({code:X.SUCCESS,data:i})}))},t.prototype.getUnreadMentionedCount=function(t){throw new Error("Method not implemented.")},t.prototype.getAllUnreadMentionedCount=function(){var t=this;return new Promise((function(e){var n=t._callCppProxy("getUnreadAndMentionCount",[Q.GROUP],"");e({code:X.SUCCESS,data:n})}))},t.prototype.getOSInfo=function(){return Dt(this,void 0,void 0,(function(){var t;return Gt(this,(function(e){return t={arch:d.arch(),platform:d.platform(),type:d.type(),version:d.version(),release:d.release(),uptime:d.uptime(),cpus:d.cpus(),freemem:d.freemem(),totalmem:d.totalmem(),networkInterfaces:d.networkInterfaces()},[2,{code:X.SUCCESS,data:t}]}))}))},t.prototype.getMainProcessInfo=function(){return Dt(this,void 0,void 0,(function(){return Gt(this,(function(t){return[2,{code:X.SUCCESS,data:{title:process.title,pid:process.pid,ppid:process.ppid,platform:process.platform,arch:process.arch,uptime:process.uptime(),cpuUsage:process.cpuUsage(),memoryUsage:process.memoryUsage(),resourceUsage:process.resourceUsage()}}]}))}))},t.prototype.setCallInfo=function(t,e,n){var o=this;return new Promise((function(r){o._callCppProxy("callInfoSignaling",t,e,n,(function(t,e){setTimeout((function(){r({code:X.SUCCESS,data:{key:t,value:e}})}),0)}),(function(t){setTimeout((function(){r({code:t})}),0)}))}))},t.prototype.setProxy=function(t){return this.tcpMgr.getConnectionStatus()!==lt.DISCONNECTED?Promise.resolve({code:X.RC_CONN_PROXY_UNAVAILABLE}):Promise.resolve(Rn(t,this.logger))},t.prototype.getProxy=function(){return Promise.resolve(ln())},t.prototype.testProxy=function(t,e){return function(t,e,n){return new Promise((function(o){var r=/^https/.test(e)?cn:sn;n.info(S.A_TEST_PROXY_O,JSON.stringify({msg:"test proxy",proxy:t,testHost:e}));var i=r(e,t,(function(t){var e=200===t.statusCode?0:t.statusCode;t.setEncoding("utf8");var n="";t.on("data",(function(t){n+=t})),t.once("end",(function(){o({status:e||0,data:n})}))}));i.once("timeout",(function(){return o({status:0})})),i.once("error",(function(t){return o({status:0,data:t.stack})})),i.end()}))}(t,e,this.logger)},t.prototype.checkDuplicateMessage=function(t){var e=this;return new Promise((function(n){var o=e._callCppProxy("checkDuplicateMessage",t);n({code:X.SUCCESS,data:o})}))},t.prototype.subscribeUser=function(t,e,n){var o=this;return new Promise((function(r){o._callCppProxy("updateSubscribeStatus",e,Et.SUBSCRIBE,t,(function(){r({code:X.SUCCESS})}),(function(t,e){r({code:t,data:e})}),n)}))},t.prototype.unSubscribeUser=function(t,e){var n=this;return new Promise((function(o){n._callCppProxy("updateSubscribeStatus",e,Et.UNSUBSCRIBE,t,(function(){o({code:X.SUCCESS})}),(function(t){o({code:t})}),0)}))},t.prototype.getSubscribeUserList=function(t,e,n){var o=this._callCppProxy("getSubscribeUserList",t,e,n),r=this._buildSubscribeEventData(o).map((function(t){var e=t.userId,n=t.subscribeType,o=t.subscribeTime,r=t.expiry,i=t.details,s={userId:e,subscribeType:n,subscribeTime:o,expiry:r};return n===ut.ONLINE_STATUS&&(s.details=$t(i)),s}));return Promise.resolve({code:X.SUCCESS,data:r})},t.prototype.setDuplicateMessageConfig=function(t){var e=this._callCppProxy("setDuplicateMessageConfig",[Q.CHATROOM],bn.cuid,t);return Promise.resolve({code:e})},t.prototype.getSubscribeUserStatus=function(t,e){var n=this._callCppProxy("getSubscribeStatusByUserIds",t,e),o=this._buildSubscribeEventData(n).map((function(t){var e=t.userId,n=t.subscribeType,o=t.subscribeTime,r=t.expiry,i=t.details,s={userId:e,subscribeType:n,subscribeTime:o,expiry:r};return n===ut.ONLINE_STATUS&&(s.details=$t(i)),s}));return Promise.resolve({code:X.SUCCESS,data:o})},t.prototype.updateMyUserProfile=function(t){var e=this;return new Promise((function(n){var o=[],r=[];Object.keys(t).forEach((function(e){var n;if("extraProfile"===e&&t.extraProfile){if(t.extraProfile){var i=t.extraProfile;Object.keys(i).forEach((function(t){r.push(JSON.stringify({key:t,value:i[t]||""}))}))}}else o.push(JSON.stringify({key:e,value:(null===(n=t[e])||void 0===n?void 0:n.toString())||""}))})),e._callCppProxy("updateUserProfile",o,r,(function(t,e){n({code:t,data:{errorKey:e}})}))}))},t.prototype.getUserProfiles=function(t){var e=this;return new Promise((function(n){e._callCppProxy("getUserProfiles",t,(function(t,o){n({code:t,data:e._string2UserProfileInfoList(o)})}))}))},t.prototype.getMyUserProfile=function(){var t=this;return new Promise((function(e){t._callCppProxy("getOwnUserProfile",(function(n,o){e({code:n,data:t._string2userProfileInfo(o)})}))}))},t.prototype._string2userProfileInfo=function(t){var e;try{var n=JSON.parse(t),o=n.userProfile.reduce((function(t,e){var n=JSON.parse(e);return["gender","role","level"].includes(n.key)?t[n.key]=Number(n.value):t[n.key]=n.value,t}),{});return o.userId=n.userId,o.extraProfile=(null===(e=n.userExtProfile)||void 0===e?void 0:e.reduce((function(t,e){var n=JSON.parse(e);return t[n.key]=n.value,t}),{}))||{},o}catch(e){this.logger.error(Le.P_PARSE_JSON_USER_PROFILE_E,JSON.stringify({error:null==e?void 0:e.stack,str:t}))}return{}},t.prototype._string2UserProfileInfoList=function(t){var e=this;try{return JSON.parse(t).list.map((function(t){return e._string2userProfileInfo(t.obj)}))}catch(e){this.logger.error(Le.P_PARSE_JSON_USER_PROFILE_E,JSON.stringify({error:null==e?void 0:e.stack,str:t}))}return[]},t.prototype.updateMyUserProfileVisibility=function(t){var e=this;return new Promise((function(n){e._callCppProxy("updateUserProfilePermission",t,(function(){n({code:X.SUCCESS})}),(function(t){n({code:t})}))}))},t.prototype.getMyUserProfileVisibility=function(){var t=this;return new Promise((function(e){t._callCppProxy("getUserProfilePermission",(function(t,n){e({code:t,data:n})}))}))},t.prototype.searchUserProfileByUniqueId=function(t){var e=this;return new Promise((function(n){e._callCppProxy("getUserProfileByUniqueId",t,(function(t,o){n({code:t,data:e._string2userProfileInfo(o)})}))}))},t.prototype.getMatchedMessage=function(t,e,n,o){var r,i=this._callCppProxy("getMatchedMessage",t.conversationType,t.targetId,e,n,o,t.channelId||""),s=[];try{r=JSON.parse(i).list;for(var a=0;a<r.length;a++){var _=this._buildMessage(r[a].obj);s.push(_)}}catch(t){return this.logger.error(Le.P_PARSE_JSON_MSGS_E,i),Promise.resolve({code:X.MAIN_PROCESS_ERROR})}return Promise.resolve({code:X.SUCCESS,data:s})},t.prototype.getConversations=function(t){var e,n=this,o=t.map((function(t){var e=t.conversationType,n=t.targetId,o=t.channelId;return{targetId:n,channelId:void 0===o?"":o,type:e}})),r=this._callCppProxy("getConversations",JSON.stringify(o));try{e=JSON.parse(r).list.map((function(t){return n._buildConversation(t.obj)}))}catch(t){return this.logger.error(Le.P_PARSE_JSON_MSGS_E,r),Promise.resolve({code:X.MAIN_PROCESS_ERROR})}return Promise.resolve({code:X.SUCCESS,data:e})},t.prototype.handleErrorCode=function(t,e){t!==X.SUCCESS&&setTimeout((function(){return e(pe(t))}),0)},t.prototype._convertGroupInfoList=function(t,e){return t&&0!==t.length?t.map((function(t){var e=t.groupId,n=t.baseInfo,o=t.createTime,r=t.createUserId,i=t.extraInfo,s=t.memberCount,a=t.ownerId,_=t.remark,c=t.joinTime,u=t.role,E=ne(n),R=ne(i);return{groupId:e,groupName:E.name||"",portraitUri:E.portraitUrl||"",introduction:E.introduction||"",notice:E.announcement||"",joinPermission:~~E.joinPerm,removeMemberPermission:~~E.removePerm,invitePermission:~~E.memInvitePerm,inviteHandlePermission:~~E.invitePerm,groupInfoEditPermission:~~E.profilePerm,memberInfoEditPermission:~~E.memProfilePerm,extProfile:R,creatorId:r||"",ownerId:a||"",createTime:o||0,membersCount:s||0,remark:_||"",joinedTime:c||0,role:u||U.UNDEF}})):[]},t.prototype._convertUpdateGroupInfoList=function(t){return t&&0!==t.length?t.map((function(t){var e=t.groupId,n=t.baseInfo,o=t.createTime,r=t.createUserId,i=t.extraInfo,s=t.memberCount,a=t.ownerId,_=t.remark,c=t.joinTime,u=t.role,E=ne(n),R=ne(i);return Ut(Ut(Ut(Ut(Ut(Ut(Ut(Ut(Ut({groupId:e},function(t){return Ut(Ut(Ut(Ut(Ut(Ut(Ut(Ut(Ut(Ut({},t.name&&{groupName:t.name}),t.portraitUrl&&{portraitUri:t.portraitUrl}),t.introduction&&{introduction:t.introduction}),t.announcement&&{notice:t.announcement}),t.joinPerm&&{joinPermission:~~t.joinPerm}),t.removePerm&&{removeMemberPermission:~~t.removePerm}),t.memInvitePerm&&{invitePermission:~~t.memInvitePerm}),t.invitePerm&&{inviteHandlePermission:~~t.invitePerm}),t.profilePerm&&{groupInfoEditPermission:~~t.profilePerm}),t.memProfilePerm&&{memberInfoEditPermission:~~t.memProfilePerm})}(E)),i.length>0&&{extProfile:R}),r&&{creatorId:r}),a&&{ownerId:a}),o&&{createTime:o}),s&&{membersCount:s}),_&&{remark:_}),c&&{joinedTime:c}),u&&{role:u})})):[]},t.prototype._convertGroupMemberInfoList=function(t){return t&&0!==t.length?t.map((function(t){var e=t.userId,n=t.nickname,o=t.groupNickname,r=t.portraitUrl,i=t.joinTime;return{userId:e,name:n||"",portraitUri:r||"",nickname:o||"",role:t.role||0,joinedTime:i||0,extra:t.extra||""}})):[]},t.prototype.createGroup=function(t,e,n,o){return Dt(this,void 0,void 0,(function(){var r=this;return Gt(this,(function(i){return[2,new Promise((function(i){var s=Dn(e),a=Dn(n||{}),_=r._callCppProxy("createGroup",t,o,JSON.stringify(s),JSON.stringify(a),(function(t,e,n){t===X.SUCCESS?setTimeout((function(){i({code:t,data:{processCode:e}})}),0):setTimeout((function(){i({code:t,msg:null!=n?n:""})}),0)}));r.handleErrorCode(_,i)}))]}))}))},t.prototype.updateGroupInfo=function(t,e,n){return Dt(this,void 0,void 0,(function(){var o=this;return Gt(this,(function(r){return[2,new Promise((function(r){var i=Dn(e),s=Dn(null!=n?n:{}),a=o._callCppProxy("updateGroupInfo",t,JSON.stringify(i),JSON.stringify(s),(function(t,e){t===X.SUCCESS?setTimeout((function(){r({code:t})}),0):setTimeout((function(){r({code:t,msg:null!=e?e:""})}),0)}));o.handleErrorCode(a,r)}))]}))}))},t.prototype.getGroupsInfo=function(t){return Dt(this,void 0,void 0,(function(){var e=this;return Gt(this,(function(n){return[2,new Promise((function(n){var o=e._callCppProxy("getGroupInfoByIds",t,(function(t,o,r,i){if(t===X.SUCCESS){var s=[];try{s=JSON.parse(i)}catch(t){e.logger.error(Le.P_PARSE_JSON_MSGS_E,i),setTimeout((function(){n({code:X.MAIN_PROCESS_ERROR})}),0)}setTimeout((function(){n({code:X.SUCCESS,data:e._convertGroupInfoList(s)})}),0)}else setTimeout((function(){n({code:t})}),0)}));e.handleErrorCode(o,n)}))]}))}))},t.prototype.kickGroupMembers=function(t,e,n){return Dt(this,void 0,void 0,(function(){var o=this;return Gt(this,(function(r){return[2,new Promise((function(r){var i=Gn(n),s=o._callCppProxy("kickOutGroupMember",t,e,JSON.stringify(i),(function(t,e){setTimeout((function(){r({code:t})}),0)}));o.handleErrorCode(s,r)}))]}))}))},t.prototype.quitGroup=function(t,e){return Dt(this,void 0,void 0,(function(){var n=this;return Gt(this,(function(o){return[2,new Promise((function(o){var r=Gn(e),i=n._callCppProxy("quitGroup",t,JSON.stringify(r),(function(t,e){setTimeout((function(){o({code:t})}),0)}));n.handleErrorCode(i,o)}))]}))}))},t.prototype.dismissGroup=function(t){return Dt(this,void 0,void 0,(function(){var e=this;return Gt(this,(function(n){return[2,new Promise((function(n){var o=e._callCppProxy("disbandGroup",t,(function(t,e){setTimeout((function(){n({code:t})}),0)}));e.handleErrorCode(o,n)}))]}))}))},t.prototype.transferGroupOwner=function(t,e,n,o){return Dt(this,void 0,void 0,(function(){var r=this;return Gt(this,(function(i){return[2,new Promise((function(i){var s=Gn(o),a=r._callCppProxy("transferGroup",t,e,n,JSON.stringify(s),(function(t,e){setTimeout((function(){i({code:t})}),0)}));r.handleErrorCode(a,i)}))]}))}))},t.prototype.setGroupManagers=function(t,e,n){return Dt(this,void 0,void 0,(function(){var o=this;return Gt(this,(function(r){return[2,new Promise((function(r){var i=o._callCppProxy("updateGroupAdmins",e,n,t,(function(t,e){setTimeout((function(){r({code:t})}),0)}));o.handleErrorCode(i,r)}))]}))}))},t.prototype.getGroupMembersByRole=function(t,e,n){return Dt(this,void 0,void 0,(function(){var o=this;return Gt(this,(function(r){return[2,new Promise((function(r){var i=e===U.UNDEF?[1,2,3]:[e],s=o._callCppProxy("getGroupMembers",t,i,n.pageToken||"",n.count,n.order?1:0,(function(t,e,n,i){if(t===X.SUCCESS){var s=[];try{s=JSON.parse(i)}catch(t){o.logger.error(Le.P_PARSE_JSON_MSGS_E,i),setTimeout((function(){r({code:X.MAIN_PROCESS_ERROR})}),0)}var a=o._convertGroupMemberInfoList(s);setTimeout((function(){r({code:X.SUCCESS,data:{totalCount:null!=n?n:0,data:a,pageToken:null!=e?e:""}})}),0)}else setTimeout((function(){r({code:t})}),0)}));o.handleErrorCode(s,r)}))]}))}))},t.prototype.getGroupMembers=function(t,e){return Dt(this,void 0,void 0,(function(){var n=this;return Gt(this,(function(o){return[2,new Promise((function(o){var r=n._callCppProxy("getGroupMembersByIds",t,e,(function(t,e,r,i){if(t===X.SUCCESS){var s=[];try{s=JSON.parse(i)}catch(t){n.logger.error(Le.P_PARSE_JSON_MSGS_E,i),setTimeout((function(){o({code:X.MAIN_PROCESS_ERROR})}),0)}var a=n._convertGroupMemberInfoList(s);setTimeout((function(){o({code:X.SUCCESS,data:a})}),0)}else setTimeout((function(){o({code:t})}),0)}));n.handleErrorCode(r,o)}))]}))}))},t.prototype.setGroupMemberInfo=function(t,e,n,o){return Dt(this,void 0,void 0,(function(){var r=this;return Gt(this,(function(i){return[2,new Promise((function(i){var s=r._callCppProxy("updateGroupMemberInfo",t,e,n,o||"",(function(t,e){setTimeout((function(){i({code:t})}),0)}));r.handleErrorCode(s,i)}))]}))}))},t.prototype.searchGroupMembers=function(t,e,n){return Dt(this,void 0,void 0,(function(){var o=this;return Gt(this,(function(r){return[2,new Promise((function(r){var i=n.order?1:0,s=o._callCppProxy("getGroupMembersByNickname",t,e,n.pageToken||"",n.count,i,(function(t,e,n,i){if(t===X.SUCCESS){var s=[];try{s=JSON.parse(i)}catch(t){o.logger.error(Le.P_PARSE_JSON_MSGS_E,i),setTimeout((function(){r({code:X.MAIN_PROCESS_ERROR})}),0)}var a=o._convertGroupMemberInfoList(s);setTimeout((function(){r({code:X.SUCCESS,data:{data:a,pageToken:e,totalCount:n}})}),0)}else setTimeout((function(){r({code:t})}),0)}));o.handleErrorCode(s,r)}))]}))}))},t.prototype.joinGroup=function(t){return Dt(this,void 0,void 0,(function(){var e=this;return Gt(this,(function(n){return[2,new Promise((function(n){var o=e._callCppProxy("joinGroup",t,(function(t,e,o){t===X.SUCCESS?setTimeout((function(){n({code:t,data:{processCode:e}})}),0):setTimeout((function(){n({code:t})}),0)}));e.handleErrorCode(o,n)}))]}))}))},t.prototype.inviteUsersToGroup=function(t,e){return Dt(this,void 0,void 0,(function(){var n=this;return Gt(this,(function(o){return[2,new Promise((function(o){var r=n._callCppProxy("inviteUsersToGroup",t,e,(function(t,e,n){t===X.SUCCESS?setTimeout((function(){o({code:t,data:{processCode:e}})}),0):setTimeout((function(){o({code:t})}),0)}));n.handleErrorCode(r,o)}))]}))}))},t.prototype.memberInviteResponse=function(t){return Dt(this,void 0,void 0,(function(){var e=this;return Gt(this,(function(n){return[2,new Promise((function(n){var o=t.groupId,r=t.inviterId,i=t.optType,s=t.optResult,a=t.joinUserId,_=t.reason,c=1===i?1:0,u=c&&a?a:"",E=e._callCppProxy("handleGroupInvite",o,u,r,s,c,null!=_?_:"",(function(t,e,o){t===X.SUCCESS?setTimeout((function(){n({code:t,data:{processCode:e}})}),0):setTimeout((function(){n({code:t})}),0)}));e.handleErrorCode(E,n)}))]}))}))},t.prototype.getGroupApplications=function(t,e,n){return void 0===e&&(e=[]),void 0===n&&(n=[]),Dt(this,void 0,void 0,(function(){var o=this;return Gt(this,(function(r){return[2,new Promise((function(r){var i=t.order?1:0,s=o._callCppProxy("getGroupRequests",e,n,"",t.pageToken||"",t.count,i,(function(t,e,n,i){if(t===X.SUCCESS){var s=[];try{s=JSON.parse(i)}catch(t){o.logger.error(Le.P_PARSE_JSON_MSGS_E,i),setTimeout((function(){r({code:X.MAIN_PROCESS_ERROR})}),0)}var a=s.map((function(t){var e=t.groupId,n=t.joinUser,o=t.approverUser,r=t.inviterUser,i=t.type;return{groupId:e,joinMemberInfo:n,inviterInfo:r,operatorInfo:o,status:t.status,direction:t.direction,type:i,operationTime:t.operateTime,reason:t.remark}}));setTimeout((function(){r({code:t,data:{totalCount:n,data:a,pageToken:e}})}),0)}else setTimeout((function(){r({code:t})}),0)}));o.handleErrorCode(s,r)}))]}))}))},t.prototype.getJoinedGroupsByRole=function(t,e){return Dt(this,void 0,void 0,(function(){var n=this;return Gt(this,(function(o){return[2,new Promise((function(o){var r=e.order?1:0,i=t===U.UNDEF?[1,2,3]:[t],s=n._callCppProxy("getGroups",i,e.pageToken||"",e.count,r,(function(t,e,r,i){if(t===X.SUCCESS){var s=[];try{s=JSON.parse(i)}catch(t){n.logger.error(Le.P_PARSE_JSON_MSGS_E,i),setTimeout((function(){o({code:X.MAIN_PROCESS_ERROR})}),0)}var a=n._convertGroupInfoList(s);setTimeout((function(){o({code:t,data:{totalCount:r,data:a,pageToken:e}})}),0)}else setTimeout((function(){o({code:t})}),0)}));n.handleErrorCode(s,o)}))]}))}))},t.prototype.searchJoinedGroups=function(t,e){return Dt(this,void 0,void 0,(function(){var n=this;return Gt(this,(function(o){return[2,new Promise((function(o){var r=e.order?1:0,i=n._callCppProxy("getGroupsByGroupName",t,e.pageToken||"",e.count,r,(function(t,e,r,i){if(t===X.SUCCESS){var s=[];try{s=JSON.parse(i)}catch(t){n.logger.error(Le.P_PARSE_JSON_MSGS_E,i),setTimeout((function(){o({code:X.MAIN_PROCESS_ERROR})}),0)}var a=n._convertGroupInfoList(s);setTimeout((function(){o({code:t,data:{totalCount:r,data:a,pageToken:e}})}),0)}else setTimeout((function(){o({code:t})}),0)}));n.handleErrorCode(i,o)}))]}))}))},t.prototype.getJoinedGroups=function(t){return Dt(this,void 0,void 0,(function(){var e=this;return Gt(this,(function(n){return[2,new Promise((function(n){var o=e._callCppProxy("getGroupsByIds",t,(function(t,o,r,i){if(t===X.SUCCESS){var s=[];try{s=JSON.parse(i)}catch(t){e.logger.error(Le.P_PARSE_JSON_MSGS_E,i),setTimeout((function(){n({code:X.MAIN_PROCESS_ERROR})}),0)}var a=e._convertGroupInfoList(s);setTimeout((function(){n({code:t,data:a})}),0)}else setTimeout((function(){n({code:t})}),0)}));e.handleErrorCode(o,n)}))]}))}))},t.prototype.setGroupRemark=function(t,e){return Dt(this,void 0,void 0,(function(){var n=this;return Gt(this,(function(o){return[2,new Promise((function(o){var r=e?V.ADD:V.REMOVE,i=n._callCppProxy("updateGroupRemark",t,e||"",r,(function(t,e){setTimeout((function(){o({code:t})}),0)}));n.handleErrorCode(i,o)}))]}))}))},t.prototype.setGroupFollows=function(t,e,n){return Dt(this,void 0,void 0,(function(){var o=this;return Gt(this,(function(r){return[2,new Promise((function(r){var i=o._callCppProxy("updateFavoriteMembers",e,n,t,(function(t,e){setTimeout((function(){r({code:t})}),0)}));o.handleErrorCode(i,r)}))]}))}))},t.prototype.getGroupFollows=function(t){return Dt(this,void 0,void 0,(function(){var e=this;return Gt(this,(function(n){return[2,new Promise((function(n){var o=e._callCppProxy("getGroupFavoriteMembers",t,"",1e3,0,(function(t,o,r,i){if(t===X.SUCCESS){var s=[];try{s=JSON.parse(i)}catch(t){e.logger.error(Le.P_PARSE_JSON_MSGS_E,i),setTimeout((function(){n({code:X.MAIN_PROCESS_ERROR})}),0)}var a=s.map((function(t){return{userId:t.userId,time:t.followTime}}));setTimeout((function(){n({code:X.SUCCESS,data:a})}),0)}else setTimeout((function(){n({code:t})}),0)}));e.handleErrorCode(o,n)}))]}))}))},t.prototype.addFriend=function(t,e,n){var o=this;return new Promise((function(r){var i=o._callCppProxy("addFriend",t,e,n,(function(t,e,n){setTimeout((function(){r({code:t})}),0)}));o.handleErrorCode(i,r)}))},t.prototype.deleteFriends=function(t,e){var n=this;return new Promise((function(o){var r=n._callCppProxy("removeFriends",t,e,(function(t,e){setTimeout((function(){o({code:t})}),0)}));n.handleErrorCode(r,o)}))},t.prototype.acceptFriendApplication=function(t){var e=this;return new Promise((function(n){var o=e._callCppProxy("acceptFriendRequest",t,"",(function(t,e){setTimeout((function(){n({code:t})}),0)}));e.handleErrorCode(o,n)}))},t.prototype.refuseFriendApplication=function(t,e){var n=this;return new Promise((function(o){var r=n._callCppProxy("rejectFriendRequest",t,e||"",(function(t,e){setTimeout((function(){o({code:t})}),0)}));n.handleErrorCode(r,o)}))},t.prototype.setFriendInfo=function(t,e,n){var o=this;return new Promise((function(r){var i=Dn(null!=n?n:{}),s=o._callCppProxy("setFriendInfo",t,e,JSON.stringify(i),(function(t,e){setTimeout((function(){r({code:t})}),0)}));o.handleErrorCode(s,r)}))},t.prototype.checkFriends=function(t,e){var n=this;return new Promise((function(o){var r=n._callCppProxy("checkFriendRelationship",t,e,(function(t,e){if(t===X.SUCCESS){var n=JSON.parse(e).map((function(t){return{userId:t.userId,relationType:t.status}}));setTimeout((function(){o({code:t,data:n})}),0)}else setTimeout((function(){o({code:t})}),0)}));n.handleErrorCode(r,o)}))},t.prototype.getFriends=function(t){var e=this;return new Promise((function(n){var o=e._callCppProxy("getFriends",t,0,(function(t,o){try{if(t===X.SUCCESS){var r=JSON.parse(o),i=e._convertFriendInfo(r);setTimeout((function(){n({code:t,data:{data:i,pageToken:""}})}),0)}else setTimeout((function(){n({code:t})}),0)}catch(t){e.logger.error(Le.P_PARSE_JSON_MSGS_E,o),setTimeout((function(){n({code:X.MAIN_PROCESS_ERROR})}),0)}}));e.handleErrorCode(o,n)}))},t.prototype.getFriendApplications=function(t,e,n){var o=this;return new Promise((function(r){var i=t.order?1:0,s=3;e&&1===e.length&&(s=null==e?void 0:e[0]);var a=o._callCppProxy("getFriendRequestListByPage",s,n||[0,1,2,3],t.count,t.pageToken||"",i,(function(t,e,n){if(t===X.SUCCESS){var i=[];try{i=JSON.parse(n)}catch(t){o.logger.error(Le.P_PARSE_JSON_MSGS_E,n),setTimeout((function(){r({code:X.MAIN_PROCESS_ERROR})}),0)}var s=i.map((function(t){return{userId:t.userId,name:t.name,portraitUri:t.portraitUrl,applicationType:t.friendRequestType,applicationStatus:t.friendRequestStatus,operationTime:t.operateTime,remark:t.extra}}));setTimeout((function(){r({code:t,data:{data:s,pageToken:null!=e?e:""}})}),0)}else setTimeout((function(){r({code:t})}),0)}));o.handleErrorCode(a,r)}))},t.prototype.deleteFriendApplication=function(t,e){return Promise.resolve({code:X.NOT_SUPPORT})},t.prototype._convertFriendInfo=function(t){return t.map((function(t){var e=t.userId,n=t.userName,o=t.remark;return{userId:e,name:n,portraitUri:t.portraitUrl,remark:o,directionType:t.friendType,extProfile:t.extProfiles,addTime:t.addTime,inBlackList:!!t.friendAttribute}}))},t.prototype.getFriendsInfo=function(t){var e=this;return new Promise((function(n){var o=e._callCppProxy("getFriendByIds",t,(function(t,o){if(t===X.SUCCESS){var r=JSON.parse(o),i=e._convertFriendInfo(r);setTimeout((function(){n({code:t,data:i})}),0)}else setTimeout((function(){n({code:t})}),0)}));e.handleErrorCode(o,n)}))},t.prototype.searchFriendsInfo=function(t){var e=this;return new Promise((function(n){var o=e._callCppProxy("getFriendByNickname",t,(function(t,o){if(t===X.SUCCESS)try{var r=JSON.parse(o),i=e._convertFriendInfo(r);setTimeout((function(){n({code:X.SUCCESS,data:i})}),0)}catch(t){e.logger.error(Le.P_PARSE_JSON_MSGS_E,o),setTimeout((function(){n({code:X.MAIN_PROCESS_ERROR})}),0)}else setTimeout((function(){n({code:t})}),0)}));e.handleErrorCode(o,n)}))},t.prototype.setFriendAddPermission=function(t){var e=this;return new Promise((function(n){var o=e._callCppProxy("setFriendAuthPermission",t,(function(t,e){setTimeout((function(){n({code:t})}),0)}));e.handleErrorCode(o,n)}))},t.prototype.getFriendAddPermission=function(){var t=this;return new Promise((function(e){var n=t._callCppProxy("getFriendAuthPermission",(function(t,n){setTimeout((function(){e({code:t,data:n})}),0)}));t.handleErrorCode(n,e)}))},t.prototype.setNotificationQuietHoursWithSetting=function(t){var e=t.startTime,n=t.spanMinutes,o=t.level,r=t.timezone,i=Bn.create(this.logger,"addPushSetting");return i.invoke(e,n,o,r||"",(function(){return i.ok()}),(function(t){return i.fail(t)})).result()},t.prototype.removeNotificationQuietHoursSetting=function(){var t=Bn.create(this.logger,"removePushSetting");return t.invoke((function(){return t.ok()}),(function(e){return t.fail(e)})).result()},t.prototype.getNotificationQuietHoursSetting=function(){var t=Bn.create(this.logger,"queryPushSetting");return t.invoke((function(e,n,o,r){var i={startTime:e,spanMinutes:n,level:o,timezone:r};t.ok(i)}),(function(e){return t.fail(e)})).result()},t.prototype.setDataBaseLogConfig=function(t){this._callCppProxy("setDataBaseLogConfig",t)},t}();process.title="".concat(function(t){var e=t.lastIndexOf("/");return-1!==e?t.substring(e+1):t}(process.title)," PsService"),function(t){var e=this,n=bt(t.argv.slice(2),5),o=n[0],r=n[1],i=n[2],s=n[3],a=n[4],_="true"===i,c=Ve(t),u=c.sendCallback,E=c.sendError,R=c.sendEvent,l=c.sendResponse,d=Be?new kn(o,r,R,_,~~s,"true"===a):null;t.on("message",(function(t){return Dt(e,void 0,void 0,(function(){var e,n,o,r,i,s;return Gt(this,(function(a){switch(a.label){case 0:return e=t.reqId,n=t.method,o=t.args,r=t.hasResponse,d?r?("sendMessage"===n&&(i=o[3],o[3]=function(t){u({reqId:i,data:t})}),[4,d.callProxy.apply(d,Ft([n],bt(o),!1))]):[3,2]:[2,l({reqId:e,success:!0,data:{code:X.ADDON_NOT_EXIST,msg:"Cannot find module ".concat(be)}})];case 1:return s=a.sent(),l({reqId:e,success:true,data:s}),[3,3];case 2:d.sendProxy.apply(d,Ft([n],bt(o),!1)),a.label=3;case 3:return[2]}}))}))})),t.on("beforeExit",(function(t){null==d||d.destroy()})),t.on("uncaughtException",(function(t){E("uncaughtException ".concat(t.stack||t.toString()))})),t.on("unhandledRejection",(function(t){E("unhandledRejection ".concat(t.stack))}))}(process);
1
+ "use strict";var t=require("os"),e=require("path"),n=require("child_process"),o=require("http"),r=require("https"),i=require("zlib"),s=require("url"),a=require("net"),_=require("events"),c=require("tls"),u=require("fs"),E=require("crypto");function R(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}function l(t){if(t&&t.__esModule)return t;var e=Object.create(null);return t&&Object.keys(t).forEach((function(n){if("default"!==n){var o=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,o.get?o:{enumerable:!0,get:function(){return t[n]}})}})),e.default=t,Object.freeze(e)}var d=l(t),p=R(i),C=function(t,e){return C=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},C(t,e)};function T(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}C(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var I,S,h,N,f,O,A,g,P,v,L,m,y,M,U,D,G,V,b,F,w,x,B,k,H,J,Y,W,K,j,X,Q,q,Z,z,$,tt,et,nt,ot,rt,it,st,at,_t,ct,ut,Et,Rt,lt,dt,pt,Ct,Tt,It,St,ht,Nt,ft,Ot,At,gt,Pt,vt,Lt,mt,yt,Mt,Ut=function(){return Ut=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},Ut.apply(this,arguments)};function Dt(t,e,n,o){return new(n||(n=Promise))((function(r,i){function s(t){try{_(o.next(t))}catch(t){i(t)}}function a(t){try{_(o.throw(t))}catch(t){i(t)}}function _(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}_((o=o.apply(t,e||[])).next())}))}function Gt(t,e){var n,o,r,i,s={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,o&&(r=2&i[0]?o.return:i[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,i[1])).done)return r;switch(o=0,r&&(i=[2&i[0],r.value]),i[0]){case 0:case 1:r=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,o=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(r=s.trys,(r=r.length>0&&r[r.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!r||i[1]>r[0]&&i[1]<r[3])){s.label=i[1];break}if(6===i[0]&&s.label<r[1]){s.label=r[1],r=i;break}if(r&&s.label<r[2]){s.label=r[2],s.ops.push(i);break}r[2]&&s.ops.pop(),s.trys.pop();continue}i=e.call(t,s)}catch(t){i=[6,t],o=0}finally{n=r=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}}function Vt(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],o=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&o>=t.length&&(t=void 0),{value:t&&t[o++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function bt(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var o,r,i=n.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(o=i.next()).done;)s.push(o.value)}catch(t){r={error:t}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return s}function Ft(t,e,n){if(n||2===arguments.length)for(var o,r=0,i=e.length;r<i;r++)!o&&r in e||(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))}!function(t){t[t.QINIU=1]="QINIU",t[t.ALI=2]="ALI",t[t.AWS=3]="AWS",t[t.STC=4]="STC",t[t.MINIO=5]="MINIO"}(I||(I={})),function(t){t.L_IMSDK_VER_O="L-imsdk_ver-O",t.A_INIT_O="A-init-O",t.A_INIT_REPEAT_O="A_INIT_REPEAT_O",t.L_INIT_O="L-init-O",t.A_DESTROY_O="A_DESTROY_O",t.L_DESTROY_O="L_DESTROY_O",t.A_CONNECT_T="A-connect-T",t.A_CONNECT_R="A-connect-R",t.A_CONNECT_S="A-connect-S",t.A_DISCONNECT_O="A-disconnect-O",t.A_RECONNECT_T="A-reconnect-T",t.A_RECONNECT_R="A_RECONNECT_R",t.L_CONNECT_T="L-connect-T",t.L_CONNECT_R="L-connect-R",t.L_CONNECT_S="L-connect-S",t.L_DB_UPGRATE_START_S="L-db_upgrate_start-S",t.L_DB_UPGRATING_S="L-db_upgrating-S",t.L_DB_UPGRATE_COMPLETE_S="L-db_upgrate_complete-S",t.L_NOTIFY_ULTRA_ONLINE_S="L-notify-ultra-online-S",t.L_ULTRA_SYNC_DONE_S="L-ultra-sync-done-S",t.L_BATCH_MESSAGE_O="L-BATCH_MESSAGE-O",t.A_MSG_LISTENER_E="A-MSG_LISTENER-E",t.O="L-original-O",t.T="L-TEST-O",t.L_INSTALL_PLUGIN_T="L-INSTALL_PLUGIN-T",t.L_INSTALL_PLUGIN_R="L-INSTALL_PLUGIN-R",t.L_NAVI_CONF_E="L-NAVI_CONF_ERROR-E",t.L_NAVI_CMP_R="L-NAVI_CPM-R",t.A_SEND_MSG_T="A-send_msg-T",t.A_SEND_MSG_R="A-send_msg-R",t.L_SEND_MSG_T="L-send_msg-T",t.L_SEND_MSG_R="L-send_msg-R",t.L_PULL_MSG_T="L-pull_msg-T",t.L_PULL_MSG_R="L-pull_msg-R",t.L_PULL_MSG_E="L-pull_msg-E",t.L_PULL_MSG_O="L-pull_msg-O",t.L_PULL_ULTRA_MSG_T="L-pull_ultra_msg-T",t.L_PULL_ULTRA_MSG_R="L-pull_ultra_msg-R",t.L_PULL_CHATROOM_KV_T="L-pull_chatroom_kv-T",t.L_PULL_CHATROOM_KV_R="L-pull_chatroom_kv-R",t.L_PULL_CHATROOM_MSG_T="L-pull_chatroom_msg-T",t.L_PULL_CHATROOM_MSG_R="L-pull_chatroom_msg-R",t.L_RECV_MULTI_SYNC_MSG_O="L-recv_multi_sync_msg-O",t.L_RECV_S_MSG_O="L-recv_s_msg-O",t.A_DELETE_MESSAGES_S="A-delete_messages-S",t.P_DELETE_MSG_S="P-delete_msg-S",t.L_PULL_CONVERSATION_S="L-pull_conversation-S",t.L_RECALL_ULTRA_MSG_S="L-recall_ultra_msg-S",t.A_REGTYP_O="A-regtyp-O",t.P_REGTYP_E="P-regtype-E",t.L_GET_NAVI_T="L-get_navi-T",t.L_GET_NAVI_R="L-get_navi-R",t.L_REQUEST_T="L-request-T",t.L_REQUEST_R="L-request-R",t.L_PARSE_NAVI_E="L-parse_navi-E",t.L_ENV_S="L-Env-S",t.L_GET_INDEX_NAVI_S="L-get_index_navi-S",t.A_JOIN_CHATROOM_T="A-join_chatroom-T",t.A_JOIN_CHATROOM_R="A-join_chatroom-R",t.L_JOIN_CHATROOM_T="L-join_chatroom-T",t.L_JOIN_CHATROOM_R="L-join_chatroom-R",t.A_QUIT_CHATROOM_T="A-quit_chatroom-T",t.A_QUIT_CHATROOM_R="A-quit_chatroom-R",t.L_REJOIN_CHATROOM_T="L-rejoin_chatroom-T",t.L_REJOIN_CHATROOM_R="L-rejoin_chatroom-R",t.L_REJOIN_CHATROOM_S="L-rejoin_chatroom-S",t.L_MEDIA_S="L-media-S",t.L_MEDIA_UPLOAD_T="L-media_upload-T",t.L_MEDIA_UPLOAD_R="L-media_upload-R",t.G_UPLOAD_LOG_S="G-upload_log-S",t.G_REPORT_LOG_S="G-report_log-S",t.G_UPLOAD_LOG_E="G-upload_log-E",t.G_GET_REAL_TIMELOG_COMMAND_S="G-get_real_timelog_command-S",t.L_CHECK_ALIVE_IM_T="L-check_alive_im-T",t.L_CHECK_ALIVE_IM_R="L-check_alive_im-R",t.L_CHECK_ALIVE_IM_S="L-check_alive_im-S",t.A_GET_HISTORY_MSG_T="A-get_history_msg-T",t.A_GET_HISTORY_MSG_R="A-get_history_msg-R",t.L_GET_HISTORY_MSG_T="L-get_history_msg-T",t.L_GET_HISTORY_MSG_R="L-get_history_msg-R",t.A_GET_PRIVATE_MESSAGE_DELIVER_TIME_E="A-get_privage_message_deliver_time-E",t.A_GET_GROUP_MESSAGE_DELIVER_LIST_E="A-get_group_message_deliver_list-E",t.A_CALLBACK_O="A-callback-O",t.A_CALLBACK_E="A-callback-E",t.L_CALLBACK_E="L-callback-E",t.A_SEND_MESSAGE_READ_RECEIPT_V4_T="A-send_message_read_receipt_V4-T",t.A_SEND_MESSAGE_READ_RECEIPT_V4_R="A-send_message_read_receipt_V4-R",t.A_GET_MESSAGE_READ_RECEIPT_V4_T="A-get_message_read_receipt_V4-T",t.A_GET_MESSAGE_READ_RECEIPT_V4_R="A-get_message_read_receipt_V4-R",t.A_BATCH_GET_MESSAGE_READ_RECEIPT_INFO_V4_T="A-batch_get_message_read_receipt_info_V4-T",t.A_BATCH_GET_MESSAGE_READ_RECEIPT_INFO_V4_R="A-batch_get_message_read_receipt_info_V4-R",t.A_SYNC_READ_STATUS_T="A-sync_read_status-T",t.A_SYNC_READ_STATUS_R="A-sync_read_status-R",t.A_GET_TOP_CONVERSATION_LIST_E="A-get_top_conversation_list-E",t.L_PB_ENCODE_E="L-pb-encode-E",t.L_PB_DECODE_E="L-pb-decode-E",t.L_NOTIFY_NAVI_CHANGE_E="L-notify_navi_change-E",t.L_REPORT_FULL_LOG_O="L-report_full_log-O",t.L_REPORT_FULL_LOG_T="L-report_full_log-T",t.L_REPORT_FULL_LOG_R="L-report_full_log-R",t.L_REPORT_LOG_POLICY_E="L-parse_navi_logpolicy-E",t.L_UNSUPPORT_INDEXDB_O="L-unsupport_IndexDB-O",t.L_LOGDB_OPEN_FAILED_E="L-logDB_open_failed-E",t.L_LOGDB_CLOSED_S="L-logDB_closed-S",t.L_LOGDB_ERROR_E="L-logDB_error-S",t.L_LOGDB_ABORT_S="L-logDB_abort-S",t.L_REALTIME_LOG_R="L_REALTIME_LOG_R",t.L_REALTIME_LOG_O="L_REALTIME_LOG_O",t.L_REALTIME_LOG_T="L_REALTIME_LOG_T",t.L_STATISTIC_LOG_R="L_STATISTIC_LOG_R",t.L_STATISTIC_LOG_O="L_STATISTIC_LOG_O",t.L_STATISTIC_LOG_T="L_STATISTIC_LOG_T",t.L_UNKNOWN_TOPIC_E="L_UNKNOWN_TOPIC_E",t.L_RECV_RMTP_O="L_RECV_RMTP_O",t.L_RECV_RMTP_E="L_RECV_RMTP_E",t.L_RECV_S_NTF_O="L-recv_s_ntf_O",t.L_VER_REPORT_T="L-VER_REPORT-T",t.L_VER_REPORT_R="L-VER_REPORT-R",t.L_CALL_MAIN_SYNC_O="L_CALL_MAIN_SYNC_O",t.L_UNSUPPORT_NTF_FROM_MAIN_E="L_UNSUPPORT_NTF_FROM_MAIN_E",t.A_SET_MSG_CONTENT_O="A_SET_MSG_CONTENT_O",t.A_REMOVE_PROXY_O="A-remove_proxy-O",t.A_SET_PROXY_O="A-set_proxy-O",t.A_TEST_PROXY_O="A-test_proxy-O",t.L_WEBSOCKET_DISACCORD_E="L-websocket_disaccord-e",t.A_SEARCH_MESSAGE_BY_USER_T="A-search_messages_by_user-T",t.A_SEARCH_MESSAGE_BY_USER_R="A-search_messages_by_user-R",t.L_GET_STATIC_CONF_T="L-get_static_conf-T",t.L_GET_STATIC_CONF_R="L-get_static_conf-R",t.L_GET_STATIC_CONF_E="L-get_static_conf-E",t.L_CLOUD_DISABLED="L-cloud_disabled",t.L_CLOUD_EXPIRE="L-cloud_expire",t.L_CLOUD_OVERCLOCK="L-cloud_overclock",t.L_CLOUD_APPKEY_REGION_E="L-cloud_appkey_region_error",t.L_CLOUD_CONFIG_DATA_E="L-cloud_config_data_error",t.L_CLOUD_SET_CACHE_O="L-cloud_set_cache-O",t.L_CLOUD_GET_CACHE_O="L-cloud_get_cache-O",t.L_CLOUD_MSG_NTF_O="L-cloud_msg_ntf-O",t.L_CLOUD_SET_AREA_CODE_O="L-cloud_set_area_code-O",t.L_CLOUD_SET_MRTR_O="L-cloud_set_mrtr-O",t.L_SYNC_SUBSCRIBED_USER_STATUS_FINISHED_S="L-sync_subscribed_user_status_finished-S",t.L_PULL_SUBSCRIBED_USER_RELATION_T="L-pull_subscribed_user_relation-T",t.L_PULL_SUBSCRIBED_USER_RELATION_R="L-pull_subscribed_user_relation-R",t.L_PULL_SUBSCRIBED_USER_STATUS_T="L-pull_subscribed_user_status-T",t.L_PULL_SUBSCRIBED_USER_STATUS_R="L-pull_subscribed_user_status-R",t.L_OWN_USER_PROFILE_CHANGED_S="L-own_user_profile_changed-S",t.L_QUERY_SUBSCRIBE_DATA_T="L-query_subscribe_data-T",t.L_QUERY_SUBSCRIBE_DATA_R="L-query_subscribe_data-R",t.L_PULL_USER_PROFILE_T="L-pull_user_profile-T",t.L_PULL_USER_PROFILE_R="L-pull_user_profile-R",t.L_PULL_OWN_PROFILE_T="L-pull_own_profile-T",t.L_PULL_OWN_PROFILE_R="L-pull_own_profile-R",t.L_QUERY_FRIEND_LIST_T="L-query_friend_list-T",t.L_QUERY_FRIEND_LIST_R="L-query_friend_list-R",t.L_PULL_USER_PROFILE_REQ_T="L-pull_user_profile_req-T",t.L_PULL_USER_PROFILE_REQ_R="L-pull_user_profile_req-R",t.L_PULL_EVENT_CHANGE_NOTIFY_ULTRA_ONLINE_S="L-pull_event_change_notify_ultra_online-S",t.L_PULL_EVENT_CHANGE_T="L-pull_event_change-T",t.L_PULL_EVENT_CHANGE_R="L-pull_event_change-R",t.L_PARSE_JSON_E="L-parse_json-E"}(S||(S={})),function(t){t[t.BOTH=2]="BOTH"}(h||(h={})),function(t){t[t.BOTH=2]="BOTH"}(N||(N={})),function(t){t[t.FREE=1]="FREE",t[t.NEED_VERIFY=2]="NEED_VERIFY",t[t.NO_ONE_ALLOWED=3]="NO_ONE_ALLOWED"}(f||(f={})),function(t){t[t.NONE=0]="NONE",t[t.IN_MY_FRIEND_LIST=1]="IN_MY_FRIEND_LIST",t[t.IN_OTHER_FRIEND_LIST=2]="IN_OTHER_FRIEND_LIST",t[t.BOTH_WAY=3]="BOTH_WAY"}(O||(O={})),function(t){t[t.SENT=1]="SENT",t[t.RECEIVED=2]="RECEIVED"}(A||(A={})),function(t){t[t.UNHANDLED=0]="UNHANDLED",t[t.ACCEPTED=1]="ACCEPTED",t[t.REFUSED=2]="REFUSED",t[t.EXPIRED=3]="EXPIRED"}(g||(g={})),function(t){t[t.FRIEND_APPLICATION=31]="FRIEND_APPLICATION"}(P||(P={})),function(t){t[t.FRIEND_APPLY=0]="FRIEND_APPLY",t[t.FRIEND_REFUSE=1]="FRIEND_REFUSE",t[t.FRIEND_USER_INFO=2]="FRIEND_USER_INFO",t[t.FRIENDS_INPUT=3]="FRIENDS_INPUT",t[t.FRIEND_CLEAR=4]="FRIEND_CLEAR",t[t.FRIEND_INFO_CHANGE=5]="FRIEND_INFO_CHANGE",t[t.FRIEND_INFO_CHANGE_SYNC=6]="FRIEND_INFO_CHANGE_SYNC"}(v||(v={})),function(t){t[t.OWNER_VERIFY=0]="OWNER_VERIFY",t[t.FREE=1]="FREE",t[t.OWNER_OR_MANAGER_VERIFY=2]="OWNER_OR_MANAGER_VERIFY",t[t.NO_ONE_ALLOWED=3]="NO_ONE_ALLOWED"}(L||(L={})),function(t){t[t.OWNER=0]="OWNER",t[t.OWNER_OR_MANAGER=1]="OWNER_OR_MANAGER",t[t.EVERYONE=2]="EVERYONE"}(m||(m={})),function(t){t[t.OWNER_OR_MANAGER_OR_SELF=0]="OWNER_OR_MANAGER_OR_SELF",t[t.OWNER_OR_SELF=1]="OWNER_OR_SELF",t[t.SELF=2]="SELF"}(y||(y={})),function(t){t[t.FREE=0]="FREE",t[t.INVITEE_VERIFY=1]="INVITEE_VERIFY"}(M||(M={})),function(t){t[t.UNDEF=0]="UNDEF",t[t.NORMAL=1]="NORMAL",t[t.MANAGER=2]="MANAGER",t[t.OWNER=3]="OWNER"}(U||(U={})),function(t){t[t.CREATE=0]="CREATE",t[t.JOIN=1]="JOIN",t[t.KICK=2]="KICK",t[t.QUIT=3]="QUIT",t[t.DISMISS=4]="DISMISS",t[t.ADD_MANAGER=5]="ADD_MANAGER",t[t.REMOVE_MANAGER=6]="REMOVE_MANAGER",t[t.TRANSFER_GROUP_OWNER=7]="TRANSFER_GROUP_OWNER"}(D||(D={})),function(t){t[t.GROUP_INFO_CHANGE=0]="GROUP_INFO_CHANGE",t[t.MEMBER_PROFILE_CHANGE=1]="MEMBER_PROFILE_CHANGE",t[t.GROUP_REMARK_SET=2]="GROUP_REMARK_SET",t[t.GROUP_REMARK_DELETE=3]="GROUP_REMARK_DELETE"}(G||(G={})),function(t){t[t.ADD=1]="ADD",t[t.REMOVE=2]="REMOVE"}(V||(V={})),function(t){t[t.MANAGER_UNHANDLED=0]="MANAGER_UNHANDLED",t[t.MANAGER_REFUSED=1]="MANAGER_REFUSED",t[t.INVITEE_UNHANDLED=2]="INVITEE_UNHANDLED",t[t.INVITEE_REFUSED=3]="INVITEE_REFUSED",t[t.JOINED=4]="JOINED",t[t.EXPIRED=5]="EXPIRED"}(b||(b={})),function(t){t[t.REFUSE=0]="REFUSE",t[t.ACCEPT=1]="ACCEPT"}(F||(F={})),function(t){t[t.APPLICANT=0]="APPLICANT",t[t.MANAGER=1]="MANAGER"}(w||(w={})),function(t){t[t.GROUP_OPERATION=11]="GROUP_OPERATION",t[t.GROUP_PROFILE_CHANGE=12]="GROUP_PROFILE_CHANGE",t[t.GROUP_APPLICATION_INVITATION=13]="GROUP_APPLICATION_INVITATION",t[t.GROUP_FOLLOW_USER_CHANGE=14]="GROUP_FOLLOW_USER_CHANGE"}(x||(x={})),function(t){t[t.APPLICATION=0]="APPLICATION",t[t.INVITATION=1]="INVITATION"}(B||(B={})),function(t){t[t.APPLICATION_SENT=0]="APPLICATION_SENT",t[t.INVITATION_SENT=1]="INVITATION_SENT",t[t.INVITATION_RECEIVED=2]="INVITATION_RECEIVED",t[t.APPLICATION_RECEIVED=3]="APPLICATION_RECEIVED"}(k||(k={})),function(t){t[t.UPDATE=1]="UPDATE",t[t.DELETE=2]="DELETE"}(H||(H={})),function(t){t[t.QUIT=0]="QUIT",t[t.JOIN=1]="JOIN"}(J||(J={})),function(t){t[t.LeaveOnMyOwn=0]="LeaveOnMyOwn",t[t.OtherDeviceLogin=1]="OtherDeviceLogin"}(Y||(Y={})),function(t){t[t.QUIT=0]="QUIT",t[t.JOIN=1]="JOIN"}(W||(W={})),function(t){t[t.UnmuteUsers=0]="UnmuteUsers",t[t.MuteUsers=1]="MuteUsers",t[t.UnmuteAll=2]="UnmuteAll",t[t.MuteAll=3]="MuteAll",t[t.RemoveWhitelist=4]="RemoveWhitelist",t[t.AddWhitelist=5]="AddWhitelist",t[t.UnmuteGloble=6]="UnmuteGloble",t[t.MuteGloble=7]="MuteGloble"}(K||(K={})),function(t){t[t.Deblock=0]="Deblock",t[t.Blocked=1]="Blocked"}(j||(j={})),function(t){t[t.SUCCESS=0]="SUCCESS",t[t.ACTIVE_DISCONNECT=2]="ACTIVE_DISCONNECT",t[t.REJECTED_BY_BLACKLIST=405]="REJECTED_BY_BLACKLIST",t[t.FORBIDDEN_IN_PRIVATE=20106]="FORBIDDEN_IN_PRIVATE",t[t.SYS_CONVERSATION_NOT_SUPPORT_MESSAGE=20109]="SYS_CONVERSATION_NOT_SUPPORT_MESSAGE",t[t.CLOUD_DATA_CENTER_INVALID=20512]="CLOUD_DATA_CENTER_INVALID",t[t.SEND_FREQUENCY_TOO_FAST=20604]="SEND_FREQUENCY_TOO_FAST",t[t.OPERATION_BLOCKED=20605]="OPERATION_BLOCKED",t[t.OPERATION_NOT_SUPPORT=20606]="OPERATION_NOT_SUPPORT",t[t.REQUEST_OVER_FREQUENCY=20607]="REQUEST_OVER_FREQUENCY",t[t.NOT_IN_DISCUSSION=21406]="NOT_IN_DISCUSSION",t[t.SENSITIVE_SHIELD=21501]="SENSITIVE_SHIELD",t[t.SENSITIVE_REPLACE=21502]="SENSITIVE_REPLACE",t[t.MESSAGE_EXPAND_NOT_EXIST=22201]="MESSAGE_EXPAND_NOT_EXIST",t[t.MESSAGE_EXPAND_NOT_SUPPORT=22202]="MESSAGE_EXPAND_NOT_SUPPORT",t[t.MESSAGE_EXPAND_FORMAT_ERROR=22203]="MESSAGE_EXPAND_FORMAT_ERROR",t[t.MESSAGE_EXPAND_NOT_AUTHORIZED=22204]="MESSAGE_EXPAND_NOT_AUTHORIZED",t[t.NOT_IN_GROUP=22406]="NOT_IN_GROUP",t[t.FORBIDDEN_IN_GROUP=22408]="FORBIDDEN_IN_GROUP",t[t.NOT_IN_CHATROOM=23406]="NOT_IN_CHATROOM",t[t.GET_USERINFO_ERROR=23407]="GET_USERINFO_ERROR",t[t.FORBIDDEN_IN_CHATROOM=23408]="FORBIDDEN_IN_CHATROOM",t[t.RC_CHATROOM_USER_KICKED=23409]="RC_CHATROOM_USER_KICKED",t[t.RC_CHATROOM_NOT_EXIST=23410]="RC_CHATROOM_NOT_EXIST",t[t.RC_CHATROOM_IS_FULL=23411]="RC_CHATROOM_IS_FULL",t[t.RC_CHATROOM_PATAMETER_INVALID=23412]="RC_CHATROOM_PATAMETER_INVALID",t[t.CHATROOM_GET_HISTORYMSG_ERROR=23413]="CHATROOM_GET_HISTORYMSG_ERROR",t[t.CHATROOM_NOT_OPEN_HISTORYMSG_STORE=23414]="CHATROOM_NOT_OPEN_HISTORYMSG_STORE",t[t.CHATROOM_KV_EXCEED=23423]="CHATROOM_KV_EXCEED",t[t.CHATROOM_KV_OVERWRITE_INVALID=23424]="CHATROOM_KV_OVERWRITE_INVALID",t[t.CHATROOM_SET_PROPERTY_OVER_FREQUENCY=23425]="CHATROOM_SET_PROPERTY_OVER_FREQUENCY",t[t.CHATROOM_KV_STORE_NOT_OPEN=23426]="CHATROOM_KV_STORE_NOT_OPEN",t[t.CHATROOM_KEY_NOT_EXIST=23427]="CHATROOM_KEY_NOT_EXIST",t[t.CHATROOM_KV_STORE_NOT_ALL_SUCCESS=23428]="CHATROOM_KV_STORE_NOT_ALL_SUCCESS",t[t.CHATROOM_KV_STORE_OUT_LIMIT=23429]="CHATROOM_KV_STORE_OUT_LIMIT",t[t.CHATROOM_KV_SET_ERROR=23431]="CHATROOM_KV_SET_ERROR",t[t.HAVNODEVICEID=24001]="HAVNODEVICEID",t[t.DEVICEIDISHAVE=24002]="DEVICEIDISHAVE",t[t.FEILD=24009]="FEILD",t[t.INTERNALERRROR=24015]="INTERNALERRROR",t[t.RC_USER_PROFILE_KEY_NOT_ALLOW_SDK_SET=24360]="RC_USER_PROFILE_KEY_NOT_ALLOW_SDK_SET",t[t.RC_USER_PROFILE_KEY_NOT_EXIST=24361]="RC_USER_PROFILE_KEY_NOT_EXIST",t[t.RC_USER_PROFILE_EXT_KEY_NOT_EXIST=24362]="RC_USER_PROFILE_EXT_KEY_NOT_EXIST",t[t.RC_USER_PROFILE_EXT_KV_COUNT_EXCEED_LIMIT=24363]="RC_USER_PROFILE_EXT_KV_COUNT_EXCEED_LIMIT",t[t.RC_USER_PROFILE_VALUE_LENGTH_EXCEED_LIMIT=24364]="RC_USER_PROFILE_VALUE_LENGTH_EXCEED_LIMIT",t[t.RC_USER_PROFILE_QUERY_COUNT_EXCEED_LIMIT=24365]="RC_USER_PROFILE_QUERY_COUNT_EXCEED_LIMIT",t[t.RC_USER_PROFILE_USER_NOT_EXIST=24366]="RC_USER_PROFILE_USER_NOT_EXIST",t[t.RC_USER_PROFILE_VALUE_CAN_ONLY_BE_NUMBERS=24367]="RC_USER_PROFILE_VALUE_CAN_ONLY_BE_NUMBERS",t[t.RC_USER_PROFILE_VALUE_EXCEED_RANGE=24368]="RC_USER_PROFILE_VALUE_EXCEED_RANGE",t[t.RC_USER_PROFILE_SERVICE_UNAVAILABLE=24369]="RC_USER_PROFILE_SERVICE_UNAVAILABLE",t[t.ULTRA_GROUP_SERVICE_UNAVAILABLE=24401]="ULTRA_GROUP_SERVICE_UNAVAILABLE",t[t.ULTRA_GROUP_SERVICE_ERROR=24402]="ULTRA_GROUP_SERVICE_ERROR",t[t.ULTRA_GROUP_PARAMETER_ERROR=24403]="ULTRA_GROUP_PARAMETER_ERROR",t[t.ULTRA_GROUP_UNKNOWN_ERROR=24404]="ULTRA_GROUP_UNKNOWN_ERROR",t[t.NOT_IN_ULTRA_GROUP=24406]="NOT_IN_ULTRA_GROUP",t[t.FORBIDDEN_IN_ULTRA_GROUP=24408]="FORBIDDEN_IN_ULTRA_GROUP",t[t.ULTRA_GROUP_NOT_EXIST=24410]="ULTRA_GROUP_NOT_EXIST",t[t.ULTRA_GROUP_MEMBERS_OVERSIZE=24411]="ULTRA_GROUP_MEMBERS_OVERSIZE",t[t.ULTRA_GROUP_JOINED_OVERSIZE=24412]="ULTRA_GROUP_JOINED_OVERSIZE",t[t.ULTRA_GROUP_CHANNELS_OVERSIZE=24413]="ULTRA_GROUP_CHANNELS_OVERSIZE",t[t.ULTRA_GROUP_CHANNEL_ID_NOT_EXIST=24414]="ULTRA_GROUP_CHANNEL_ID_NOT_EXIST",t[t.ULTRA_GROUP_MESSAGE_SENT_OVER_FREQUENCY=24415]="ULTRA_GROUP_MESSAGE_SENT_OVER_FREQUENCY",t[t.ULTRA_GROUP_USER_NOT_IN_PRIVATE_CHANNEL=24416]="ULTRA_GROUP_USER_NOT_IN_PRIVATE_CHANNEL",t[t.RECALL_MESSAGE=25101]="RECALL_MESSAGE",t[t.MESSAGE_STORAGE_SERVICE_UNAVAILABLE=25102]="MESSAGE_STORAGE_SERVICE_UNAVAILABLE",t[t.RC_SERVER_UNKOWN_ERROR=25104]="RC_SERVER_UNKOWN_ERROR",t[t.RECALL_MESSAGE_USER_INVALID=25107]="RECALL_MESSAGE_USER_INVALID",t[t.RC_ENTRUST_SERVER_ERROR=25402]="RC_ENTRUST_SERVER_ERROR",t[t.RC_ENTRUST_SERVER_PARAMETER_ERROR=25403]="RC_ENTRUST_SERVER_PARAMETER_ERROR",t[t.RC_GROUP_ILLEGAL_ERROR=25404]="RC_GROUP_ILLEGAL_ERROR",t[t.RC_GROUP_AUTHORITY_ERROR=25405]="RC_GROUP_AUTHORITY_ERROR",t[t.RC_GROUP_PARAMETER_LENGTH_EXCEED_LIMIT=25406]="RC_GROUP_PARAMETER_LENGTH_EXCEED_LIMIT",t[t.RC_GROUP_PARAMETER_FORMAT_ERROR=25407]="RC_GROUP_PARAMETER_FORMAT_ERROR",t[t.RC_GROUP_PARAMETER_VALUE_CAN_ONLY_BE_NUMBERS=25408]="RC_GROUP_PARAMETER_VALUE_CAN_ONLY_BE_NUMBERS",t[t.RC_GROUP_ID_ALREADY_EXIST=25409]="RC_GROUP_ID_ALREADY_EXIST",t[t.RC_GROUP_ID_NOT_EXIST=25410]="RC_GROUP_ID_NOT_EXIST",t[t.RC_GROUP_MEMBERS_COUNT_EXCEED_LIMIT=25411]="RC_GROUP_MEMBERS_COUNT_EXCEED_LIMIT",t[t.RC_GROUP_MEMBERS_ALREADY_IN_GROUP=25412]="RC_GROUP_MEMBERS_ALREADY_IN_GROUP",t[t.RC_GROUP_NOT_ALLOW_SDK_OPERATION=25413]="RC_GROUP_NOT_ALLOW_SDK_OPERATION",t[t.RC_GROUP_NOT_ALLOW_JOIN=25414]="RC_GROUP_NOT_ALLOW_JOIN",t[t.RC_GROUP_EXT_KEY_NOT_EXIST=25415]="RC_GROUP_EXT_KEY_NOT_EXIST",t[t.RC_GROUP_REQUEST_OVERFREQUENCY=25416]="RC_GROUP_REQUEST_OVERFREQUENCY",t[t.RC_GROUP_OWNER_NOT_ALLOW_QUIT_OR_KICK=25417]="RC_GROUP_OWNER_NOT_ALLOW_QUIT_OR_KICK",t[t.RC_GROUP_USER_NOT_IN_GROUP=25418]="RC_GROUP_USER_NOT_IN_GROUP",t[t.RC_GROUP_MANAGER_OR_FOLLOW_COUNT_EXCEED_LIMIT=25419]="RC_GROUP_MANAGER_OR_FOLLOW_COUNT_EXCEED_LIMIT",t[t.RC_GROUP_USER_IS_NOT_MANAGER_IN_GROUP=25420]="RC_GROUP_USER_IS_NOT_MANAGER_IN_GROUP",t[t.RC_GROUP_APPLICATION_NOT_EXIST=25421]="RC_GROUP_APPLICATION_NOT_EXIST",t[t.RC_GROUP_QUERY_GROUP_COUNT_EXCEED_LIMIT=25422]="RC_GROUP_QUERY_GROUP_COUNT_EXCEED_LIMIT",t[t.RC_GROUP_NAME_INVALID=25423]="RC_GROUP_NAME_INVALID",t[t.RC_GROUP_JOIN_GROUP_NEED_MANAGER_ACCEPT=25424]="RC_GROUP_JOIN_GROUP_NEED_MANAGER_ACCEPT",t[t.RC_GROUP_OWNER_NOT_ALLOW_BE_MANAGER=25425]="RC_GROUP_OWNER_NOT_ALLOW_BE_MANAGER",t[t.RC_GROUP_NO_INVITE_PERMISSION=25426]="RC_GROUP_NO_INVITE_PERMISSION",t[t.RC_GROUP_NEED_INVITEE_ACCEPT=25427]="RC_GROUP_NEED_INVITEE_ACCEPT",t[t.RC_GROUP_APPLICATION_ALREADY_HANDLE=25428]="RC_GROUP_APPLICATION_ALREADY_HANDLE",t[t.RC_GROUP_OLD_GROUP_NOT_ENTRUST=25429]="RC_GROUP_OLD_GROUP_NOT_ENTRUST",t[t.RC_GROUP_ID_INVALID=25430]="RC_GROUP_ID_INVALID",t[t.RC_PAGE_TOKEN_PARSING_FAILED=25432]="RC_PAGE_TOKEN_PARSING_FAILED",t[t.RC_FRIEND_ALREADY_FRIEND=25460]="RC_FRIEND_ALREADY_FRIEND",t[t.RC_FRIEND_NEED_ACCEPT=25461]="RC_FRIEND_NEED_ACCEPT",t[t.RC_FRIEND_IN_OTHER_BLACK_LIST=25462]="RC_FRIEND_IN_OTHER_BLACK_LIST",t[t.RC_FRIEND_NOT_IN_OTHER_WHITE_LIST=25463]="RC_FRIEND_NOT_IN_OTHER_WHITE_LIST",t[t.RC_FRIEND_IN_MY_BLACK_LIST=25464]="RC_FRIEND_IN_MY_BLACK_LIST",t[t.RC_FRIEND_NOT_IN_MY_WHITE_LIST=25465]="RC_FRIEND_NOT_IN_MY_WHITE_LIST",t[t.RC_FRIEND_APPLICATION_NOT_EXIST=25466]="RC_FRIEND_APPLICATION_NOT_EXIST",t[t.RC_FRIEND_MY_FRIEND_COUNT_EXCEED_LIMIT=25467]="RC_FRIEND_MY_FRIEND_COUNT_EXCEED_LIMIT",t[t.RC_FRIEND_OTHER_FRIEND_COUNT_EXCEED_LIMIT=25468]="RC_FRIEND_OTHER_FRIEND_COUNT_EXCEED_LIMIT",t[t.RC_FRIEND_NOT_FRIEND=25469]="RC_FRIEND_NOT_FRIEND",t[t.RC_FRIEND_FIELDS_LENGTH_EXCEED_LIMIT=25470]="RC_FRIEND_FIELDS_LENGTH_EXCEED_LIMIT",t[t.RC_FRIEND_OTHER_NOT_ALLOW_ADD_FRIEND=25471]="RC_FRIEND_OTHER_NOT_ALLOW_ADD_FRIEND",t[t.RC_FRIEND_NOT_EXIST=25472]="RC_FRIEND_NOT_EXIST",t[t.RC_FRIEND_NOT_ALLOW_ADD_SELF=25473]="RC_FRIEND_NOT_ALLOW_ADD_SELF",t[t.PUSH_PARAMETER_INVALID=26001]="PUSH_PARAMETER_INVALID",t[t.USER_SETTING_SYNCED_ERROR=26002]="USER_SETTING_SYNCED_ERROR",t[t.CONVERSATION_TAG_OVERSIZE=26004]="CONVERSATION_TAG_OVERSIZE",t[t.RC_READ_RECEIPT_V4_INVALID=26005]="RC_READ_RECEIPT_V4_INVALID",t[t.RC_SERVER_DRIVE_UNREAD_COUNT_INVALID=26006]="RC_SERVER_DRIVE_UNREAD_COUNT_INVALID",t[t.RC_SERVER_PARAMETER_MESSAGEUIDS_CONFUSED=26007]="RC_SERVER_PARAMETER_MESSAGEUIDS_CONFUSED",t[t.RC_SERVER_PARAMETER_MESSAGEUID_INVALID=26009]="RC_SERVER_PARAMETER_MESSAGEUID_INVALID",t[t.RC_SERVER_PARAMETER_INVALID=26010]="RC_SERVER_PARAMETER_INVALID",t[t.RC_SUBSCRIBE_ONLINE_SERVICE_UNAVAILABLE=26020]="RC_SUBSCRIBE_ONLINE_SERVICE_UNAVAILABLE",t[t.RC_BESUBSCRIBED_USERIDS_COUNT_EXCEED_LIMIT=26021]="RC_BESUBSCRIBED_USERIDS_COUNT_EXCEED_LIMIT",t[t.RC_SUBSCRIBED_USERIDS_EXCEED_LIMIT=26022]="RC_SUBSCRIBED_USERIDS_EXCEED_LIMIT",t[t.RC_FILE_SIZE_EXCEED_LIMIT=26106]="RC_FILE_SIZE_EXCEED_LIMIT",t[t.INVALID_PARAMETER_SIZE_NOT_FOUND=26107]="INVALID_PARAMETER_SIZE_NOT_FOUND",t[t.RC_NET_CHANNEL_INVALID=30001]="RC_NET_CHANNEL_INVALID",t[t.RC_NET_UNAVAILABLE=30002]="RC_NET_UNAVAILABLE",t[t.RC_MSG_RESP_TIMEOUT=30003]="RC_MSG_RESP_TIMEOUT",t[t.RC_HTTP_SEND_FAIL=30004]="RC_HTTP_SEND_FAIL",t[t.RC_HTTP_REQ_FAIL=30005]="RC_HTTP_REQ_FAIL",t[t.RC_HTTP_RECV_FAIL=30006]="RC_HTTP_RECV_FAIL",t[t.RC_NAVI_REQ_FAILED=30007]="RC_NAVI_REQ_FAILED",t[t.RC_NODE_NOT_FOUND=30008]="RC_NODE_NOT_FOUND",t[t.RC_DOMAIN_NOT_RESOLVE=30009]="RC_DOMAIN_NOT_RESOLVE",t[t.RC_SOCKET_NOT_CREATED=30010]="RC_SOCKET_NOT_CREATED",t[t.RC_SOCKET_DISCONNECTED=30011]="RC_SOCKET_DISCONNECTED",t[t.RC_PING_EXCEED_LIMIT=30012]="RC_PING_EXCEED_LIMIT",t[t.PONG_RECEIVED_ERROR=30013]="PONG_RECEIVED_ERROR",t[t.RC_MSG_SEND_FAIL=30014]="RC_MSG_SEND_FAIL",t[t.CONNECT_OVER_FREQUENCY=30015]="CONNECT_OVER_FREQUENCY",t[t.RC_MSG_CONTENT_EXCEED_LIMIT=30016]="RC_MSG_CONTENT_EXCEED_LIMIT",t[t.RC_NETWORK_DOWN=30019]="RC_NETWORK_DOWN",t[t.RC_TCP_DISCONNECTED_NO_RMTP=30021]="RC_TCP_DISCONNECTED_NO_RMTP",t[t.RC_CONN_ACK_TIMEOUT=31e3]="RC_CONN_ACK_TIMEOUT",t[t.RC_CONN_PROTO_VERSION_ERROR=31001]="RC_CONN_PROTO_VERSION_ERROR",t[t.RC_CONN_IDENTIFIER_REJECTED=31002]="RC_CONN_IDENTIFIER_REJECTED",t[t.RC_CONN_SERVER_UNAVAILABLE=31003]="RC_CONN_SERVER_UNAVAILABLE",t[t.RC_CONN_TOKEN_INCORRECT=31004]="RC_CONN_TOKEN_INCORRECT",t[t.RC_CONN_NOT_AUTHRORIZED=31005]="RC_CONN_NOT_AUTHRORIZED",t[t.RC_CONN_REDIRECTED=31006]="RC_CONN_REDIRECTED",t[t.RC_CONN_PACKAGE_NAME_INVALID=31007]="RC_CONN_PACKAGE_NAME_INVALID",t[t.RC_CONN_APP_BLOCKED_OR_DELETED=31008]="RC_CONN_APP_BLOCKED_OR_DELETED",t[t.RC_CONN_USER_BLOCKED=31009]="RC_CONN_USER_BLOCKED",t[t.RC_DISCONN_KICK=31010]="RC_DISCONN_KICK",t[t.RC_DISCONN_EXCEPTION=31011]="RC_DISCONN_EXCEPTION",t[t.CONNECTION_ENCRYPT_AUTHORIZED_ERROR=31012]="CONNECTION_ENCRYPT_AUTHORIZED_ERROR",t[t.RC_CONN_TOKEN_EXPIRED=31020]="RC_CONN_TOKEN_EXPIRED",t[t.RC_CONN_DEVICE_ERROR=31021]="RC_CONN_DEVICE_ERROR",t[t.RC_CONN_HOSTNAME_ERROR=31022]="RC_CONN_HOSTNAME_ERROR",t[t.RC_DISCONN_SAME_CLIENT_ON_LINE=31023]="RC_DISCONN_SAME_CLIENT_ON_LINE",t[t.RC_LISCENSE_COUNT_OUT_OF_LIMIT=31024]="RC_LISCENSE_COUNT_OUT_OF_LIMIT",t[t.RC_CONN_WRONG_CLUSTER=31025]="RC_CONN_WRONG_CLUSTER",t[t.RC_APP_AUTH_NOT_PASS=31026]="RC_APP_AUTH_NOT_PASS",t[t.RC_OTP_USED=31027]="RC_OTP_USED",t[t.RC_PLATFORM_ERROR=31028]="RC_PLATFORM_ERROR",t[t.RC_ACCOUNT_CANCELLATION=31029]="RC_ACCOUNT_CANCELLATION",t[t.RC_LICENSE_EXPIRED=31030]="RC_LICENSE_EXPIRED",t[t.RC_QUERY_ACK_NO_DATA=32001]="RC_QUERY_ACK_NO_DATA",t[t.RC_MSG_DATA_INCOMPLETE=32002]="RC_MSG_DATA_INCOMPLETE",t[t.RC_UDP_DISCONNECTED=32011]="RC_UDP_DISCONNECTED",t[t.RC_TCP_RESET=32054]="RC_TCP_RESET",t[t.CONNECTION_REFUSED=32061]="CONNECTION_REFUSED",t[t.PROTOCOL_MESSAGE_SAVED_ERROR=33e3]="PROTOCOL_MESSAGE_SAVED_ERROR",t[t.BIZ_ERROR_CLIENT_NOT_INIT=33001]="BIZ_ERROR_CLIENT_NOT_INIT",t[t.BIZ_ERROR_DATABASE_ERROR=33002]="BIZ_ERROR_DATABASE_ERROR",t[t.BIZ_ERROR_INVALID_PARAMETER=33003]="BIZ_ERROR_INVALID_PARAMETER",t[t.BIZ_ERROR_NO_CHANNEL=33004]="BIZ_ERROR_NO_CHANNEL",t[t.BIZ_ERROR_RECONNECT_SUCCESS=33005]="BIZ_ERROR_RECONNECT_SUCCESS",t[t.BIZ_ERROR_CONNECTING=33006]="BIZ_ERROR_CONNECTING",t[t.MSG_ROAMING_SERVICE_UNAVAILABLE=33007]="MSG_ROAMING_SERVICE_UNAVAILABLE",t[t.MSG_INSERT_ERROR=33008]="MSG_INSERT_ERROR",t[t.MSG_DEL_ERROR=33009]="MSG_DEL_ERROR",t[t.TAG_NOT_EXIST=33100]="TAG_NOT_EXIST",t[t.TAG_EXISTS=33101]="TAG_EXISTS",t[t.NO_TAG_IN_CONVER=33102]="NO_TAG_IN_CONVER",t[t.RC_CONNECTION_EXIST=34001]="RC_CONNECTION_EXIST",t[t.PACKAGE_ENVIRONMENT_ERROR=34005]="PACKAGE_ENVIRONMENT_ERROR",t[t.CONNECTION_TIMEOUT=34006]="CONNECTION_TIMEOUT",t[t.MESSAGE_KV_NOT_SUPPORT=34008]="MESSAGE_KV_NOT_SUPPORT",t[t.MESSAGE_EXPANDED_ERROR=34009]="MESSAGE_EXPANDED_ERROR",t[t.EXPANSION_LIMIT_EXCEET=34010]="EXPANSION_LIMIT_EXCEET",t[t.UPLOAD_FAIL=34011]="UPLOAD_FAIL",t[t.CONVER_OUT_LIMIT_ERROR=34013]="CONVER_OUT_LIMIT_ERROR",t[t.READ_RECEIPT_ERROR=34014]="READ_RECEIPT_ERROR",t[t.PUSH_CONTENT_CONFIG_SERVICE_UNAVAILABLE=34016]="PUSH_CONTENT_CONFIG_SERVICE_UNAVAILABLE",t[t.MESSAGE_INTERCEPTION_PRODUCED_NULL_MESSAGE=34017]="MESSAGE_INTERCEPTION_PRODUCED_NULL_MESSAGE",t[t.MEDIA_EXCEPTION=34018]="MEDIA_EXCEPTION",t[t.MESSAGE_NOT_REGISTERED=34021]="MESSAGE_NOT_REGISTERED",t[t.METHOD_NOT_SUPPORT=34022]="METHOD_NOT_SUPPORT",t[t.ULTRA_GROUP_CHANNEL_NOT_EXIST=34024]="ULTRA_GROUP_CHANNEL_NOT_EXIST",t[t.INCONSISTENT_CONVERSATION_TYPE=34025]="INCONSISTENT_CONVERSATION_TYPE",t[t.CONVERSATION_TYPE_NOT_SUPPORT=34201]="CONVERSATION_TYPE_NOT_SUPPORT",t[t.INVALID_PARAMETER_TIMESTAMP=34202]="INVALID_PARAMETER_TIMESTAMP",t[t.INVALID_PARAMETER_MESSAGE_UID=34203]="INVALID_PARAMETER_MESSAGE_UID",t[t.INVALID_PARAMETER_MESSAGE_ID=34204]="INVALID_PARAMETER_MESSAGE_ID",t[t.INVALID_PARAMETER_MESSAGE_CONTENT=34205]="INVALID_PARAMETER_MESSAGE_CONTENT",t[t.MSG_LIMIT_ERROR=34206]="MSG_LIMIT_ERROR",t[t.INVALID_PARAMETER_MEDIA_TYPE=34207]="INVALID_PARAMETER_MEDIA_TYPE",t[t.INVALID_PARAMETER_CONVERSATION_TYPE=34209]="INVALID_PARAMETER_CONVERSATION_TYPE",t[t.INVALID_PARAMETER_TARGET_ID=34210]="INVALID_PARAMETER_TARGET_ID",t[t.INVALID_PARAMETER_CHANNEL_ID=34211]="INVALID_PARAMETER_CHANNEL_ID",t[t.INVALID_PARAMETER_TAG_ID=34212]="INVALID_PARAMETER_TAG_ID",t[t.INVALID_PARAMETER_TAG_NAME=34213]="INVALID_PARAMETER_TAG_NAME",t[t.INVALID_PARAMETER_USER_ID=34214]="INVALID_PARAMETER_USER_ID",t[t.INVALID_PARAMETER_USERIDLIST=34215]="INVALID_PARAMETER_USERIDLIST",t[t.INVALID_PARAMETER_DOWNLOADMEDIAFILENAME=34217]="INVALID_PARAMETER_DOWNLOADMEDIAFILENAME",t[t.INVALID_PARAMETER_MESSAGE_EXPANSION=34220]="INVALID_PARAMETER_MESSAGE_EXPANSION",t[t.INVALID_PARAMETER_TIMESTRING=34224]="INVALID_PARAMETER_TIMESTRING",t[t.INVALID_PARAMETER_CONVERSATION=34225]="INVALID_PARAMETER_CONVERSATION",t[t.INVALID_PARAMETER_NOTIFICATION_LEVEL=34228]="INVALID_PARAMETER_NOTIFICATION_LEVEL",t[t.INVALID_PARAMETER_MESSAGE_ARRAY=34229]="INVALID_PARAMETER_MESSAGE_ARRAY",t[t.INVALID_PARAMETER_RECEIVED_STATUS=34230]="INVALID_PARAMETER_RECEIVED_STATUS",t[t.INVALID_PARAMETER_CHANNEL_TYPE=34231]="INVALID_PARAMETER_CHANNEL_TYPE",t[t.INVALID_PARAMETER_COUNT=34232]="INVALID_PARAMETER_COUNT",t[t.INVALID_PARAMETER_MEDIA_URL=34235]="INVALID_PARAMETER_MEDIA_URL",t[t.INVALID_PARAMETER_UNIQUE_ID=34236]="INVALID_PARAMETER_UNIQUE_ID",t[t.INVALID_PARAMETER_PROXY=34238]="INVALID_PARAMETER_PROXY",t[t.INVALID_PARAMETER_TESTHOST=34239]="INVALID_PARAMETER_TESTHOST",t[t.INVALID_CONNECT_TESTHOST_FAILED=34240]="INVALID_CONNECT_TESTHOST_FAILED",t[t.INVALID_PARAMETER_CONVERSATIONS=34242]="INVALID_PARAMETER_CONVERSATIONS",t[t.INVALID_PARAMETER_SENT_STATUS=34244]="INVALID_PARAMETER_SENT_STATUS",t[t.RC_CONN_PROXY_UNAVAILABLE=34245]="RC_CONN_PROXY_UNAVAILABLE",t[t.INVALID_PARAMETER_RTCROOMID=34259]="INVALID_PARAMETER_RTCROOMID",t[t.INVALID_PARAMETER_KEY=34260]="INVALID_PARAMETER_KEY",t[t.INVALID_PARAMETER_KEYS=34261]="INVALID_PARAMETER_KEYS",t[t.INVALID_PARAMETER_VALUE=34262]="INVALID_PARAMETER_VALUE",t[t.INVALID_PARAMETER_ENTRIES=34263]="INVALID_PARAMETER_ENTRIES",t[t.INVALID_PARAMETER_NOTIFICATION_EXTRA=34264]="INVALID_PARAMETER_NOTIFICATION_EXTRA",t[t.INVALID_PARAMETER_MESSAGE_OBJECT_NAME=34271]="INVALID_PARAMETER_MESSAGE_OBJECT_NAME",t[t.INVALID_PARAMETER_BEFORE=34272]="INVALID_PARAMETER_BEFORE",t[t.INVALID_PARAMETER_AFTER=34273]="INVALID_PARAMETER_AFTER",t[t.INVALID_PARAMETER_KEYWORD=34274]="INVALID_PARAMETER_KEYWORD",t[t.INVALID_PARAMETER_MESSAGE_OBJECT_NAME_LIST=34275]="INVALID_PARAMETER_MESSAGE_OBJECT_NAME_LIST",t[t.INVALID_PARAMETER_OFFSET=34276]="INVALID_PARAMETER_OFFSET",t[t.INVALID_PARAMETER_START_TIME=34277]="INVALID_PARAMETER_START_TIME",t[t.INVALID_PARAMETER_END_TIME=34278]="INVALID_PARAMETER_END_TIME",t[t.INVALID_PARAMETER_LIMIT=34279]="INVALID_PARAMETER_LIMIT",t[t.INVALID_MESSAGE_DIRECTION=34280]="INVALID_MESSAGE_DIRECTION",t[t.INVALID_MESSAGE_SENT_STATUS=34281]="INVALID_MESSAGE_SENT_STATUS",t[t.INVALID_PARAMETER_TARGETID_LIST=34282]="INVALID_PARAMETER_TARGETID_LIST",t[t.INVALID_PARAMETER_SPAN_MINUTES=34283]="INVALID_PARAMETER_SPAN_MINUTES",t[t.INVALID_PARAMETER_CONVERSATION_TYPE_LIST=34284]="INVALID_PARAMETER_CONVERSATION_TYPE_LIST",t[t.INVALID_PARAMETER_CONVERSATION_LIST=34287]="INVALID_PARAMETER_CONVERSATION_LIST",t[t.INVALID_PARAMETER_CLEAR_MESSAGE_OPTION_LIST=34288]="INVALID_PARAMETER_CLEAR_MESSAGE_OPTION_LIST",t[t.INVALID_PARAMETER_START_MESSAGE_UID=34289]="INVALID_PARAMETER_START_MESSAGE_UID",t[t.INVALID_PARAMETER_END_MESSAGE_UID=34290]="INVALID_PARAMETER_END_MESSAGE_UID",t[t.READ_RECEIPT_V4_NOT_SUPPORT=34291]="READ_RECEIPT_V4_NOT_SUPPORT",t[t.READ_RECEIPT_V4_UPDATE_NOT_SUPPORT=34292]="READ_RECEIPT_V4_UPDATE_NOT_SUPPORT",t[t.RC_DIRECTIONAL_MESSAGE_INVALID_CONVERSATION_TYPE=34296]="RC_DIRECTIONAL_MESSAGE_INVALID_CONVERSATION_TYPE",t[t.RC_DB_NOT_INIT=34301]="RC_DB_NOT_INIT",t[t.RC_DB_CORRUPT=34302]="RC_DB_CORRUPT",t[t.RC_DB_SQL_ERROR=34303]="RC_DB_SQL_ERROR",t[t.RC_DB_DATA_NOT_FOUND=34304]="RC_DB_DATA_NOT_FOUND",t[t.RC_NET_DATA_ERROR=34305]="RC_NET_DATA_ERROR",t[t.INVALID_PARAMETER_SUBSCRIBE_TYPE=34306]="INVALID_PARAMETER_SUBSCRIBE_TYPE",t[t.INVALID_PARAMETER_SUBSCRIBE_EXPIRY=34307]="INVALID_PARAMETER_SUBSCRIBE_EXPIRY",t[t.INVALID_PARAMETER_SUBSCRIBE_PUBLISHER_USERIDS=34308]="INVALID_PARAMETER_SUBSCRIBE_PUBLISHER_USERIDS",t[t.INVALID_PARAMETER_SUBSCRIBE_PAGESIZE=34309]="INVALID_PARAMETER_SUBSCRIBE_PAGESIZE",t[t.SUB_PROCESS_EXIT=34310]="SUB_PROCESS_EXIT",t[t.ADDON_NOT_EXIST=34311]="ADDON_NOT_EXIST",t[t.INVALID_PARAMETER_USER_PROFILE=34312]="INVALID_PARAMETER_USER_PROFILE",t[t.INVALID_PARAMETER_USER_PROFILE_VISIBILITY=34313]="INVALID_PARAMETER_USER_PROFILE_VISIBILITY",t[t.INVALID_PARAMETER_EXTRA=34314]="INVALID_PARAMETER_EXTRA",t[t.DB_UPGRADE_FAILED=34315]="DB_UPGRADE_FAILED",t[t.INVALID_PARAMETER_GROUP_INFO=34318]="INVALID_PARAMETER_GROUP_INFO",t[t.INVALID_PARAMETER_GROUP_ID=34319]="INVALID_PARAMETER_GROUP_ID",t[t.INVALID_PARAMETER_GROUP_NAME=34320]="INVALID_PARAMETER_GROUP_NAME",t[t.INVALID_PARAMETER_GROUP_IDS=34321]="INVALID_PARAMETER_GROUP_IDS",t[t.INVALID_PARAMETER_GROUP_MEMBER_ROLE=34322]="INVALID_PARAMETER_GROUP_MEMBER_ROLE",t[t.INVALID_PARAMETER_GROUP_APPLICATION_STATUS=34323]="INVALID_PARAMETER_GROUP_APPLICATION_STATUS",t[t.INVALID_PARAMETER_GROUP_APPLICATION_DIRECTION=34324]="INVALID_PARAMETER_GROUP_APPLICATION_DIRECTION",t[t.INVALID_PARAMETER_NICK_NAME=34325]="INVALID_PARAMETER_NICK_NAME",t[t.INVALID_PARAMETER_REASON=34326]="INVALID_PARAMETER_REASON",t[t.INVALID_PARAMETER_REMARK=34327]="INVALID_PARAMETER_REMARK",t[t.INVALID_PARAMETER_PAGING_QUERY_OPTION=34328]="INVALID_PARAMETER_PAGING_QUERY_OPTION",t[t.NET_DATA_IS_SYNCHRONIZING=34329]="NET_DATA_IS_SYNCHRONIZING",t[t.INVALID_PARAMETER_QUERY_FRIENDS_DIRECTION_TYPE=34330]="INVALID_PARAMETER_QUERY_FRIENDS_DIRECTION_TYPE",t[t.INVALID_PARAMETER_DIRECTION_TYPE=34331]="INVALID_PARAMETER_DIRECTION_TYPE",t[t.INVALID_PARAMETER_FRIEND_APPLICATION_TYPE=34332]="INVALID_PARAMETER_FRIEND_APPLICATION_TYPE",t[t.INVALID_PARAMETER_FRIEND_APPLICATION_STATUS=34333]="INVALID_PARAMETER_FRIEND_APPLICATION_STATUS",t[t.INVALID_PARAMETER_FRIEND_ADD_PERMISSION=34334]="INVALID_PARAMETER_FRIEND_ADD_PERMISSION",t[t.INVALID_PARAMETER_FRIEND_INFO_EXT_FIELDS=34335]="INVALID_PARAMETER_FRIEND_INFO_EXT_FIELDS",t[t.RC_REAL_TIME_CONVERSATION_UNAVAILABLE=34336]="RC_REAL_TIME_CONVERSATION_UNAVAILABLE",t[t.GROUP_SYNC_ERROR=35001]="GROUP_SYNC_ERROR",t[t.GROUP_MATCH_ERROR=35002]="GROUP_MATCH_ERROR",t[t.NOT_SUPPORT=35004]="NOT_SUPPORT",t[t.MAIN_PROCESS_ERROR=35005]="MAIN_PROCESS_ERROR",t[t.CAN_NOT_RECONNECT=35007]="CAN_NOT_RECONNECT",t[t.SERVER_UNAVAILABLE=35008]="SERVER_UNAVAILABLE",t[t.HOSTNAME_ERROR=35009]="HOSTNAME_ERROR",t[t.HAS_OHTER_SAME_CLIENT_ON_LINE=35010]="HAS_OHTER_SAME_CLIENT_ON_LINE",t[t.METHOD_NOT_AVAILABLE=35011]="METHOD_NOT_AVAILABLE",t[t.METHOD_ONLY_SUPPORT_ULTRA_GROUP=35014]="METHOD_ONLY_SUPPORT_ULTRA_GROUP",t[t.DRAFT_SAVE_ERROR=35015]="DRAFT_SAVE_ERROR",t[t.DRAFT_REMOVE_ERROR=35016]="DRAFT_REMOVE_ERROR",t[t.CONVER_REMOVE_ERROR=35020]="CONVER_REMOVE_ERROR",t[t.CONVER_GET_ERROR=35021]="CONVER_GET_ERROR",t[t.SEARCH_PROPS_LIMIT_ERROR=35022]="SEARCH_PROPS_LIMIT_ERROR",t[t.INVALID_PARAMETER_MESSAGE_TYPE=35024]="INVALID_PARAMETER_MESSAGE_TYPE",t[t.INVALID_PARAMETER_ORDER=35025]="INVALID_PARAMETER_ORDER",t[t.INVALID_PARAMETER_DRAFT=35028]="INVALID_PARAMETER_DRAFT",t[t.INVALID_PARAMETER_MESSAGE=35029]="INVALID_PARAMETER_MESSAGE",t[t.INVALID_PARAMETER_PUSH_CONTENT=35030]="INVALID_PARAMETER_PUSH_CONTENT",t[t.INVALID_PARAMETER_SENDOPTIONS=35031]="INVALID_PARAMETER_SENDOPTIONS",t[t.INVALID_PARAMETER_CONTENT_DISPOSITION=35032]="INVALID_PARAMETER_CONTENT_DISPOSITION",t[t.INVALID_PARAMETER_SAVE_NAME=35033]="INVALID_PARAMETER_SAVE_NAME",t[t.INVALID_PARAMETER_SERVER_TYPE=35034]="INVALID_PARAMETER_SERVER_TYPE",t[t.INVALID_PARAMETER_CLEAN_SPACE=35035]="INVALID_PARAMETER_CLEAN_SPACE",t[t.INVALID_PARAMETER_CAN_INCLUDE_EXPANSION=35036]="INVALID_PARAMETER_CAN_INCLUDE_EXPANSION",t[t.INVALID_PARAMETER_DISABLE_NOTIFICATION=35037]="INVALID_PARAMETER_DISABLE_NOTIFICATION",t[t.INVALID_PARAMETER_CHECK_DUPLICATE=35038]="INVALID_PARAMETER_CHECK_DUPLICATE",t[t.INVALID_PARAMETER_IS_AUTO_DELETE=35039]="INVALID_PARAMETER_IS_AUTO_DELETE",t[t.INVALID_PARAMETER_IS_SEND_NOTIFICATION=35040]="INVALID_PARAMETER_IS_SEND_NOTIFICATION",t[t.INVALID_PARAMETER_IS_FORCE=35041]="INVALID_PARAMETER_IS_FORCE",t[t.INVALID_PARAMETER_IS_TOP=35042]="INVALID_PARAMETER_IS_TOP",t[t.INVALID_PARAMETER_IS_UPDATE_TIME=35043]="INVALID_PARAMETER_IS_UPDATE_TIME",t[t.INVALID_PARAMETER_CONTAIN_MUTED=35044]="INVALID_PARAMETER_CONTAIN_MUTED",t[t.INVALID_PARAMETER_IS_STATUS_MESSAGE=35045]="INVALID_PARAMETER_IS_STATUS_MESSAGE",t[t.INVALID_PARAMETER_IS_MENTIONED=35046]="INVALID_PARAMETER_IS_MENTIONED",t[t.INVALID_PARAMETER_IS_VOIP_PUSH=35047]="INVALID_PARAMETER_IS_VOIP_PUSH",t[t.INVALID_PARAMETER_MENTIONED_TYPE=35048]="INVALID_PARAMETER_MENTIONED_TYPE",t[t.INVALID_PARAMETER_PUSH_CONFIG=35049]="INVALID_PARAMETER_PUSH_CONFIG",t[t.INVALID_PARAMETER_PUSH_DATA=35050]="INVALID_PARAMETER_PUSH_DATA",t[t.DNS_PROXY_TIMEOUT=35051]="DNS_PROXY_TIMEOUT",t[t.DNS_PROXY_ERROR=35052]="DNS_PROXY_ERROR",t[t.DNS_PROXY_DATA_DESTRUCTUR_ERROR=35053]="DNS_PROXY_DATA_DESTRUCTUR_ERROR",t[t.INVALID_DISABLE_UPDATE_LAST_MESSAGE=35054]="INVALID_DISABLE_UPDATE_LAST_MESSAGE",t[t.CHATROOM_ID_ISNULL=36001]="CHATROOM_ID_ISNULL",t[t.CHARTOOM_JOIN_ERROR=36002]="CHARTOOM_JOIN_ERROR",t[t.CHATROOM_HISMESSAGE_ERROR=36003]="CHATROOM_HISMESSAGE_ERROR",t[t.CHATROOM_KV_NOT_FOUND=36004]="CHATROOM_KV_NOT_FOUND",t[t.BLACK_ADD_ERROR=37001]="BLACK_ADD_ERROR",t[t.BLACK_GETSTATUS_ERROR=37002]="BLACK_GETSTATUS_ERROR",t[t.BLACK_REMOVE_ERROR=37003]="BLACK_REMOVE_ERROR",t[t.DRAF_GET_ERROR=38001]="DRAF_GET_ERROR",t[t.QNTKN_GET_ERROR=41002]="QNTKN_GET_ERROR",t[t.TIMEOUT=-1]="TIMEOUT"}(X||(X={})),function(t){t[t.NONE=0]="NONE",t[t.PRIVATE=1]="PRIVATE",t[t.DISCUSSION=2]="DISCUSSION",t[t.GROUP=3]="GROUP",t[t.CHATROOM=4]="CHATROOM",t[t.CUSTOMER_SERVICE=5]="CUSTOMER_SERVICE",t[t.SYSTEM=6]="SYSTEM",t[t.APP_PUBLIC_SERVICE=7]="APP_PUBLIC_SERVICE",t[t.PUBLIC_SERVICE=8]="PUBLIC_SERVICE",t[t.ULTRA_GROUP=10]="ULTRA_GROUP",t[t.RTC_ROOM=12]="RTC_ROOM"}(Q||(Q={})),function(t){t[t.RMTP=1]="RMTP",t[t.TLS=2]="TLS",t[t.RPP=3]="RPP",t[t.QUIC=4]="QUIC",t[t.WS=5]="WS",t[t.WSS=6]="WSS",t[t.HTTP=11]="HTTP",t[t.HTTPS=12]="HTTPS"}(q||(q={})),function(t){t[t.IMAGE=1]="IMAGE",t[t.AUDIO=2]="AUDIO",t[t.VIDEO=3]="VIDEO",t[t.FILE=4]="FILE",t[t.SIGHT=5]="SIGHT",t[t.COMBINE_HTML=6]="COMBINE_HTML"}(Z||(Z={})),function(t){t[t.ALL=1]="ALL",t[t.SINGAL=2]="SINGAL"}(z||(z={})),function(t){t.TextMessage="RC:TxtMsg",t.VOICE="RC:VcMsg",t.HQ_VOICE="RC:HQVCMsg",t.IMAGE="RC:ImgMsg",t.GIF="RC:GIFMsg",t.RICH_CONTENT="RC:ImgTextMsg",t.LOCATION="RC:LBSMsg",t.FILE="RC:FileMsg",t.SIGHT="RC:SightMsg",t.COMBINE="RC:CombineMsg",t.COMBINE_V2="RC:CombineV2Msg",t.CHRM_KV_NOTIFY="RC:chrmKVNotiMsg",t.LOG_COMMAND="RC:LogCmdMsg",t.EXPANSION_NOTIFY="RC:MsgExMsg",t.REFERENCE="RC:ReferenceMsg",t.RECALL="RC:RcCmd",t.RECALL_NOTIFICATION_MESSAGE="RC:RcNtf",t.READ_RECEIPT="RC:ReadNtf",t.READ_RECEIPT_REQUEST="RC:RRReqMsg",t.READ_RECEIPT_RESPONSE="RC:RRRspMsg",t.SYNC_READ_STATUS="RC:SRSMsg",t.GROUP_READ_RECEIPT_REQUEST="RC:RRMsg",t.READ_STATE="RC:RSMsg",t.DELIVERED="RC:Delivered",t.DELIVERED_MSG="RC:DRMsg",t.CHATROOM_MERGE_CHANGE="RC:ChrmMemChange",t.CHATROOM_SYNC_MSG="RC:ChrmSyncMsg",t.CHATROOM_MERGE_BLOCK="RC:ChrmBlockMsg",t.CHATROOM_MERGE_BAN="RC:ChrmBanMsg",t.TYPING_STATUS="RC:TypSts",t.INTERCEPT="RC:InterceptMsg",t.CLOUD_CONTROL="RC:CCConfigChangeRequestMsg"}($||($={})),function(t){t[t.PUBLIC=0]="PUBLIC",t[t.PRIVATE=1]="PRIVATE"}(tt||(tt={})),function(t){t[t.PUBLIC_TO_PRIVATE=2]="PUBLIC_TO_PRIVATE",t[t.PRIVATE_TO_PUBLIC=3]="PRIVATE_TO_PUBLIC",t[t.PUBLIC_TO_PRIVATE_USER_NOT_IN=6]="PUBLIC_TO_PRIVATE_USER_NOT_IN"}(et||(et={})),function(t){t[t.MSG_EXPANSION=1]="MSG_EXPANSION",t[t.MSG_MODIFY=2]="MSG_MODIFY",t[t.MSG_RECALL=3]="MSG_RECALL",t[t.CHANNEL_CHANGE=4]="CHANNEL_CHANGE",t[t.USER_GROUP_CHANGE=5]="USER_GROUP_CHANGE"}(nt||(nt={})),function(t){t[t.CHANNEL_DELETE=1]="CHANNEL_DELETE",t[t.PUBLIC_TO_PRIVATE=2]="PUBLIC_TO_PRIVATE",t[t.PRIVATE_TO_PUBLIC=3]="PRIVATE_TO_PUBLIC",t[t.PRIVATE_CHANNEL_USER_JOIN_PUBLIC=4]="PRIVATE_CHANNEL_USER_JOIN_PUBLIC",t[t.CHANNEL_USER_KICKED=5]="CHANNEL_USER_KICKED",t[t.PUBLIC_TO_PRIVATE_USER_NOT_IN=6]="PUBLIC_TO_PRIVATE_USER_NOT_IN"}(ot||(ot={})),function(t){t[t.REMOVE_USER_GROUP=1]="REMOVE_USER_GROUP",t[t.JOIN_USER_GROUP=2]="JOIN_USER_GROUP",t[t.EXIT_USER_GROUP=3]="EXIT_USER_GROUP",t[t.CHANNEL_BIND_USER_GROUP=4]="CHANNEL_BIND_USER_GROUP",t[t.CHANNEL_UNBIND_USER_GROUP=5]="CHANNEL_UNBIND_USER_GROUP"}(rt||(rt={})),function(t){t[t.NOT_MENTIONED=0]="NOT_MENTIONED",t[t.ALL=1]="ALL",t[t.ME=2]="ME"}(it||(it={})),function(t){t[t.SENDING=10]="SENDING",t[t.FAILED=20]="FAILED",t[t.SENT=30]="SENT",t[t.RECEIVED=40]="RECEIVED",t[t.READ=50]="READ",t[t.DESTROYED=60]="DESTROYED"}(st||(st={})),function(t){t[t.typing=0]="typing"}(at||(at={})),function(t){t[t.ONLINE=1]="ONLINE",t[t.OFFLINE=0]="OFFLINE"}(_t||(_t={})),function(t){t[t.Other=0]="Other",t[t.iOS=1]="iOS",t[t.Android=2]="Android",t[t.Web=3]="Web",t[t.PC=4]="PC",t[t.Mini=5]="Mini",t[t.HarmonyOS=6]="HarmonyOS"}(ct||(ct={})),function(t){t[t.ONLINE_STATUS=1]="ONLINE_STATUS",t[t.USER_PROFILE=2]="USER_PROFILE",t[t.FRIEND_ONLINE_STATUS=3]="FRIEND_ONLINE_STATUS",t[t.FRIEND_USER_PROFILE=4]="FRIEND_USER_PROFILE"}(ut||(ut={})),function(t){t[t.SUBSCRIBE=0]="SUBSCRIBE",t[t.UNSUBSCRIBE=1]="UNSUBSCRIBE"}(Et||(Et={})),function(t){t[t.NOT_SET=0]="NOT_SET",t[t.INVISIBLE=1]="INVISIBLE",t[t.EVERYONE=2]="EVERYONE",t[t.FriendVisible=3]="FriendVisible"}(Rt||(Rt={})),function(t){t[t.CONNECTED=0]="CONNECTED",t[t.CONNECTING=1]="CONNECTING",t[t.DISCONNECTED=2]="DISCONNECTED",t[t.SUSPENDED=3]="SUSPENDED"}(lt||(lt={})),function(t){t[t.GLOBAL=1]="GLOBAL",t[t.CUSTOM=2]="CUSTOM",t[t.THIRD_PARTY=3]="THIRD_PARTY"}(dt||(dt={})),function(t){t[t.MSG_ORIGINAL=0]="MSG_ORIGINAL",t[t.MSG_EXPANSION=1]="MSG_EXPANSION",t[t.MSG_MODIFY=2]="MSG_MODIFY"}(pt||(pt={})),function(t){t[t.SEND=1]="SEND",t[t.RECEIVE=2]="RECEIVE"}(Ct||(Ct={})),function(t){t.NORMAL="NORMAL",t.LOW="LOW"}(Tt||(Tt={})),function(t){t.IM_NAVI="IM-stats_navi-S",t.IM_WEBSOCKET="IM-stats_websocket-S",t.IM_CONNECTION_DURATION="IM-stats_con_dur-S",t.IM_CMP="IM-stats_cmp-S",t.IM_CMP_RMTP="IM-stats_cmp_rmtp-S",t.IM_STATS_CS="IM-stats_cs-S",t.IM_NETWORK_CHANGE="IM-stats_network_change-S",t.L_CLOUD_INFO_FETCH_T="L-cloud_info_fetch-T",t.L_CLOUD_INFO_FETCH_R="L-cloud_info_fetch-R",t.IM_MSG_SEND="IM-msg_send-S",t.IM_MSG_RECEIVE="IM-msg_receive-S"}(It||(It={})),function(t){t[t.OPEN=1]="OPEN",t[t.CLOSE=2]="CLOSE"}(St||(St={})),function(t){t[t.ALL_MESSAGE=-1]="ALL_MESSAGE",t[t.NOT_SET=0]="NOT_SET",t[t.AT_MESSAGE_NOTIFICATION=1]="AT_MESSAGE_NOTIFICATION",t[t.AT_USER_NOTIFICATION=2]="AT_USER_NOTIFICATION",t[t.AT_GROUP_ALL_USER_NOTIFICATION=4]="AT_GROUP_ALL_USER_NOTIFICATION",t[t.NOT_MESSAGE_NOTIFICATION=5]="NOT_MESSAGE_NOTIFICATION"}(ht||(ht={})),function(t){t[t.READ=1]="READ",t[t.LISTENED=2]="LISTENED",t[t.DOWNLOADED=4]="DOWNLOADED",t[t.RETRIEVED=8]="RETRIEVED",t[t.UNREAD=0]="UNREAD"}(Nt||(Nt={})),function(t){t[t.PRIVATE=1]="PRIVATE",t[t.OPEN=0]="OPEN"}(ft||(ft={})),function(t){t[t.NAVI=1]="NAVI",t[t.TCP=2]="TCP",t[t.WS=3]="WS"}(Ot||(Ot={})),function(t){t[t.REQUEST=0]="REQUEST",t[t.LOCAL=1]="LOCAL"}(At||(At={})),function(t){t[t.CURRENT=2]="CURRENT"}(gt||(gt={})),function(t){t[t.CONNECT=0]="CONNECT",t[t.RECONNECT=1]="RECONNECT"}(Pt||(Pt={})),function(t){t[t.CONNECT=0]="CONNECT",t[t.RECONNECT=1]="RECONNECT",t[t.REDIRECTED=3]="REDIRECTED",t[t.TIMEOUT=4]="TIMEOUT"}(vt||(vt={})),function(t){t.PASSIVE="passive",t.ACTIVE="active",t.TIME_SENSITIVE="time-sensitive",t.CRITICAL="critical"}(Lt||(Lt={})),function(t){t[t.PUSH_NOTIFICATION_QUIET_HOURS_LEVEL_DEFAULT=0]="PUSH_NOTIFICATION_QUIET_HOURS_LEVEL_DEFAULT",t[t.PUSH_NOTIFICATION_QUIET_HOURS_LEVEL_MENTION_MESSAGE=1]="PUSH_NOTIFICATION_QUIET_HOURS_LEVEL_MENTION_MESSAGE",t[t.PUSH_NOTIFICATION_QUIET_HOURS_LEVEL_BLOCKED=5]="PUSH_NOTIFICATION_QUIET_HOURS_LEVEL_BLOCKED"}(mt||(mt={})),function(t){t.WIFI="wifi",t.FOUR_G="4g",t.THREE_G="3g",t.TWO_G="2g",t.FIVE_G="2g",t.THREE_GENT="3gnet",t.UNKONWN="unknown"}(yt||(yt={})),function(t){t.GET="GET",t.POST="POST",t.PUT="PUT"}(Mt||(Mt={}));var wt=72e5,xt={"RC:TxtMsg":{isCounted:!0,isPersited:!0},"RC:ImgMsg":{isCounted:!0,isPersited:!0},"RC:VcMsg":{isCounted:!0,isPersited:!0},"RC:ImgTextMsg":{isCounted:!0,isPersited:!0,searchProps:["content","title"]},"RC:FileMsg":{isCounted:!0,isPersited:!0,searchProps:["name"]},"RC:HQVCMsg":{isCounted:!0,isPersited:!0},"RC:LBSMsg":{isCounted:!0,isPersited:!0},"RC:PSImgTxtMsg":{isCounted:!0,isPersited:!0},"RC:PSMultiImgTxtMsg":{isCounted:!0,isPersited:!0},"RCJrmf:RpMsg":{isCounted:!0,isPersited:!0},"RCJrmf:RpOpendMsg":{isCounted:!0,isPersited:!0},"RC:CombineMsg":{isCounted:!0,isPersited:!0},"RC:CombineV2Msg":{isCounted:!0,isPersited:!0},"RC:ReferenceMsg":{isCounted:!0,isPersited:!0,searchProps:["content"]},"RC:SightMsg":{isCounted:!0,isPersited:!0},"RC:GIFMsg":{isCounted:!0,isPersited:!0},"RC:RLStart":{isCounted:!0,isPersited:!0},"RC:RLEnd":{isCounted:!0,isPersited:!0},"RC:InfoNtf":{isCounted:!1,isPersited:!0},"RC:ContactNtf":{isCounted:!1,isPersited:!0},"RC:ProfileNtf":{isCounted:!1,isPersited:!0},"RC:CmdNtf":{isCounted:!1,isPersited:!0},"RC:GrpNtf":{isCounted:!1,isPersited:!0},"RC:RcCmd":{isCounted:!1,isPersited:!0},"RC:RcNtf":{isCounted:!1,isPersited:!0},"RC:CmdMsg":{isCounted:!1,isPersited:!1},"RC:TypSts":{isCounted:!1,isPersited:!1},"RC:PSCmd":{isCounted:!1,isPersited:!1},"RC:SRSMsg":{isCounted:!1,isPersited:!1},"RC:RRReqMsg":{isCounted:!1,isPersited:!1},"RC:RRRspMsg":{isCounted:!1,isPersited:!1},"RC:CsChaR":{isCounted:!1,isPersited:!1},"RC:CSCha":{isCounted:!1,isPersited:!1},"RC:CsEva":{isCounted:!1,isPersited:!1},"RC:CsContact":{isCounted:!1,isPersited:!1},"RC:CsHs":{isCounted:!1,isPersited:!1},"RC:CsHsR":{isCounted:!1,isPersited:!1},"RC:CsSp":{isCounted:!1,isPersited:!1},"RC:CsEnd":{isCounted:!1,isPersited:!1},"RC:CsUpdate":{isCounted:!1,isPersited:!1},"RC:ReadNtf":{isCounted:!1,isPersited:!1},"RC:chrmKVNotiMsg":{isCounted:!1,isPersited:!1},"RC:VCAccept":{isCounted:!1,isPersited:!1},"RC:VCRinging":{isCounted:!1,isPersited:!1},"RC:VCSummary":{isCounted:!1,isPersited:!1},"RC:VCHangup":{isCounted:!1,isPersited:!1},"RC:VCInvite":{isCounted:!1,isPersited:!1},"RC:VCModifyMedia":{isCounted:!1,isPersited:!1},"RC:VCModifyMem":{isCounted:!1,isPersited:!1},"RC:MsgExMsg":{isCounted:!1,isPersited:!1},"RC:Delivered":{isCounted:!1,isPersited:!1},"RC:RRMsg":{isCounted:!1,isPersited:!1},"RC:LogCmdMsg":{isCounted:!1,isPersited:!1},"RC:InterceptMsg":{isCounted:!1,isPersited:!1},"RC:RLJoin":{isCounted:!1,isPersited:!1},"RC:RLQuit":{isCounted:!1,isPersited:!1},"RC:RL":{isCounted:!1,isPersited:!1},"RC:CCConfigChangeRequestMsg":{isCounted:!1,isPersited:!1}},Bt="5.14.1".replace(/-.+$/,""),kt="rongcloudsystem",Ht="undefined"!=typeof window&&window?(window.__RCVersionInfo||(window.__RCVersionInfo={}),window.__RCVersionInfo):{};Ht.engine="5.14.1";var Jt=function(){function t(){}return t.add=function(t,e){Ht[t]=e},t.validEngine=function(t){var e=t.match(/\d+\.\d+\.\d+/);if(!e)return!1;var n=e[0].split(".").map((function(t){return t.padStart(3,"0")})).join("");return Ht.engine.match(/\d+\.\d+\.\d+/)[0].split(".").map((function(t){return t.padStart(3,"0")})).join("")>=n},t.getInfo=function(){return Ht},t}();var Yt=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(t){var e=Math.floor(36*Math.random());return("x"===t?e:3&e|8).toString(36)}))},Wt=function(t){void 0===t&&(t=22);var e,n=Date.now(),o=n.toString(36),r=Math.floor(Math.random()*n).toString(36),i=t-o.length-r.length;return[r,o,i>0?(e=i,Array.from({length:e}).map((function(){return Math.floor(36*Math.random()).toString(36)})).join("")):""].join("").slice(0,t)}(22),Kt=Date.now(),jt=function(t){return-1!==Object.prototype.toString.call(t).indexOf("Array")},Xt=function(t){return"[object Object]"===Object.prototype.toString.call(t)},Qt=function(t){return void 0===t||"[object Undefined]"===Object.prototype.toString.call(t)},qt=function(t){return function(t){return"string"==typeof t}(t)&&/https?:\/\//.test(t)},Zt=function(t){for(var e in t)if(Object.prototype.hasOwnProperty.call(t,e))return!0;return!1},zt=function(t){return{isRead:(t&Nt.READ)===Nt.READ,isListened:(t&Nt.LISTENED)===Nt.LISTENED,isDownload:(t&Nt.DOWNLOADED)===Nt.DOWNLOADED,isRetrieved:(t&Nt.RETRIEVED)===Nt.RETRIEVED}},$t=function(t){return[ct.Android,ct.iOS,ct.Web,ct.PC,ct.Mini,ct.HarmonyOS].map((function(e){var n=t.findIndex((function(t){return t.platform===e}));return-1===n?{platform:e,changeTime:0,eventValue:0}:t[n]}))},te=function(t,e,n){return e?1===n?q.TLS:q.RMTP:"http"===t?q.WS:q.WSS},ee=function(t,e){var n=t.server,o=t.backupServer,r=t.bs,i=t.serverAddr,s=t.protocol,a=t.openTLS;if(i)return Ft([],bt(i.filter((function(t){return t.addr}))),!1);var _=[],c=[];return n&&c.push(n),(o||r||"").split(",").forEach((function(t){c.indexOf(t)<0&&c.push(t)})),c.forEach((function(t,o){t&&_.push({addr:t,protocol:te(s,e,a),weight:n.length-o,race:!1})})),Ft([],bt(_),!1)},ne=function(t){return t.reduce((function(t,e){return t[e.key]=e.value,t}),{})},oe=function(t,e){var n=Math.floor(1e3*Math.random()%1e4),o=Yt(),r=function(t){t=t||"-";var e=new Date,n=e.getFullYear(),o=e.getMonth()+1,r=e.getDate();return"".concat(n).concat(t).concat(o).concat(t).concat(r)}(),i=(new Date).getTime(),s="";if(e){var a=e.split(".");s=".".concat(a[a.length-1])}return"".concat(t,"__RC-").concat(r,"_").concat(n,"_").concat(i).concat(o).concat(s)},re=function(t,e,n){void 0===t&&(t={}),void 0===e&&(e={}),void 0===n&&(n={});var o=e.channelIdMi,r=e.channelIdHW,i=e.channelIdOPPO,s=e.typeVivo,a=e.importanceHW,_=e.categoryHW,c=e.imageUrlHW,u=e.categoryVivo,E=e.importanceHonor,R=e.imageUrlHonor,l=function(t,e){void 0===t&&(t={}),void 0===e&&(e={});var n=t.threadId,o=t.apnsCollapseId,r=t.category,i=t.richMediaUri,s=t.interruptionLevel,a=e.googleConfig,_={};_["thread-id"]=n||"",_["apns-collapse-id"]=o||"",_.category=r||"",_.richMediaUri=i||"",_["interruption-level"]=s||"active";var c={};c.collapse_key=null==a?void 0:a.collapseKey,c.imageUrl=null==a?void 0:a.imageUrl;var u=null==a?void 0:a.priority;return u&&!["high","normal"].includes(u)&&(u="normal"),c.priority=u,{APNS:_,FCM:c}}(t,e),d=[{HW:{channelId:r||"",importance:a||"NORMAL",image:c||"",category:_||""}},{MI:{channelId:o||""}},{OPPO:{channelId:i||""}},{VIVO:{classification:s||"",category:u||""}},{APNS:l.APNS},{FCM:l.FCM},{HONOR:{importance:E||Tt.NORMAL,image:R||""}},{OHOS:{category:n.category||null,image:n.image||""}}];return JSON.stringify(d)},ie=function(){var t=Jt.getInfo(),e="electron";for(var n in t)"engine"!==n&&(e=["imlib-v2-adapter","imlib-v4-adapter","imlib-next"].includes(n)?n:"electron");return e};function se(t,e){var n;if(!t)return"";var o="undefined"!=typeof window&&"https:"===(null===(n=null===window||void 0===window?void 0:window.location)||void 0===n?void 0:n.protocol);return/^https?:\/\//.test(t)?o?t.replace(/^https?:\/\//i,"https://"):t:e!==q.HTTP||o?"https://".concat(t):"http://".concat(t)}var ae=function(t,e){if(!t)return"";var n=t.ossConfig,o=void 0===n?"":n,r="";try{var i=JSON.parse(o);if(i.length>0){var s=i.find((function(t){return t.minio}));s&&(r=s.minio)}}catch(t){e.warn(S.L_PARSE_JSON_E,JSON.stringify({ossConfig:o,error:t}))}return r};!function(t){function e(e){var n=t.call(this,e)||this;return n.name="CMSYError",n}T(e,t),e.InvalidParameters=function(t){return(null==t?void 0:t.length)?new e("Invalid parameter -> ".concat(t)):new e("Invalid parameters.")},e.ParameterTypeError=function(){return new e("Wrong parameter type")}}(Error);var _e=function(){function t(){this._map=new Map,this._piped=new Set}return t.prototype._addItem=function(t,e,n,o,r){void 0===r&&(r=0);var i=Symbol(),s=this._map.get(t)||this._map.set(t,[]).get(t),a={symbol:i,priority:Math.min(r,100),listener:e.bind(o),once:n},_=s.findIndex((function(t){return t.priority>r}));return-1===_?s.push(a):s.splice(_,0,a),i},t.prototype.on=function(t,e,n,o){return void 0===o&&(o=0),this._addItem(t,e,!1,n,o)},t.prototype.once=function(t,e,n,o){return void 0===o&&(o=0),this._addItem(t,e,!0,n,o)},t.prototype.off=function(t){var e,n;try{for(var o=Vt(this._map),r=o.next();!r.done;r=o.next()){var i=bt(r.value,2),s=(i[0],i[1]),a=s.findIndex((function(e){return e.symbol===t}));if(-1!==a)return void s.splice(a,1)}}catch(t){e={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(e)throw e.error}}},t.prototype.emit=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];var o=this._map.get(t);if(o&&o.length>0)for(var r=o.length-1;r>=0;r-=1){var i=o[r],s=i.once,a=i.listener;s&&o.splice(r,1);try{a.apply(void 0,Ft([],bt(e),!1))}catch(t){null===console||void 0===console||console.error(t)}}Ft([],bt(this._piped.values()),!1).forEach((function(n){return n.emit.apply(n,Ft([t],bt(e),!1))}))},t.prototype.removeAll=function(t){this._map.delete(t)},t.prototype.clear=function(){this._piped.clear(),this._map.clear()},t.prototype.pipe=function(t){this._piped.add(t)},t}();!function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._versionQueue=[],e._isPulling=null,e._dataVersion=0,e._invervalTimer=-1,e._intervalGap=0,e}T(e,t),e.prototype.setInitVersion=function(t,e){return Dt(this,void 0,void 0,(function(){return Gt(this,(function(n){switch(n.label){case 0:return 0!==this._dataVersion?[2]:(this._dataVersion=t,e?[4,this._execPulling()]:[3,2]);case 1:n.sent(),n.label=2;case 2:return[2]}}))}))},e.prototype.push=function(t){t<this._dataVersion||(this._versionQueue.push(t),0!==this._dataVersion&&this._execPulling())},e.prototype._execPulling=function(){return Dt(this,void 0,void 0,(function(){var t,e,n,o,r;return Gt(this,(function(i){switch(i.label){case 0:return this._isPulling?[4,this._isPulling]:[3,2];case 1:return i.sent(),[2];case 2:return this._isPulling=this._sendRequest(this._dataVersion),[4,this._isPulling];case 3:if(t=i.sent(),e=t.code,n=t.version,o=t.hasNext,this._isPulling=null,0!==e)return[2];if(void 0===n||n<this._dataVersion)throw new Error("version error, please check: lastVersion: ".concat(this._dataVersion,", newVersion: ").concat(n));return r=this._versionQueue.filter((function(t){return t>n})),this._versionQueue=Ft([],bt(r),!1),this._dataVersion=n,this._resetIntervalTimer(),o?(this._execPulling(),[2]):(this._versionQueue.length>0&&(this._versionQueue.length=0,this._execPulling()),[2])}}))}))},e.prototype.startInterval=function(t){var e=this;-1===this._invervalTimer&&(this._intervalGap=t,this._invervalTimer=setInterval((function(){return e._execPulling()}),t))},e.prototype._resetIntervalTimer=function(){var t=this;-1!==this._invervalTimer&&(clearInterval(this._invervalTimer),this._invervalTimer=setInterval((function(){return t._execPulling()}),this._intervalGap))},e.prototype.stopInterval=function(){-1!==this._invervalTimer&&clearInterval(this._invervalTimer)},e.prototype.reset=function(){this.stopInterval(),this._versionQueue.length=0,this._dataVersion=0}}(_e);var ce,ue,Ee,Re=function(){function t(t,e,n){this.code=t,this.msg=e,this.data=n,this.isOk=0===t}return t.prototype.next=function(t){return Dt(this,void 0,void 0,(function(){return Gt(this,(function(e){return this.isOk?[2,t(this.data)]:[2,this.wipe()]}))}))},t.prototype.trans=function(t){return this.isOk?le(t(this.data)):this.wipe()},t.prototype.tryTrans=function(t){return this.isOk?t(this.data):this.wipe()},t.prototype.wipe=function(){return this.isOk?le(void 0,this.msg):pe(this.code,this.msg)},t.ok=function(e,n){return new t(0,n||"success",e)},t.unknown=function(t,e,n){return 0===t?le(e,n):pe(t,n)},t.fail=function(e,n,o){return new t(e,n||"fail: ".concat(e),o)},t}(),le=Re.ok,de=Re.unknown,pe=Re.fail,Ce="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function Te(t){var e,n,o,r,i,s,a="",_=0;for(t=t.replace(/[^A-Za-z0-9+/=]/g,"");_<t.length;)e=Ce.indexOf(t.charAt(_++))<<2|(r=Ce.indexOf(t.charAt(_++)))>>4,n=(15&r)<<4|(i=Ce.indexOf(t.charAt(_++)))>>2,o=(3&i)<<6|(s=Ce.indexOf(t.charAt(_++))),a+=String.fromCharCode(e),64!==i&&(a+=String.fromCharCode(n)),64!==s&&(a+=String.fromCharCode(o));return a}!function(t){t[t.add=1]="add",t[t.update=2]="update",t[t.delete=3]="delete"}(ce||(ce={})),function(t){t[t.BJ=1]="BJ",t[t.SG=2]="SG",t[t.NA=3]="NA",t[t.SG_A=4]="SG_A",t[t.SG_B=4]="SG_B",t[t.SA=5]="SA"}(Ee||(Ee={}));var Ie=((ue={})[Ee.BJ]={naviUrlBase64:["bmF2LnJvbmctZWRnZS5jb20=","bmF2LWIucm9uZy1lZGdlLmNvbQ=="],logUrlBase64:[{addr:"Y29sbGVjdGlvbi5yb25nLWVkZ2UuY29t",protocol:q.HTTPS,weight:-1}],miniCmpBase64:["d3Mucm9uZy1lZGdlLmNvbQ==","d3MtYi5yb25nLWVkZ2UuY29t"],staticConfigUrlBase64:["aHR0cHM6Ly9ib290c3RyYXBwcm9maWxlLWMtMS5vc3MtY24tYmVpamluZy5hbGl5dW5jcy5jb20="],cloudControllerUrlBase64:["Y2xvdWRjb250cm9sLnJvbmctZWRnZS5jb20=","Y2xvdWRjb250cm9sLWIucm9uZy1lZGdlLmNvbQ=="]},ue[Ee.SG]={naviUrlBase64:["bmF2LnNnLWxpZ2h0LWVkZ2UuY29t","bmF2LWIuc2ctbGlnaHQtZWRnZS5jb20="],logUrlBase64:[{addr:"Y29sbGVjdGlvbi5zZy1saWdodC1lZGdlLmNvbQ==",protocol:q.HTTPS,weight:-1}],miniCmpBase64:["d3Muc2ctbGlnaHQtZWRnZS5jb20=","d3MtYi5zZy1saWdodC1lZGdlLmNvbQ=="],staticConfigUrlBase64:["aHR0cHM6Ly9ib290c3RyYXBwcm9maWxlLWItMi5zMy5hcC1zb3V0aGVhc3QtMS5hbWF6b25hd3MuY29t"],cloudControllerUrlBase64:["Y2xvdWRjb250cm9sLnNnLWxpZ2h0LWVkZ2UuY29t","Y2xvdWRjb250cm9sLWIuc2ctbGlnaHQtZWRnZS5jb20="]},ue[Ee.NA]={naviUrlBase64:["bmF2LnVzLWxpZ2h0LWVkZ2UuY29t","bmF2LWIudXMtbGlnaHQtZWRnZS5jb20="],logUrlBase64:[{addr:"Y29sbGVjdGlvbi51cy1saWdodC1lZGdlLmNvbQ==",protocol:q.HTTPS,weight:-1}],miniCmpBase64:["d3MudXMtbGlnaHQtZWRnZS5jb20=","d3MtYi51cy1saWdodC1lZGdlLmNvbQ=="],staticConfigUrlBase64:[],cloudControllerUrlBase64:["Y2xvdWRjb250cm9sLnVzLWxpZ2h0LWVkZ2UuY29t","Y2xvdWRjb250cm9sLWIudXMtbGlnaHQtZWRnZS5jb20="]},ue[Ee.SG_B]={naviUrlBase64:["bmF2LnNnLWItbGlnaHQtZWRnZS5jb20=","bmF2LWIuc2ctYi1saWdodC1lZGdlLmNvbQ=="],logUrlBase64:[{addr:"Y29sbGVjdGlvbi5zZy1iLWxpZ2h0LWVkZ2UuY29t",protocol:q.HTTPS,weight:-1}],miniCmpBase64:["d3Muc2ctYi1saWdodC1lZGdlLmNvbQ==","d3MtYi5zZy1iLWxpZ2h0LWVkZ2UuY29t"],staticConfigUrlBase64:[],cloudControllerUrlBase64:["Y2xvdWRjb250cm9sLnNnLWItbGlnaHQtZWRnZS5jb20=","Y2xvdWRjb250cm9sLWIuc2ctYi1saWdodC1lZGdlLmNvbQ=="]},ue[Ee.SA]={naviUrlBase64:["bmF2LnNhdS1saWdodC1lZGdlLmNvbQ==","bmF2LWIuc2F1LWxpZ2h0LWVkZ2UuY29t"],logUrlBase64:[{addr:"Y29sbGVjdGlvbi5zYXUtbGlnaHQtZWRnZS5jb20=",protocol:q.HTTPS,weight:-1}],miniCmpBase64:["d3Muc2F1LWxpZ2h0LWVkZ2UuY29t","d3MtYi5zYXUtbGlnaHQtZWRnZS5jb20="],staticConfigUrlBase64:[],cloudControllerUrlBase64:["Y2xvdWRjb250cm9sLnNhdS1saWdodC1lZGdlLmNvbQ==","Y2xvdWRjb250cm9sLWIuc2F1LWxpZ2h0LWVkZ2UuY29t"]},ue);function Se(t){return Ee[t]?t:Ee.BJ}var he,Ne=function(){function t(){this.initOption={}}return t.prototype.init=function(t){this.initOption=t},t.prototype.getNaviUrlList=function(t,e){var n,o=this.initOption||{},r=o.areaCode,i=o.navigators,s=(n=r,void 0===n&&(n=Ee.BJ),Ie[Se(n)].naviUrlBase64).map((function(t){return Te(t)})),a=[],_=bt(t.split("@"),2)[1];e&&(a=_?_.split(";"):[]);var c=i&&i.length>0?Ft(Ft([],bt(a),!1),bt(i),!1):Ft(Ft([],bt(a),!1),bt(s),!1);return c.filter((function(t,e){return c.indexOf(t)===e})).map((function(t){return se(t)}))},t.prototype.getLogUrlPolicyList=function(t,e){var n,o=t||{},r=o.log,i=o.logPolicy,s=this.initOption||{},a=s.areaCode,_=s.logServerUrl,c=(n=a,void 0===n&&(n=Ee.BJ),Ie[Se(n)].logUrlBase64).map((function(t){return Ut(Ut({},t),{addr:Te(t.addr)})})),u=[],E={level:1,itv:6,times:5};if(r)u.push.apply(u,Ft([],bt(r.addrs),!1)),Object.assign(E,r.policy);else if(i)try{var R=JSON.parse(i);u.push({addr:R.url,protocol:q.HTTPS,weight:1}),E.level=R.level,E.itv=R.itv,E.times=R.times}catch(n){e.warn(S.L_REPORT_LOG_POLICY_E,JSON.stringify({policy:t.logPolicy}))}var l=_?Ft([{addr:_,protocol:q.HTTPS,weight:101}],bt(u),!1):Ft(Ft([],bt(u),!1),bt(c),!1);return{policy:E,addrs:l.filter((function(t,e){return l.findIndex((function(e){return e.addr===t.addr&&e.protocol===t.protocol}))===e})).map((function(t){return Ut(Ut({},t),{addr:se(t.addr,t.protocol)})})).sort((function(t,e){return e.weight-t.weight}))}},t.prototype.getMiniCmpUrlList=function(){var t,e,n=(e=null===(t=this.initOption)||void 0===t?void 0:t.areaCode,void 0===e&&(e=Ee.BJ),Ie[Se(e)].miniCmpBase64).map((function(t){return Te(t)})),o=(this.initOption||{}).miniCMPProxy;return o&&o.length>0?o:n},t.prototype.getStaticConfigUrl=function(){var t,e;return(e=null===(t=this.initOption)||void 0===t?void 0:t.areaCode,void 0===e&&(e=Ee.BJ),Ie[Se(e)].staticConfigUrlBase64).map((function(t){return Te(t)}))},t.prototype.getCloudControllerUrl=function(t){var e,n,o=null!=t?t:null===(e=this.initOption)||void 0===e?void 0:e.areaCode;return(n=o,void 0===n&&(n=Ee.BJ),Ie[Se(n)].cloudControllerUrlBase64).map((function(t){return Te(t)}))},t.prototype.getAreaCode=function(){var t,e;return null!==(e=null===(t=this.initOption)||void 0===t?void 0:t.areaCode)&&void 0!==e?e:Ee.BJ},t.prototype.setAreaCode=function(t){return!(!t||!Ee[t]||t===this.initOption.areaCode)&&(this.initOption.areaCode=t,!0)},t}(),fe=new Ne,Oe=function(){function t(t,e){this.appkey=t,this.logger=e,this.staticUrls=[]}return t.prototype.getStaticConfig=function(){var t;return Dt(this,void 0,void 0,(function(){var e,n,o,r,i,s,a,_;return Gt(this,(function(c){switch(c.label){case 0:if(!(e=this.getCache()))return[3,6];c.label=1;case 1:return c.trys.push([1,4,,5]),n=JSON.parse(e),Date.now()-(null==n?void 0:n.time)<18e5?[4,this.decryptData(n.val)]:[3,3];case 2:return o=c.sent(),(r=o.resources.navi.slice()).sort((function(t,e){return e.weight-t.weight})),[2,{navi:r.map((function(t){return se(t.addr,t.protocol)}))||[]}];case 3:return[3,5];case 4:return i=c.sent(),this.logger.error(S.L_GET_STATIC_CONF_E,JSON.stringify({error:null==i?void 0:i.stack})),[3,5];case 5:this.clearCache(),c.label=6;case 6:return[4,this._requestHandle()];case 7:return(s=c.sent())?[4,this.decryptData(s)]:[2];case 8:return(null==(a=c.sent())?void 0:a.areaCode)!==fe.getAreaCode()?[2]:(this.setCache(JSON.stringify({time:Date.now(),val:s})),this.staticUrls=(null==a?void 0:a.bootstrap)||[],(_=null===(t=null==a?void 0:a.resources)||void 0===t?void 0:t.navi.slice()).sort((function(t,e){return e.weight-t.weight})),[2,{navi:_.map((function(t){return se(t.addr,t.protocol)}))||[]}])}}))}))},t.prototype._requestHandle=function(){return Dt(this,void 0,void 0,(function(){var t,e,n,o,r,i,s,a,_,c,u;return Gt(this,(function(E){switch(E.label){case 0:t=(t=Ft(Ft([],bt(this.staticUrls),!1),bt(fe.getStaticConfigUrl()),!1).map((function(t){return se(t)}))).filter((function(e,n){return t.indexOf(e)===n})),E.label=1;case 1:E.trys.push([1,6,7,8]),e=Vt(t),n=e.next(),E.label=2;case 2:return n.done?[3,5]:(o=n.value,this.logger.info(S.L_GET_STATIC_CONF_T,JSON.stringify({url:o})),r=Date.now(),[4,this.sendRequest("".concat(o,"/").concat(this.appkey))]);case 3:if(i=E.sent(),s=i.code,a=i.data,200===s)return this.logger.info(S.L_GET_STATIC_CONF_R,JSON.stringify({url:o,code:s,duration:Date.now()-r})),[2,a];this.logger.warn(S.L_GET_STATIC_CONF_R,JSON.stringify({url:o,code:s,duration:Date.now()-r})),E.label=4;case 4:return n=e.next(),[3,2];case 5:return[3,8];case 6:return _=E.sent(),c={error:_},[3,8];case 7:try{n&&!n.done&&(u=e.return)&&u.call(e)}finally{if(c)throw c.error}return[7];case 8:return[2]}}))}))},t}();!function(t){t[t.STATISTICS=-2]="STATISTICS",t[t.RECORD=-1]="RECORD",t[t.FATAL=0]="FATAL",t[t.ERROR=1]="ERROR",t[t.WARN=2]="WARN",t[t.INFO=3]="INFO",t[t.DEBUG=4]="DEBUG"}(he||(he={}));var Ae,ge=function(){function t(t,e,n){this._appkey=t,this._id=e,this._type=n,this.outputLevel=he.WARN,this.debug=this._log.bind(this,he.DEBUG),this.info=this._log.bind(this,he.INFO),this.warn=this._log.bind(this,he.WARN),this.error=this._log.bind(this,he.ERROR),this.__statistics=this._log.bind(this,he.STATISTICS),this.record=this.__statistics}return t.prototype._writer=function(t,e,n,o){var r=new Date;/^[\w-]+$/.test(e)?t!==he.DEBUG&&this.flush({time:+r,sessionId:Wt,type:this._type,loggerId:this._id,tag:e,level:t,content:n,traceId:o}):console.error("".concat((new Date).toISOString(),"[").concat(this._id,"]['ERROR']: ").concat(e," | ").concat(n," | ").concat(o))},t.prototype.createTraceId=function(){return"".concat(++t._traceIdCount)},t.prototype.getSessionId=function(){return Wt},t.prototype._stdout=function(t,e,n,o,r){var i;if(!(t<=he.FATAL)&&console&&!(t>this.outputLevel)){var s=["error","warn","info","debug"][t-1];null===(i=console)||void 0===i||i[s]("".concat(n,"[").concat(this._id,"][").concat(s.toUpperCase(),"]: ").concat(e," | ").concat(o," | ").concat(r))}},t.prototype.setOutputLevel=function(t){(function(t){return[he.DEBUG,he.INFO,he.WARN,he.ERROR].some((function(e){return e===t}))})(t)&&(this.outputLevel=t)},t.prototype._log=function(t,e,n,o){this._stdout(t,e,(new Date).toISOString(),n,o),this._writer(t,e,n,o)},t._traceIdCount=0,t}(),Pe=function(){function t(t,e,n,o,r,i){void 0===i&&(i=!1),this.appkey=t,this.deviceId=e,this.deviceInfo=n,this.logDB=o,this.logger=r,this.disableLogReport=i,this.userId="",this.timer=null,this.started=!1,this.reportFailedNumber=0,this.itvByNavi=6,this.timesByNavi=5}return t.prototype.checkStart=function(t,e){return Dt(this,void 0,void 0,(function(){var n,o,r;return Gt(this,(function(i){return this.started?[2]:(this.userId=t.userId,!t.logSwitch||this.disableLogReport||(n=fe.getLogUrlPolicyList(t,this.logger),o=n.policy,r=n.addrs,this.started=!0,this.itvByNavi=o.itv,this.timesByNavi=o.times,r.length>0&&this.realtimeReport(r[0].addr,o.level,o.itv,e)),[2])}))}))},t.prototype._sendLogs2Realtime=function(t,e,n,o){return Dt(this,void 0,void 0,(function(){var r,i,s,a,_,c,u,E,R,l,d;return Gt(this,(function(p){switch(p.label){case 0:return this.logger.debug(S.L_REALTIME_LOG_O,JSON.stringify({count:t.length}),e),r=o,[4,this.compressLogs(t)];case 1:return a=p.sent(),_=a.success,c=a.data,_||this.logger.warn(S.L_REALTIME_LOG_O,"compress failed",e),this.logger.debug(S.L_REALTIME_LOG_O,"compress done",e),u=qt(n)?n:"https://".concat(n),u+="?version=".concat("5.14.1","&appkey=").concat(this.appkey,"&userId=").concat(encodeURIComponent(this.userId),"&deviceId=").concat(this.deviceId,"&deviceInfo=").concat(this.deviceInfo,"&platform=Web"),[4,this.send({url:u,body:c,method:"POST"})];case 2:if(E=p.sent(),R=E.status,l=E.data,this.logger.debug(S.L_REALTIME_LOG_R,JSON.stringify({status:R,data:l}),e),200===R){if(this.reportFailedNumber=0,l)try{(d=JSON.parse(l)).nextTime&&(r=d.nextTime),i=d.level,s=d.logSwitch}catch(t){this.logger.warn(S.L_PARSE_JSON_E,JSON.stringify({error:null==t?void 0:t.stack}),e)}this.logDB.setTimestamp4RealtimeLog(t[t.length-1].time+1)}else this.reportFailedNumber>this.timesByNavi&&this.itvByNavi<60&&(r+=r),this.reportFailedNumber++;return[2,{itv:r,level:i,logSwitch:s}]}}))}))},t.prototype.realtimeReport=function(t,e,n,o){return Dt(this,void 0,void 0,(function(){var r,i,s,a,_,c,u,E,R,l,d,p=this;return Gt(this,(function(C){switch(C.label){case 0:return r=Date.now(),i=this.logDB.getTimestamp4RealtimeLog()||Kt,s=Math.max(r-5e3,i),a=this.logger.createTraceId(),this.logger.debug(S.L_REALTIME_LOG_T,JSON.stringify({startTime:i,endTime:s,level:e,itv:n}),a),[4,this.logDB.getLogs(i,s,e,!0,o)];case 1:return _=C.sent(),c=_.dbReady,u=_.logs,c?[3,2]:(this.logger.warn(S.L_REALTIME_LOG_R,"db error",a),[3,4]);case 2:return u.length>0?[4,this._sendLogs2Realtime(u,a,t,n)]:[3,4];case 3:if(E=C.sent(),R=E.itv,l=E.level,d=E.logSwitch,n=R,void 0!==l&&(e=l),0===d)return[2];C.label=4;case 4:return this.started&&(this.timer&&clearTimeout(this.timer),n>=60&&this.itvByNavi<60&&(n=60),this.timer=setTimeout((function(){return p.realtimeReport(t,e,n,o)}),1e3*n)),[2]}}))}))},t.prototype.report=function(t,e,n,o,r,i,s){return void 0===s&&(s=!1),Dt(this,void 0,void 0,(function(){var a,_,c,u,E,R,l,d,p,C;return Gt(this,(function(T){switch(T.label){case 0:return"web"!==n.toLowerCase()||this.disableLogReport?[2]:(a=this.logger.createTraceId(),this.logger.info(S.L_REPORT_FULL_LOG_T,JSON.stringify({startTime:t,endTime:e,logId:r,messageUId:i,isCloudControl:s}),a),[4,this.logDB.getLogs(t,e,he.DEBUG,!1)]);case 1:return _=T.sent(),c=_.dbReady,u=_.logs,this.logger.info(S.L_REPORT_FULL_LOG_O,JSON.stringify({count:u.length}),a),E=qt(o)?o:"https://".concat(o),E+="?version=".concat("5.14.1","&appkey=").concat(this.appkey,"&userId=").concat(encodeURIComponent(this.userId),"&deviceId=").concat(this.deviceId,"&deviceInfo=").concat(this.deviceInfo,"&platform=Web&logId=").concat(r),c?u.length>0?[4,this.compressLogs(u)]:[3,3]:[3,5];case 2:return l=T.sent(),d=l.success,p=l.data,R=d?p:"compress failed",[3,4];case 3:R="no data",T.label=4;case 4:return[3,6];case 5:R="no database",T.label=6;case 6:return this.logger.debug(S.L_REPORT_FULL_LOG_O,"compress done",a),s&&(E+="&source=cloud"),[4,this.send({url:E,body:R,method:"POST"})];case 7:return C=T.sent().status,this.logger.info(S.L_REPORT_FULL_LOG_R,JSON.stringify({status:C}),a),[2]}}))}))},t.prototype.stop=function(){this.timer&&(clearTimeout(this.timer),this.timer=null),this.started=!1},t}();!function(t){t[t.init=1]="init",t[t.newWorkChange=2]="newWorkChange",t[t.other=3]="other"}(Ae||(Ae={}));var ve=function(){function t(t){this.reporter=t,this.logId="",this.uploadTask=[],this.taskLock=!0}return t.prototype.uploadLogCmdTask=function(t){this.uploadTask.push(t),this.enqueueTask()},t.prototype.reportLogCmdTask=function(t){var e,n,o,r,i=this;this.taskLock=!1;var s=null!==(e=t.startTime)&&void 0!==e?e:0,a=null!==(n=t.endTime)&&void 0!==n?n:0,_=null!==(o=t.platform)&&void 0!==o?o:"",c=null!==(r=t.uri)&&void 0!==r?r:"";t.logId!==this.logId&&""!==c&&(this.logId=t.logId,this.reporter.report(s,a,_,c,t.logId,"",!0).finally((function(){i.taskLock=!0,i.uploadTask.length>0&&i.enqueueTask()})))},t.prototype.enqueueTask=function(){if(this.taskLock){var t=this.uploadTask.shift();t&&this.reportLogCmdTask(t)}},t}();var Le,me,ye=function(){function t(t,e,n){this.logger=t,this.appkey=e,this.reporter=n,this.isEable=!0,this.expire=0,this.interval=0,this.timestamp=0,this.lastRequestTime=0,this.changeAreaCode=0,this._cache=null,this.uploadTaskManage=new ve(n)}return t.prototype.init=function(){try{var t=this.getLocalCloudControllerCache();this._cache=t?JSON.parse(t):{timestamp:0,lastRequestTime:0,cc:{temporary:!1,enable:!0,expire:72e5,interval:6e5},uploadLog:{temporary:!0,tasks:[]},mrtr:{chatroom:0,group:0,private:0,ultraGroup:0,temporary:!1}}}catch(t){this._cache={timestamp:0,lastRequestTime:0,cc:{temporary:!1,enable:!0,expire:72e5,interval:6e5},uploadLog:{temporary:!0,tasks:[]},mrtr:{chatroom:0,group:0,private:0,ultraGroup:0,temporary:!1}}}this._cache&&(this.interval=this._cache.cc.interval,this.expire=this._cache.cc.expire,this.timestamp=this._cache.timestamp||0,this.isEable=this._cache.cc.enable,this.lastRequestTime=this._cache.lastRequestTime,this.logCmdMsgTasks(this._cache),this.setMRTRConfig(this._handleMrtrData(this._cache.mrtr)))},t.prototype.isExire=function(){return(new Date).getTime()-this.timestamp<this.expire},t.prototype.isOverclock=function(){return(new Date).getTime()-this.lastRequestTime<this.interval},t.prototype.logCmdMsgTasks=function(t){var e=this;t.uploadLog&&t.uploadLog.tasks.forEach((function(t){t.objectName===$.LOG_COMMAND&&e.uploadTaskManage.uploadLogCmdTask(t)}))},t.prototype.dataHandle=function(t){var e=this._cache;e.lastRequestTime=this.lastRequestTime,Zt(t)&&(e.timestamp=t.timestamp,t.uploadLog&&!t.uploadLog.temporary&&(e.uploadLog=t.uploadLog),t.cc&&!t.cc.temporary&&(e.cc=t.cc),t.mrtr&&!t.mrtr.temporary&&(e.mrtr=this._handleMrtrData(t.mrtr)),t.mrtr&&this.setMRTRConfig(this._handleMrtrData(t.mrtr))),this.setCloudControllerCache(e),this.expire=e.cc.expire,this.interval=e.cc.interval,this.timestamp=e.timestamp,this.logCmdMsgTasks(t)},t.prototype.request=function(t,e,n){return Dt(this,void 0,void 0,(function(){var o,r,i,s,a,_,c,u,E,R;return Gt(this,(function(l){switch(l.label){case 0:return!this.isEable&&e===Ae.init&&this.isExire()?(this.logger.info(S.L_CLOUD_DISABLED,JSON.stringify({msg:"cloud controller is disabled"})),[2,this.timestamp]):!this.isEable&&e===Ae.newWorkChange&&this.isOverclock()?(this.logger.info(S.L_CLOUD_OVERCLOCK,JSON.stringify({msg:"cloud controller is overclock"})),[2,this.timestamp]):(o=se(t),this.lastRequestTime=(new Date).getTime(),r="".concat(o,"/v1/config"),i={"Content-Type":"application/json","RC-App-Key":this.appkey},n&&(i["RC-Token"]=n),s={platform:"web",version:"5.14.1",timestamp:this.timestamp},this.logger.record(It.L_CLOUD_INFO_FETCH_T,JSON.stringify({appKey:this.appkey,timestamp:this.timestamp,token:!!n,uri:r})),[4,this.httpRequest(r,Mt.POST,i,s)]);case 1:return a=l.sent(),_=a.code,c=a.data,this.logger.record(It.L_CLOUD_INFO_FETCH_R,JSON.stringify({appkey:this.appkey,info:c})),_===X.CLOUD_DATA_CENTER_INVALID&&c&&c.targetRegion?(u=c.targetRegion,this.changeAreaCode===u?[2,this.timestamp]:(E=fe.setAreaCode(u),this.logger.info(S.L_CLOUD_SET_AREA_CODE_O,JSON.stringify({isChangeSuccess:E,originAreaCode:fe.getAreaCode(),newAreaCode:u})),this.changeAreaCode=u,(R=fe.getCloudControllerUrl(u))[0]?[2,this.request(R[0],Ae.other)]:(this.logger.info(S.L_CLOUD_APPKEY_REGION_E,JSON.stringify({appkey:this.appkey,uri:r,msg:"appkey region error"})),[2,this.timestamp]))):(c&&this.dataHandle(c),[2,this.timestamp||this.lastRequestTime])}}))}))},t.prototype._handleMrtrData=function(t){return{chatroom:(null==t?void 0:t.chatroom)||0,group:(null==t?void 0:t.group)||0,private:(null==t?void 0:t.private)||0,ultraGroup:(null==t?void 0:t.ultraGroup)||0,temporary:!!(null==t?void 0:t.temporary)}},t}(),Me=function(t){return t===X.RC_CONN_REDIRECTED},Ue=function(){function t(t,e,n,o){this.appkey=t,this.navi=e,this.logger=n,this.listener=o,this.token="",this.curCmpUrl="",this.reconnectKick=!1,this._connectDurSwitch=!1,this.retryCount=0,this.uuid="",this.reason=0,this.connectedTime=0,this._network={status:!0,type:yt.UNKONWN},this._checkAliveTimer=null,this._crtConnectionStatus=lt.DISCONNECTED,this._crtUserId="",this._openCallPlus=!1,this._crtConnectionTask=null,this.reconnectTimer=null,this._failedCount=0,this.ALLOW_FAILED_TIMES=2}return t.prototype.getToken=function(){return this.token},t.prototype.getCurrentUserId=function(){return this._crtUserId},t.prototype.setConnectionStatus=function(t,e){if(this._crtConnectionStatus!==t){if(this._crtConnectionStatus=t,this._connectDurSwitch&&t!==lt.CONNECTED&&t!==lt.CONNECTING){var n={bid:ie(),cod:e,net:this.getNetwork().type,dur:Date.now()-this.connectedTime,cid:"".concat(this.uuid,"_").concat(this.retryCount)};this.logger.record(It.IM_CONNECTION_DURATION,JSON.stringify(n)),this._connectDurSwitch=!1}switch(t){case lt.CONNECTED:this.logger.info(S.L_CONNECT_S,t),this.checkAlive(),this.listener.onConnected();break;case lt.CONNECTING:this.logger.warn(S.L_CONNECT_S,"status: ".concat(t,", code: ").concat(e)),this.listener.onConnecting();break;case lt.SUSPENDED:this.logger.warn(S.L_CONNECT_S,"status: ".concat(t,", code: ").concat(e)),Me(e)&&this.clearCmpWeightCache(),this._checkAliveTimer&&clearTimeout(this._checkAliveTimer),this.listener.onSuspend(e);break;default:this.logger.warn(S.L_CONNECT_S,"status: ".concat(t,", code: ").concat(e)),this.clearCmpWeightCache(),this._checkAliveTimer&&clearTimeout(this._checkAliveTimer),this.listener.onDisconnected(e)}}},t.prototype.getConnectionStatus=function(){return this._crtConnectionStatus},t.prototype.setNetwork=function(t,e){if(!e){var n={cid:"".concat(this.uuid,"_").concat(this.retryCount),cn:t.type,on:this._network.type};this.logger.record(It.IM_NETWORK_CHANGE,JSON.stringify(n))}this._network=t},t.prototype.getNetwork=function(){return this._network},t.prototype.connect=function(t,e,n,o){return Dt(this,void 0,void 0,(function(){var r,i,s,a;return Gt(this,(function(_){switch(_.label){case 0:return this._crtConnectionStatus===lt.CONNECTED?[2,le(this._crtUserId)]:this._crtConnectionTask?[2,this._crtConnectionTask]:(this._openCallPlus=n,this.retryCount=0,this.uuid=Yt(),this.token=t,this.reconnectKick=e,this.setConnectionStatus(lt.CONNECTING),r={cid:"".concat(this.uuid,"_").concat(this.retryCount),reason:vt.CONNECT,net:this.getNetwork().type,spr:0},this.logger.record(It.IM_STATS_CS,JSON.stringify(r),o),[4,this.try2Connect(t,e,!1,o,!0)]);case 1:return i=_.sent(),s=i.code,a=i.data,s!==X.SUCCESS?(this.setConnectionStatus(lt.DISCONNECTED,s),[2,pe(s)]):(this.setConnectionStatus(lt.CONNECTED),[2,le(a)])}}))}))},t.prototype.try2Connect=function(t,e,n,o,r){return Dt(this,void 0,void 0,(function(){var i;return Gt(this,(function(s){switch(s.label){case 0:return this._crtConnectionTask?[2,this._crtConnectionTask]:(this._crtConnectionTask=this.createConnectionTask(t,e,n,o,r),[4,this._crtConnectionTask]);case 1:return i=s.sent(),this._crtConnectionTask=null,[2,i]}}))}))},t.prototype.createConnectionTask=function(t,e,n,o,r){return Dt(this,void 0,void 0,(function(){var i,s,a,_,c,u,E,R,l;return Gt(this,(function(d){switch(d.label){case 0:return i={retryCount:this.retryCount,uuid:this.uuid,type:this.getNetwork().type,reason:this.reason},[4,this.navi.request(t,n,!1,o,i)];case 1:return s=d.sent(),a=s.code,_=s.data,a!==X.SUCCESS?[2,pe(a)]:1===(c=_).type?[2,pe(X.PACKAGE_ENVIRONMENT_ERROR)]:(this.logger.info(S.L_CONNECT_T,JSON.stringify({token:t,reconnectKickEnable:e}),o),[4,this.connectWithToken(t.replace(/@.+$/,"@"),c,e,o)]);case 2:return u=d.sent(),E=u.code,R=u.data,Me(E)?(this.logger.warn(S.L_CONNECT_R,"redirect code: ".concat(E),o),this.clearCmpWeightCache(),[2,this.createConnectionTask(t,e,!0,o,r)]):[X.RC_TCP_RESET,X.RC_CONN_ACK_TIMEOUT,X.RC_TCP_DISCONNECTED_NO_RMTP].includes(E)&&this.cmpWeightCache&&this.cmpWeightCache.length>1?(this.updateCmpWeight(this.curCmpUrl,!1),l=this.cmpWeightCache.every((function(t){return t.failed})),r&&l?(this.logger.warn(S.L_CONNECT_R,"cpp code:".concat(E,",reture code:").concat(X.SERVER_UNAVAILABLE),o),[2,pe(X.SERVER_UNAVAILABLE)]):(this.logger.warn(S.L_CONNECT_R,"cmp ack timeout, code: ".concat(E),o),this.setConnectionStatus(lt.SUSPENDED,E),this.setConnectionStatus(lt.CONNECTING),[2,this.createConnectionTask(t,e,!1,o,r)])):E!==X.SUCCESS?(this.logger.warn(S.L_CONNECT_R,"code: ".concat(E),o),[2,pe(E)]):(this.logger.info(S.L_CONNECT_R,"userId: ".concat(R),o),this._connectDurSwitch=!0,this._crtUserId=R,[2,le(R)])}}))}))},t.prototype.setReconnectReason=function(t){switch(t){case X.TIMEOUT:return void(this.reason=vt.TIMEOUT);case X.RC_CONN_REDIRECTED:return void(this.reason=vt.REDIRECTED);default:this.reason=vt.RECONNECT}},t.prototype.try2Reconnect=function(t,e){return Dt(this,void 0,void 0,(function(){var n,o,r=this;return Gt(this,(function(i){return n=this.logger.createTraceId(),this.logger.debug(S.T,"try2Reconnect -> ignoreNaviCache: ".concat(t,", reason: ").concat(e),n),this.stopReconnectTimer(),o=function(){return Dt(r,void 0,void 0,(function(){var r,i;return Gt(this,(function(s){switch(s.label){case 0:return this._crtConnectionStatus!==lt.SUSPENDED?[2]:(this.setConnectionStatus(lt.CONNECTING,e),this.setReconnectReason(e),this.retryCount+=1,r={cid:"".concat(this.uuid,"_").concat(this.retryCount),reason:this.reason,net:this.getNetwork().type,spr:0},this.logger.record(It.IM_STATS_CS,JSON.stringify(r)),[4,this.try2Connect(this.token,!0,t,n,!1)]);case 1:return i=s.sent().code,this.reconnectTimer=null,i===X.SUCCESS?(this.setConnectionStatus(lt.CONNECTED),[2]):[X.SERVER_UNAVAILABLE,X.TIMEOUT,X.RC_SOCKET_DISCONNECTED,X.RC_SOCKET_NOT_CREATED,X.RC_CONN_ACK_TIMEOUT,X.RC_TCP_RESET,X.RC_NAVI_REQ_FAILED,X.RC_NETWORK_DOWN,X.RC_TCP_DISCONNECTED_NO_RMTP].includes(i)?(this._crtConnectionStatus!==lt.CONNECTING||(this.setConnectionStatus(lt.SUSPENDED,i),this.reconnectTimer=setTimeout(o,5e3)),[2]):(this.setConnectionStatus(lt.DISCONNECTED,i),[2])}}))}))},o(),[2]}))}))},t.prototype.onDisconnectByServer=function(t,e){var n=this;return Me(t)?(this.setConnectionStatus(lt.SUSPENDED,t),void this.try2Reconnect(!0,t)):t===X.RC_UDP_DISCONNECTED?(this.setConnectionStatus(lt.SUSPENDED,t),void setTimeout((function(){n.try2Reconnect(!0,t)}),1e3*(e||0))):void this.setConnectionStatus(lt.DISCONNECTED,t)},t.prototype.onDisconenctUnusual=function(t){this.setConnectionStatus(lt.SUSPENDED,t),this.try2Reconnect(!1,t)},t.prototype.checkAlive=function(){return Dt(this,void 0,void 0,(function(){var t,e,n=this;return Gt(this,(function(o){switch(o.label){case 0:return this._crtConnectionStatus!==lt.CONNECTED?(this._failedCount=0,this.logger.debug(S.L_CHECK_ALIVE_IM_S,"stop ping because of no connection"),[2]):(t=this.logger.createTraceId(),this.logger.info(S.L_CHECK_ALIVE_IM_T,null,t),[4,this.sendPing(15e3)]);case 1:return(e=o.sent())===X.SUCCESS?(this.logger.info(S.L_CHECK_ALIVE_IM_R,e,t),this._failedCount=0,this._checkAliveTimer=setTimeout((function(){return n.checkAlive()}),15e3),[2]):this._crtConnectionStatus!==lt.CONNECTED?[2]:(this._failedCount+=1,this.logger.info(S.L_CHECK_ALIVE_IM_R,"code: ".concat(e,", count: ").concat(this._failedCount),t),this._failedCount<this.ALLOW_FAILED_TIMES?[2,this.checkAlive()]:(this._failedCount=0,this.logger.warn(S.L_CHECK_ALIVE_IM_S,"ping timeout, close connection to reconnect!"),this.close(!0,!1),this.setConnectionStatus(lt.SUSPENDED,X.RC_PING_EXCEED_LIMIT),this.try2Reconnect(!1,X.RC_PING_EXCEED_LIMIT),[2]))}}))}))},t.prototype.disconnect=function(t){return Dt(this,void 0,void 0,(function(){return Gt(this,(function(e){switch(e.label){case 0:return this.stopReconnectTimer(),this._crtConnectionTask?[4,this._crtConnectionTask]:[3,2];case 1:e.sent(),e.label=2;case 2:return this.setConnectionStatus(lt.DISCONNECTED,X.ACTIVE_DISCONNECT),this.close(!1,t),[2]}}))}))},t.prototype.stopReconnectTimer=function(){this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null)},t.prototype.getCmpList=function(t,e){if(this.cmpWeightCache&&this.cmpWeightCache.length>0)return Ft([],bt(this.cmpWeightCache),!1);var n=ee(t,e);return this.cmpWeightCache=Ft([],bt(n),!1),Ft([],bt(n),!1)},t.prototype.updateCmpWeight=function(t,e,n){if(this.cmpWeightCache){var o=this.cmpWeightCache.find((function(e){return n?e.addr===t&&e.protocol===q.QUIC:e.addr===t}));if(o)if(e){var r=Math.max.apply(Math,Ft([],bt(this.cmpWeightCache.map((function(t){return t.weight}))),!1));o.weight!==r&&(o.weight=r+1)}else{var i=Math.min.apply(Math,Ft([],bt(this.cmpWeightCache.map((function(t){return t.weight}))),!1));o.weight!==i&&(o.weight=i-1),o.failed=!0}}},t.prototype.clearCmpWeightCache=function(){this.cmpWeightCache=void 0},t.prototype.reconnect=function(t,e,n,o){this.token=t,this.reconnectKick=e,this._openCallPlus=n,this.onDisconenctUnusual(o)},t}(),De=function(t){return t.replace(/@.+$/,"@")},Ge=function(){function t(t,e,n,o,r){void 0===o&&(o=!0),void 0===r&&(r=!0),this.appkey=t,this.logger=e,this.staticConfigManager=n,this.isRequestProfile=o,this.isUseDynamicNaviUrl=r,this.crtRequest=null,this._environment="default"}return t.prototype.getCatchKey=function(t){return t+(this._environment?"-".concat(this._environment):"")},t.prototype.request=function(t,e,n,o,r){return Dt(this,void 0,void 0,(function(){var i;return Gt(this,(function(s){switch(s.label){case 0:return this.crtRequest?[2,this.crtRequest]:(this.crtRequest=this.sendRequest(t,e,n,o,r),[4,this.crtRequest]);case 1:return i=s.sent(),this.crtRequest=null,[2,i]}}))}))},t.prototype.sendRequest=function(t,e,n,o,r){var i;return Dt(this,void 0,void 0,(function(){var s,a,_,c,u,E,R,l,d,p,C,T,I,h;return Gt(this,(function(N){switch(N.label){case 0:return s=De(t),a=this.getNaviCache(s),!e&&a&&(_=a.timestamp,c=a.naviInfo,n||Date.now()-_<wt)?(this.logger.info(S.L_REQUEST_T,JSON.stringify({fromCache:!0,naviInfo:c}),o),u={bid:ie(),ptc:Ot.NAVI,cod:X.SUCCESS,net:null==r?void 0:r.type,dur:0,spr:0,pr:null!==(i=c.type)&&void 0!==i?i:0,hos:"",cache:At.LOCAL,v:gt.CURRENT,rsn:null==r?void 0:r.reason,cid:"".concat(null==r?void 0:r.uuid,"_").concat(null==r?void 0:r.retryCount),count:null==r?void 0:r.retryCount},this.logger.record(It.IM_NAVI,JSON.stringify(u),o),[2,le(c)]):(E=fe.getNaviUrlList(t,this.isUseDynamicNaviUrl),this.logger.info(S.L_GET_NAVI_T,JSON.stringify({token:t,uris:E}),o),[4,this.requestHandler(E,t,o,r)]);case 1:return R=N.sent(),l=R.code,d=R.data,l===X.RC_NAVI_REQ_FAILED&&this.isRequestProfile?[4,this.staticConfigManager.getStaticConfig()]:[3,4];case 2:return(null==(p=N.sent())?void 0:p.navi)&&(null==p?void 0:p.navi.length)>0?(C=p.navi,[4,this.requestHandler(C,t,o,r)]):[3,4];case 3:T=N.sent(),l=T.code,d=T.data,N.label=4;case 4:return l!==X.SUCCESS?(this.logger.warn(S.L_GET_NAVI_R,l,o),[2,pe(l)]):(I=d).code&&200!==I.code?(this.logger.warn(S.L_GET_NAVI_R,I.code,o),[2,pe(this.transHttpCode(I.code))]):ee(I).length>0?(this.logger.info(S.L_GET_NAVI_R,JSON.stringify({naviInfo:I}),o),this.setNaviCache(s,I),[2,de(l,I)]):(h={server:I.server,backupServer:I.backupServer,serverAddr:I.serverAddr,bs:I.bs},this.logger.warn(S.L_GET_NAVI_R,"navi server address invalid: ".concat(JSON.stringify(h)),o),[2,pe(X.SERVER_UNAVAILABLE)])}}))}))},t.prototype.requestHandler=function(t,e,n,o){return Dt(this,void 0,void 0,(function(){var r,i,s,a,_,c,u,E,R;return Gt(this,(function(l){switch(l.label){case 0:r=0,i=t.length,l.label=1;case 1:return r<i?(s=r===t.length-1,a=this.useV2Navi()?this.httpRequestV2:this.httpRequest,_=Date.now(),[4,a.call(this,t[r],this.appkey,e,n,s)]):[3,4];case 2:if(c=l.sent(),u=c.code,E=c.data,R={bid:ie(),ptc:Ot.NAVI,cod:u,net:null==o?void 0:o.type,dur:Date.now()-_,spr:0,pr:(null==E?void 0:E.type)||0,hos:t[r],cache:At.REQUEST,v:gt.CURRENT,rsn:null==o?void 0:o.reason,cid:"".concat(null==o?void 0:o.uuid,"_").concat(null==o?void 0:o.retryCount),count:null==o?void 0:o.retryCount},this.logger.record(It.IM_NAVI,JSON.stringify(R),n),[X.SUCCESS,X.RC_CONN_TOKEN_INCORRECT,X.RC_LICENSE_EXPIRED].includes(u))return[2,de(u,E)];l.label=3;case 3:return r+=1,[3,1];case 4:return[2,pe(X.RC_NAVI_REQ_FAILED)]}}))}))},t.prototype.transHttpCode=function(t){switch(t){case 401:case 403:return X.RC_CONN_TOKEN_INCORRECT;case 416:return X.RC_LICENSE_EXPIRED;default:return X.RC_NAVI_REQ_FAILED}},t.prototype.getNaviInfoFromCache=function(t){var e=this.getNaviCache(De(t));return e?e.naviInfo:null},t.prototype.updateVoipCallInfo=function(t,e){var n=this.getNaviInfoFromCache(t);n&&this.setNaviCache(De(t),Ut(Ut({},n),{voipCallInfo:e}))},t.prototype.getNaviV2RequestOption=function(t){var e,n=t.uri,o=t.token,r=t.platform,i=t.protocol,s=t.mac;e="".concat(n,"/v2/navi.json?cloud=").concat(0);var a="token=".concat(encodeURIComponent(o),"&version=").concat("5.14.1","&platfrom=").concat(r);return s&&(a+="&m=".concat(s)),{method:"POST",headers:{"RC-Appkey":this.appkey,"Content-Type":"Application/x-www-form-urlencoded","RC-Negotiate":"conn=".concat(i,";rtc=4;log=2")},body:a,url:e,timeout:1e4}},t.prototype.useV2Navi=function(){return!0},t}();!function(t){t.P_INIT_O="P-init-O",t.P_DB_OPEN_O="P-db_open-O",t.P_DB_UPGRATE_START_S="P-db_upgrate_start-S",t.P_DB_UPGRATING_S="P-db_upgrating-S",t.P_DB_UPGRATE_COMPLETE_S="P-db_upgrate_complete-S",t.P_CALL_MAIN_SYNC_E="P-call_main_sync-E",t.P_CALL_MAIN_E="P-call_main-E",t.P_SEND_2_MAIN_E="P-send_2_main-E",t.P_REGTYP_O="P-regtype-O",t.P_CALL_ADDON_E="P-call_addon-E",t.P_CALL_ADDON_T="P-call_addon-T",t.P_CALL_ADDON_O="P-call_addon-O",t.P_CALL_ADDON_R="P-call_addon-R",t.P_CALL_EXTRA_E="P-call_extra-E",t.P_CONNECT_S="P-connect-S",t.P_CONNECT_T="P-connect-T",t.P_CONNECT_O="P-connect-O",t.P_CONNECT_ENTRY_S="P-connect_entry-S",t.P_REPORT_VER_O="P-report_version-O",t.P_PARSE_JSON_MSGS_E="P-parse_json_messsages-E",t.P_PARSE_JSON_MSGS_R="P-parse_json_messsages-R",t.P_RECEIVE_MESSAGE_E="P-receive_message-E",t.P_HTTP_REQ_E="P-http_request-E",t.P_SET_MSG_EXTEN_O="P-set_msg_extension-O",t.P_SEND_MSG_T="P-send_msg-T",t.P_SEND_MSG_R="P-send_msg-R",t.P_PARSE_JSON_SUBSCRIBE_DATA_E="P-parse_json_subscribe_data-E",t.P_PARSE_JSON_USER_PROFILE_E="P-parse_json_user_profile-E",t.P_PARSE_JSON_USER_PROFILE_LIST_E="P-parse_json_user_profile_list-E",t.P_WRITE_LOG_T="P_WRITE_LOG_T",t.P_WRITE_LOG_R="P_WRITE_LOG_R",t.P_PARSE_JSON_E="P-parse_json-E"}(Le||(Le={})),function(t){t[t.ERROR=-1]="ERROR",t[t.RESPONSE=0]="RESPONSE",t[t.EVENT=1]="EVENT",t[t.CALLBACK=2]="CALLBACK"}(me||(me={}));var Ve=function(t){return{sendError:function(e){t.send({type:me.ERROR,data:{msg:e}})},sendEvent:function(e){for(var n=[],o=1;o<arguments.length;o++)n[o-1]=arguments[o];t.send({type:me.EVENT,data:{eventName:e,data:n}})},sendResponse:function(e){t.send({type:me.RESPONSE,data:e})},sendCallback:function(e){t.send({type:me.CALLBACK,data:e})}}},be=e.resolve(__dirname,"binding","electron-".concat(t.platform(),"-").concat(t.arch(),".node")),Fe={addon:null},we=Ve(process).sendError;try{Fe.addon=require(be)}catch(t){console.error("error ->",be,"\n",t),we(t.toString())}Fe.addon||console.error("error -> cannot find module: ",be);var xe,Be=Fe.addon,ke={flushTimestamp:Date.now(),queue:[],locked:!1};function He(){xe&&clearInterval(xe)}function Je(t){He(),xe=setInterval((function(){return Ke(t)}),1e4)}function Ye(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];(t=ke.queue).push.apply(t,Ft([],bt(e),!1))}var We=200;function Ke(t){var e=ke.queue,n=ke.flushTimestamp;if(!(ke.locked||0===e.length||Date.now()-n<3e4&&e.length<We)){ke.locked=!0;var o=t.createTraceId(),r=t.getSessionId(),i=e.splice(0,We).map((function(t){var e=t.sessionId,n=t.level,o=t.time,i=t.type,s=t.tag,a=t.loggerId,_=t.content,c=t.traceId;return{level:n,time:o,type:i,tag:s,sessionId:"".concat(r,":").concat(e),content:{loggerId:a,content:_,traceId:c}}}));t.debug(Le.P_WRITE_LOG_T,"writingLen: ".concat(i.length,", queueLen: ").concat(e.length),o);var s=JSON.stringify(i);Be.writeLog(s),t.debug(Le.P_WRITE_LOG_R,"write done, queueLen: ".concat(e.length),o),ke.flushTimestamp=Date.now(),ke.locked=!1,setTimeout((function(){return Ke(t)}))}}var je=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return T(e,t),e.prototype.flush=function(t){Ye(t)},e}(ge),Xe=function(t,e){var n,o=Buffer.from(t),r=o.length;for(e.push(r),n=0;n<r;n++)e.push(o[n])},Qe=function(t){return"string"==typeof t},qe=function(t){return Qe(t)?t.toUpperCase():""},Ze=function(t,e){var n="";return 2!==t.length?n="Unexpected number of bytes received.":5!==t[0]?n="Unexpected SOCKS version number: ".concat(t[0],"."):255===t[1]?n="No acceptable authentication methods were offered.":-1===e.indexOf(t[1])&&(n="Unexpected SOCKS authentication method: ".concat(t[1],".")),n},ze=function(t){var e="";return 2!==t.length?e="Unexpected number of bytes received.":1!==t[0]?e="Unexpected authentication method code: ".concat(t[0],"."):0!==t[1]&&(e="Username and password authentication failure: ".concat(t[1],".")),e},$e=function(t){var e=qe(t.method)||"GET",n=t.pathname||"/",o=t.headers||{},r=t.search||"";o.Host=t.host||"loclahost";var i="";for(var s in i="".concat(e," ").concat(n+r," HTTP/1.1\n"),o)if(Object.hasOwnProperty.call(o,s)){var a=o[s];i+="".concat(s,": ").concat(a,"\n")}return t.body&&(i+="Content-Length: ".concat(t.body.length,"\n")),i+="\n","POST"===e&&t.body&&(i+="".concat(t.body)),i},tn=function(t){return new Promise((function(e){var n,o;t.socket.once("data",(function(o){var r,i=Ze(o,n);if(!i)return 2===o[1]?(t.socket.once("data",(function(n){var o=ze(n);o?t.emit("error",new Error("SOCKS authentication failed. ".concat(o))):e()})),r=[1],Xe(t.socksUsername,r),Xe(t.socksPassword,r),void t.write(Buffer.from(r))):void e();t.emit("error",new Error("SOCKS authentication failed. ".concat(i)))})),n=[0],t.socksUsername&&n.push(2),(o=Buffer.alloc(2+n.length))[0]=5,o[1]=n.length,n.forEach((function(t,e){o[2+e]=t})),t.write(o)}))},en=function(t,e,n){return new Promise((function(o){var r,i;switch(t.socket.once("data",(function(e){var n;5!==e[0]?n="Unexpected SOCKS version number: ".concat(e[0],"."):0!==e[1]?n="".concat(function(t){switch(t){case 1:return"General SOCKS server failure";case 2:return"Connection not allowed by ruleset";case 3:return"Network unreachable";case 4:return"Host unreachable";case 5:return"Connection refused";case 6:return"TTL expired";case 7:return"Command not supported";case 8:return"Address type not supported";default:return"Unknown status code ".concat(t)}}(e[1]),"."):0!==e[2]&&(n="The reserved byte must be 0x00."),n?t.emit("error",new Error("SOCKS connection failed. ".concat(n))):o()})),(r=[]).push(5),r.push(1),r.push(0),a.isIP(e)){case 0:r.push(3),Xe(e,r);break;case 4:r.push(1),function(t,e){var n,o,r=t.split(".");for(n=0;n<4;n++)o=parseInt(r[n],10),e.push(o)}(e,r);break;case 6:t.emit("error",new Error("Does not support IPV6"))}r.length+=2,(i=Buffer.from(r)).writeUInt16BE(n,i.length-2),t.write(i)}))},nn=function(t){function e(e){var n=t.call(this)||this;return n.readable=!0,n.socket=new a.Socket,n.options=e,n.socksHost=e.socksHost||"localhost",n.socksPort=e.socksPort||1080,n.socksUsername=e.socksUsername||"",n.socksPassword=e.socksPassword||"",n.socket.on("error",(function(t){n.emit("error",t)})),n.on("error",(function(){n.socket.destroyed||n.socket.destroy()})),n.on("end",n.end),n}return T(e,t),e.prototype.ref=function(){return this.socket.ref()},e.prototype.unref=function(){return this.socket.unref()},e.prototype.setTimeout=function(t,e){return this.socket.setTimeout(t,e)},e.prototype.setNoDelay=function(t){return this.socket.setNoDelay(t)},e.prototype.setKeepAlive=function(t,e){return this.socket.setKeepAlive(t,e)},e.prototype.address=function(){return this.socket.address()},e.prototype.cork=function(){return this.socket.cork()},e.prototype.uncork=function(){return this.socket.uncork()},e.prototype.pause=function(){return this.socket.pause()},e.prototype.resume=function(){return this.socket.resume()},e.prototype.pipe=function(t){return this.socket.pipe(t)},e.prototype.end=function(t,e){var n=this.socket.end(t,e);return this.writable=this.socket.writable,n},e.prototype.destroy=function(t){return this.socket.destroy(t)},e.prototype.setEncoding=function(t){return this.socket.setEncoding(t)},e.prototype.write=function(t,e,n){return this.socket.write(t,e,n)},e.prototype.read=function(t){return this.socket.read(t)},e.prototype.connect=function(t,e){var n=this;if("string"==typeof t&&/^\d+$/.test(t)&&(t=parseInt(t,10)),!Number.isInteger(t)||t<1||t>65535)throw new TypeError("Invalid port: ".concat(t));if(!e||"string"!=typeof e)throw new TypeError("Invalid host: ".concat(e));return this.socket.connect({port:this.socksPort,host:this.socksHost},(function(){return Dt(n,void 0,void 0,(function(){var n;return Gt(this,(function(o){switch(o.label){case 0:return[4,tn(this)];case 1:return o.sent(),[4,en(this,e,t)];case 2:return o.sent(),this.onProxied(),n=$e(this.options),this.socket.write(Buffer.from(n)),[2]}}))}))})),this},e.prototype.onProxied=function(){var t=this;this.socket.on("close",(function(e){t.emit("close",e)})),this.socket.on("end",(function(){t.emit("end")})),this.socket.on("data",(function(e){t.emit("data",e)})),this.writable=!0,this.readable=!0,this.emit("connect")},e}(_.EventEmitter),on=function(t){var e,n=t.hostname,o=t.port;return!t.host||n&&o||(e=t.host.split(":")),!o&&e&&(o=parseInt(e[1],10)||0),!n&&e&&(n=bt(e,1)[0]),new nn(t).connect(o,n)},rn=function(t){function e(e){var n=t.call(this)||this;return n.createConnection=on,n}return T(e,t),e}(o.Agent),sn=function(t,e,n){return(e=Ut(Ut({},e),s.parse(t))).port||(e.port=80),e.agent=new rn(e),o.request(e,n)},an=function(t){var e,n;return e=on(t),n=e.onProxied,e.onProxied=function(){var o;t.socket=e.socket,t.hostname?t.servername=t.hostname:t.host&&(o=bt(t.host.split(":"),1),t.servername=o[0]),e.socket=c.connect(t,(function(){e.authorized=e.socket.authorized,n.call(e)})),e.socket.on("error",(function(t){e.emit("error",t)}))},e},_n=function(t){function e(e,n){var o=t.call(this,n)||this;return o.url=e,o.socksHost=n.socksHost||"localhost",o.socksPort=n.socksPort||1080,o.createConnection=an,o}return T(e,t),e}(r.Agent),cn=function(t,e,n,o){var i,s;return e.protocol="https:",!e.port&&e.host&&(i=bt(e.host.split(":"),2),e.port=i[0],e.port=i[1]),e.port||(e.port=443),s=new _n(t,e),e.agent=s,r.request(t,e,n)},un=null;function En(t,e,n){void 0===n&&(n=!1);var i=e.url,s=e.headers,a=e.body,_=e.method,c=e.query,u=e.timeout,E=void 0===u?6e4:u;return new Promise((function(e){var u=/^https/.test(i),R={headers:Ut(Ut({},s),{"Accept-Encoding":"gzip, br"}),method:_};u&&(R.rejectUnauthorized=n);var l=null;un?((R=Ut(Ut({},R),un)).body=a,l=u?cn:sn):(l=o.request,u&&(R.agent=new r.Agent(R),l=r.request));var d=l(function(t,e){if(t=t.replace(/\?$/,""),!e)return t;var n=Object.keys(e).map((function(t){return"".concat(t,"=").concat(e[t])})).filter((function(t){return!!t}));return n.length?[t,n.join("&")].join("?"):t}(i,c),R,(function(t){var n,o,r=t.statusCode,i="";if("gzip"===(null===(n=t.headers)||void 0===n?void 0:n["content-encoding"])){var s=p.default.createGunzip();t.pipe(s),s.on("data",(function(t){i+=t})),s.on("end",(function(){e({status:r,data:i})}))}else if("br"===(null===(o=t.headers)||void 0===o?void 0:o["content-encoding"])){var a=p.default.createBrotliDecompress();t.pipe(a),a.on("data",(function(t){i+=t})),a.on("end",(function(){e({status:r,data:i})}))}else t.setEncoding("utf8"),t.on("data",(function(t){i+=t})),t.once("end",(function(){e({status:r||0,data:i})}))}));d.once("timeout",(function(){t.warn(Le.P_HTTP_REQ_E,JSON.stringify({msg:"timeout",url:i,method:_,query:c,timeout:E})),e({status:0})})),d.setTimeout(E),d.once("error",(function(n){t.warn(Le.P_HTTP_REQ_E,JSON.stringify({msg:n.stack,url:i,method:_,query:c,timeout:E})),e({status:0})})),d.write(a),d.end()}))}function Rn(t,e){return t?(un=Ut(Ut({},un),t),e.info(S.A_SET_PROXY_O,JSON.stringify({msg:"set proxy",data:un})),{code:X.SUCCESS}):(un=null,e.info(S.A_REMOVE_PROXY_O,JSON.stringify({msg:"remove proxy"})),{code:X.SUCCESS})}function ln(){var t=un||void 0;return{code:X.SUCCESS,data:t}}var dn=function(){function t(t,e,n,o){var r=this;this.p=t,this.emit=e,this.callback=n,this.errorHandle=o,this.count=0,this.maps={},this.p.on("message",(function(t){var i=t.type,s=t.data;switch(i){case me.EVENT:var a=s,_=a.eventName,c=a.data;null==e||e.apply(void 0,Ft([_],bt(c),!1));break;case me.RESPONSE:var u=s,E=u.reqId,R=u.success,l=u.data,d=r.maps[E];if(!d)return;d({success:R,data:l}),delete r.maps[E];break;case me.CALLBACK:null==n||n(s);break;case me.ERROR:var p=s.msg;null==o||o(p)}})),this.p.on("error",(function(t){null==o||o("SubProcessProxy error ".concat(t))})),this.p.on("exit",(function(t,e){if(0!==t){for(var n in r.maps){if(Object.prototype.hasOwnProperty.call(r.maps,n))(0,r.maps[n])({success:!0,data:{code:X.SUB_PROCESS_EXIT,msg:"sub process exit"}})}null==o||o("SubProcessProxy exit ".concat(t," ").concat(e),!0)}})),this.p.on("close",(function(t,e){console.log("SubProcessProxy close",t,e)}))}return t.prototype.call=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return Dt(this,void 0,void 0,(function(){var n=this;return Gt(this,(function(o){return this.p.killed||this.p.exitCode?[2,Promise.resolve({success:!1,data:{code:X.SUB_PROCESS_EXIT,msg:"sub process exit"}})]:[2,new Promise((function(o){var r=++n.count;n.maps[r]=o;var i={reqId:r,method:t,args:e,hasResponse:!0};n.p.send(i)}))]}))}))},t.prototype.send=function(t){for(var e,n=[],o=1;o<arguments.length;o++)n[o-1]=arguments[o];return Dt(this,void 0,void 0,(function(){var o;return Gt(this,(function(r){return(this.p.killed||this.p.exitCode)&&(null===(e=this.errorHandle)||void 0===e||e.call(this,"sub process exit")),o={reqId:-1,method:t,args:n},this.p.send(o),[2]}))}))},t.prototype.destroy=function(){this.send("destroy")},t}(),pn="rc-realtime-log-timestamp",Cn=[],Tn=!1,In=function(){return Dt(void 0,void 0,void 0,(function(){var t,e,n,o,r,i,s,a,_,c,u,E;return Gt(this,(function(R){return Tn||0===Cn.length||(Tn=!0,t=Cn.shift(),e=t.args,n=t.resolve,o=e.startTime,r=e.endTime,i=e.level,s=e.realtimeReport,a=0,_=0,c=[],u=function(t){a+=t.length;var e=bt(t.split(",")),o=e[0],r=e[1],u=e[2],E=e[3],R=e[4],l=e.slice(5);if(a>20971520&&parseInt(r,10)!==_)n(c);else{_=parseInt(r,10);try{if(!s&&i<0)return;var d={time:parseInt(r,10),level:parseInt(E,10),sessionId:o,type:u,tag:R,content:l.join(",")};c.push(d)}catch(t){console.error(t)}}},E=function(t){n(c),Tn=!1,In()},Be.getFullLog(i,o,r,!1,u,E)),[2]}))}))},Sn=function(t){function o(e,n,o,r){void 0===r&&(r=!1);var i,s=process.versions.electron,a="Electron|".concat(s,"|").concat(process.arch,"|").concat(process.platform);return i=t.call(this,e,n,a,{getLogs:function(t,e,n,o){return Dt(this,void 0,void 0,(function(){return Gt(this,(function(r){switch(r.label){case 0:return[4,(i={startTime:t,endTime:e,level:n,realtimeReport:o},Dt(void 0,void 0,void 0,(function(){return Gt(this,(function(t){return[2,new Promise((function(t){Cn.push({resolve:t,args:i}),In()}))]}))})))];case 1:return[2,{logs:r.sent(),dbReady:!0}]}var i}))}))},getTimestamp4RealtimeLog:function(){var t=Be.getStoreValue(pn);return parseInt(t,10)||0},setTimestamp4RealtimeLog:function(t){Be.setStoreValue(pn,t.toString())}},o,r)||this,i}return T(o,t),o.prototype.send=function(t){return En(this.logger,t)},o.prototype.stop=function(){this._subProcess&&this._subProcess.destroy(),t.prototype.stop.call(this)},o.prototype.compressLogs=function(t){return Dt(this,void 0,void 0,(function(){var o,r,i,s;return Gt(this,(function(a){switch(a.label){case 0:return this._subProcess||(o=n.fork(e.resolve(__dirname,"sub-process.js")),this._subProcess=new dn(o)),[4,this._subProcess.call("compressLogs",t)];case 1:return r=a.sent(),i=r.success,s=r.data,i?[2,{success:i,data:s.data}]:[2,{success:i,data:""}]}}))}))},o}(Pe),hn=[q.RMTP,q.TLS];"darwin"===process.platform&&hn.push(q.QUIC);var Nn=function(t){return"RongCloud/navis/".concat(t,"/navi-cache.json")},fn="deviceId",On=function(t){return"RongCloud/caches/".concat(t,"/staticConfig.json")},An=function(t){return"RongCloud/cloudControl/".concat(t,"/cloudControl.json")},gn=null,Pn=function(){var e,n=Date.now(),o=[t.arch(),t.platform(),process.pid,n,Math.floor(Math.random()*n)].join("__");return e=o,E.createHash("md5").update(e).digest("hex")},vn=function(t){if(gn)return gn;var n=e.resolve(t,fn);return u.existsSync(n)?gn=u.readFileSync(n).toString():(gn=Pn(),u.writeFileSync(n,gn),gn)},Ln=function(){function t(t){this._callCppProxy=t,this._setTime=15962112e5}return t.prototype._setToProtocol=function(t,e,n,o,r,i){var s=JSON.stringify(r);"{}"!==s&&t.info(Le.P_SET_MSG_EXTEN_O,JSON.stringify({messageUId:o,ext:r})),this._callCppProxy("setMessageExtension",e,n,o,s,i)},t.prototype.setLocalFromReceiveMsg=function(t,e){var n=e.channelId,o=e.conversationType,r=e.targetId,i=e.messageUId,s=e.expansion,a=e.sentTime;if(s&&0!==Object.keys(s).length){var _={};for(var c in s)_[c]={v:"",ts:0},_[c].v=s[c],_[c].ts=a;this._setToProtocol(t,o,r,i,_,n||"")}},t.prototype.setLocalFromExtMsg=function(t,e){var n=e.channelId,o=e.conversationType,r=e.targetId,i=e.content,s=e.sentTime,a=i,_=a.put,c=this._callCppProxy("getMessage",a.mid),u=JSON.parse(c).extMsg,E=JSON.parse(u||"{}");if(_)for(var R in _){var l=E[R];l&&l.ts<s-this._setTime?(l.v=_[R],l.ts=s-this._setTime):(E[R]={v:"",ts:0},E[R].v=_[R],E[R].ts=s-this._setTime)}a.del&&a.del.forEach((function(t){delete E[t]})),this._setToProtocol(t,o,r,a.mid,E,n||"")},t.prototype.parseReceiveExpansion=function(t){var e=JSON.parse(t.extMsg||"{}"),n={};for(var o in e)n[o]=e[o].v;return n},t.prototype.parseConverOrHisExpansion=function(t){var e=JSON.parse(t.extMsg),n=JSON.parse(e||"{}"),o={};for(var r in n)o[r]=n[r].v;return o},t}();function mn(e){var n,o;void 0===e&&(e="IPv4");var r=t.networkInterfaces(),i=[];try{for(var s=Vt(Object.values(r)),a=s.next();!a.done;a=s.next()){var _=a.value;if(_&&-1!==Object.prototype.toString.call(_).indexOf("Array")){var c=_.filter((function(t){return!(t.internal||(n=t.mac,/^(0{1,2}[:-]){5}0{1,2}$/.test(n))||t.family&&t.family!==e);var n})).map((function(t){return t.mac}));i.push.apply(i,Ft([],bt(c),!1))}}}catch(t){n={error:t}}finally{try{a&&!a.done&&(o=s.return)&&o.call(s)}finally{if(n)throw n.error}}return i.length?Ft([],bt(i),!1).sort()[0]:""}var yn,Mn=function(t,e,n){return Dt(void 0,void 0,void 0,(function(){var o,r;return Gt(this,(function(i){return o=E.createDecipheriv("aes-256-cbc",e,n),r=o.update(t,"base64","utf-8"),[2,r+=o.final("utf8")]}))}))},Un=function(t){if(!u.existsSync(t)){var n=e.resolve(t,"..");u.existsSync(n)||Un(n),u.mkdirSync(t)}},Dn=function(t){return Object.entries(t).map((function(t){var e=bt(t,2),n=e[0],o=e[1];return{key:n,value:String(o)}}))},Gn=function(t){return{removeMute:!!(null==t?void 0:t.removeMuteStatus),removeWhiteList:!!(null==t?void 0:t.removeWhiteList),removeFavoriteMembers:!!(null==t?void 0:t.removeFollow)}},Vn=function(t){function n(n,o,r,i){var s=t.call(this,n,o,i)||this;s.naviPath="",s._caches={},s.naviPath="".concat(r,"/").concat(Nn(n));var a=e.dirname(s.naviPath);return u.existsSync(a)||Un(a),s}return T(n,t),n.prototype.httpRequest=function(t,e,n,o){return Dt(this,void 0,void 0,(function(){var r,i,s,a,_;return Gt(this,(function(c){switch(c.label){case 0:return r="token=".concat(encodeURIComponent(n),"&v=").concat(Bt,"&p=PC&ev=").concat("5.14.1","&m=").concat(mn()),i="".concat(t,"/navi.json?r=").concat(Date.now(),"&env=").concat(this._environment),this.logger.info(S.L_REQUEST_T,JSON.stringify({url:i,body:r}),o),[4,En(this.logger,{method:"POST",headers:{appId:e},body:r,url:i,timeout:1e4})];case 1:if(200!==(s=c.sent()).status)return this.logger.warn(S.L_REQUEST_R,JSON.stringify({url:i,code:s.status}),o),[2,pe(this.transHttpCode(s.status))];this.logger.info(S.L_REQUEST_R,JSON.stringify({url:i,data:s.data}),o);try{return a=JSON.parse(s.data),_=/^https/.test(i)?"https":"http",a.protocol=_,a.code&&200!==a.code?[2,pe(this.transHttpCode(a.code))]:[2,le(a)]}catch(t){return this.logger.error(S.L_PARSE_NAVI_E,s.data,o),[2,pe(X.RC_NAVI_REQ_FAILED)]}return[2]}}))}))},n.prototype.httpRequestV2=function(t,e,n,o){return Dt(this,void 0,void 0,(function(){var r,i,s,a;return Gt(this,(function(_){switch(_.label){case 0:return r=this.getNaviV2RequestOption({appkey:e,token:n,uri:t,platform:"electron",protocol:hn.join(","),mac:mn()}),this.logger.info(S.L_REQUEST_T,JSON.stringify({url:r.url,body:r.body,headers:r.headers}),o),[4,En(this.logger,r)];case 1:if(200!==(i=_.sent()).status)return this.logger.warn(S.L_REQUEST_R,JSON.stringify({url:r.url,code:i.status}),o),[2,pe(this.transHttpCode(i.status))];this.logger.info(S.L_REQUEST_R,JSON.stringify({url:r.url,data:i.data}),o);try{return s=JSON.parse(i.data),a=/^https/.test(r.url)?"https":"http",s.protocol=a,[2,le(s)]}catch(t){return this.logger.error(S.L_PARSE_NAVI_E,i.data,o),[2,pe(X.RC_NAVI_REQ_FAILED)]}return[2]}}))}))},n.prototype.getNaviCache=function(t){var e=this.getCatchKey(t),n=this._caches[e];if(n)return n;if(!u.existsSync(this.naviPath))return null;var o=u.readFileSync(this.naviPath,{encoding:"utf8"});try{return this._caches=JSON.parse(o),this._caches[e]}catch(t){this.logger.error(S.L_PARSE_NAVI_E,o)}return null},n.prototype.setNaviCache=function(t,e){var n=Date.now(),o=this.getCatchKey(t);if(Zt(this._caches))for(var r in this._caches){(n-this._caches[r].timestamp>wt||o===r)&&delete this._caches[r]}this._caches[o]={token:t,naviInfo:e,timestamp:Date.now(),environment:this._environment},u.writeFileSync(this.naviPath,JSON.stringify(this._caches))},n.prototype.setEnvironment=function(t){this._environment=t},n}(Ge);!function(t){t[t.SUCCESS=0]="SUCCESS",t[t.NOT_INIT=-1]="NOT_INIT",t[t.CANCELED=-2]="CANCELED",t[t.REPEAT=-3]="REPEAT"}(yn||(yn={}));var bn,Fn=function(t){function e(e,n,o,r,i){var s=t.call(this,e,o,r,i)||this;return s.callCppProxy=n,s._connectedTime=0,s._naviInfo=null,s._excludeLogTag=["P-API_RCGetValueForKey-T","P-API_RCGetValueForKey-E","P-API_RCGetValueForKey-R","P-API_RCSetValueForKey-T","P-API_RCSetValueForKey-E","P-API_RCSetValueForKey-R"],s.connectResolve=null,s._startTime=0,s._tcpDuration=0,s.pingResolve=null,s.callCppProxy("setConnectionStatusListener",s._onConnectionStatusChange.bind(s),(function(t){s.logger.info(Le.P_DB_OPEN_O,t)}),(function(){return s.recvPong(X.SUCCESS)}),s._onConnectionStatusChange.bind(s),s._onTcpConnectResponse.bind(s),(function(){var t;s.logger.info(Le.P_DB_UPGRATE_START_S),null===(t=i.onDBUpgrateStart)||void 0===t||t.call(i)}),(function(t){var e;s.logger.info(Le.P_DB_UPGRATING_S,t),null===(e=i.onDBUpgrading)||void 0===e||e.call(i,t)}),(function(t){var e;s.logger.info(Le.P_DB_UPGRATE_COMPLETE_S,t),null===(e=i.onDBUpgradeComplete)||void 0===e||e.call(i,t)})),s}return T(e,t),e.prototype.getConnectedTime=function(){return this._connectedTime},e.prototype.connectWithToken=function(t,e,n,o){var r=this;return new Promise((function(i){r._naviInfo=e,r.connectResolve={resolve:i,traceId:o,userId:e.userId};var s={},a=ln().data;a&&(s={proxy_passwd:a.socksPassword||"",proxy_name:a.socksUsername||"",proxy_port:a.socksPort||1082,proxy_host:a.socksHost||"localhost",proxy_type:0});var _=JSON.stringify(Ut(Ut({},s),{call_plus:r._openCallPlus})),c=r.getCmpList(e,!0).filter((function(t){return hn.includes(t.protocol)})).sort((function(t,e){return t.weight>e.weight?-1:1})),u=[];c.forEach((function(t){var e=u.find((function(e){return e.addr===t.addr}));e?e.protocol!==q.QUIC&&t.protocol!==q.QUIC||(e.race=!0,e.protocol=q.QUIC):(t.race=!1,u.push(t))})),r.logger.info(Le.P_CONNECT_O,JSON.stringify({use:u,catche:r.cmpWeightCache,proxy:s,FORMATED_VERSION:Bt,reconnectKickEnable:n}),o),r._startTime=Date.now();try{r.callCppProxy("connectWithToken",t,Bt,JSON.stringify(Ut(Ut({},e),{serverAddr:u,tagBlacklist:r._excludeLogTag.join(",")})),n,_)}catch(t){r.logger.error(Le.P_CALL_ADDON_E,null==t?void 0:t.stack,o),r.recvConnectRes(X.RC_SOCKET_NOT_CREATED)}}))},e.prototype.close=function(t,e){void 0===e&&(e=!0),t||this.callCppProxy("disconnect",e)},e.prototype.sendPing=function(t){var e=this;return new Promise((function(n){e.pingResolve=n,e.callCppProxy("sendHeartbeat"),setTimeout((function(){return e.recvPong(X.TIMEOUT)}),t)}))},e.prototype.recvPong=function(t){this.pingResolve&&(this.pingResolve(t),this.pingResolve=null)},e.prototype._onConnectionStatusChange=function(t,e){switch(this.logger.info(Le.P_CONNECT_S,JSON.stringify({status:t,delay:e})),t){case X.SUCCESS:this.recvConnectRes(X.SUCCESS);break;case X.RC_CONN_REDIRECTED:case 32061:this.recvConnectRes(X.RC_CONN_REDIRECTED,!0);break;case 11:case 10:case 12:break;case X.RC_SOCKET_DISCONNECTED:this.recvConnectRes(t,!1);break;case X.RC_SOCKET_NOT_CREATED:case X.RC_CONN_ACK_TIMEOUT:case X.RC_TCP_RESET:this.recvConnectRes(t);break;case X.RC_UDP_DISCONNECTED:this.recvConnectRes(t,!0,e);break;default:this.recvConnectRes(t,!0)}},e.prototype.recvConnectRes=function(t,e,n){if(this.connectResolve){var o=this.connectResolve,r=o.resolve,i=o.userId,s=Date.now()-(this._startTime+this._tcpDuration),a={bid:ie(),cod:t,net:this.getNetwork().type,dur:s,spr:0,cid:"".concat(this.uuid,"_").concat(this.retryCount),v:gt.CURRENT,count:this.retryCount};return this.logger.record(It.IM_CMP_RMTP,JSON.stringify(a)),t===X.SUCCESS&&(this._connectedTime=Date.now()-this.callCppProxy("getDeltaTime")),r(de(t,i)),void(this.connectResolve=null)}if(e)this.onDisconnectByServer(t,n);else{if(t===X.RC_SOCKET_DISCONNECTED)if(this.getConnectionStatus()!==lt.CONNECTED)return;this.onDisconenctUnusual(t)}},e.prototype._onTcpConnectResponse=function(t,e,n,o,r,i,s){var a,_=this.cmpWeightCache.findIndex((function(t){return t.addr==="".concat(e,":").concat(n)})),c={bid:ie(),ptc:Ot.TCP,cod:t,net:this.getNetwork().type,dur:o,spr:0,pr:(null===(a=this._naviInfo)||void 0===a?void 0:a.type)||0,hos:"".concat(e,":").concat(n),idx:_,rct:this.retryCount?Pt.RECONNECT:Pt.CONNECT,cid:"".concat(this.uuid,"_").concat(this.retryCount),v:gt.CURRENT,rsn:this.reason,ddu:r,count:this.retryCount,weight:_>=0?this.cmpWeightCache[_].weight:-1};if(this.logger.record(It.IM_CMP,JSON.stringify(c)),this.logger.info(Le.P_CONNECT_ENTRY_S,JSON.stringify({code:t,host:e,port:n,duration:o,dnsDuration:r,index:i,isQuic:s})),t===yn.SUCCESS)this.curCmpUrl="".concat(e,":").concat(n),this.updateCmpWeight("".concat(e,":").concat(n),!0,s);else if(t!==yn.NOT_INIT){var u=n&&0!==n?"".concat(e,":").concat(n):"".concat(e);this.updateCmpWeight(u,!1)}},e}(Ue),wn=function(t){function n(n,o,r){var i=t.call(this,n,o)||this;i.appkey=n,i.logger=o,i.dbpath=r,i._cachePath="",i._cachePath="".concat(r,"/").concat(On(n));var s=e.dirname(i._cachePath);return u.existsSync(s)||Un(s),i}return T(n,t),n.prototype.getCache=function(){return u.existsSync(this._cachePath)&&u.readFileSync(this._cachePath,{encoding:"utf8"})||null},n.prototype.setCache=function(t){u.writeFileSync(this._cachePath,t)},n.prototype.clearCache=function(){u.writeFileSync(this._cachePath,"")},n.prototype.sendRequest=function(t){return Dt(this,void 0,void 0,(function(){var e,n,o;return Gt(this,(function(r){switch(r.label){case 0:return[4,En(this.logger,{url:t,body:""})];case 1:return e=r.sent(),n=e.status,o=e.data,[2,{code:n,data:o}]}}))}))},n.prototype.decryptData=function(t){return Dt(this,void 0,void 0,(function(){var e,n;return Gt(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,Mn(t,"cd4936151214ce45dc1d12673a59d94c","51ad078e5eb17a91")];case 1:return e=o.sent(),[2,JSON.parse(e)];case 2:return n=o.sent(),this.logger.error(S.L_GET_STATIC_CONF_E,JSON.stringify({error:null==n?void 0:n.stack})),[3,3];case 3:return[2]}}))}))},n}(Oe),xn=function(t){function n(n,o,r,i,s){var a=t.call(this,o,n,r)||this;a.deviceId=i,a.model="",a.catchFilePath="",a.model="Electron|".concat(process.platform,"|").concat(process.arch),a.catchFilePath="".concat(s,"/").concat(An(n));var _=e.dirname(a.catchFilePath);return u.existsSync(_)||Un(_),a.init(),a}return T(n,t),n.prototype.httpRequest=function(t,e,n,o){return Dt(this,void 0,void 0,(function(){var r,i,s,a,_,c,u,E;return Gt(this,(function(R){switch(R.label){case 0:return(r=o).deviceId=this.deviceId,r.model=this.model,i={url:t,method:e,headers:n,body:JSON.stringify(r)},this.logger.info(S.L_REQUEST_T,JSON.stringify(i)),[4,En(this.logger,i)];case 1:s=R.sent(),a=s.status,_=s.data,c=void 0===_?"":_,this.logger.info(S.L_REQUEST_R,JSON.stringify({status:a,data:c}));try{return u=JSON.parse(c),E=u.data,[2,{code:a,data:E}]}catch(t){return this.logger.warn(S.L_CLOUD_CONFIG_DATA_E,JSON.stringify({status:a,data:c,error:t})),[2,{code:a,msg:t}]}return[2]}}))}))},n.prototype.setCloudControllerCache=function(t){u.writeFileSync(this.catchFilePath,JSON.stringify(t)),this.logger.info(S.L_CLOUD_SET_CACHE_O,JSON.stringify(t))},n.prototype.getLocalCloudControllerCache=function(){if(!u.existsSync(this.catchFilePath))return null;var t=u.readFileSync(this.catchFilePath,{encoding:"utf8"});return this.logger.info(S.L_CLOUD_GET_CACHE_O,JSON.stringify({appkey:this.appkey,data:t})),t},n.prototype.setMRTRConfig=function(t){var e={mrtrChatroom:t.chatroom,mrtrGroup:t.group,mrtrPrivate:t.private,mrtrUltraGroup:t.ultraGroup};this.logger.info(S.L_CLOUD_SET_MRTR_O,JSON.stringify(e)),Be.setCloudConfig(JSON.stringify(e))},n}(ye),Bn=function(){function t(t,e){var n=this;this._logger=t,this._method=e,this._traceId=this._logger.createTraceId(),this._promise=new Promise((function(t){n._resolve=t}))}return t.create=function(e,n){return new t(e,n)},t.prototype.invoke=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var o=this,r=o._method,i=o._traceId,s=o._logger;s.debug(Le.P_CALL_ADDON_T,JSON.stringify({method:r,params:e}),i);try{t=Be[r].apply(Be,Ft([],bt(e),!1))}catch(t){throw s.error(Le.P_CALL_ADDON_E,JSON.stringify({stack:null==t?void 0:t.stack,method:r}),i),t}return t!==X.SUCCESS&&this.fail(t),this},t.prototype.ok=function(t){this._logger.debug(Le.P_CALL_ADDON_R,"success",this._traceId),this._flush(le(t))},t.prototype.fail=function(t){this._logger.warn(Le.P_CALL_ADDON_R,"faile: ".concat(t),this._traceId),this._flush(pe(t))},t.prototype._flush=function(t){var e=this;setTimeout((function(){return e._resolve(t)}),0)},t.prototype.result=function(){return this._promise},t}();!function(t){t[t.cuid=1]="cuid",t[t.uid=2]="uid",t[t.all=4]="all"}(bn||(bn={}));var kn=function(){function t(t,e,n,o,r,i){var s=this;this._appkey=t,this._dbpath=e,this._dispatchEvent=n,this._enableSyncEmptyTopConversation=o,this._logOutputLevel=r,this._customMessageType={},this.cloudControllerUri="",this.cloudControllerLock=!0,this.cloudControllerMsgs=[],this._buildSubscribeEventData=function(t){var e=[];try{JSON.parse(t).list.forEach((function(t){var n=JSON.parse(t.obj),o=n.userId,r=n.subscribeType,i=n.subscribeTime,a=n.duration,_=n.operationType,c=n.details,u=void 0===c?[]:c,E=n.userProfile,R={userId:o,subscribeType:r,subscribeTime:i,expiry:a,operationType:_};[ut.ONLINE_STATUS,ut.FRIEND_ONLINE_STATUS].includes(r)&&(R.details=u.map((function(t){var e=JSON.parse(t);return{changeTime:e.changeTime,eventValue:e.changeValue,platform:e.platform}}))),[ut.USER_PROFILE,ut.FRIEND_USER_PROFILE].includes(r)&&(R.userProfile=s._string2userProfileInfo(E)),e.push(R)}))}catch(e){s.logger.error(Le.P_PARSE_JSON_SUBSCRIBE_DATA_E,JSON.stringify({error:null==e?void 0:e.stack,data:t}))}return e},this._chatroomCache=[],this.rtcHeartbeatResolves={};var a=this._dbpath,_=vn(a);this.logger=new je(this._appkey,"RC-M","IM"),Be.initWithAppkey(t,a,Bt,this.logger.getSessionId()),Be.setConsoleLogLevel((this._logOutputLevel||he.WARN)+1),this.logger.setOutputLevel(this._logOutputLevel),Je(this.logger),this.reporter=new Sn(t,_,this.logger,i),this.logger.info(Le.P_INIT_O,JSON.stringify({appkey:t,dbpath:a,proto_commit:Be.getNodeVersion(),deviceId:_,commit:"bb02ce9b00b8d2a591b38b86f7bd87daf5c5e56d",processName:process.title,processPId:process.pid,disableLogReport:i})),this._callCppProxy("setDeviceId",_),this._staticConfigManager=new wn(t,this.logger,a),this.navi=new Vn(t,this.logger,a,this._staticConfigManager),this.tcpMgr=new Fn(t,this._callCppProxy.bind(this),this.navi,this.logger,{onConnected:this.onConnected.bind(this),onSuspend:this.onSuspend.bind(this),onDisconnected:this.onDisconnected.bind(this),onConnecting:this.onConnecting.bind(this),onDBUpgrateStart:this.dbUpgradeStart.bind(this),onDBUpgrading:this.dbUpgrading.bind(this),onDBUpgradeComplete:this.dbUpgradeComplete.bind(this)}),this._enableCreateEmptyTopConversation(this._enableSyncEmptyTopConversation),this._initCloudController(_,a),this._registerMsgTypes(),this._setOnReceiveMessageListener(),this._setConversationStatusListener(),this._setPushNotificationListener(),this._setRTCHeartbeatListener(),this._setRTCLivingRoomEventListener(),this._setChatroomEventListener(),this._setCallInfoListener(),this._setSubscribeEventListener(),this._setUserProfileListener(),this._setEntrustGroupListener(),this._setFriendEventListener(),this._msgExpansionHandler=new Ln(this._callCppProxy.bind(this))}return t.prototype._initCloudController=function(t,e){var n;n=bt(fe.getCloudControllerUrl(),1),this.cloudControllerUri=n[0],this.cloudController=new xn(this._appkey,this.logger,this.reporter,t,e),this.cloudControllerUri&&this.cloudController.request(this.cloudControllerUri,Ae.init)},t.prototype.callProxy=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return Dt(this,void 0,void 0,(function(){var n,o,r;return Gt(this,(function(i){switch(i.label){case 0:if(!(n=this[t]))return this.logger.warn(Le.P_CALL_MAIN_E,JSON.stringify({method:t,error:"not found"})),[2,Promise.resolve({code:X.NOT_SUPPORT})];o="",i.label=1;case 1:return i.trys.push([1,3,,4]),[4,n.call.apply(n,Ft([this],bt(e),!1))];case 2:return[2,i.sent()];case 3:return r=i.sent(),o=JSON.stringify({error:null==r?void 0:r.stack,method:t}),this.logger.error(Le.P_CALL_MAIN_E,o),[3,4];case 4:return[2,{code:X.MAIN_PROCESS_ERROR,msg:o}]}}))}))},t.prototype.sendProxy=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return Dt(this,void 0,void 0,(function(){var n;return Gt(this,(function(o){if(!(n=this[t]))return this.logger.warn(Le.P_CALL_MAIN_E,JSON.stringify({method:t,error:"not found"})),[2];try{n.call.apply(n,Ft([this],bt(e),!1))}catch(e){this.logger.error(Le.P_CALL_MAIN_E,JSON.stringify({error:null==e?void 0:e.stack,method:t}))}return[2]}))}))},t.prototype.registerRenderers=function(t){var e=t.navigators,n=t.areaCode,o=t.logServerUrl,r=t.environment;this._environment=r||"default",this.navi.setEnvironment(r),fe.init({areaCode:n,navigators:e,logServerUrl:o})},t.prototype.onConnected=function(){return Dt(this,void 0,void 0,(function(){var t,e,n;return Gt(this,(function(o){switch(o.label){case 0:return t=this.getNaviInfoFromCache(),this.reporter.checkStart(t,""),this._try2RejoinChatroom(),e=this._dispatchEvent,n=["onConnected"],[4,this.getMainProcessCache()];case 1:return e.apply(this,n.concat([o.sent()])),[2]}}))}))},t.prototype.onConnecting=function(){this._dispatchEvent("onConnecting",void 0)},t.prototype.onSuspend=function(t){this._dispatchEvent("onSuspend",t)},t.prototype.onDisconnected=function(t){this._dispatchEvent("onDisconnected",t)},t.prototype.dbUpgradeStart=function(){this._dispatchEvent("databaseUpgradeWillStart")},t.prototype.dbUpgrading=function(t){this._dispatchEvent("databaseUpgrading",t)},t.prototype.dbUpgradeComplete=function(t){this._dispatchEvent("databaseUpgradeDidComplete",t)},t.prototype._callCppProxy=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];var o=this.logger.createTraceId();try{return this.logger.debug(Le.P_CALL_ADDON_O,JSON.stringify({method:t,content:e}),o),Be[t].apply(Be,Ft([],bt(e),!1))}catch(e){throw this.logger.error(Le.P_CALL_ADDON_E,JSON.stringify({stack:null==e?void 0:e.stack,method:t}),o),e}},t.prototype.refetchNaviInfo=function(){return this.navi.request(this.tcpMgr.getToken(),!0,!0,this.logger.createTraceId())},t.prototype.sendHTTPRequest=function(t){return En(this.logger,t)},t.prototype.onRendererLogsReceived=function(t){Ye.apply(void 0,Ft([],bt(t),!1))},t.prototype.setNetwork=function(t,e){if(this.tcpMgr.setNetwork(t,e),t.status&&this.cloudController){var n=this.tcpMgr.getToken();this.cloudController.request(this.cloudControllerUri,Ae.newWorkChange,n)}},t.prototype.destroy=function(){this.reporter.stop(),He(),Be.destroy(),process.exit(0)},t.prototype.callExtra=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];var o=this[t];if(!o)return this.logger.warn(Le.P_CALL_EXTRA_E,JSON.stringify({method:t,error:"not found"})),Promise.resolve({code:X.NOT_SUPPORT});try{return o.call.apply(o,Ft([this],bt(e),!1))}catch(e){this.logger.error(Le.P_CALL_EXTRA_E,JSON.stringify({error:null==e?void 0:e.stack,method:t}))}return Promise.resolve({code:X.MAIN_PROCESS_ERROR})},t.prototype.getConversationsByPage=function(t,e,n,o,r){var i,s=this,a=this._callCppProxy("getConversationListByPageWithTopPriority",t,e,n,r||!1,o||"");try{i=JSON.parse(a).list.map((function(t){return s._buildConversation(t.obj)}))}catch(t){return Promise.resolve({code:X.MAIN_PROCESS_ERROR})}return Promise.resolve({code:X.SUCCESS,data:i})},t.prototype.getUnreadConversationList=function(t){var e,n=this,o=this._callCppProxy("getUnreadConversationList",t);try{e=JSON.parse(o).list.map((function(t){return n._buildConversation(t.obj)}))}catch(t){return Promise.resolve({code:X.MAIN_PROCESS_ERROR})}return Promise.resolve({code:X.SUCCESS,data:e})},t.prototype.getConversationListWithAllChannel=function(){var t,e=this,n=[Q.PRIVATE,Q.GROUP,Q.SYSTEM,Q.APP_PUBLIC_SERVICE,Q.PUBLIC_SERVICE],o=this._callCppProxy("getConversationListWithAllChannel",n);try{t=JSON.parse(o).list.map((function(t){return e._buildConversation(t.obj)}))}catch(t){return Promise.resolve({code:X.MAIN_PROCESS_ERROR})}return Promise.resolve({code:X.SUCCESS,data:t})},t.prototype.getConversationListWithAllChannelByPage=function(t,e){var n,o=this,r=[Q.PRIVATE,Q.GROUP,Q.SYSTEM,Q.APP_PUBLIC_SERVICE,Q.PUBLIC_SERVICE],i=this._callCppProxy("getConversationListWithAllChannelByPage",r,t,e);try{n=JSON.parse(i).list.map((function(t){return o._buildConversation(t.obj)}))}catch(t){return Promise.resolve({code:X.MAIN_PROCESS_ERROR})}return Promise.resolve({code:X.SUCCESS,data:n})},t.prototype.getHistoryMessagesByObjectNames=function(t,e,n,o,r,i,s){var a=0===i,_=o+1,c=this._callCppProxy("getHistoryMessagesByObjectNames",t,e,n,_,r,a,s||""),u=[];try{var E=JSON.parse(c).list;E.reverse();for(var R=0;R<E.length;R++){var l=this._buildMessage(E[R].obj);u[R]=l}}catch(t){return Promise.resolve({code:X.MAIN_PROCESS_ERROR})}return Promise.resolve({code:X.SUCCESS,data:{list:_===u.length?u.slice(1,_):u,hasMore:o<u.length}})},t.prototype.updateMessageReceiptStatus=function(t,e,n,o){void 0===o&&(o="");var r=this._callCppProxy("updateMessageReceiptStatus",t,e,n,o);return Promise.resolve({code:X.SUCCESS,data:r})},t.prototype.getNaviInfoFromCache=function(){return this.tcpMgr.getConnectionStatus()!==lt.CONNECTED?null:this.navi.getNaviInfoFromCache(this.tcpMgr.getToken())},t.prototype.createLogger=function(t,e){return/^RC/.test(t)?null:new je(this._appkey,t,e)},t.prototype.getConnectedTime=function(){return this.tcpMgr.getConnectedTime()},t.prototype.getServerTime=function(){return Date.now()-Be.getDeltaTime()},t.prototype.getCurrentUserId=function(){return this.tcpMgr.getCurrentUserId()},t.prototype.getMainProcessCache=function(){var t=this.tcpMgr.getConnectedTime(),e=this.tcpMgr.getConnectionStatus(),n=this.getNaviInfoFromCache(),o=this.tcpMgr.getCurrentUserId(),r=this.getDeviceId(),i=Be.getDeltaTime();return Promise.resolve({connectedTime:t,deviceId:r,crtUserId:o,naviInfo:n,connectionStatus:e,deltaTime:i})},t.prototype._enableCreateEmptyTopConversation=function(t){this._callCppProxy("enableCreateEmptyTopConversation",t)},t.prototype._registerMsgTypes=function(){for(var t in xt["RC:RcCmd"]={isCounted:!1,isPersited:!1},xt){var e=xt[t],n=e.isCounted,o=e.isPersited,r=e.searchProps,i=0;o&&(i|=1),n&&(i|=2),"RC:TypSts"===t&&(i=16),this._callCppProxy("registerMessageType",t,i,r||[])}},t.prototype._buildIsMentioned=function(t,e){var n,o=!1;if(Xt(t))n=t;else try{n=t?JSON.parse(t):t}catch(e){n=t,this.logger.error(Le.P_PARSE_JSON_MSGS_E,JSON.stringify({content:t}))}return Xt(n)&&(o=!!n.mentionedInfo),{isMentioned:o,msgContent:n}},t.prototype._buildMsgOption=function(t){var e={isCounted:!1,isPersited:!1};return t in xt?e=xt[t]:t in this._customMessageType&&(e=this._customMessageType[t]),e},t.prototype._buildSupportExt=function(t,e,n){var o=null;return t&&(o=this._msgExpansionHandler.parseReceiveExpansion(n),"conversation"!==e&&"history"!==e||(o=this._msgExpansionHandler.parseConverOrHisExpansion(n))),o},t.prototype._handleReadReceiptRequest=function(t){var e=JSON.parse(t),n=this.getNaviInfoFromCache();if(!(null==n?void 0:n.grpRRVer))return e;var o=e,r=o.hasRespond,i=o.readerInfo,s=void 0===i?{}:i,a=o.readCount,_=o.totalCount,c=o.readerList,u=void 0===c?[]:c,E={readCount:a,totalCount:_};if(1===(null==n?void 0:n.grpRRVer)){var R=[];for(var l in s)R.push({userId:l,readTime:s[l]});E.readerList=R,E.hasRespond=r}return 3===(null==n?void 0:n.grpRRVer)&&(E.readerList=u),E},t.prototype._buildMessage=function(t,e){var n;void 0===e&&(e={});var o=e.isOffLineMessage,r=e.buildFrom,i=JSON.parse(t),s=i.channelId,a=i.conversationType,_=i.targetId,c=i.senderUserId,u=i.content,E=i.objectName,R=i.messageUid,l=i.direction,d=i.status,p=i.messageId,C=i.sentTime,T=i.readReceiptRequest,I=i.supportExt,h=i.pushContent,N=i.pushTitle,f=i.pushId,O=i.pushConfig,A=i.templateId,g=i.disableTitle,P=i.forcePushDetail,v=i.hasMore,L=i.directedUsers,m=i.noNotification,y=i.disableUpdateLastMessage,M=this._buildIsMentioned(u,p),U=M.isMentioned,D=M.msgContent,G=this._buildMsgOption(E),V=this._buildSupportExt(I,r,i),b=Qt(o)?C<this.tcpMgr.getConnectedTime():o,F={};O&&(F=function(t,e,n){var o={},r={notificationId:n||""},i={};if(!e)return{iOSConfig:o,androidConfig:r,harmonyOSConfig:i};try{var s=JSON.parse(e);null==s||s.forEach((function(t){var e,n,s,a,_,c,u,E,R,l,d,p,C=Object.keys(t);if(0!==C.length){var T=C[0];switch(T){case"HW":return r.channelIdHW=null===(e=t[T])||void 0===e?void 0:e.channelId,r.importanceHW=null===(n=t[T])||void 0===n?void 0:n.importance,r.imageUrlHW=null===(s=t[T])||void 0===s?void 0:s.image,void(r.categoryHW=null===(a=t[T])||void 0===a?void 0:a.category);case"MI":return void(r.channelIdMi=null===(_=t[T])||void 0===_?void 0:_.channelId);case"OPPO":return void(r.channelIdOPPO=null===(c=t[T])||void 0===c?void 0:c.channelId);case"VIVO":return r.typeVivo=null===(u=t[T])||void 0===u?void 0:u.classification,void(r.categoryVivo=null===(E=t[T])||void 0===E?void 0:E.category);case"APNS":return o.threadId=t[T]["thread-id"],o.apnsCollapseId=t[T]["apns-collapse-id"],o.category=t[T].category,o.richMediaUri=t[T].richMediaUri,void(o.interruptionLevel=t[T]["interruption-level"]);case"FCM":return void(r.googleConfig={collapseKey:t[T].collapse_key||"",imageUrl:t[T].imageUrl||"",priority:t[T].priority||""});case"HONOR":return r.importanceHonor=null===(R=t[T])||void 0===R?void 0:R.importance,void(r.imageUrlHonor=null===(l=t[T])||void 0===l?void 0:l.image);case"OHOS":i.category=null===(d=t[T])||void 0===d?void 0:d.category,i.image=null===(p=t[T])||void 0===p?void 0:p.image}}}))}catch(n){t.error(S.O,"Wrong format for pushConfigs field! content: ".concat(e))}return{iOSConfig:o,androidConfig:r,harmonyOSConfig:i}}(this.logger,O,f));var w=Ut(Ut({},F),{pushTitle:N,pushContent:h,pushData:h,disablePushTitle:g,forceShowDetailContent:P,templateId:A}),x={channelId:s,conversationType:a,targetId:_,senderUserId:c,content:D||{},messageType:E,messageUId:R||"",messageDirection:l,isOffLineMessage:b,sentTime:C,receivedTime:0,isPersited:G.isPersited,isCounted:G.isCounted,isMentioned:U,disableNotification:m,isStatusMessage:(null===(n=this._customMessageType[E])||void 0===n?void 0:n.isStatusMessage)||!1,canIncludeExpansion:I,expansion:I?V:null,receivedStatus:d,receivedStatusInfo:zt(d),messageId:p,pushConfig:w,hasMore:v,directedUserIds:L||[],disableUpdateLastMessage:y};if(l===Ct.RECEIVE?x.receivedStatus=this._compatibleReceivedStatus(x.receivedStatusInfo):l===Ct.SEND&&(x.sentStatus=d),T){var B=this._handleReadReceiptRequest(T);x.readReceiptInfo=B}return x},t.prototype._compatibleReceivedStatus=function(t){var e=Nt.UNREAD;return t.isRead?e=Nt.READ:t.isListened?e=Nt.LISTENED:t.isDownload?e=Nt.DOWNLOADED:t.isRetrieved&&(e=Nt.RETRIEVED),e},t.prototype._updateReadReceiptInfo=function(t,e){var n=this._callCppProxy("getMessage",t),o=JSON.parse(n),r=o.readReceiptRequest?JSON.parse(o.readReceiptRequest):{},i=Ut(Ut({},r),e);this._callCppProxy("updateReadReceiptRequestInfo",t,JSON.stringify(i))},t.prototype._processRRRspMsg=function(t,e,n){var o,r,i,s;if(e!==this.getCurrentUserId()){var a=t[this.getCurrentUserId()]||[];try{for(var _=Vt(a),c=_.next();!c.done;c=_.next()){h=c.value;var u=this._callCppProxy("getMessage",h),E=JSON.parse(u),R=E.readReceiptRequest?JSON.parse(E.readReceiptRequest):{},l=R.isReceiptRequestMessage,d=R.readerList,p=void 0===d?[]:d;l&&!p.includes(e)&&(p.push(e),this._callCppProxy("updateReadReceiptRequestInfo",h,JSON.stringify({isReceiptRequestMessage:l,readerList:p})))}}catch(t){i={error:t}}finally{try{c&&!c.done&&(s=_.return)&&s.call(_)}finally{if(i)throw i.error}}}else for(var C in t){var T=t[C];try{for(var I=(o=void 0,Vt(T)),S=I.next();!S.done;S=I.next()){var h=S.value;this._callCppProxy("updateReadReceiptRequestInfo",h,JSON.stringify({isReceiptRequestMessage:!0,hasRespond:!0}))}}catch(t){o={error:t}}finally{try{S&&!S.done&&(r=I.return)&&r.call(I)}finally{if(o)throw o.error}}}},t.prototype._processRSMsg=function(t){var e=t.conversationType,n=t.targetId,o=t.content,r=t.channelId,i=o.msgId,s=o.rrn,a=o.tmn,_=o.endMsgTime;e===Q.PRIVATE?this.updateMessageReceiptStatus(e,n,_,r||""):this._updateReadReceiptInfo(i,{readCount:s,totalCount:a});var c={conversationType:e,targetId:n,channelId:r};this._sendMessageReadReceipt(e===Q.PRIVATE?{privateReadReceipt:Ut(Ut({},c),{endMsgTime:o.endMsgTime})}:{groupReadReceipt:Ut(Ut({},c),{totalCount:o.tmn,readedCount:o.rrn,messageUId:o.msgId})})},t.prototype._processSRSMsg=function(t){var e=this.getNaviInfoFromCache(),n=t.conversationType,o=t.targetId,r=t.content,i=t.channelId,s=t.senderUserId,a=t.sentTime;return s===this.tcpMgr.getCurrentUserId()&&(this._callCppProxy("clearUnreadCountByTimestamp",n,o,r.lastMessageSendTime,i||""),1!==(null==e?void 0:e.sesDriven)||(a>this.tcpMgr.getConnectedTime()||this._sendsyncReadStatus({conversationType:n,targetId:o,channelId:i,timestamp:r.lastMessageSendTime}),!1))},t.prototype._buildConversation=function(t){var e=JSON.parse(t),n=e.channelId,o=e.conversationType,r=e.targetId,i=e.unreadCount,s=e.lastestMsg,a=e.isTop,_=e.blockStatus,c=e.matchCount,u=e.hasUnreadMention,E=e.conversationTime,R=e.draft,l=_>0?St.OPEN:St.CLOSE;return{channelId:n,conversationType:o,targetId:r,unreadMessageCount:i,latestMessage:-1===JSON.parse(s).messageId?null:this._buildMessage(s),hasMentioned:u,mentionedInfo:null,notificationStatus:l,isTop:a,lastUnreadTime:0,matchCount:c,operationTime:E,notificationLevel:_,draft:R}},t.prototype._convertResultList=function(t,e){var n=JSON.parse(t).list;return n=n.map((function(t){var n=JSON.parse(t.obj);return e?e(n):n}))},t.prototype._handleNotNotificationMessage=function(t){var e,n=t.messageType,o=t.senderUserId,r=t.content;if(n===$.LOG_COMMAND&&t.senderUserId===kt){var i=t.content,s=i.startTime,a=i.endTime,_=i.platform,c=i.logId,u=i.uri;return this.reporter.report(parseInt(s,10),parseInt(a,10),_,u,c,t.messageUId),!0}if(n===$.CLOUD_CONTROL&&o===kt)return this.cloudControllerMsgs.push(t),this._ccMsgHandler(),!0;if(n===$.READ_STATE)return this._processRSMsg(t),!0;if("RC:MsgExMsg"===n)return this._msgExpansionHandler.setLocalFromExtMsg(this.logger,t),this._sendMessageExpansion(t),!0;if(n===$.SYNC_READ_STATUS&&!this._processSRSMsg(t))return!0;if(n===$.DELIVERED)return this._callCppProxy("setMessageDeliverTime",JSON.stringify(r)),this._sendMessageDelivered(t.content.map((function(t){return{deliverTime:t.time,messageUId:t.messageUId,objectName:t.objectName,targetId:t.targetId}}))),!0;if(n===$.DELIVERED_MSG){var E={totalCount:t.content.tmn,list:null===(e=t.content.dl)||void 0===e?void 0:e.map((function(t){return{MessageUId:t.msgId,deliveryCount:t.drn}}))};return this._sendGroupMessageDeliveredStatus(E),!0}return!1},t.prototype._setOnReceiveMessageListener=function(){var t=this;Be.setOnReceiveMessageListener((function(e,n,o,r){try{var i=t._buildMessage(e,{isOffLineMessage:o}),s=i.messageType,a=i.channelId,_=void 0===a?"":a,c=i.senderUserId,u=i.content,E=i.sentTime,R=i.conversationType,l=i.targetId;if(t._handleNotNotificationMessage(i))return;if(s===$.READ_RECEIPT_REQUEST&&u.messageUId&&t._updateReadReceiptInfo(u.messageUId,{isReceiptRequestMessage:!0,hasRespond:!1}),s===$.READ_RECEIPT_RESPONSE&&u.receiptMessageDic&&t._processRRRspMsg(u.receiptMessageDic,c,E),s===$.GROUP_READ_RECEIPT_REQUEST){var d=u.msgId,p=u.rrn,C=u.tmn;t._updateReadReceiptInfo(d,{readCount:p,totalCount:C})}i.canIncludeExpansion&&t._msgExpansionHandler.setLocalFromReceiveMsg(t.logger,i),s===$.READ_RECEIPT&&c===t.tcpMgr.getCurrentUserId()&&t._callCppProxy("clearUnreadCountByTimestamp",R,l,u.lastMessageSendTime,_);var T=!0;if(0!==n||r||(T=!1),s===$.RECALL){if(!t.handleRecalledMessage(i))return;var I=t._fixRecallContentInfo(i);R=I.conversationType,l=I.targetId}t._sendMessageNotification(Object.assign(i,{hasMoreMsg:T,conversationType:R,targetId:l}))}catch(n){t.logger.error(Le.P_RECEIVE_MESSAGE_E,JSON.stringify({error:null==n?void 0:n.stack,message:e}))}}),(function(){t._sendPullOfflineFinished()}))},t.prototype._ccMsgHandler=function(){var t;return Dt(this,void 0,void 0,(function(){var e,n;return Gt(this,(function(o){switch(o.label){case 0:return this.cloudControllerLock?(this.cloudControllerLock=!1,this.cloudControllerMsgs.shift()?(e=this.tcpMgr.getToken(),[4,null===(t=this.cloudController)||void 0===t?void 0:t.request(this.cloudControllerUri,Ae.other,e)]):[3,2]):[2];case 1:n=o.sent()||0,this.cloudControllerMsgs=this.cloudControllerMsgs.filter((function(t){return t.sentTime>n})),this.cloudControllerLock=!0,this._ccMsgHandler(),o.label=2;case 2:return[2]}}))}))},t.prototype._fixRecallContentInfo=function(t){var e=t.conversationType,n=t.targetId;return t.senderUserId===this.tcpMgr.getCurrentUserId()&&(e=t.content.conversationType||e,n=t.content.targetId||n),{conversationType:e,targetId:n}},t.prototype.handleRecalledMessage=function(t){var e=t.content,n=e.messageUId,o=e.sentTime;if(!n)return!0;var r=this._callCppProxy("getMessage",n),i=this._buildMessage(r,{isOffLineMessage:!1});if(t.content.isDelete)return-1===i.messageId||this._callCppProxy("deleteMessages",[i.messageId]),!0;if(i.messageType===$.RECALL_NOTIFICATION_MESSAGE)return!1;var s={recallTime:Date.now(),admin:!!t.content.isAdmin,originalObjectName:i.messageType,originalMessageContent:i.content,recallActionTime:t.sentTime,operatorId:t.senderUserId};if(t.content.user&&(s.user=t.content.user),t.content.extra&&(s.extra=t.content.extra),i.messageType===$.TextMessage&&(s.recallContent=i.content.content),-1===i.messageId){var a=t.conversationType,_=t.targetId,c=t.senderUserId,u=t.channelId,E=t.messageDirection;return this._callCppProxy("insertMessage",a,_,c,$.RECALL_NOTIFICATION_MESSAGE,JSON.stringify(s),(function(){}),(function(){}),E,1,30,o,"",0,n,!1,!0,JSON.stringify({}),u||""),!0}return i.receivedStatus||this.setMessageReceivedStatus(i.messageId,1),this._callCppProxy("setMessageContent",i.messageId,JSON.stringify(s),$.RECALL_NOTIFICATION_MESSAGE),!0},t.prototype._sendMessageExpansion=function(t){var e=t.channelId,n=void 0===e?"":e,o=t.content,r=t.conversationType,i=t.targetId,s=o,a=s.put,_=s.del,c=s.mid,u={};a&&(u.updatedExpansion={channelId:n,messageUId:c,expansion:a,conversationType:r,targetId:i}),_&&(u.deletedExpansion={channelId:n,messageUId:c,deletedKeys:_,conversationType:r,targetId:i}),this._dispatchEvent("expansion",u)},t.prototype._sendMessageNotification=function(t){this._dispatchEvent("batchMessage",t)},t.prototype._sendPullOfflineFinished=function(){this._dispatchEvent("pullFinished",null)},t.prototype._sendMessageDelivered=function(t){this._dispatchEvent("messageDelivered",t)},t.prototype._sendGroupMessageDeliveredStatus=function(t){this._dispatchEvent("groupMessageDeliveredStatus",t)},t.prototype._sendChatroomStatus=function(t){this._dispatchEvent("chatroom",t)},t.prototype._sendMessageReadReceipt=function(t){this._dispatchEvent("messageReadReceipt",t)},t.prototype._sendsyncReadStatus=function(t){this._dispatchEvent("syncReadStatus",t)},t.prototype._setConversationStatusListener=function(){var t=this;Be.setConversationStatusListener((function(e){var n=JSON.parse(e).list,o=[];n.forEach((function(t){var e=JSON.parse(t.obj),n=e.conversationType,r=e.targetId,i=e.status,s=e.channelId,a={notificationStatus:2,isTop:!1};i.forEach((function(t){var e=JSON.parse(t.item);1===e.type?a.notificationStatus=1===Number(e.value)?St.OPEN:St.CLOSE:a.isTop=1===Number(e.value)})),o.push({channelId:s,conversationType:n,targetId:r,updatedItems:{notificationStatus:{val:a.notificationStatus,time:0},isTop:{val:a.isTop,time:0}}})})),t._dispatchEvent("conversation",o)}),(function(e){t._dispatchEvent("conversationTag",e)}),(function(e,n,o,r){t._callCppProxy("clearUnreadCountByTimestamp",e,n,r,o||""),t._sendsyncReadStatus({conversationType:e,targetId:n,channelId:o,timestamp:r})}))},t.prototype._setPushNotificationListener=function(){var t=this;Be.setPushNotificationListener((function(){}),(function(e){t._dispatchEvent("tag",e),t._getRTCProfile()}))},t.prototype._getRTCProfile=function(){var t=this._callCppProxy("getRTCProfile");if(t){var e=this.tcpMgr.getToken();this.navi.updateVoipCallInfo(e,t);var n=this.navi.getNaviInfoFromCache(e);this._dispatchEvent("onNaviDataChange",n)}},t.prototype._setRTCLivingRoomEventListener=function(){var t=this;Be.setRTCRoomEventListener((function(e){t._dispatchEvent("onRTCDataChange",Array.prototype.slice.call(e))}))},t.prototype._setChatroomEventListener=function(){var t=this;Be.setChatroomEventListener((function(e,n){t._sendChatroomStatus({chatroomDestroyed:e})}))},t.prototype._setCallInfoListener=function(){var t=this;Be.setCallInfoListener((function(e){var n=[];try{JSON.parse(e).list.forEach((function(t){Object.entries(t).forEach((function(t){var e=bt(t,2),o=e[0],r=e[1];n.push({key:o,value:r})}))}))}catch(e){t.logger.error(Le.P_PARSE_JSON_E,JSON.stringify({error:e}))}t._dispatchEvent("callInfo",JSON.stringify({list:n}))}))},t.prototype._setSubscribeEventListener=function(){var t=this;Be.setSubscribeEventListener((function(){}),(function(e){t._dispatchEvent("syncSubscribedUserStatusFinished",e)}),(function(e){var n=t._buildSubscribeEventData(e).map((function(t){return{userId:t.userId,subscribeType:t.subscribeType,subscribeTime:t.subscribeTime,expiry:t.expiry,operationType:t.operationType}}));t._dispatchEvent("subscribedRelationChange",n)}),(function(e){var n=t._buildSubscribeEventData(e).map((function(t){var e=t.userId,n=t.subscribeType,o=t.subscribeTime,r=t.expiry,i=t.details,s=t.userProfile,a={userId:e,subscribeType:n,subscribeTime:o,expiry:r};return[ut.ONLINE_STATUS,ut.FRIEND_ONLINE_STATUS].includes(n)?a.details=i:[ut.USER_PROFILE,ut.FRIEND_USER_PROFILE].includes(n)&&(a.userProfile=s),a}));t._dispatchEvent("subscribedUserStatusChange",n)}))},t.prototype._setUserProfileListener=function(){var t=this;Be.setUserProfileListener((function(e){t._dispatchEvent("syncSubscribedUserStatusFinished",e)}),(function(e){t._dispatchEvent("ownUserProfileChanged",t._string2userProfileInfo(e))}))},t.prototype._onGroupOperationChanged=function(t,e,n,o,r){var i,s,a,_=[];try{s=JSON.parse(o),_=JSON.parse(r),a=JSON.parse(t);var c={groupId:s[0]?s[0].groupId:"",operatorInfo:this._convertGroupMemberInfoList([a])[0],operation:e,operationTime:n};0===e?(i=bt(this._convertGroupInfoList(s),1),c.groupInfo=i[0]):c.memberInfos=this._convertGroupMemberInfoList(_),this._dispatchEvent("groupOperation",c)}catch(e){this.logger.error(Le.P_PARSE_JSON_E,JSON.stringify({error:e,groupInfoJson:o,membersJson:r,operatorInfo:t}))}},t.prototype._onGroupInfoChanged=function(t,e,n,o,r,i){try{var s=JSON.parse(n),a=this._convertUpdateGroupInfoList(JSON.parse(r))[0];switch(t){case G.GROUP_INFO_CHANGE:this._dispatchEvent("groupInfoChanged",{operatorInfo:this._convertGroupMemberInfoList([s])[0],operationTime:i,groupInfo:a,changedGroupInfo:a,fullGroupInfo:o?this._convertUpdateGroupInfoList(JSON.parse(o))[0]:void 0});break;case G.GROUP_REMARK_DELETE:case G.GROUP_REMARK_SET:var _=t===G.GROUP_REMARK_SET?V.ADD:V.REMOVE;this._dispatchEvent("groupRemarkChangedSync",{groupId:e,operationType:_,operationTime:i,groupRemark:(null==a?void 0:a.remark)||""})}}catch(t){this.logger.error(Le.P_PARSE_JSON_E,JSON.stringify({error:t,groupInfoJson:r,operatorInfoJson:n}))}},t.prototype._onGroupMemberInfoChanged=function(t,e,n,o){try{var r=JSON.parse(e),i=JSON.parse(n),s={groupId:t,operatorInfo:this._convertGroupMemberInfoList([r])[0],memberInfo:this._convertGroupMemberInfoList([i])[0],operationTime:o};this._dispatchEvent("groupMemberInfoChanged",s)}catch(t){this.logger.error(Le.P_PARSE_JSON_E,JSON.stringify({error:t,operatorInfoJson:e,updateMemberInfoJson:n}))}},t.prototype._onGroupRequestChanged=function(t,e,n,o){try{var r=JSON.parse(n),i=r.groupId,s=r.joinUser,a=r.approverUser,_=r.inviterUser,c=r.type,u=r.status,E=r.direction,R=r.remark,l=Ut(Ut(Ut(Ut({groupId:i},s&&{joinMemberInfo:this._convertGroupMemberInfoList([s])[0]}),_&&_.userId&&{inviterInfo:this._convertGroupMemberInfoList([_])[0]}),a&&a.userId&&{operatorInfo:this._convertGroupMemberInfoList([a])[0]}),{status:u,direction:E,type:c,operationTime:o,reason:R});this._dispatchEvent("groupApplicationEvent",l)}catch(t){this.logger.error(Le.P_PARSE_JSON_E,JSON.stringify({error:t,groupInfo:e,requestInfoJson:n}))}},t.prototype._onFavoriteMembersChanged=function(t,e,n,o){try{var r=JSON.parse(n),i=[];r&&jt(r.list)&&(i=r.list.map((function(t){return t.value}))),this._dispatchEvent("groupFollowsChangedSync",{groupId:t,operationType:e,operationTime:o,userIds:i})}catch(t){this.logger.error(Le.P_PARSE_JSON_E,JSON.stringify({error:t,memberIds:n}))}},t.prototype._setEntrustGroupListener=function(){Be.setEntrustGroupListener(this._onGroupOperationChanged.bind(this),this._onGroupInfoChanged.bind(this),this._onGroupMemberInfoChanged.bind(this),this._onGroupRequestChanged.bind(this),this._onFavoriteMembersChanged.bind(this))},t.prototype._onFriendApplicationStatusChanged=function(t,e,n,o,r,i){this._dispatchEvent("friendApplicationStatusChanged",{userId:t,applicationType:e,applicationStatus:n,directionType:o,operationTime:r,extra:null!=i?i:""})},t.prototype._onFriendAdd=function(t,e,n,o,r){this._dispatchEvent("friendAdd",{userId:e,name:n,portraitUri:o,directionType:t,operationTime:r})},t.prototype._onFriendDelete=function(t,e,n){this._dispatchEvent("friendDelete",{userIds:e,directionType:t,operationTime:n})},t.prototype._onFriendsClearedFromServer=function(t){this._dispatchEvent("friendCleared",t)},t.prototype._onFriendInfoChangedSync=function(t,e,n){try{var o=JSON.parse(n);this._dispatchEvent("friendInfoChangedSync",{userId:t,remark:e,extProfile:o.list})}catch(t){this.logger.error(Le.P_PARSE_JSON_E,JSON.stringify({error:t,profiles:n}))}},t.prototype._setFriendEventListener=function(){Be.setFriendEventListener(this._onFriendApplicationStatusChanged.bind(this),this._onFriendAdd.bind(this),this._onFriendDelete.bind(this),this._onFriendsClearedFromServer.bind(this),this._onFriendInfoChangedSync.bind(this))},t.prototype.registerMessageType=function(t,e,n,o,r){var i=0;e&&(i|=1),n&&(i|=2),r&&(i=16),this._customMessageType[t]={isCounted:n,isPersited:e,isStatusMessage:r},this.logger.info(Le.P_REGTYP_O,JSON.stringify({type:t,opt:i,search:o})),this._callCppProxy("registerMessageType",t,i,o||[])},t.prototype.connect=function(t,e,n,o){return this.tcpMgr.connect(t,e,n,o)},t.prototype.reconnect=function(t,e,n){var o=X.RC_SOCKET_DISCONNECTED;return this.tcpMgr.reconnect(t,e,n,o)},t.prototype.reportSDKInfo=function(t){var e=JSON.stringify(Ut(Ut({},t),{"electron-main":"5.14.1"}));this.logger.info(Le.P_REPORT_VER_O,e),this._callCppProxy("uploadSDKVersion",e,"")},t.prototype.disconnect=function(t){t=t||!0,this._chatroomCache.length=0,this.reporter.stop(),Rn(null,this.logger),this.tcpMgr.disconnect(t)},t.prototype.logout=function(){this.disconnect()},t.prototype.setUserStatusListener=function(t,e){Be.setOnReceiveStatusListener((function(t,n){e({userId:t,status:n})}));var n=t.userIds||[];n.length&&this.subscribeUserStatus(n)},t.prototype.subscribeUserStatus=function(t){var e=this;return new Promise((function(n){e._callCppProxy("subscribeUserStatus",t,(function(){setTimeout((function(){n(X.SUCCESS)}),0)}),(function(t){setTimeout((function(){n(t)}),0)}))}))},t.prototype.setUserStatus=function(t){var e=this;return new Promise((function(n){e._callCppProxy("setUserStatus",t,(function(){setTimeout((function(){n(X.SUCCESS)}),0)}),(function(t){setTimeout((function(){n(t)}),0)}))}))},t.prototype.getUserStatus=function(t){var e=this;return new Promise((function(n){e._callCppProxy("getUserStatus",t,(function(t){setTimeout((function(){n({code:X.SUCCESS,data:{status:t}})}),0)}),(function(t){setTimeout((function(){n({code:t})}),0)}))}))},t.prototype._handleDirectionalUserIdList=function(t,e){var n=t.messageType,o=t.content,r=t.directionalUserIdList,i=void 0===r?[]:r,s=e===Q.GROUP;if(n===$.READ_RECEIPT_RESPONSE&&o.receiptMessageDic&&s)for(var a in o.receiptMessageDic)i.push(a);return n===$.SYNC_READ_STATUS&&function(t){return[Q.GROUP,Q.DISCUSSION,Q.ULTRA_GROUP,Q.PUBLIC_SERVICE,Q.APP_PUBLIC_SERVICE].includes(t)}(e)&&(i=[this.getCurrentUserId()]),i},t.prototype._handleMessage2Callback=function(t,e){var n=this;if("RC:MsgExMsg"===t.messageType&&this._msgExpansionHandler.setLocalFromExtMsg(this.logger,t),t.messageType===$.READ_RECEIPT_REQUEST)this._updateReadReceiptInfo(e.content.messageUId,{isReceiptRequestMessage:!0,readerList:[]});else if(t.messageType===$.READ_RECEIPT_RESPONSE){var o=e.content.receiptMessageDic;if(!o)return;for(var r in o)o[r].forEach((function(t){n._updateReadReceiptInfo(t,{isReceiptRequestMessage:!0,hasRespond:!0})}))}},t.prototype.sendMessage=function(t,e,n,o,r){var i=this;void 0===r&&(r=this.logger.createTraceId());var s=n.messageType,a=n.content,_=n.expansion,c=n.pushConfig,u=n.pushContent,E=void 0===u?"":u,R=n.pushData,l=void 0===R?"":R,d=n.directionalUserIdList,p=void 0===d?[]:d,C=n.disableNotification,T=void 0!==C&&C,I=n.canIncludeExpansion,S=void 0!==I&&I,h=n.isVoipPush,N=void 0!==h&&h,f=n.channelId,O=void 0===f?"":f,A=n.messageId,g=void 0===A?0:A,P=n.disableUpdateLastMessage,v=void 0!==P&&P,L=c||{},m=L.iOSConfig,y=L.androidConfig,M=L.harmonyOSConfig,U=L.templateId,D=void 0===U?"":U,G=L.pushTitle,V=void 0===G?"":G,b=L.pushContent,F=void 0===b?E:b,w=L.pushData,x=void 0===w?l:w,B=L.disablePushTitle,k=void 0!==B&&B,H=L.forceShowDetailContent,J=void 0!==H&&H,Y=re(m,y,M);return new Promise((function(c){E=F,l=x;var u=(null==y?void 0:y.notificationId)||"";p=i._handleDirectionalUserIdList(n,t);var R={};for(var d in _)R[d]={v:""},R[d].v=_[d];var C=D;i.logger.info(Le.P_SEND_MSG_T,JSON.stringify({messageType:s,conversationType:t,targetId:e,channelId:O}),r);var I=i._callCppProxy("sendMessage",(function(t,e){var o=i._buildMessage(t,{isOffLineMessage:!1});if(i.logger.info(Le.P_SEND_MSG_R,JSON.stringify({code:e,messageUId:o.messageUId}),r),e===X.SENSITIVE_REPLACE)return setTimeout((function(){c({code:e})}),0);[$.READ_RECEIPT_REQUEST,$.READ_RECEIPT_RESPONSE,$.EXPANSION_NOTIFY].findIndex((function(t){return t===o.messageType}))>-1&&i._handleMessage2Callback(o,n),o.canIncludeExpansion&&i._msgExpansionHandler.setLocalFromReceiveMsg(i.logger,o),setTimeout((function(){c({code:X.SUCCESS,data:o})}),0)}),(function(t,e){var n=i._buildMessage(t,{isOffLineMessage:!1});i.logger.warn(Le.P_SEND_MSG_R,JSON.stringify({code:e,messageId:n.messageId}),r),n.sentTime=Date.now()-Be.getDeltaTime(),setTimeout((function(){c({code:e,data:n})}),0)}),t,e,s,JSON.stringify(a),p,T,k,J,E,l,u,V,Y,C,S,JSON.stringify(R),N,O,g,v),h=JSON.parse(I);null==o||o(h.messageId)}))},t.prototype.recallMsg=function(t,e,n,o,r){var i=this;return new Promise((function(s){var a,_=r.user,c=r.pushContent,u=r.channelId,E=r.extra,R=r.pushConfig,l=r.disableNotification,d=r.isDelete,p=r.directionalUserIdList,C=r.disableUpdateLastMessage,T={conversationType:t,targetId:e,messageUId:n,sentTime:o,user:_,extra:E,channelId:u,isDelete:d||!1};_&&(T.user=_),E&&(T.extra=E);var I={conversationType:t,targetId:e,senderUserId:i.tcpMgr.getCurrentUserId(),content:T,objectName:$.RECALL,messageUid:n,direction:Ct.SEND,status:Nt.UNREAD,sentTime:o,channelId:u},S=i._buildMessage(JSON.stringify(I),{isOffLineMessage:!1});i._callCppProxy("recallMessage",(function(){i.handleRecalledMessage(S),S.pushConfig=R,setTimeout((function(){s({code:X.SUCCESS,data:S})}),0)}),(function(t){setTimeout((function(){s({code:t})}),0)}),$.RECALL,JSON.stringify(T),l||!1,(null==R?void 0:R.disablePushTitle)||!1,(null==R?void 0:R.forceShowDetailContent)||!1,c||"",(null==R?void 0:R.pushData)||"",(null===(a=null==R?void 0:R.androidConfig)||void 0===a?void 0:a.notificationId)||"",(null==R?void 0:R.pushTitle)||"",re(null==R?void 0:R.iOSConfig,null==R?void 0:R.androidConfig,null==R?void 0:R.harmonyOSConfig),(null==R?void 0:R.templateId)||"",u,p||[],n,null!=C&&C)}))},t.prototype.getHistoryMessage=function(t,e,n,o,r,i,s){var a=this;return new Promise((function(_){n=n||0;var c=0===r,u=o+1,E=a._callCppProxy("getHistoryMessages",t,e,n,u,s,c,i),R=JSON.parse(E).list,l=[];R.reverse();for(var d=0;d<R.length;d++){var p=a._buildMessage(R[d].obj);l[d]=p}_({code:X.SUCCESS,data:{list:u===l.length?l.slice(1,u):l,hasMore:o<l.length}})}))},t.prototype.getMessages=function(t,e,n,o,r,i){var s=this;return new Promise((function(a){var _=0===r,c=n,u=0!==n,E=o+1;u&&(c+=_?1:-1,E++);for(var R=s._callCppProxy("getMessages",t,e,c,E,_,i),l=JSON.parse(R).list,d=[],p=0;p<l.length;p++){var C=s._buildMessage(l[p].obj);d[p]=C}var T=s._computeRepairInfo(d,_,n,c,E),I=T.isNeedRepair,S=void 0!==I&&I,h=T.repairTime,N=void 0===h?0:h;if(!S)return u&&(d.shift(),E--),d.reverse(),void a({code:X.SUCCESS,data:{list:E===d.length?d.slice(1,E):d,hasMore:o<d.length}});s._processRepairHisMsg(t,e,n,o,r,i,N,a)}))},t.prototype._computeRepairInfo=function(t,e,n,o,r){var i=!1,s=0,a=this.getNaviInfoFromCache()||{},_=a.repairHisMsg,c=void 0===_?0:_,u=a.historyMsg;if(1!==c||!u)return{isNeedRepair:i,repairTime:s};var E=t.findIndex((function(t){return t.hasMore||0===Object.keys(t.content).length}));return e&&E>=0?(i=!0,s=t[E].hasMore?t[E].sentTime:t[E].sentTime+1):!e&&E>=1?(i=!0,s=t[E-1].sentTime):t.length<r||0===n?(i=!0,s=n):t.length>0&&t[0].sentTime!==n&&(i=!0,s=o),{isNeedRepair:i,repairTime:s}},t.prototype._processRepairHisMsg=function(t,e,n,o,r,i,s,a){var _=this,c=function(s){for(var c=0===r,u=o+1,E=_._callCppProxy("getMessages",t,e,n,u,c,i),R=JSON.parse(E).list,l=[],d=0;d<R.length;d++){var p=_._buildMessage(R[d].obj);l[d]=p}l.reverse(),a({code:s,data:{list:u<=l.length?l.slice(1,u):l,hasMore:o<l.length}})},u=o+10>100?100:o+10;this._callCppProxy("getRemoteHistoryMessages",t,e,s,u,(function(){return c(0)}),(function(t){c(t)}),r,!0,i,!1)},t.prototype.getContinuousMessages=function(t,e,n,o,r,i){var s=this;return new Promise((function(a){n=n||0;var _=0===r;s._callCppProxy("getContinuousMessages",t,e,n,o,(function(t,e,n){var o=JSON.parse(t).list,r=[];o.reverse();for(var i=0;i<o.length;i++){var _=s._buildMessage(o[i].obj);r[i]=_}setTimeout((function(){a({code:X.SUCCESS,data:{list:r,timestamp:e,hasMore:n}})}))}),(function(t){setTimeout((function(){a({code:t})}),0)}),_,i)}))},t.prototype.getRemoteHistoryMessages=function(t,e,n,o,r,i){var s=this;return new Promise((function(a){n=n||0;s._callCppProxy("getRemoteHistoryMessages",t,e,n,o,(function(t,e){var n=JSON.parse(t).list,o=[];n.reverse();for(var r=0;r<n.length;r++){var i=s._buildMessage(n[r].obj);o[r]=i}setTimeout((function(){a({code:X.SUCCESS,data:{list:o,hasMore:!!e}})}),0)}),(function(t){setTimeout((function(){a({code:t})}),0)}),r,!0,i,!0)}))},t.prototype.deleteRemoteMessage=function(t,e,n,o){var r=this;return new Promise((function(i){var s=JSON.stringify(n);r._callCppProxy("deleteRemoteHistoryMessages",t,e,s,!1,o,(function(){setTimeout((function(){i(X.SUCCESS)}),0)}),i)}))},t.prototype.deleteRemoteMessageByTimestamp=function(t,e,n,o){var r=this;return new Promise((function(i){r._callCppProxy("clearRemoteHistoryMessages",t,e,n,(function(){setTimeout((function(){i(X.SUCCESS)}),0)}),(function(t){setTimeout((function(){i(t)}),0)}),o)}))},t.prototype.clearMessages=function(t,e,n){var o=this;return new Promise((function(r){o._callCppProxy("clearMessages",t,e,n),r(X.SUCCESS)}))},t.prototype.getConversationList=function(t,e,n,o,r){var i=this;return void 0===r&&(r=""),new Promise((function(t){for(var e=i._callCppProxy("getConversationList",[1,3,6,7],r),n=JSON.parse(e).list,o=[],s=0;s<n.length;s++)o.push(i._buildConversation(n[s].obj));t({code:X.SUCCESS,data:o})}))},t.prototype.getConversation=function(t,e,n){var o=this;return new Promise((function(r){var i=o._callCppProxy("getConversation",t,e,n);if(i)r({code:X.SUCCESS,data:o._buildConversation(i)});else{var s=o._callCppProxy("getHistoryMessages",t,e,0,1,"",!0,n),a=void 0;try{a=JSON.parse(s).list}catch(t){o.logger.error(Le.P_PARSE_JSON_MSGS_E,null==t?void 0:t.stack),a=[]}var _=null;a.length>0&&(_=o._buildMessage(a[0].obj));var c=o._callCppProxy("getConversationNotificationStatus",t,e,n),u=o._callCppProxy("getConversationTopStatus",t,e,n);r({code:X.SUCCESS,data:{conversationType:t,targetId:e,channelId:n,unreadMessageCount:0,latestMessage:_,notificationStatus:c?St.OPEN:St.CLOSE,isTop:Boolean(u),lastUnreadTime:0}})}}))},t.prototype.removeConversation=function(t,e,n){var o=this._callCppProxy("removeConversation",t,e,n);return Promise.resolve(o?X.SUCCESS:X.CONVER_REMOVE_ERROR)},t.prototype.batchRemoveConversation=function(t){var e=t.map((function(t){return{conversation_type:t.conversationType,target_id:t.targetId,channel_id:t.channelId}})),n=this._callCppProxy("removeConversationInBatches",JSON.stringify(e));return Promise.resolve(n?X.SUCCESS:X.CONVER_REMOVE_ERROR)},t.prototype.clearConversations=function(t,e){var n=this;return new Promise((function(o){var r=[];r=jt(t)?t:[Q.PRIVATE,Q.GROUP,Q.SYSTEM,Q.PUBLIC_SERVICE],n._callCppProxy("clearConversations",r,e||""),o(X.SUCCESS)}))},t.prototype.getAllConversationUnreadCount=function(t,e,n){var o=this._callCppProxy("getTotalUnreadCount",e,n,t);return Promise.resolve({code:X.SUCCESS,data:o})},t.prototype.getConversationUnreadCount=function(t,e,n){var o=this;return void 0===n&&(n=""),new Promise((function(r){var i=o._callCppProxy("getUnreadCount",t,e,n);r({code:X.SUCCESS,data:i})}))},t.prototype.clearConversationUnreadCount=function(t,e,n){var o=this;return void 0===n&&(n=""),new Promise((function(r){o._callCppProxy("clearUnreadCount",t,e,n),r(X.SUCCESS)}))},t.prototype.clearUnreadCountByTimestamp=function(t,e,n,o){var r=this;return new Promise((function(i){r._callCppProxy("clearUnreadCountByTimestamp",t,e,n,o),i(X.SUCCESS)}))},t.prototype.getFirstUnreadMessage=function(t,e,n){var o=this;return new Promise((function(r){var i=o._callCppProxy("getTheFirstUnreadMessage",t,e,n),s=o._buildMessage(i);r({code:X.SUCCESS,data:-1!==s.messageId?s:null})}))},t.prototype.getFirstUnreadMessageInfo=function(t,e,n){var o=this;return new Promise((function(r,i){var s=o._callCppProxy("getTheFirstUnreadMessage",t,e,n),a=o._buildMessage(s);r({code:X.SUCCESS,data:-1!==a.messageId?{messageUId:a.messageUId,sentTime:a.sentTime}:null})}))},t.prototype.batchSetConversationToTop=function(t,e,n){var o=this;return new Promise((function(r,i){var s=t.map((function(t){return{conversation_type:t.conversationType,target_id:t.targetId,channel_id:t.channelId,is_top:e}}));o._callCppProxy("setIsTopInBatches",JSON.stringify(s),n||!1),r(X.SUCCESS)}))},t.prototype.setConversationStatus=function(t,e,n,o,r,i){var s=this;return new Promise((function(i){s._callCppProxy("setConversationStatus",t,e,n,o,(function(){setTimeout((function(){i(X.SUCCESS)}),0)}),(function(t){setTimeout((function(){i(t)}),0)}),r,!0)}))},t.prototype.setConversationToTop=function(t,e,n,o,r){var i=this;return new Promise((function(r){r(i._callCppProxy("setConversationToTop",t,e,n,o,!0,!0)?X.SUCCESS:X.RC_MSG_DATA_INCOMPLETE)}))},t.prototype.getConversationNotificationStatus=function(t,e,n){var o=this;return new Promise((function(r){var i=o._callCppProxy("getConversationNotificationStatus",t,e,n);r({code:X.SUCCESS,data:i?St.OPEN:St.CLOSE})}))},t.prototype.setConversationTypeNotificationLevel=function(t,e){var n=this;return new Promise((function(o,r){n._callCppProxy("setBlockPushLevelForType",t,e,(function(){o({code:X.SUCCESS})}),(function(t){o({code:t})}))}))},t.prototype.getConversationTypeNotificationLevel=function(t){var e=this;return new Promise((function(n,o){var r=e._callCppProxy("getBlockPushLevelForType",t);n({code:X.SUCCESS,data:r})}))},t.prototype.searchConversationByContent=function(t,e,n,o){var r=this;return new Promise((function(i){o=o||[1,3,6,7];for(var s=r._callCppProxy("searchConversationByContent",o,t,e,n),a=JSON.parse(s).list,_=[],c=0;c<a.length;c++)_[c]=r._buildConversation(a[c].obj);i({code:X.SUCCESS,data:_})}))},t.prototype.searchConversationByContentWithAllChannel=function(t,e,n){var o=this;return new Promise((function(r){n=n||[1,3,6,7];for(var i=o._callCppProxy("searchConversationByContentWithAllChannel",n,t,e),s=JSON.parse(i).list,a=[],_=0;_<s.length;_++)a[_]=o._buildConversation(s[_].obj);r({code:X.SUCCESS,data:a})}))},t.prototype.searchMessageByContent=function(t,e,n,o,r,i,s){var a=this;return new Promise((function(i){a._callCppProxy("searchMessageByContent",t,e,n,o,r,1,(function(t,e){for(var n=t?JSON.parse(t).list:[],o=[],r=0;r<n.length;r++)o[r]=a._buildMessage(n[r].obj);setTimeout((function(){i({code:X.SUCCESS,data:{messages:o,count:e}})}),0)}),s)}))},t.prototype.searchMessageByContentAndMessageType=function(t,e,n,o,r,i,s){var a=this;return new Promise((function(_){a._callCppProxy("searchMessageByContentAndObjectName",e,t,s||"",void 0===s,n,i,r,o,1,(function(t,e){for(var n=t?JSON.parse(t).list:[],o=[],r=0;r<n.length;r++)o[r]=a._buildMessage(n[r].obj);setTimeout((function(){_({code:X.SUCCESS,data:{messages:o,count:e}})}),0)}))}))},t.prototype.searchMessagesByUser=function(t,e,n,o,r,i){var s=this;return new Promise((function(a){s._callCppProxy("getMessageBySender",t,e,n,o,r,i,(function(t){for(var e=t?JSON.parse(t).list:[],n=[],o=0;o<e.length;o++)n[o]=s._buildMessage(e[o].obj);setTimeout((function(){a({code:X.SUCCESS,data:{messages:n}})}),0)}))}))},t.prototype.searchMessageByContentWithAllChannel=function(t,e,n,o,r){var i=this;return new Promise((function(s){i._callCppProxy("searchMessageByContentWithAllChannel",t,e,n,o,r,1,(function(t,e){for(var n=t?JSON.parse(t).list:[],o=[],r=0;r<n.length;r++)o[r]=i._buildMessage(n[r].obj);setTimeout((function(){s({code:X.SUCCESS,data:{messages:o,count:e}})}),0)}))}))},t.prototype.searchMessageByContentInTimeRangeWithAllChannel=function(t,e,n,o,r,i,s){var a=this;return new Promise((function(_){a._callCppProxy("searchMessageByTimestampWithAllChannel",t,e,n,o,r,i,s,(function(t){for(var e=t?JSON.parse(t).list:[],n=[],o=0;o<e.length;o++)n[o]=a._buildMessage(e[o].obj);setTimeout((function(){_({code:X.SUCCESS,data:{messages:n}})}),0)}))}))},t.prototype.getUnreadMentionedMessages=function(t,e,n){for(var o=JSON.parse(this._callCppProxy("getUnreadMentionedMessages",t,e,n)).list,r=0;r<o.length;r++)o[r]=this._buildMessage(o[r].obj);return o},t.prototype.addToBlacklist=function(t){var e=this;return new Promise((function(n){e._callCppProxy("addToBlacklist",t,(function(){setTimeout((function(){n(X.SUCCESS)}),0)}),(function(t){setTimeout((function(){n(t)}),0)}))}))},t.prototype.removeFromBlacklist=function(t){var e=this;return new Promise((function(n){e._callCppProxy("removeFromBlacklist",t,(function(){setTimeout((function(){n(X.SUCCESS)}),0)}),(function(t){setTimeout((function(){n(t)}),0)}))}))},t.prototype.getBlacklist=function(){var t=this;return new Promise((function(e){t._callCppProxy("getBlacklist",(function(t){setTimeout((function(){e({code:X.SUCCESS,data:t})}),0)}),(function(t){setTimeout((function(){e({code:t})}),0)}))}))},t.prototype.getBlacklistStatus=function(t){var e=this;return new Promise((function(n){e._callCppProxy("getBlacklistStatus",t,(function(t){setTimeout((function(){n({code:X.SUCCESS,data:t})}),0)}),(function(t){setTimeout((function(){n({code:t})}),0)}))}))},t.prototype.insertMessage=function(t,e,n){var o=this,r=n.content,i=n.senderUserId,s=n.messageType,a=n.messageDirection,_=n.readStatus,c=n.sentStatus,u=n.sentTime,E=n.searchContent,R=n.isUnread,l=n.messageUId,d=n.disableNotification,p=n.canIncludeExpansion,C=n.expansionMsg,T=n.channelId,I=n.directedUserIds,S=n.disableUpdateLastMessage;r=JSON.stringify(r);var h={};if(u=u||0,C){var N=JSON.parse(C);for(var f in N)h[f]={v:"",ts:0},h[f].v=N[f],h[f].ts=u}return new Promise((function(n){var C=R?0:1,N=o._callCppProxy("insertMessage",t,e,i,s,r,(function(){}),(function(t){setTimeout((function(){n({code:t})}),0)}),a,_||0,c||10,u,E||"",C,l||"",!!d,!!p,JSON.stringify(h),T||"",I||[],S||!1),f=o._buildMessage(N,{isOffLineMessage:!1});f.messageUId=l,f.sentTime=u,n({code:-1===f.messageId?X.MSG_INSERT_ERROR:X.SUCCESS,data:f})}))},t.prototype.batchInsertMessage=function(t,e){var n=this;return void 0===e&&(e=!1),new Promise((function(o){var r=t.map((function(t){var e=t.content,n=t.senderUserId,o=t.messageType,r=t.messageDirection,i=t.receivedStatus,s=void 0===i?0:i,a=t.sentStatus,_=t.sentTime,c=t.searchContent,u=t.isUnread,E=t.messageUId,R=t.disableNotification,l=t.canIncludeExpansion,d=t.expansion,p=t.channelId,C=t.conversationType,T=t.targetId,I=t.source,S=t.isMentioned,h=t.receivedStatusInfo,N=t.directedUserIds,f=t.disableUpdateLastMessage,O=s;h&&(O=function(t){var e=Nt.UNREAD;return(null==t?void 0:t.isRead)&&(e|=Nt.READ),(null==t?void 0:t.isListened)&&(e|=Nt.LISTENED),(null==t?void 0:t.isDownload)&&(e|=Nt.DOWNLOADED),(null==t?void 0:t.isRetrieved)&&(e|=Nt.RETRIEVED),e}(h));var A={};if(_=_||0,d)for(var g in d)A[g]={v:"",ts:0},A[g].v=d[g],A[g].ts=_;return{conversationType:C,targetId:T,channelId:p||"",direction:r,senderUserId:n,status:a||10,sentTime:_,objectName:o,content:JSON.stringify(e),messageUid:E||"",noNotification:!!R,supportExt:!!l,extMsg:JSON.stringify(A),readStatus:O,searchContent:c||"",isUnread:!!u,source:I||"",isMention:S,directedUsers:N,disableUpdateLastMessage:f||!1}})),i=n._callCppProxy("insertMessages",JSON.stringify(r),e);o({code:i?X.SUCCESS:X.MSG_INSERT_ERROR,data:i||!1})}))},t.prototype.getMessageCount=function(t,e,n){var o=this;return new Promise((function(r){var i=o._callCppProxy("getMessageCount",t,e,n);r({code:X.SUCCESS,data:i})}))},t.prototype.deleteMessages=function(t){var e=this;return new Promise((function(n){e._callCppProxy("deleteMessages",t),n(X.SUCCESS)}))},t.prototype.deleteMessagesByTimestamp=function(t,e,n,o,r){var i=this;return new Promise((function(s){i._callCppProxy("deleteMessagesByTimestamp",t,e,n,o,r),s(X.SUCCESS)}))},t.prototype.batchClearMessagesByTimestamp=function(t){var e=this;return new Promise((function(n,o){var r=t.map((function(t){return{conversation_type:t.conversationType,target_id:t.targetId,channel_id:t.channelId||"",send_time:t.timestamp}}));e._callCppProxy("deleteMessageBySendTimeInBatches",JSON.stringify(r)),n(X.SUCCESS)}))},t.prototype.batchClearRemoteHistoryMessages=function(t,e){var n=this;return new Promise((function(o,r){var i=t.map((function(t){return{conversation_type:t.conversationType,target_id:t.targetId,channel_id:t.channelId||"",send_time:t.timestamp}}));n._callCppProxy("deleteRemoteMessageBySendTimeInBatches",JSON.stringify(i),e||!1,(function(){setTimeout((function(){o(X.SUCCESS)}),0)}),(function(t){setTimeout((function(){o(t)}),0)}))}))},t.prototype.getMessage=function(t){var e=this;return new Promise((function(n){var o=e._callCppProxy("getMessage",t),r=e._buildMessage(o,{isOffLineMessage:!1});n({code:X.SUCCESS,data:r})}))},t.prototype.setMessageContent=function(t,e,n){var o=this;return new Promise((function(r){e=JSON.stringify(e),o._callCppProxy("setMessageContent",t,e,n),r(X.SUCCESS)}))},t.prototype.setMessageSearchField=function(t,e,n){var o=this;return new Promise((function(r){o._callCppProxy("setMessageSearchField",t,e,n),r(X.SUCCESS)}))},t.prototype.setMessageSentStatus=function(t,e){var n=this;return new Promise((function(o){n._callCppProxy("setMessageSentStatus",t,e),o(X.SUCCESS)}))},t.prototype.setMessageReceivedStatus=function(t,e){var n=this;return new Promise((function(o){n._callCppProxy("setMessageReceivedStatus",t,e),o(X.SUCCESS)}))},t.prototype.saveConversationMessageDraft=function(t,e,n,o){var r=this;return new Promise((function(i){r._callCppProxy("saveTextMessageDraft",t,e,n,o||"")&&i(X.SUCCESS),i(X.DRAFT_SAVE_ERROR)}))},t.prototype.getConversationMessageDraft=function(t,e,n){var o=this;return new Promise((function(r){var i=o._callCppProxy("getTextMessageDraft",t,e,n||"");r({code:X.SUCCESS,data:i})}))},t.prototype.clearConversationMessageDraft=function(t,e,n){var o=this;return new Promise((function(r){o._callCppProxy("clearTextMessageDraft",t,e,n||"")&&r(X.SUCCESS),r(X.DRAFT_REMOVE_ERROR)}))},t.prototype.pullConversationStatus=function(t){throw new Error("Method not implemented.")},t.prototype.batchSetConversationStatus=function(t){var e=t[0],n=e.conversationType,o=e.targetId,r=e.isTop,i=e.notificationStatus,s=e.channelId,a=e.isUpdateTime,_=void 0===a||a,c=this._callCppProxy("getConversationNotificationStatus",n,o,s||""),u=this._callCppProxy("getConversationTopStatus",n,o,s||""),E=Qt(i)?Boolean(c):i===St.OPEN,R=Qt(r)?Boolean(u):r;return this.setConversationStatus(n,o,E,R,s,_)},t.prototype.getConversationNotificationLevel=function(t,e,n){return Dt(this,void 0,void 0,(function(){var o;return Gt(this,(function(r){return o=this._callCppProxy("getBlockPushLevelForConversation",e,n,t),[2,Promise.resolve({code:X.SUCCESS,data:o})]}))}))},t.prototype.setConversationNotificationLevel=function(t,e,n,o){var r=this;return void 0===o&&(o=""),new Promise((function(i){r._callCppProxy("setBlockPushLevelForConversation",e,o,t,n,(function(){setTimeout((function(){i(X.SUCCESS)}),0)}),(function(t){setTimeout((function(){i(t)}),0)}))}))},t.prototype.batchSetConversationNotificationLevel=function(t,e){var n=this;return new Promise((function(o,r){var i=t.map((function(t){return{conversation_type:t.conversationType,target_id:t.targetId,channel_id:t.channelId,level:e}}));n._callCppProxy("setBlockPushLevelInBatches",JSON.stringify(i),(function(){setTimeout((function(){o(X.SUCCESS)}),0)}),(function(t){setTimeout((function(){o(t)}),0)}))}))},t.prototype.getTotalUnreadCountByLevels=function(t,e,n){if(n){var o=this._callCppProxy("getUnreadMentionedCountByLevel",t,e);return Promise.resolve({code:X.SUCCESS,data:o})}var r=this._callCppProxy("getUnreadCountByLevel",t,e);return Promise.resolve({code:X.SUCCESS,data:r})},t.prototype.pullUserSettings=function(t){throw new Error("Method not implemented.")},t.prototype.sendReadReceiptMessage=function(t,e,n){var o=this;return new Promise((function(r){o._callCppProxy("sendReadReceipt",t,n||"",e,(function(){e.forEach((function(t){o._updateReadReceiptInfo(t,{hasRespond:!0});try{var e=JSON.parse(o._callCppProxy("getMessage",t)).messageId;o.setMessageReceivedStatus(e,1)}catch(e){o.logger.error(Le.P_PARSE_JSON_MSGS_E,JSON.stringify({messageUId:t,error:null==e?void 0:e.stack}))}})),setTimeout((function(){r({code:X.SUCCESS})}),0)}),(function(t){setTimeout((function(){r({code:t})}),0)}))}))},t.prototype.getMessageReader=function(t,e,n){var o=this;return new Promise((function(r){o._callCppProxy("getMessageReader",t,n,e,(function(t,n){var i=[],s={};(t=JSON.parse(t)).list.forEach((function(t){var e=JSON.parse(t.obj),n=e.id,o=e.time;i.push({userId:n,readTime:o}),s[n]=o}));var a={readerInfo:s,readCount:i.length,totalCount:n};o._updateReadReceiptInfo(e,a),setTimeout((function(){r({code:X.SUCCESS,data:{list:i,totalMemberCount:n}})}),0)}),(function(t){setTimeout((function(){r({code:t})}),0)}))}))},t.prototype.sendReadReceiptMessageV4=function(t,e,n){var o=this;return new Promise((function(r){var i=t.conversationType,s=t.targetId,a=t.channelId;o._callCppProxy("sendMessageReadReceipt",i,s,a||"",e,n,(function(){setTimeout((function(){r({code:X.SUCCESS})}),0)}),(function(t){setTimeout((function(){r({code:t})}),0)}))}))},t.prototype.getMessageReadReceiptV4=function(t,e){var n=this;return new Promise((function(o){var r=t.targetId,i=t.channelId;n._callCppProxy("getMessageReadReceipt",r,i||"",e,(function(t,r,i){var s=[],a=n._callCppProxy("getMessage",e),_=JSON.parse(a);try{JSON.parse(i).list.forEach((function(t){var e=JSON.parse(t.obj),n=e.id,o=e.time;s.push({userId:n,readTime:o})}))}catch(t){n.logger.error(Le.P_PARSE_JSON_E,"method: getMessageReadReceipt, info: ".concat(i,", error: ").concat(t))}var c=JSON.parse(_.readReceiptRequest||"{}"),u=c.readerList,E=void 0===u?[]:u,R=c.readCount,l=void 0===R?0:R,d=!1;E.length<s.length&&(E=s,d=!0),l<r&&(l=r,d=!0),d&&n._callCppProxy("updateReadReceiptRequestInfo",e,JSON.stringify({readerList:E,readCount:l,totalCount:t})),setTimeout((function(){o({code:X.SUCCESS,data:{list:s,totalCount:t,readCount:l}})}),0)}),(function(t){setTimeout((function(){o({code:t})}),0)}))}))},t.prototype.updateConversationReadTime=function(t,e){var n=this;return new Promise((function(o){var r=t.conversationType,i=t.targetId,s=t.channelId;n._callCppProxy("updateConversationReadTime",r,i,s||"",e,(function(){setTimeout((function(){o({code:X.SUCCESS})}),0)}),(function(t){setTimeout((function(){o({code:t})}),0)}))}))},t.prototype._addChatroomCache=function(t,e,n,o){this._rmChatroomCache(t),this._chatroomCache.push({chatroomId:t,joinExist:n,count:e,extra:o})},t.prototype._rmChatroomCache=function(t){this._chatroomCache=this._chatroomCache.filter((function(e){return e.chatroomId!==t}))},t.prototype._try2RejoinChatroom=function(){var t=this;if(0!==this._chatroomCache.length){var e=this.logger.createTraceId();this._chatroomCache.forEach((function(n){return Dt(t,void 0,void 0,(function(){var t,o,r,i,s,a,_;return Gt(this,(function(c){switch(c.label){case 0:return t=n.chatroomId,o=n.joinExist,r=n.count,i=n.extra,this.logger.info(S.L_REJOIN_CHATROOM_T,t,e),[4,this._joinChrm(t,r,o,!1,i)];case 1:return s=c.sent(),a=s.code,_=s.data,a===X.SUCCESS?(this.logger.info(S.L_REJOIN_CHATROOM_R,t,e),this._sendChatroomStatus({rejoinedRoom:Ut({chatroomId:t,count:r},_)}),[2]):(a===X.RC_CHATROOM_USER_KICKED&&this._rmChatroomCache(t),this._sendChatroomStatus({rejoinedRoom:{chatroomId:t,errorCode:a}}),this.logger.warn(S.L_REJOIN_CHATROOM_R,"chrmId: ".concat(t,", code: ").concat(a),e),[2])}}))}))}))}},t.prototype._joinChrm=function(t,e,n,o,r){var i=this,s=n?"joinExistChatRoom":"joinChatRoom";return new Promise((function(a){o&&i._callCppProxy("clearMessages",Q.CHATROOM,t,""),i._callCppProxy(s,t,e,(function(o,s,_,c,u,E,R){i._addChatroomCache(t,e,n,r||""),setTimeout((function(){a({code:X.SUCCESS,data:{createTime:Number(o),memberCount:s,isAllChatroomBanned:_,isCurrentUserBanned:c,isCurrentChatroomBanned:u,isCurrentChatroomInWhitelist:E,joinTime:R}})}),0)}),(function(t){setTimeout((function(){a({code:t})}),0)}),r||"")}))},t.prototype.joinChatroom=function(t,e,n){return Dt(this,void 0,void 0,(function(){return Gt(this,(function(o){switch(o.label){case 0:return[4,this._joinChrm(t,e,!1,!0,n)];case 1:return[2,o.sent().code]}}))}))},t.prototype.joinExistChatroom=function(t,e,n){return this._joinChrm(t,e,!0,!0,n)},t.prototype.quitChatroom=function(t){var e=this;return this._rmChatroomCache(t),new Promise((function(n){e._callCppProxy("quitChatRoom",t,(function(){setTimeout((function(){n(X.SUCCESS)}),0)}),(function(t){setTimeout((function(){n(t)}),0)}))}))},t.prototype.getChatroomInfo=function(t,e,n){var o=this;return new Promise((function(r){o._callCppProxy("getChatroomInfo",t,e,n,(function(t,e){var n=t?JSON.parse(t).list:[],o=[];if(n.length>0)for(var i=0;i<n.length;i++)o.push(JSON.parse(n[i].obj));setTimeout((function(){r({code:X.SUCCESS,data:{userInfos:o,userCount:e}})}),0)}),(function(t){setTimeout((function(){r({code:t})}),0)}))}))},t.prototype.getChatroomHistoryMessages=function(t,e,n,o){var r=this;return new Promise((function(i){r._callCppProxy("getChatroomHistoryMessage",t,e,n,o,(function(t){var e;try{e=JSON.parse(t)}catch(t){e={list:[],hasMore:!1}}var n=e.list;if(n&&n.length)try{e.list=n.map((function(t){return r._buildMessage(t.obj)}))}catch(t){e.list=[]}setTimeout((function(){i({code:X.SUCCESS,data:e})}),0)}),(function(t){setTimeout((function(){i({code:t})}),0)}),"")}))},t.prototype.setChatroomEntry=function(t,e){var n=this;return new Promise((function(o){var r='[{"key":"'.concat(e.key,'", "value":"').concat(e.value,'"}]');n._callCppProxy("setChatroomKV",t,r,!!e.isAutoDelete,!!e.isOverwrite,(function(){setTimeout((function(){o(X.SUCCESS)}),0)}),(function(t){setTimeout((function(){o(t)}),0)}))}))},t.prototype.setChatroomEntries=function(t,e){var n=this;return new Promise((function(o){n._callCppProxy("setChatroomKV",t,JSON.stringify(e.entries),!!e.isAutoDelete,!!e.isOverwrite,(function(){o({code:X.SUCCESS})}),(function(t){o({code:t})}))}))},t.prototype.forceSetChatroomEntry=function(t,e){return e.isOverwrite=!0,e.userId=e.userId||this.tcpMgr.getCurrentUserId(),this.setChatroomEntry(t,e)},t.prototype.removeChatroomEntry=function(t,e){var n=this,o=[e.key];return new Promise((function(r){n._callCppProxy("deleteChatroomKV",t,o,!!e.isOverwrite,(function(){r(X.SUCCESS)}),(function(t){r(t)}))}))},t.prototype.forceRemoveChatroomEntry=function(t,e){return e.isOverwrite=!0,e.userId=e.userId||this.tcpMgr.getCurrentUserId(),this.removeChatroomEntry(t,e)},t.prototype.removeChatroomEntries=function(t,e){var n=this;return new Promise((function(o){var r=e.entries.map((function(t){return t.key}));n._callCppProxy("deleteChatroomKV",t,r,!!e.isOverwrite,(function(){o({code:X.SUCCESS})}),(function(t){o({code:t})}))}))},t.prototype.getChatroomEntry=function(t,e){return Dt(this,void 0,void 0,(function(){var n,o,r;return Gt(this,(function(i){switch(i.label){case 0:return[4,this.getAllChatroomEntry(t)];case 1:return n=i.sent(),o=n.code,r=n.data,o!==X.SUCCESS?[2,{code:o}]:r&&r[e]?[2,{code:o,data:r[e]}]:[2,{code:X.CHATROOM_KEY_NOT_EXIST}]}}))}))},t.prototype.getAllChatroomEntry=function(t){var e=this;return new Promise((function(n){e._callCppProxy("getChatroomKV",t,(function(t){var e={};try{(t?JSON.parse(t):{list:[]}).list.map((function(t){return JSON.parse(t.obj)})).forEach((function(t){e[t.key]=t.value?t.value:""}))}catch(t){}setTimeout((function(){n({code:X.SUCCESS,data:e})}),0)}),(function(t){setTimeout((function(){n({code:t})}),0)}))}))},t.prototype.removeChatroomFromCatch=function(t){this._rmChatroomCache(t)},t.prototype.getFileToken=function(t,e,n,o,r,i){var s=this;return n=n||"",o=o||"",r=r||"",new Promise((function(a){var _;_=o&&"uploads"!==o?e||"":oe(t,e);var c=s.getNaviInfoFromCache(),u={uploadDomain:ae(c,s.logger),env:s._environment};i=i?Math.ceil(i):0,s._callCppProxy("getUploadToken",t,_,n,o,r,JSON.stringify(u),i,(function(t,e,n,o,r,i,s,c,u,E,R,l,d,p,C,T,I,S,h,N,f,O,A){setTimeout((function(){a({code:X.SUCCESS,data:{token:t,deadline:0,bosToken:e,bosDate:n,path:o,osskeyId:r,ossPolicy:i,ossSign:s,ossBucketName:c,fileName:_,s3Credential:u,s3Algorithm:E,s3Date:R,s3Policy:l,s3Signature:d,s3BucketName:p,stcAuthorization:C,stcContentSha256:T,stcDate:I,stcBucketName:S,minioAuthorization:h,minioContentSha256:N,minioDate:f,minioBucketName:O,downloadAuthInfo:A?JSON.parse(A):null}})}),0)}),(function(t){setTimeout((function(){a({code:t})}),0)}))}))},t.prototype.getFileUrl=function(t,e,n,o){var r=this;return new Promise((function(i){var s=r.getNaviInfoFromCache(),a={url:ae(s,r.logger)};r._callCppProxy("getDownloadUrl",t,n,o,e-1,JSON.stringify(a),-1,(function(t){setTimeout((function(){i({code:X.SUCCESS,data:{downloadUrl:t}})}),0)}),(function(t){setTimeout((function(){i({code:t})}),0)}))}))},t.prototype.clearData=function(){var t=this;return new Promise((function(e){var n=t._callCppProxy("clearData");e({code:X.SUCCESS,data:n})}))},t.prototype.getDeviceId=function(){var t=this._dbpath;return vn(t)},t.prototype.getVoIPKey=function(t,e){var n=this;return new Promise((function(o){n._callCppProxy("getVoIPKey",t,e,"",(function(t){setTimeout((function(){o({code:X.SUCCESS,data:t})}),0)}),(function(t){setTimeout((function(){o({code:t})}),0)}))}))},t.prototype.bindRTCRoomForChatroom=function(t){var e=this;return new Promise((function(n){var o=t.chatRoomId,r=t.rtcRoomId;e._callCppProxy("bindRTCRoomForChatroom",o,r,(function(){setTimeout((function(){n(X.SUCCESS)}),0)}),(function(t){setTimeout((function(){n(t)}),0)}))}))},t.prototype.getGroupMessageDeliverList=function(t,e,n){var o=this;return new Promise((function(r){o._callCppProxy("getGroupMessageDeliverList",t,n,e,(function(t,e){var n=JSON.parse(t).list.map((function(t){return{time:JSON.parse(t.obj).time,userId:JSON.parse(t.obj).id}}));setTimeout((function(){r({code:X.SUCCESS,data:{totalCount:e,list:n}})}),0)}),(function(t){setTimeout((function(){r({code:t})}),0)}))}))},t.prototype.getPrivateMessageDeliverTime=function(t,e){var n=this;return new Promise((function(o){var r=n._callCppProxy("getMessageDeliverTime",t);if(r)o({code:X.SUCCESS,data:r});else{n._callCppProxy("getPrivateMessageDeliverList",e,t,(function(t){var e=0,n=JSON.parse(t).list;if(n.length>0){var r=JSON.parse(n[0].obj).time;e=r}setTimeout((function(){o({code:X.SUCCESS,data:e})}),0)}),(function(t){setTimeout((function(){o({code:t})}),0)}))}}))},t.prototype.rtcSignaling=function(t,e,n,o){var r=this;return new Promise((function(i){r._callCppProxy("rtcSignaling",t,e,n,o,(function(t){var e=Array.prototype.slice.call(t);i({code:X.SUCCESS,buffer:e})}),(function(t){i({code:t})}),30)}))},t.prototype._setRTCHeartbeatListener=function(){var t=this;Be.setRTCHeartbeatListener((function(e,n){var o=t.rtcHeartbeatResolves[e];if(o){var r=o.find((function(t){return""===t.seqId}));r&&(r.seqId=n)}}),(function(e,n,o,r){var i=t.rtcHeartbeatResolves[e];if(i){var s=i.findIndex((function(t){return t.seqId===o}));-1!==s&&i.splice(s,1)[0].resolve({code:n,data:{version:Number(r)}})}}))},t.prototype.rtcPing=function(t,e,n){var o=this;return new Promise((function(e){var n={resolve:e,seqId:""},r=o.rtcHeartbeatResolves[t];r?r.push(n):o.rtcHeartbeatResolves[t]=[n],o._callCppProxy("sendRTCHeartbeat",[t],30)}))},t.prototype.createTag=function(t){var e=this;return new Promise((function(n){e._callCppProxy("addTag",t.tagId,t.tagName,(function(){setTimeout((function(){n({code:X.SUCCESS})}),0)}),(function(t){setTimeout((function(){n({code:t})}),0)}))}))},t.prototype.removeTag=function(t){var e=this;return new Promise((function(n){e._callCppProxy("deleteTag",t,(function(){setTimeout((function(){n({code:X.SUCCESS})}),0)}),(function(t){setTimeout((function(){n({code:t})}),0)}))}))},t.prototype.updateTag=function(t){var e=this;return new Promise((function(n){e._callCppProxy("renameTag",t.tagId,t.tagName,(function(){setTimeout((function(){n({code:X.SUCCESS})}),0)}),(function(t){setTimeout((function(){n({code:t})}),0)}))}))},t.prototype.getTagList=function(){var t=this;return new Promise((function(e){var n=t._callCppProxy("getTags"),o=t._convertResultList(n,(function(t){return{tagId:t.tagId,tagName:t.tagName,conversationCount:t.conversationCount,createdTime:t.tagTime}}));e({code:X.SUCCESS,data:o})}))},t.prototype.addTagForConversations=function(t,e){var n=this;return new Promise((function(o){e.forEach((function(t){t.conversationType&&(t.type=t.conversationType)}));n._callCppProxy("addConversationsForTag",t,JSON.stringify(e),(function(){setTimeout((function(){o({code:X.SUCCESS})}),0)}),(function(t){setTimeout((function(){o({code:t})}),0)}))}))},t.prototype.removeTagForConversations=function(t,e){var n=this;return new Promise((function(o){e.forEach((function(t){t.conversationType&&(t.type=t.conversationType)})),n._callCppProxy("removeConversationsForTag",t,JSON.stringify(e),(function(){setTimeout((function(){o({code:X.SUCCESS})}),0)}),(function(t){setTimeout((function(){o({code:t})}),0)}))}))},t.prototype.removeTagsForConversation=function(t,e){var n=this;return new Promise((function(o){n._callCppProxy("removeTagsForConversation",t.conversationType,t.targetId,t.channelId||"",e,(function(){setTimeout((function(){o({code:X.SUCCESS})}),0)}),(function(t){setTimeout((function(){o({code:t})}),0)}))}))},t.prototype.getConversationListByTag=function(t,e,n,o){var r=this;return new Promise((function(i){var s=r._callCppProxy("getConversationsForTagByPage",t,e,n||20,o||""),a=r._convertResultList(s,(function(t){return Ut(Ut({},r._buildConversation(JSON.stringify(t))),{isTopInTag:t.topForTag})}));i({code:X.SUCCESS,data:a})}))},t.prototype.getUnreadCountByTag=function(t,e){var n=this;return new Promise((function(o){var r=n._callCppProxy("getConversationUnreadCountForTag",t,e);o({code:X.SUCCESS,data:r})}))},t.prototype.setConversationStatusInTag=function(t,e,n){var o=this;return new Promise((function(r){o._callCppProxy("setConversationToTopForTag",t,e.conversationType,e.targetId,e.channelId||"",n.isTop||!1,(function(){setTimeout((function(){r({code:X.SUCCESS})}),0)}),(function(t){setTimeout((function(){r({code:t})}),0)}))}))},t.prototype.getTagsForConversation=function(t){var e=this;return new Promise((function(n){var o=e._callCppProxy("getTagsForConversation",t.conversationType,t.targetId,t.channelId||""),r=e._convertResultList(o,(function(t){return{tagId:t.tagId,tagName:t.tagName,isTop:t.isTop,createdTime:t.tagTime}}));n({code:X.SUCCESS,data:r})}))},t.prototype.getBlockConversationList=function(){throw new Error("Method not implemented.")},t.prototype.getTopConversationList=function(t,e){var n=this;return new Promise((function(o){var r=Qt(e)?n._callCppProxy("getTopConversations",t):n._callCppProxy("getTopConversations",t,e),i=JSON.parse(r).list.map((function(t){return n._buildConversation(t.obj)}));o({code:X.SUCCESS,data:i})}))},t.prototype.getUnreadMentionedCount=function(t){throw new Error("Method not implemented.")},t.prototype.getAllUnreadMentionedCount=function(){var t=this;return new Promise((function(e){var n=t._callCppProxy("getUnreadAndMentionCount",[Q.GROUP],"");e({code:X.SUCCESS,data:n})}))},t.prototype.getOSInfo=function(){return Dt(this,void 0,void 0,(function(){var t;return Gt(this,(function(e){return t={arch:d.arch(),platform:d.platform(),type:d.type(),version:d.version(),release:d.release(),uptime:d.uptime(),cpus:d.cpus(),freemem:d.freemem(),totalmem:d.totalmem(),networkInterfaces:d.networkInterfaces()},[2,{code:X.SUCCESS,data:t}]}))}))},t.prototype.getMainProcessInfo=function(){return Dt(this,void 0,void 0,(function(){return Gt(this,(function(t){return[2,{code:X.SUCCESS,data:{title:process.title,pid:process.pid,ppid:process.ppid,platform:process.platform,arch:process.arch,uptime:process.uptime(),cpuUsage:process.cpuUsage(),memoryUsage:process.memoryUsage(),resourceUsage:process.resourceUsage()}}]}))}))},t.prototype.setCallInfo=function(t,e,n){var o=this;return new Promise((function(r){o._callCppProxy("callInfoSignaling",t,e,n,(function(t,e){setTimeout((function(){r({code:X.SUCCESS,data:{key:t,value:e}})}),0)}),(function(t){setTimeout((function(){r({code:t})}),0)}))}))},t.prototype.setProxy=function(t){return this.tcpMgr.getConnectionStatus()!==lt.DISCONNECTED?Promise.resolve({code:X.RC_CONN_PROXY_UNAVAILABLE}):Promise.resolve(Rn(t,this.logger))},t.prototype.getProxy=function(){return Promise.resolve(ln())},t.prototype.testProxy=function(t,e){return function(t,e,n){return new Promise((function(o){var r=/^https/.test(e)?cn:sn;n.info(S.A_TEST_PROXY_O,JSON.stringify({msg:"test proxy",proxy:t,testHost:e}));var i=r(e,t,(function(t){var e=200===t.statusCode?0:t.statusCode;t.setEncoding("utf8");var n="";t.on("data",(function(t){n+=t})),t.once("end",(function(){o({status:e||0,data:n})}))}));i.once("timeout",(function(){return o({status:0})})),i.once("error",(function(t){return o({status:0,data:t.stack})})),i.end()}))}(t,e,this.logger)},t.prototype.checkDuplicateMessage=function(t){var e=this;return new Promise((function(n){var o=e._callCppProxy("checkDuplicateMessage",t);n({code:X.SUCCESS,data:o})}))},t.prototype.subscribeUser=function(t,e,n){var o=this;return new Promise((function(r){o._callCppProxy("updateSubscribeStatus",e,Et.SUBSCRIBE,t,(function(){r({code:X.SUCCESS})}),(function(t,e){r({code:t,data:e})}),n)}))},t.prototype.unSubscribeUser=function(t,e){var n=this;return new Promise((function(o){n._callCppProxy("updateSubscribeStatus",e,Et.UNSUBSCRIBE,t,(function(){o({code:X.SUCCESS})}),(function(t){o({code:t})}),0)}))},t.prototype.getSubscribeUserList=function(t,e,n){var o=this._callCppProxy("getSubscribeUserList",t,e,n),r=this._buildSubscribeEventData(o).map((function(t){var e=t.userId,n=t.subscribeType,o=t.subscribeTime,r=t.expiry,i=t.details,s={userId:e,subscribeType:n,subscribeTime:o,expiry:r};return n===ut.ONLINE_STATUS&&(s.details=$t(i)),s}));return Promise.resolve({code:X.SUCCESS,data:r})},t.prototype.setDuplicateMessageConfig=function(t){var e=this._callCppProxy("setDuplicateMessageConfig",[Q.CHATROOM],bn.cuid,t);return Promise.resolve({code:e})},t.prototype.getSubscribeUserStatus=function(t,e){var n=this._callCppProxy("getSubscribeStatusByUserIds",t,e),o=this._buildSubscribeEventData(n).map((function(t){var e=t.userId,n=t.subscribeType,o=t.subscribeTime,r=t.expiry,i=t.details,s={userId:e,subscribeType:n,subscribeTime:o,expiry:r};return n===ut.ONLINE_STATUS&&(s.details=$t(i)),s}));return Promise.resolve({code:X.SUCCESS,data:o})},t.prototype.updateMyUserProfile=function(t){var e=this;return new Promise((function(n){var o=[],r=[];Object.keys(t).forEach((function(e){var n;if("extraProfile"===e&&t.extraProfile){if(t.extraProfile){var i=t.extraProfile;Object.keys(i).forEach((function(t){r.push(JSON.stringify({key:t,value:i[t]||""}))}))}}else o.push(JSON.stringify({key:e,value:(null===(n=t[e])||void 0===n?void 0:n.toString())||""}))})),e._callCppProxy("updateUserProfile",o,r,(function(t,e){n({code:t,data:{errorKey:e}})}))}))},t.prototype.getUserProfiles=function(t){var e=this;return new Promise((function(n){e._callCppProxy("getUserProfiles",t,(function(t,o){n({code:t,data:e._string2UserProfileInfoList(o)})}))}))},t.prototype.getMyUserProfile=function(){var t=this;return new Promise((function(e){t._callCppProxy("getOwnUserProfile",(function(n,o){e({code:n,data:t._string2userProfileInfo(o)})}))}))},t.prototype._string2userProfileInfo=function(t){var e;try{var n=JSON.parse(t),o=n.userProfile.reduce((function(t,e){var n=JSON.parse(e);return["gender","role","level"].includes(n.key)?t[n.key]=Number(n.value):t[n.key]=n.value,t}),{});return o.userId=n.userId,o.extraProfile=(null===(e=n.userExtProfile)||void 0===e?void 0:e.reduce((function(t,e){var n=JSON.parse(e);return t[n.key]=n.value,t}),{}))||{},o}catch(e){this.logger.error(Le.P_PARSE_JSON_USER_PROFILE_E,JSON.stringify({error:null==e?void 0:e.stack,str:t}))}return{}},t.prototype._string2UserProfileInfoList=function(t){var e=this;try{return JSON.parse(t).list.map((function(t){return e._string2userProfileInfo(t.obj)}))}catch(e){this.logger.error(Le.P_PARSE_JSON_USER_PROFILE_E,JSON.stringify({error:null==e?void 0:e.stack,str:t}))}return[]},t.prototype.updateMyUserProfileVisibility=function(t){var e=this;return new Promise((function(n){e._callCppProxy("updateUserProfilePermission",t,(function(){n({code:X.SUCCESS})}),(function(t){n({code:t})}))}))},t.prototype.getMyUserProfileVisibility=function(){var t=this;return new Promise((function(e){t._callCppProxy("getUserProfilePermission",(function(t,n){e({code:t,data:n})}))}))},t.prototype.searchUserProfileByUniqueId=function(t){var e=this;return new Promise((function(n){e._callCppProxy("getUserProfileByUniqueId",t,(function(t,o){n({code:t,data:e._string2userProfileInfo(o)})}))}))},t.prototype.getMatchedMessage=function(t,e,n,o){var r,i=this._callCppProxy("getMatchedMessage",t.conversationType,t.targetId,e,n,o,t.channelId||""),s=[];try{r=JSON.parse(i).list;for(var a=0;a<r.length;a++){var _=this._buildMessage(r[a].obj);s.push(_)}}catch(t){return this.logger.error(Le.P_PARSE_JSON_MSGS_E,i),Promise.resolve({code:X.MAIN_PROCESS_ERROR})}return Promise.resolve({code:X.SUCCESS,data:s})},t.prototype.getConversations=function(t){var e,n=this,o=t.map((function(t){var e=t.conversationType,n=t.targetId,o=t.channelId;return{targetId:n,channelId:void 0===o?"":o,type:e}})),r=this._callCppProxy("getConversations",JSON.stringify(o));try{e=JSON.parse(r).list.map((function(t){return n._buildConversation(t.obj)}))}catch(t){return this.logger.error(Le.P_PARSE_JSON_MSGS_E,r),Promise.resolve({code:X.MAIN_PROCESS_ERROR})}return Promise.resolve({code:X.SUCCESS,data:e})},t.prototype.handleErrorCode=function(t,e){t!==X.SUCCESS&&setTimeout((function(){return e(pe(t))}),0)},t.prototype._convertGroupInfoList=function(t,e){return t&&0!==t.length?t.map((function(t){var e=t.groupId,n=t.baseInfo,o=t.createTime,r=t.createUserId,i=t.extraInfo,s=t.memberCount,a=t.ownerId,_=t.remark,c=t.joinTime,u=t.role,E=ne(n),R=ne(i);return{groupId:e,groupName:E.name||"",portraitUri:E.portraitUrl||"",introduction:E.introduction||"",notice:E.announcement||"",joinPermission:~~E.joinPerm,removeMemberPermission:~~E.removePerm,invitePermission:~~E.memInvitePerm,inviteHandlePermission:~~E.invitePerm,groupInfoEditPermission:~~E.profilePerm,memberInfoEditPermission:~~E.memProfilePerm,extProfile:R,creatorId:r||"",ownerId:a||"",createTime:o||0,membersCount:s||0,remark:_||"",joinedTime:c||0,role:u||U.UNDEF}})):[]},t.prototype._convertUpdateGroupInfoList=function(t){return t&&0!==t.length?t.map((function(t){var e=t.groupId,n=t.baseInfo,o=t.createTime,r=t.createUserId,i=t.extraInfo,s=t.memberCount,a=t.ownerId,_=t.remark,c=t.joinTime,u=t.role,E=ne(n),R=ne(i);return Ut(Ut(Ut(Ut(Ut(Ut(Ut(Ut(Ut({groupId:e},function(t){return Ut(Ut(Ut(Ut(Ut(Ut(Ut(Ut(Ut(Ut({},t.name&&{groupName:t.name}),t.portraitUrl&&{portraitUri:t.portraitUrl}),t.introduction&&{introduction:t.introduction}),t.announcement&&{notice:t.announcement}),t.joinPerm&&{joinPermission:~~t.joinPerm}),t.removePerm&&{removeMemberPermission:~~t.removePerm}),t.memInvitePerm&&{invitePermission:~~t.memInvitePerm}),t.invitePerm&&{inviteHandlePermission:~~t.invitePerm}),t.profilePerm&&{groupInfoEditPermission:~~t.profilePerm}),t.memProfilePerm&&{memberInfoEditPermission:~~t.memProfilePerm})}(E)),i.length>0&&{extProfile:R}),r&&{creatorId:r}),a&&{ownerId:a}),o&&{createTime:o}),s&&{membersCount:s}),_&&{remark:_}),c&&{joinedTime:c}),u&&{role:u})})):[]},t.prototype._convertGroupMemberInfoList=function(t){return t&&0!==t.length?t.map((function(t){var e=t.userId,n=t.nickname,o=t.groupNickname,r=t.portraitUrl,i=t.joinTime;return{userId:e,name:n||"",portraitUri:r||"",nickname:o||"",role:t.role||0,joinedTime:i||0,extra:t.extra||""}})):[]},t.prototype.createGroup=function(t,e,n,o){return Dt(this,void 0,void 0,(function(){var r=this;return Gt(this,(function(i){return[2,new Promise((function(i){var s=Dn(e),a=Dn(n||{}),_=r._callCppProxy("createGroup",t,o,JSON.stringify(s),JSON.stringify(a),(function(t,e,n){t===X.SUCCESS?setTimeout((function(){i({code:t,data:{processCode:e}})}),0):setTimeout((function(){i({code:t,msg:null!=n?n:""})}),0)}));r.handleErrorCode(_,i)}))]}))}))},t.prototype.updateGroupInfo=function(t,e,n){return Dt(this,void 0,void 0,(function(){var o=this;return Gt(this,(function(r){return[2,new Promise((function(r){var i=Dn(e),s=Dn(null!=n?n:{}),a=o._callCppProxy("updateGroupInfo",t,JSON.stringify(i),JSON.stringify(s),(function(t,e){t===X.SUCCESS?setTimeout((function(){r({code:t})}),0):setTimeout((function(){r({code:t,msg:null!=e?e:""})}),0)}));o.handleErrorCode(a,r)}))]}))}))},t.prototype.getGroupsInfo=function(t){return Dt(this,void 0,void 0,(function(){var e=this;return Gt(this,(function(n){return[2,new Promise((function(n){var o=e._callCppProxy("getGroupInfoByIds",t,(function(t,o,r,i){if(t===X.SUCCESS){var s=[];try{s=JSON.parse(i)}catch(t){e.logger.error(Le.P_PARSE_JSON_MSGS_E,i),setTimeout((function(){n({code:X.MAIN_PROCESS_ERROR})}),0)}setTimeout((function(){n({code:X.SUCCESS,data:e._convertGroupInfoList(s)})}),0)}else setTimeout((function(){n({code:t})}),0)}));e.handleErrorCode(o,n)}))]}))}))},t.prototype.kickGroupMembers=function(t,e,n){return Dt(this,void 0,void 0,(function(){var o=this;return Gt(this,(function(r){return[2,new Promise((function(r){var i=Gn(n),s=o._callCppProxy("kickOutGroupMember",t,e,JSON.stringify(i),(function(t,e){setTimeout((function(){r({code:t})}),0)}));o.handleErrorCode(s,r)}))]}))}))},t.prototype.quitGroup=function(t,e){return Dt(this,void 0,void 0,(function(){var n=this;return Gt(this,(function(o){return[2,new Promise((function(o){var r=Gn(e),i=n._callCppProxy("quitGroup",t,JSON.stringify(r),(function(t,e){setTimeout((function(){o({code:t})}),0)}));n.handleErrorCode(i,o)}))]}))}))},t.prototype.dismissGroup=function(t){return Dt(this,void 0,void 0,(function(){var e=this;return Gt(this,(function(n){return[2,new Promise((function(n){var o=e._callCppProxy("disbandGroup",t,(function(t,e){setTimeout((function(){n({code:t})}),0)}));e.handleErrorCode(o,n)}))]}))}))},t.prototype.transferGroupOwner=function(t,e,n,o){return Dt(this,void 0,void 0,(function(){var r=this;return Gt(this,(function(i){return[2,new Promise((function(i){var s=Gn(o),a=r._callCppProxy("transferGroup",t,e,n,JSON.stringify(s),(function(t,e){setTimeout((function(){i({code:t})}),0)}));r.handleErrorCode(a,i)}))]}))}))},t.prototype.setGroupManagers=function(t,e,n){return Dt(this,void 0,void 0,(function(){var o=this;return Gt(this,(function(r){return[2,new Promise((function(r){var i=o._callCppProxy("updateGroupAdmins",e,n,t,(function(t,e){setTimeout((function(){r({code:t})}),0)}));o.handleErrorCode(i,r)}))]}))}))},t.prototype.getGroupMembersByRole=function(t,e,n){return Dt(this,void 0,void 0,(function(){var o=this;return Gt(this,(function(r){return[2,new Promise((function(r){var i=e===U.UNDEF?[1,2,3]:[e],s=o._callCppProxy("getGroupMembers",t,i,n.pageToken||"",n.count,n.order?1:0,(function(t,e,n,i){if(t===X.SUCCESS){var s=[];try{s=JSON.parse(i)}catch(t){o.logger.error(Le.P_PARSE_JSON_MSGS_E,i),setTimeout((function(){r({code:X.MAIN_PROCESS_ERROR})}),0)}var a=o._convertGroupMemberInfoList(s);setTimeout((function(){r({code:X.SUCCESS,data:{totalCount:null!=n?n:0,data:a,pageToken:null!=e?e:""}})}),0)}else setTimeout((function(){r({code:t})}),0)}));o.handleErrorCode(s,r)}))]}))}))},t.prototype.getGroupMembers=function(t,e){return Dt(this,void 0,void 0,(function(){var n=this;return Gt(this,(function(o){return[2,new Promise((function(o){var r=n._callCppProxy("getGroupMembersByIds",t,e,(function(t,e,r,i){if(t===X.SUCCESS){var s=[];try{s=JSON.parse(i)}catch(t){n.logger.error(Le.P_PARSE_JSON_MSGS_E,i),setTimeout((function(){o({code:X.MAIN_PROCESS_ERROR})}),0)}var a=n._convertGroupMemberInfoList(s);setTimeout((function(){o({code:X.SUCCESS,data:a})}),0)}else setTimeout((function(){o({code:t})}),0)}));n.handleErrorCode(r,o)}))]}))}))},t.prototype.setGroupMemberInfo=function(t,e,n,o){return Dt(this,void 0,void 0,(function(){var r=this;return Gt(this,(function(i){return[2,new Promise((function(i){var s=r._callCppProxy("updateGroupMemberInfo",t,e,n,o||"",(function(t,e){setTimeout((function(){i({code:t})}),0)}));r.handleErrorCode(s,i)}))]}))}))},t.prototype.searchGroupMembers=function(t,e,n){return Dt(this,void 0,void 0,(function(){var o=this;return Gt(this,(function(r){return[2,new Promise((function(r){var i=n.order?1:0,s=o._callCppProxy("getGroupMembersByNickname",t,e,n.pageToken||"",n.count,i,(function(t,e,n,i){if(t===X.SUCCESS){var s=[];try{s=JSON.parse(i)}catch(t){o.logger.error(Le.P_PARSE_JSON_MSGS_E,i),setTimeout((function(){r({code:X.MAIN_PROCESS_ERROR})}),0)}var a=o._convertGroupMemberInfoList(s);setTimeout((function(){r({code:X.SUCCESS,data:{data:a,pageToken:e,totalCount:n}})}),0)}else setTimeout((function(){r({code:t})}),0)}));o.handleErrorCode(s,r)}))]}))}))},t.prototype.joinGroup=function(t){return Dt(this,void 0,void 0,(function(){var e=this;return Gt(this,(function(n){return[2,new Promise((function(n){var o=e._callCppProxy("joinGroup",t,(function(t,e,o){t===X.SUCCESS?setTimeout((function(){n({code:t,data:{processCode:e}})}),0):setTimeout((function(){n({code:t})}),0)}));e.handleErrorCode(o,n)}))]}))}))},t.prototype.inviteUsersToGroup=function(t,e){return Dt(this,void 0,void 0,(function(){var n=this;return Gt(this,(function(o){return[2,new Promise((function(o){var r=n._callCppProxy("inviteUsersToGroup",t,e,(function(t,e,n){t===X.SUCCESS?setTimeout((function(){o({code:t,data:{processCode:e}})}),0):setTimeout((function(){o({code:t})}),0)}));n.handleErrorCode(r,o)}))]}))}))},t.prototype.memberInviteResponse=function(t){return Dt(this,void 0,void 0,(function(){var e=this;return Gt(this,(function(n){return[2,new Promise((function(n){var o=t.groupId,r=t.inviterId,i=t.optType,s=t.optResult,a=t.joinUserId,_=t.reason,c=1===i?1:0,u=c&&a?a:"",E=e._callCppProxy("handleGroupInvite",o,u,r,s,c,null!=_?_:"",(function(t,e,o){t===X.SUCCESS?setTimeout((function(){n({code:t,data:{processCode:e}})}),0):setTimeout((function(){n({code:t})}),0)}));e.handleErrorCode(E,n)}))]}))}))},t.prototype.getGroupApplications=function(t,e,n){return void 0===e&&(e=[]),void 0===n&&(n=[]),Dt(this,void 0,void 0,(function(){var o=this;return Gt(this,(function(r){return[2,new Promise((function(r){var i=t.order?1:0,s=o._callCppProxy("getGroupRequests",e,n,"",t.pageToken||"",t.count,i,(function(t,e,n,i){if(t===X.SUCCESS){var s=[];try{s=JSON.parse(i)}catch(t){o.logger.error(Le.P_PARSE_JSON_MSGS_E,i),setTimeout((function(){r({code:X.MAIN_PROCESS_ERROR})}),0)}var a=s.map((function(t){var e=t.groupId,n=t.joinUser,o=t.approverUser,r=t.inviterUser,i=t.type;return{groupId:e,joinMemberInfo:n,inviterInfo:r,operatorInfo:o,status:t.status,direction:t.direction,type:i,operationTime:t.operateTime,reason:t.remark}}));setTimeout((function(){r({code:t,data:{totalCount:n,data:a,pageToken:e}})}),0)}else setTimeout((function(){r({code:t})}),0)}));o.handleErrorCode(s,r)}))]}))}))},t.prototype.getJoinedGroupsByRole=function(t,e){return Dt(this,void 0,void 0,(function(){var n=this;return Gt(this,(function(o){return[2,new Promise((function(o){var r=e.order?1:0,i=t===U.UNDEF?[1,2,3]:[t],s=n._callCppProxy("getGroups",i,e.pageToken||"",e.count,r,(function(t,e,r,i){if(t===X.SUCCESS){var s=[];try{s=JSON.parse(i)}catch(t){n.logger.error(Le.P_PARSE_JSON_MSGS_E,i),setTimeout((function(){o({code:X.MAIN_PROCESS_ERROR})}),0)}var a=n._convertGroupInfoList(s);setTimeout((function(){o({code:t,data:{totalCount:r,data:a,pageToken:e}})}),0)}else setTimeout((function(){o({code:t})}),0)}));n.handleErrorCode(s,o)}))]}))}))},t.prototype.searchJoinedGroups=function(t,e){return Dt(this,void 0,void 0,(function(){var n=this;return Gt(this,(function(o){return[2,new Promise((function(o){var r=e.order?1:0,i=n._callCppProxy("getGroupsByGroupName",t,e.pageToken||"",e.count,r,(function(t,e,r,i){if(t===X.SUCCESS){var s=[];try{s=JSON.parse(i)}catch(t){n.logger.error(Le.P_PARSE_JSON_MSGS_E,i),setTimeout((function(){o({code:X.MAIN_PROCESS_ERROR})}),0)}var a=n._convertGroupInfoList(s);setTimeout((function(){o({code:t,data:{totalCount:r,data:a,pageToken:e}})}),0)}else setTimeout((function(){o({code:t})}),0)}));n.handleErrorCode(i,o)}))]}))}))},t.prototype.getJoinedGroups=function(t){return Dt(this,void 0,void 0,(function(){var e=this;return Gt(this,(function(n){return[2,new Promise((function(n){var o=e._callCppProxy("getGroupsByIds",t,(function(t,o,r,i){if(t===X.SUCCESS){var s=[];try{s=JSON.parse(i)}catch(t){e.logger.error(Le.P_PARSE_JSON_MSGS_E,i),setTimeout((function(){n({code:X.MAIN_PROCESS_ERROR})}),0)}var a=e._convertGroupInfoList(s);setTimeout((function(){n({code:t,data:a})}),0)}else setTimeout((function(){n({code:t})}),0)}));e.handleErrorCode(o,n)}))]}))}))},t.prototype.setGroupRemark=function(t,e){return Dt(this,void 0,void 0,(function(){var n=this;return Gt(this,(function(o){return[2,new Promise((function(o){var r=e?V.ADD:V.REMOVE,i=n._callCppProxy("updateGroupRemark",t,e||"",r,(function(t,e){setTimeout((function(){o({code:t})}),0)}));n.handleErrorCode(i,o)}))]}))}))},t.prototype.setGroupFollows=function(t,e,n){return Dt(this,void 0,void 0,(function(){var o=this;return Gt(this,(function(r){return[2,new Promise((function(r){var i=o._callCppProxy("updateFavoriteMembers",e,n,t,(function(t,e){setTimeout((function(){r({code:t})}),0)}));o.handleErrorCode(i,r)}))]}))}))},t.prototype.getGroupFollows=function(t){return Dt(this,void 0,void 0,(function(){var e=this;return Gt(this,(function(n){return[2,new Promise((function(n){var o=e._callCppProxy("getGroupFavoriteMembers",t,"",1e3,0,(function(t,o,r,i){if(t===X.SUCCESS){var s=[];try{s=JSON.parse(i)}catch(t){e.logger.error(Le.P_PARSE_JSON_MSGS_E,i),setTimeout((function(){n({code:X.MAIN_PROCESS_ERROR})}),0)}var a=s.map((function(t){return{userId:t.userId,time:t.followTime}}));setTimeout((function(){n({code:X.SUCCESS,data:a})}),0)}else setTimeout((function(){n({code:t})}),0)}));e.handleErrorCode(o,n)}))]}))}))},t.prototype.addFriend=function(t,e,n){var o=this;return new Promise((function(r){var i=o._callCppProxy("addFriend",t,e,n,(function(t,e,n){setTimeout((function(){r({code:t})}),0)}));o.handleErrorCode(i,r)}))},t.prototype.deleteFriends=function(t,e){var n=this;return new Promise((function(o){var r=n._callCppProxy("removeFriends",t,e,(function(t,e){setTimeout((function(){o({code:t})}),0)}));n.handleErrorCode(r,o)}))},t.prototype.acceptFriendApplication=function(t){var e=this;return new Promise((function(n){var o=e._callCppProxy("acceptFriendRequest",t,"",(function(t,e){setTimeout((function(){n({code:t})}),0)}));e.handleErrorCode(o,n)}))},t.prototype.refuseFriendApplication=function(t,e){var n=this;return new Promise((function(o){var r=n._callCppProxy("rejectFriendRequest",t,e||"",(function(t,e){setTimeout((function(){o({code:t})}),0)}));n.handleErrorCode(r,o)}))},t.prototype.setFriendInfo=function(t,e,n){var o=this;return new Promise((function(r){var i=Dn(null!=n?n:{}),s=o._callCppProxy("setFriendInfo",t,e,JSON.stringify(i),(function(t,e){setTimeout((function(){r({code:t})}),0)}));o.handleErrorCode(s,r)}))},t.prototype.checkFriends=function(t,e){var n=this;return new Promise((function(o){var r=n._callCppProxy("checkFriendRelationship",t,e,(function(t,e){if(t===X.SUCCESS){var n=JSON.parse(e).map((function(t){return{userId:t.userId,relationType:t.status}}));setTimeout((function(){o({code:t,data:n})}),0)}else setTimeout((function(){o({code:t})}),0)}));n.handleErrorCode(r,o)}))},t.prototype.getFriends=function(t){var e=this;return new Promise((function(n){var o=e._callCppProxy("getFriends",t,0,(function(t,o){try{if(t===X.SUCCESS){var r=JSON.parse(o),i=e._convertFriendInfo(r);setTimeout((function(){n({code:t,data:{data:i,pageToken:""}})}),0)}else setTimeout((function(){n({code:t})}),0)}catch(t){e.logger.error(Le.P_PARSE_JSON_MSGS_E,o),setTimeout((function(){n({code:X.MAIN_PROCESS_ERROR})}),0)}}));e.handleErrorCode(o,n)}))},t.prototype.getFriendApplications=function(t,e,n){var o=this;return new Promise((function(r){var i=t.order?1:0,s=3;e&&1===e.length&&(s=null==e?void 0:e[0]);var a=o._callCppProxy("getFriendRequestListByPage",s,n||[0,1,2,3],t.count,t.pageToken||"",i,(function(t,e,n){if(t===X.SUCCESS){var i=[];try{i=JSON.parse(n)}catch(t){o.logger.error(Le.P_PARSE_JSON_MSGS_E,n),setTimeout((function(){r({code:X.MAIN_PROCESS_ERROR})}),0)}var s=i.map((function(t){return{userId:t.userId,name:t.name,portraitUri:t.portraitUrl,applicationType:t.friendRequestType,applicationStatus:t.friendRequestStatus,operationTime:t.operateTime,remark:t.extra}}));setTimeout((function(){r({code:t,data:{data:s,pageToken:null!=e?e:""}})}),0)}else setTimeout((function(){r({code:t})}),0)}));o.handleErrorCode(a,r)}))},t.prototype.deleteFriendApplication=function(t,e){return Promise.resolve({code:X.NOT_SUPPORT})},t.prototype._convertFriendInfo=function(t){return t.map((function(t){var e=t.userId,n=t.userName,o=t.remark;return{userId:e,name:n,portraitUri:t.portraitUrl,remark:o,directionType:t.friendType,extProfile:t.extProfiles,addTime:t.addTime,inBlackList:!!t.friendAttribute}}))},t.prototype.getFriendsInfo=function(t){var e=this;return new Promise((function(n){var o=e._callCppProxy("getFriendByIds",t,(function(t,o){if(t===X.SUCCESS){var r=JSON.parse(o),i=e._convertFriendInfo(r);setTimeout((function(){n({code:t,data:i})}),0)}else setTimeout((function(){n({code:t})}),0)}));e.handleErrorCode(o,n)}))},t.prototype.searchFriendsInfo=function(t){var e=this;return new Promise((function(n){var o=e._callCppProxy("getFriendByNickname",t,(function(t,o){if(t===X.SUCCESS)try{var r=JSON.parse(o),i=e._convertFriendInfo(r);setTimeout((function(){n({code:X.SUCCESS,data:i})}),0)}catch(t){e.logger.error(Le.P_PARSE_JSON_MSGS_E,o),setTimeout((function(){n({code:X.MAIN_PROCESS_ERROR})}),0)}else setTimeout((function(){n({code:t})}),0)}));e.handleErrorCode(o,n)}))},t.prototype.setFriendAddPermission=function(t){var e=this;return new Promise((function(n){var o=e._callCppProxy("setFriendAuthPermission",t,(function(t,e){setTimeout((function(){n({code:t})}),0)}));e.handleErrorCode(o,n)}))},t.prototype.getFriendAddPermission=function(){var t=this;return new Promise((function(e){var n=t._callCppProxy("getFriendAuthPermission",(function(t,n){setTimeout((function(){e({code:t,data:n})}),0)}));t.handleErrorCode(n,e)}))},t.prototype.setNotificationQuietHoursWithSetting=function(t){var e=t.startTime,n=t.spanMinutes,o=t.level,r=t.timezone,i=Bn.create(this.logger,"addPushSetting");return i.invoke(e,n,o,r||"",(function(){return i.ok()}),(function(t){return i.fail(t)})).result()},t.prototype.removeNotificationQuietHoursSetting=function(){var t=Bn.create(this.logger,"removePushSetting");return t.invoke((function(){return t.ok()}),(function(e){return t.fail(e)})).result()},t.prototype.getNotificationQuietHoursSetting=function(){var t=Bn.create(this.logger,"queryPushSetting");return t.invoke((function(e,n,o,r){var i={startTime:e,spanMinutes:n,level:o,timezone:r};t.ok(i)}),(function(e){return t.fail(e)})).result()},t.prototype.setDataBaseLogConfig=function(t){this._callCppProxy("setDataBaseLogConfig",t)},t}();process.title="".concat(function(t){var e=t.lastIndexOf("/");return-1!==e?t.substring(e+1):t}(process.title)," PsService"),function(t){var e=this,n=bt(t.argv.slice(2),5),o=n[0],r=n[1],i=n[2],s=n[3],a=n[4],_="true"===i,c=Ve(t),u=c.sendCallback,E=c.sendError,R=c.sendEvent,l=c.sendResponse,d=Be?new kn(o,r,R,_,~~s,"true"===a):null;t.on("message",(function(t){return Dt(e,void 0,void 0,(function(){var e,n,o,r,i,s;return Gt(this,(function(a){switch(a.label){case 0:return e=t.reqId,n=t.method,o=t.args,r=t.hasResponse,d?r?("sendMessage"===n&&(i=o[3],o[3]=function(t){u({reqId:i,data:t})}),[4,d.callProxy.apply(d,Ft([n],bt(o),!1))]):[3,2]:[2,l({reqId:e,success:!0,data:{code:X.ADDON_NOT_EXIST,msg:"Cannot find module ".concat(be)}})];case 1:return s=a.sent(),l({reqId:e,success:true,data:s}),[3,3];case 2:d.sendProxy.apply(d,Ft([n],bt(o),!1)),a.label=3;case 3:return[2]}}))}))})),t.on("beforeExit",(function(t){null==d||d.destroy()})),t.on("uncaughtException",(function(t){E("uncaughtException ".concat(t.stack||t.toString()))})),t.on("unhandledRejection",(function(t){E("unhandledRejection ".concat(t.stack))}))}(process);