@rongcloud/engine 5.20.2-enterprise.10 → 5.20.2-enterprise.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.cjs +1 -1
- package/index.cjs.js +1 -1
- package/index.esm.js +1 -1
- package/index.mjs +1 -1
- package/package.json +1 -1
package/index.cjs
CHANGED
|
@@ -13,4 +13,4 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
|
13
13
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
14
14
|
PERFORMANCE OF THIS SOFTWARE.
|
|
15
15
|
***************************************************************************** */
|
|
16
|
-
var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},e(t,r)};function t(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}var r,n=function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},n.apply(this,arguments)};function i(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s}function o(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))}function s(e,t){var r,n,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,n=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}}function a(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function u(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s}function l(e,t,r){if(r||2===arguments.length)for(var n,i=0,o=t.length;i<o;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))}function c(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)}function d(e,t,r,n,i){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?i.call(e,r):i?i.value=r:t.set(e,r),r}exports.UploadMethod=void 0,(r=exports.UploadMethod||(exports.UploadMethod={}))[r.QINIU=1]="QINIU",r[r.ALI=2]="ALI",r[r.AWS=3]="AWS",r[r.STC=4]="STC",r[r.MINIO=5]="MINIO";var p,f,h,_,b,E,v,y,m,I,T,R,C,O,S,A,P,N,w,M,L,U,D,x,j,V,G,k,F,B,H={L_IMSDK_VER_O:"L-imsdk_ver-O",A_INIT_REPEAT_O:"A_INIT_REPEAT_O",L_INIT_O:"L-init-O",A_DESTROY_O:"A_DESTROY_O",A_CONNECT_T:"A-connect-T",A_CONNECT_R:"A-connect-R",A_CONNECT_S:"A-connect-S",L_QUERY_CMP_T:"L-query_cmp-T",L_QUERY_CMP_R:"L-query_cmp-R",A_DISCONNECT_O:"A-disconnect-O",A_RECONNECT_T:"A-reconnect-T",A_RECONNECT_R:"A_RECONNECT_R",L_CONNECT_T:"L-connect-T",L_CONNECT_O:"L-connect-O",L_CONNECT_R:"L-connect-R",L_CONNECT_S:"L-connect-S",L_DB_UPGRATE_START_S:"L-db_upgrate_start-S",L_DB_UPGRATING_S:"L-db_upgrating-S",L_DB_UPGRATE_COMPLETE_S:"L-db_upgrate_complete-S",L_NOTIFY_ULTRA_ONLINE_S:"L-notify-ultra-online-S",L_ULTRA_SYNC_DONE_S:"L-ultra-sync-done-S",L_BATCH_MESSAGE_O:"L-BATCH_MESSAGE-O",A_MSG_LISTENER_E:"A-MSG_LISTENER-E",O:"L-original-O",T:"L-TEST-O",L_INSTALL_PLUGIN_T:"L-INSTALL_PLUGIN-T",L_INSTALL_PLUGIN_R:"L-INSTALL_PLUGIN-R",L_NAVI_CONF_E:"L-NAVI_CONF_ERROR-E",L_NAVI_CMP_R:"L-NAVI_CPM-R",A_SEND_MSG_T:"A-send_msg-T",A_SEND_MSG_R:"A-send_msg-R",L_SEND_MSG_T:"L-send_msg-T",L_SEND_MSG_R:"L-send_msg-R",L_PULL_MSG_T:"L-pull_msg-T",L_PULL_MSG_R:"L-pull_msg-R",L_PULL_MSG_E:"L-pull_msg-E",L_PULL_MSG_O:"L-pull_msg-O",L_PULL_ULTRA_MSG_T:"L-pull_ultra_msg-T",L_PULL_ULTRA_MSG_R:"L-pull_ultra_msg-R",L_PULL_UG_RELATIONS_T:"L-pull_ug_relations-T",L_PULL_UG_RELATIONS_R:"L-pull_ug_relations-R",L_PULL_CHATROOM_KV_T:"L-pull_chatroom_kv-T",L_PULL_CHATROOM_KV_R:"L-pull_chatroom_kv-R",L_PULL_CHATROOM_MSG_T:"L-pull_chatroom_msg-T",L_PULL_CHATROOM_MSG_R:"L-pull_chatroom_msg-R",L_RECV_MULTI_SYNC_MSG_O:"L-recv_multi_sync_msg-O",L_RECV_S_MSG_O:"L-recv_s_msg-O",A_DELETE_MESSAGES_S:"A-delete_messages-S",P_DELETE_MSG_S:"P-delete_msg-S",A_RECALL_MESSAGE_T:"A-recall_msg-T",A_RECALL_MESSAGE_R:"A-recall_msg-R",A_RECALL_MESSAGE_E:"A-recall_msg-E",A_REGTYP_O:"A-regtyp-O",P_REGTYP_E:"P-regtype-E",L_GET_NAVI_T:"L-get_navi-T",L_GET_NAVI_R:"L-get_navi-R",L_REQUEST_T:"L-request-T",L_REQUEST_R:"L-request-R",L_PARSE_NAVI_E:"L-parse_navi-E",L_ENV_S:"L-Env-S",L_GET_INDEX_NAVI_S:"L-get_index_navi-S",A_JOIN_CHATROOM_T:"A-join_chatroom-T",A_JOIN_CHATROOM_R:"A-join_chatroom-R",L_JOIN_CHATROOM_T:"L-join_chatroom-T",L_JOIN_CHATROOM_R:"L-join_chatroom-R",A_QUIT_CHATROOM_T:"A-quit_chatroom-T",A_QUIT_CHATROOM_R:"A-quit_chatroom-R",L_REJOIN_CHATROOM_T:"L-rejoin_chatroom-T",L_REJOIN_CHATROOM_R:"L-rejoin_chatroom-R",L_REJOIN_CHATROOM_S:"L-rejoin_chatroom-S",L_MEDIA_S:"L-media-S",L_MEDIA_UPLOAD_T:"L-media_upload-T",L_MEDIA_UPLOAD_R:"L-media_upload-R",G_UPLOAD_LOG_S:"G-upload_log-S",G_REPORT_LOG_S:"G-report_log-S",G_UPLOAD_LOG_E:"G-upload_log-E",G_GET_REAL_TIMELOG_COMMAND_S:"G-get_real_timelog_command-S",L_CHECK_ALIVE_IM_T:"L-check_alive_im-T",L_CHECK_ALIVE_IM_R:"L-check_alive_im-R",L_CHECK_ALIVE_IM_S:"L-check_alive_im-S",A_GET_LOCAL_MESSAGE_T:"A-get_local_message-T",A_GET_LOCAL_MESSAGE_R:"A-get_local_message-R",A_GET_HISTORY_MSG_T:"A-get_history_msg-T",A_GET_HISTORY_MSG_R:"A-get_history_msg-R",L_GET_HISTORY_MSG_T:"L-get_history_msg-T",L_GET_HISTORY_MSG_R:"L-get_history_msg-R",L_CALLBACK_E:"L-callback-E",A_SEND_MESSAGE_READ_RECEIPT_V4_T:"A-send_message_read_receipt_V4-T",A_SEND_MESSAGE_READ_RECEIPT_V4_R:"A-send_message_read_receipt_V4-R",A_GET_MESSAGE_READ_RECEIPT_V4_T:"A-get_message_read_receipt_V4-T",A_GET_MESSAGE_READ_RECEIPT_V4_R:"A-get_message_read_receipt_V4-R",A_BATCH_GET_MESSAGE_READ_RECEIPT_INFO_V4_T:"A-batch_get_message_read_receipt_info_V4-T",A_BATCH_GET_MESSAGE_READ_RECEIPT_INFO_V4_R:"A-batch_get_message_read_receipt_info_V4-R",A_SYNC_READ_STATUS_T:"A-sync_read_status-T",A_SYNC_READ_STATUS_R:"A-sync_read_status-R",L_PB_ENCODE_E:"L-pb-encode-E",L_PB_DECODE_E:"L-pb-decode-E",L_NOTIFY_NAVI_CHANGE_E:"L-notify_navi_change-E",L_REPORT_FULL_LOG_O:"L-report_full_log-O",L_REPORT_FULL_LOG_T:"L-report_full_log-T",L_REPORT_FULL_LOG_R:"L-report_full_log-R",L_REPORT_LOG_POLICY_E:"L-parse_navi_logpolicy-E",L_UNSUPPORT_INDEXDB_O:"L-unsupport_IndexDB-O",L_LOGDB_OPEN_FAILED_E:"L-logDB_open_failed-E",L_LOGDB_CLOSED_S:"L-logDB_closed-S",L_LOGDB_ERROR_E:"L-logDB_error-S",L_LOGDB_ABORT_S:"L-logDB_abort-S",L_REALTIME_LOG_T:"L_REALTIME_LOG_T",L_REALTIME_LOG_R:"L_REALTIME_LOG_R",L_REALTIME_LOG_O:"L_REALTIME_LOG_O",L_RECV_RMTP_O:"L_RECV_RMTP_O",L_RECV_RMTP_E:"L_RECV_RMTP_E",L_RECV_S_NTF_O:"L-recv_s_ntf_O",L_RECV_S_CMD_O:"L-recv_s_cmd_O",L_VER_REPORT_T:"L-VER_REPORT-T",L_VER_REPORT_R:"L-VER_REPORT-R",L_CALL_MAIN_SYNC_O:"L_CALL_MAIN_SYNC_O",L_UNSUPPORT_NTF_FROM_MAIN_E:"L_UNSUPPORT_NTF_FROM_MAIN_E",A_SET_MSG_CONTENT_O:"A_SET_MSG_CONTENT_O",A_REMOVE_PROXY_O:"A-remove_proxy-O",A_SET_PROXY_O:"A-set_proxy-O",A_TEST_PROXY_O:"A-test_proxy-O",L_WS_DISACCORD_E:"L-ws_disaccord-E",L_GET_STATIC_CONF_T:"L-get_static_conf-T",L_GET_STATIC_CONF_R:"L-get_static_conf-R",L_GET_STATIC_CONF_E:"L-get_static_conf-E",L_CLOUD_DISABLED:"L-cloud_disabled",L_CLOUD_OVERCLOCK:"L-cloud_overclock",L_CLOUD_APPKEY_REGION_E:"L-cloud_appkey_region_error",L_CLOUD_CONFIG_DATA_E:"L-cloud_config_data_error",L_CLOUD_SET_CACHE_O:"L-cloud_set_cache-O",L_CLOUD_GET_CACHE_O:"L-cloud_get_cache-O",L_CLOUD_SET_AREA_CODE_O:"L-cloud_set_area_code-O",L_CLOUD_SET_MRTR_O:"L-cloud_set_mrtr-O",L_SYNC_SUBSCRIBED_USER_STATUS_FINISHED_S:"L-sync_subscribed_user_status_finished-S",L_PULL_SUBSCRIBED_USER_RELATION_T:"L-pull_subscribed_user_relation-T",L_PULL_SUBSCRIBED_USER_RELATION_R:"L-pull_subscribed_user_relation-R",L_PULL_SUBSCRIBED_USER_STATUS_T:"L-pull_subscribed_user_status-T",L_PULL_SUBSCRIBED_USER_STATUS_R:"L-pull_subscribed_user_status-R",L_OWN_USER_PROFILE_CHANGED_S:"L-own_user_profile_changed-S",L_QUERY_SUBSCRIBE_DATA_T:"L-query_subscribe_data-T",L_QUERY_SUBSCRIBE_DATA_R:"L-query_subscribe_data-R",L_PULL_USER_PROFILE_T:"L-pull_user_profile-T",L_PULL_USER_PROFILE_R:"L-pull_user_profile-R",L_PULL_OWN_PROFILE_T:"L-pull_own_profile-T",L_PULL_OWN_PROFILE_R:"L-pull_own_profile-R",L_QUERY_FRIEND_LIST_T:"L-query_friend_list-T",L_QUERY_FRIEND_LIST_R:"L-query_friend_list-R",L_PULL_USER_PROFILE_REQ_T:"L-pull_user_profile_req-T",L_PULL_USER_PROFILE_REQ_R:"L-pull_user_profile_req-R",L_SERVER_EVENT_NOTIFY_ONLINE_T:"L-server_event_notify_online-T",L_SERVER_EVENT_NOTIFY_ONLINE_R:"L-server_event_notify_online-R",L_PULL_EVENT_CHANGE_T:"L-pull_event_change-T",L_PULL_EVENT_CHANGE_R:"L-pull_event_change-R",L_PARSE_JSON_E:"L-parse_json-E",L_REQ_STREAM_MSG_CONTENT_T:"L-req_stream_msg_content-T",L_REQ_STREAM_MSG_CONTENT_R:"L-req_stream_msg_content-R",L_REQ_STREAM_MSG_CONTENT_O:"L-req_stream_msg_content-O",L_REQ_STREAM_MSG_CONTENT_E:"L-req_stream_msg_content-E",L_PULL_CONVERSATION_SETTINGS_T:"L-pull_conversation_settings-T",L_PULL_CONVERSATION_SETTINGS_R:"L-pull_conversation_settings-R",L_PULL_SG_RELATIONS_T:"L-pull_sg_relations-T",L_PULL_SG_RELATIONS_R:"L-pull_sg_relations-R",A_REMOVE_CONVERSATION_T:"A-remove_conversation-T",A_REMOVE_CONVERSATION_R:"A-remove_conversation-R",A_GET_CONVERSATION_LIST_BY_FILTER_T:"A-get_conversation_list_by_filter-T",A_GET_CONVERSATION_LIST_BY_FILTER_R:"A-get_conversation_list_by_filter-R",A_GET_CONVERSATION_T:"A-get_conversation-T",A_GET_CONVERSATION_R:"A-get_conversation-R",A_BATCH_SET_CONVERSATION_TO_TOP_T:"A-batch_set_conversation_to_top-T",A_BATCH_SET_CONVERSATION_TO_TOP_R:"A-batch_set_conversation_to_top-R",A_BATCH_SET_CONVERSATION_NOTIFICATION_LEVEL_T:"A-batch_set_conversation_notification_level-T",A_BATCH_SET_CONVERSATION_NOTIFICATION_LEVEL_R:"A-batch_set_conversation_notification_level-R",A_CLEAR_ALL_UNREAD_COUNT_O:"A-clear_all_unread_count-O",A_DELETE_REMOTE_MESSAGE_BY_TIMESTAMP_T:"A-delete_remote_message_by_timestamp-T",A_DELETE_REMOTE_MESSAGE_BY_TIMESTAMP_R:"A-delete_remote_message_by_timestamp-R",A_DELETE_REMOTE_MESSAGE_T:"A-delete_remote_message-T",A_DELETE_REMOTE_MESSAGE_R:"A-delete_remote_message-R",A_BATCH_CLEAR_REMOTE_MSG_T:"A-batch_clear_remote_msg-T",A_BATCH_CLEAR_REMOTE_MSG_R:"A-batch_clear_remote_msg-R",L_EVENT_LOOP_BLOCKING_S:"L-event_loop_blocking-S",A_E_SEARCH_CONVERSATION_BY_CONTENT_T:"A-e_search_conversation_by_content-T",A_E_SEARCH_CONVERSATION_BY_CONTENT_R:"A-e_search_conversation_by_content-R",P_GET_SYS_VERSION_E:"P-get_sys_version-E",A_CLEAR_LOCAL_CACHE_O:"A-clear_local_cache-O",A_E_SET_MESSAGE_STATUS_TO_READ_T:"A-e_set_message_status_to_read-T",A_E_SET_MESSAGE_STATUS_TO_READ_R:"A-e_set_message_status_to_read-R",A_SEARCH_MSGS_BY_PARAMS_T:"A-search_msgs_by_params-T",A_SEARCH_MSGS_BY_PARAMS_R:"A-search_msgs_by_params-R",L_PULL_OFFLINE_MESSAGE_FINISHED_S:"L-pull_offline_message_finished-S"};exports.DirectionType=void 0,(p=exports.DirectionType||(exports.DirectionType={}))[p.BOTH=2]="BOTH",exports.QueryFriendsDirectionType=void 0,(f=exports.QueryFriendsDirectionType||(exports.QueryFriendsDirectionType={}))[f.BOTH=2]="BOTH",exports.FriendAddPermission=void 0,(h=exports.FriendAddPermission||(exports.FriendAddPermission={}))[h.FREE=1]="FREE",h[h.NEED_VERIFY=2]="NEED_VERIFY",h[h.NO_ONE_ALLOWED=3]="NO_ONE_ALLOWED",exports.FriendRelationType=void 0,(_=exports.FriendRelationType||(exports.FriendRelationType={}))[_.NONE=0]="NONE",_[_.IN_MY_FRIEND_LIST=1]="IN_MY_FRIEND_LIST",_[_.IN_OTHER_FRIEND_LIST=2]="IN_OTHER_FRIEND_LIST",_[_.BOTH_WAY=3]="BOTH_WAY",exports.FriendApplicationType=void 0,(b=exports.FriendApplicationType||(exports.FriendApplicationType={}))[b.SENT=1]="SENT",b[b.RECEIVED=2]="RECEIVED",exports.FriendApplicationStatus=void 0,(E=exports.FriendApplicationStatus||(exports.FriendApplicationStatus={}))[E.UNHANDLED=0]="UNHANDLED",E[E.ACCEPTED=1]="ACCEPTED",E[E.REFUSED=2]="REFUSED",E[E.EXPIRED=3]="EXPIRED",function(e){e[e.FRIEND_APPLICATION=31]="FRIEND_APPLICATION"}(v||(v={})),function(e){e[e.FRIEND_APPLY=0]="FRIEND_APPLY",e[e.FRIEND_REFUSE=1]="FRIEND_REFUSE",e[e.FRIEND_USER_INFO=2]="FRIEND_USER_INFO",e[e.FRIENDS_INPUT=3]="FRIENDS_INPUT",e[e.FRIEND_CLEAR=4]="FRIEND_CLEAR",e[e.FRIEND_INFO_CHANGE=5]="FRIEND_INFO_CHANGE",e[e.FRIEND_INFO_CHANGE_SYNC=6]="FRIEND_INFO_CHANGE_SYNC"}(y||(y={})),exports.GroupJoinPermission=void 0,(m=exports.GroupJoinPermission||(exports.GroupJoinPermission={}))[m.OWNER_VERIFY=0]="OWNER_VERIFY",m[m.FREE=1]="FREE",m[m.OWNER_OR_MANAGER_VERIFY=2]="OWNER_OR_MANAGER_VERIFY",m[m.NO_ONE_ALLOWED=3]="NO_ONE_ALLOWED",exports.GroupOperationPermission=void 0,(I=exports.GroupOperationPermission||(exports.GroupOperationPermission={}))[I.OWNER=0]="OWNER",I[I.OWNER_OR_MANAGER=1]="OWNER_OR_MANAGER",I[I.EVERYONE=2]="EVERYONE",exports.GroupMemberInfoEditPermission=void 0,(T=exports.GroupMemberInfoEditPermission||(exports.GroupMemberInfoEditPermission={}))[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",exports.GroupInviteHandlePermission=void 0,(R=exports.GroupInviteHandlePermission||(exports.GroupInviteHandlePermission={}))[R.FREE=0]="FREE",R[R.INVITEE_VERIFY=1]="INVITEE_VERIFY",exports.GroupMemberRole=void 0,(C=exports.GroupMemberRole||(exports.GroupMemberRole={}))[C.UNDEF=0]="UNDEF",C[C.NORMAL=1]="NORMAL",C[C.MANAGER=2]="MANAGER",C[C.OWNER=3]="OWNER",exports.GroupOperation=void 0,(O=exports.GroupOperation||(exports.GroupOperation={}))[O.CREATE=0]="CREATE",O[O.JOIN=1]="JOIN",O[O.KICK=2]="KICK",O[O.QUIT=3]="QUIT",O[O.DISMISS=4]="DISMISS",O[O.ADD_MANAGER=5]="ADD_MANAGER",O[O.REMOVE_MANAGER=6]="REMOVE_MANAGER",O[O.TRANSFER_GROUP_OWNER=7]="TRANSFER_GROUP_OWNER",function(e){e[e.GROUP_INFO_CHANGE=0]="GROUP_INFO_CHANGE",e[e.MEMBER_PROFILE_CHANGE=1]="MEMBER_PROFILE_CHANGE",e[e.GROUP_REMARK_SET=2]="GROUP_REMARK_SET",e[e.GROUP_REMARK_DELETE=3]="GROUP_REMARK_DELETE"}(S||(S={})),exports.GroupOperationType=void 0,(A=exports.GroupOperationType||(exports.GroupOperationType={}))[A.ADD=1]="ADD",A[A.REMOVE=2]="REMOVE",exports.GroupApplicationStatus=void 0,(P=exports.GroupApplicationStatus||(exports.GroupApplicationStatus={}))[P.MANAGER_UNHANDLED=0]="MANAGER_UNHANDLED",P[P.MANAGER_REFUSED=1]="MANAGER_REFUSED",P[P.INVITEE_UNHANDLED=2]="INVITEE_UNHANDLED",P[P.INVITEE_REFUSED=3]="INVITEE_REFUSED",P[P.JOINED=4]="JOINED",P[P.EXPIRED=5]="EXPIRED",exports.GroupOperationStatus=void 0,(N=exports.GroupOperationStatus||(exports.GroupOperationStatus={}))[N.REFUSE=0]="REFUSE",N[N.ACCEPT=1]="ACCEPT",exports.GroupOperationRole=void 0,(w=exports.GroupOperationRole||(exports.GroupOperationRole={}))[w.APPLICANT=0]="APPLICANT",w[w.MANAGER=1]="MANAGER",function(e){e[e.GROUP_OPERATION=11]="GROUP_OPERATION",e[e.GROUP_PROFILE_CHANGE=12]="GROUP_PROFILE_CHANGE",e[e.GROUP_APPLICATION_INVITATION=13]="GROUP_APPLICATION_INVITATION",e[e.GROUP_FOLLOW_USER_CHANGE=14]="GROUP_FOLLOW_USER_CHANGE"}(M||(M={})),exports.GroupApplicationType=void 0,(L=exports.GroupApplicationType||(exports.GroupApplicationType={}))[L.APPLICATION=0]="APPLICATION",L[L.INVITATION=1]="INVITATION",exports.GroupApplicationDirection=void 0,(U=exports.GroupApplicationDirection||(exports.GroupApplicationDirection={}))[U.APPLICATION_SENT=0]="APPLICATION_SENT",U[U.INVITATION_SENT=1]="INVITATION_SENT",U[U.INVITATION_RECEIVED=2]="INVITATION_RECEIVED",U[U.APPLICATION_RECEIVED=3]="APPLICATION_RECEIVED",exports.ChatroomEntryType=void 0,(D=exports.ChatroomEntryType||(exports.ChatroomEntryType={}))[D.UPDATE=1]="UPDATE",D[D.DELETE=2]="DELETE",exports.ChrmSyncStatus=void 0,(x=exports.ChrmSyncStatus||(exports.ChrmSyncStatus={}))[x.QUIT=0]="QUIT",x[x.JOIN=1]="JOIN",exports.ChatroomSyncStatusReason=void 0,(j=exports.ChatroomSyncStatusReason||(exports.ChatroomSyncStatusReason={}))[j.LeaveOnMyOwn=0]="LeaveOnMyOwn",j[j.OtherDeviceLogin=1]="OtherDeviceLogin",exports.ChatroomUserChangeType=void 0,(V=exports.ChatroomUserChangeType||(exports.ChatroomUserChangeType={}))[V.QUIT=0]="QUIT",V[V.JOIN=1]="JOIN",exports.ChrmMemBanType=void 0,(G=exports.ChrmMemBanType||(exports.ChrmMemBanType={}))[G.UnmuteUsers=0]="UnmuteUsers",G[G.MuteUsers=1]="MuteUsers",G[G.UnmuteAll=2]="UnmuteAll",G[G.MuteAll=3]="MuteAll",G[G.RemoveWhitelist=4]="RemoveWhitelist",G[G.AddWhitelist=5]="AddWhitelist",G[G.UnmuteGloble=6]="UnmuteGloble",G[G.MuteGloble=7]="MuteGloble",exports.ChrmMemOperateType=void 0,(k=exports.ChrmMemOperateType||(exports.ChrmMemOperateType={}))[k.Deblock=0]="Deblock",k[k.Blocked=1]="Blocked",exports.ErrorCode=void 0,(F=exports.ErrorCode||(exports.ErrorCode={}))[F.SUCCESS=0]="SUCCESS",F[F.ACTIVE_DISCONNECT=2]="ACTIVE_DISCONNECT",F[F.REJECTED_BY_BLACKLIST=405]="REJECTED_BY_BLACKLIST",F[F.FORBIDDEN_IN_PRIVATE=20106]="FORBIDDEN_IN_PRIVATE",F[F.SYS_CONVERSATION_NOT_SUPPORT_MESSAGE=20109]="SYS_CONVERSATION_NOT_SUPPORT_MESSAGE",F[F.CLOUD_DATA_CENTER_INVALID=20512]="CLOUD_DATA_CENTER_INVALID",F[F.SEND_FREQUENCY_TOO_FAST=20604]="SEND_FREQUENCY_TOO_FAST",F[F.OPERATION_BLOCKED=20605]="OPERATION_BLOCKED",F[F.OPERATION_NOT_SUPPORT=20606]="OPERATION_NOT_SUPPORT",F[F.REQUEST_OVER_FREQUENCY=20607]="REQUEST_OVER_FREQUENCY",F[F.NOT_IN_DISCUSSION=21406]="NOT_IN_DISCUSSION",F[F.SENSITIVE_SHIELD=21501]="SENSITIVE_SHIELD",F[F.SENSITIVE_REPLACE=21502]="SENSITIVE_REPLACE",F[F.MESSAGE_EXPAND_NOT_EXIST=22201]="MESSAGE_EXPAND_NOT_EXIST",F[F.MESSAGE_EXPAND_NOT_SUPPORT=22202]="MESSAGE_EXPAND_NOT_SUPPORT",F[F.MESSAGE_EXPAND_FORMAT_ERROR=22203]="MESSAGE_EXPAND_FORMAT_ERROR",F[F.MESSAGE_EXPAND_NOT_AUTHORIZED=22204]="MESSAGE_EXPAND_NOT_AUTHORIZED",F[F.NOT_IN_GROUP=22406]="NOT_IN_GROUP",F[F.FORBIDDEN_IN_GROUP=22408]="FORBIDDEN_IN_GROUP",F[F.NOT_IN_CHATROOM=23406]="NOT_IN_CHATROOM",F[F.GET_USERINFO_ERROR=23407]="GET_USERINFO_ERROR",F[F.FORBIDDEN_IN_CHATROOM=23408]="FORBIDDEN_IN_CHATROOM",F[F.RC_CHATROOM_USER_KICKED=23409]="RC_CHATROOM_USER_KICKED",F[F.RC_CHATROOM_NOT_EXIST=23410]="RC_CHATROOM_NOT_EXIST",F[F.RC_CHATROOM_IS_FULL=23411]="RC_CHATROOM_IS_FULL",F[F.RC_CHATROOM_PATAMETER_INVALID=23412]="RC_CHATROOM_PATAMETER_INVALID",F[F.CHATROOM_GET_HISTORYMSG_ERROR=23413]="CHATROOM_GET_HISTORYMSG_ERROR",F[F.CHATROOM_NOT_OPEN_HISTORYMSG_STORE=23414]="CHATROOM_NOT_OPEN_HISTORYMSG_STORE",F[F.CHATROOM_KV_EXCEED=23423]="CHATROOM_KV_EXCEED",F[F.CHATROOM_KV_OVERWRITE_INVALID=23424]="CHATROOM_KV_OVERWRITE_INVALID",F[F.CHATROOM_SET_PROPERTY_OVER_FREQUENCY=23425]="CHATROOM_SET_PROPERTY_OVER_FREQUENCY",F[F.CHATROOM_KV_STORE_NOT_OPEN=23426]="CHATROOM_KV_STORE_NOT_OPEN",F[F.CHATROOM_KEY_NOT_EXIST=23427]="CHATROOM_KEY_NOT_EXIST",F[F.CHATROOM_KV_STORE_NOT_ALL_SUCCESS=23428]="CHATROOM_KV_STORE_NOT_ALL_SUCCESS",F[F.CHATROOM_KV_STORE_OUT_LIMIT=23429]="CHATROOM_KV_STORE_OUT_LIMIT",F[F.CHATROOM_KV_SET_ERROR=23431]="CHATROOM_KV_SET_ERROR",F[F.HAVNODEVICEID=24001]="HAVNODEVICEID",F[F.DEVICEIDISHAVE=24002]="DEVICEIDISHAVE",F[F.FEILD=24009]="FEILD",F[F.INTERNALERRROR=24015]="INTERNALERRROR",F[F.RC_USER_PROFILE_KEY_NOT_ALLOW_SDK_SET=24360]="RC_USER_PROFILE_KEY_NOT_ALLOW_SDK_SET",F[F.RC_USER_PROFILE_KEY_NOT_EXIST=24361]="RC_USER_PROFILE_KEY_NOT_EXIST",F[F.RC_USER_PROFILE_EXT_KEY_NOT_EXIST=24362]="RC_USER_PROFILE_EXT_KEY_NOT_EXIST",F[F.RC_USER_PROFILE_EXT_KV_COUNT_EXCEED_LIMIT=24363]="RC_USER_PROFILE_EXT_KV_COUNT_EXCEED_LIMIT",F[F.RC_USER_PROFILE_VALUE_LENGTH_EXCEED_LIMIT=24364]="RC_USER_PROFILE_VALUE_LENGTH_EXCEED_LIMIT",F[F.RC_USER_PROFILE_QUERY_COUNT_EXCEED_LIMIT=24365]="RC_USER_PROFILE_QUERY_COUNT_EXCEED_LIMIT",F[F.RC_USER_PROFILE_USER_NOT_EXIST=24366]="RC_USER_PROFILE_USER_NOT_EXIST",F[F.RC_USER_PROFILE_VALUE_CAN_ONLY_BE_NUMBERS=24367]="RC_USER_PROFILE_VALUE_CAN_ONLY_BE_NUMBERS",F[F.RC_USER_PROFILE_VALUE_EXCEED_RANGE=24368]="RC_USER_PROFILE_VALUE_EXCEED_RANGE",F[F.RC_USER_PROFILE_SERVICE_UNAVAILABLE=24369]="RC_USER_PROFILE_SERVICE_UNAVAILABLE",F[F.ULTRA_GROUP_SERVICE_UNAVAILABLE=24401]="ULTRA_GROUP_SERVICE_UNAVAILABLE",F[F.ULTRA_GROUP_SERVICE_ERROR=24402]="ULTRA_GROUP_SERVICE_ERROR",F[F.ULTRA_GROUP_PARAMETER_ERROR=24403]="ULTRA_GROUP_PARAMETER_ERROR",F[F.ULTRA_GROUP_UNKNOWN_ERROR=24404]="ULTRA_GROUP_UNKNOWN_ERROR",F[F.NOT_IN_ULTRA_GROUP=24406]="NOT_IN_ULTRA_GROUP",F[F.FORBIDDEN_IN_ULTRA_GROUP=24408]="FORBIDDEN_IN_ULTRA_GROUP",F[F.ULTRA_GROUP_NOT_EXIST=24410]="ULTRA_GROUP_NOT_EXIST",F[F.ULTRA_GROUP_MEMBERS_OVERSIZE=24411]="ULTRA_GROUP_MEMBERS_OVERSIZE",F[F.ULTRA_GROUP_JOINED_OVERSIZE=24412]="ULTRA_GROUP_JOINED_OVERSIZE",F[F.ULTRA_GROUP_CHANNELS_OVERSIZE=24413]="ULTRA_GROUP_CHANNELS_OVERSIZE",F[F.ULTRA_GROUP_CHANNEL_ID_NOT_EXIST=24414]="ULTRA_GROUP_CHANNEL_ID_NOT_EXIST",F[F.ULTRA_GROUP_MESSAGE_SENT_OVER_FREQUENCY=24415]="ULTRA_GROUP_MESSAGE_SENT_OVER_FREQUENCY",F[F.ULTRA_GROUP_USER_NOT_IN_PRIVATE_CHANNEL=24416]="ULTRA_GROUP_USER_NOT_IN_PRIVATE_CHANNEL",F[F.RECALL_MESSAGE=25101]="RECALL_MESSAGE",F[F.MESSAGE_STORAGE_SERVICE_UNAVAILABLE=25102]="MESSAGE_STORAGE_SERVICE_UNAVAILABLE",F[F.RC_SERVER_UNKOWN_ERROR=25104]="RC_SERVER_UNKOWN_ERROR",F[F.RECALL_MESSAGE_USER_INVALID=25107]="RECALL_MESSAGE_USER_INVALID",F[F.RC_ENTRUST_SERVER_ERROR=25402]="RC_ENTRUST_SERVER_ERROR",F[F.RC_ENTRUST_SERVER_PARAMETER_ERROR=25403]="RC_ENTRUST_SERVER_PARAMETER_ERROR",F[F.RC_GROUP_ILLEGAL_ERROR=25404]="RC_GROUP_ILLEGAL_ERROR",F[F.RC_GROUP_AUTHORITY_ERROR=25405]="RC_GROUP_AUTHORITY_ERROR",F[F.RC_GROUP_PARAMETER_LENGTH_EXCEED_LIMIT=25406]="RC_GROUP_PARAMETER_LENGTH_EXCEED_LIMIT",F[F.RC_GROUP_PARAMETER_FORMAT_ERROR=25407]="RC_GROUP_PARAMETER_FORMAT_ERROR",F[F.RC_GROUP_PARAMETER_VALUE_CAN_ONLY_BE_NUMBERS=25408]="RC_GROUP_PARAMETER_VALUE_CAN_ONLY_BE_NUMBERS",F[F.RC_GROUP_ID_ALREADY_EXIST=25409]="RC_GROUP_ID_ALREADY_EXIST",F[F.RC_GROUP_ID_NOT_EXIST=25410]="RC_GROUP_ID_NOT_EXIST",F[F.RC_GROUP_MEMBERS_COUNT_EXCEED_LIMIT=25411]="RC_GROUP_MEMBERS_COUNT_EXCEED_LIMIT",F[F.RC_GROUP_MEMBERS_ALREADY_IN_GROUP=25412]="RC_GROUP_MEMBERS_ALREADY_IN_GROUP",F[F.RC_GROUP_NOT_ALLOW_SDK_OPERATION=25413]="RC_GROUP_NOT_ALLOW_SDK_OPERATION",F[F.RC_GROUP_NOT_ALLOW_JOIN=25414]="RC_GROUP_NOT_ALLOW_JOIN",F[F.RC_GROUP_EXT_KEY_NOT_EXIST=25415]="RC_GROUP_EXT_KEY_NOT_EXIST",F[F.RC_GROUP_REQUEST_OVERFREQUENCY=25416]="RC_GROUP_REQUEST_OVERFREQUENCY",F[F.RC_GROUP_OWNER_NOT_ALLOW_QUIT_OR_KICK=25417]="RC_GROUP_OWNER_NOT_ALLOW_QUIT_OR_KICK",F[F.RC_GROUP_USER_NOT_IN_GROUP=25418]="RC_GROUP_USER_NOT_IN_GROUP",F[F.RC_GROUP_MANAGER_OR_FOLLOW_COUNT_EXCEED_LIMIT=25419]="RC_GROUP_MANAGER_OR_FOLLOW_COUNT_EXCEED_LIMIT",F[F.RC_GROUP_USER_IS_NOT_MANAGER_IN_GROUP=25420]="RC_GROUP_USER_IS_NOT_MANAGER_IN_GROUP",F[F.RC_GROUP_APPLICATION_NOT_EXIST=25421]="RC_GROUP_APPLICATION_NOT_EXIST",F[F.RC_GROUP_QUERY_GROUP_COUNT_EXCEED_LIMIT=25422]="RC_GROUP_QUERY_GROUP_COUNT_EXCEED_LIMIT",F[F.RC_GROUP_NAME_INVALID=25423]="RC_GROUP_NAME_INVALID",F[F.RC_GROUP_JOIN_GROUP_NEED_MANAGER_ACCEPT=25424]="RC_GROUP_JOIN_GROUP_NEED_MANAGER_ACCEPT",F[F.RC_GROUP_OWNER_NOT_ALLOW_BE_MANAGER=25425]="RC_GROUP_OWNER_NOT_ALLOW_BE_MANAGER",F[F.RC_GROUP_NO_INVITE_PERMISSION=25426]="RC_GROUP_NO_INVITE_PERMISSION",F[F.RC_GROUP_NEED_INVITEE_ACCEPT=25427]="RC_GROUP_NEED_INVITEE_ACCEPT",F[F.RC_GROUP_APPLICATION_ALREADY_HANDLE=25428]="RC_GROUP_APPLICATION_ALREADY_HANDLE",F[F.RC_GROUP_OLD_GROUP_NOT_ENTRUST=25429]="RC_GROUP_OLD_GROUP_NOT_ENTRUST",F[F.RC_GROUP_ID_INVALID=25430]="RC_GROUP_ID_INVALID",F[F.RC_PAGE_TOKEN_PARSING_FAILED=25432]="RC_PAGE_TOKEN_PARSING_FAILED",F[F.RC_FRIEND_ALREADY_FRIEND=25460]="RC_FRIEND_ALREADY_FRIEND",F[F.RC_FRIEND_NEED_ACCEPT=25461]="RC_FRIEND_NEED_ACCEPT",F[F.RC_FRIEND_IN_OTHER_BLACK_LIST=25462]="RC_FRIEND_IN_OTHER_BLACK_LIST",F[F.RC_FRIEND_NOT_IN_OTHER_WHITE_LIST=25463]="RC_FRIEND_NOT_IN_OTHER_WHITE_LIST",F[F.RC_FRIEND_IN_MY_BLACK_LIST=25464]="RC_FRIEND_IN_MY_BLACK_LIST",F[F.RC_FRIEND_NOT_IN_MY_WHITE_LIST=25465]="RC_FRIEND_NOT_IN_MY_WHITE_LIST",F[F.RC_FRIEND_APPLICATION_NOT_EXIST=25466]="RC_FRIEND_APPLICATION_NOT_EXIST",F[F.RC_FRIEND_MY_FRIEND_COUNT_EXCEED_LIMIT=25467]="RC_FRIEND_MY_FRIEND_COUNT_EXCEED_LIMIT",F[F.RC_FRIEND_OTHER_FRIEND_COUNT_EXCEED_LIMIT=25468]="RC_FRIEND_OTHER_FRIEND_COUNT_EXCEED_LIMIT",F[F.RC_FRIEND_NOT_FRIEND=25469]="RC_FRIEND_NOT_FRIEND",F[F.RC_FRIEND_FIELDS_LENGTH_EXCEED_LIMIT=25470]="RC_FRIEND_FIELDS_LENGTH_EXCEED_LIMIT",F[F.RC_FRIEND_OTHER_NOT_ALLOW_ADD_FRIEND=25471]="RC_FRIEND_OTHER_NOT_ALLOW_ADD_FRIEND",F[F.RC_FRIEND_NOT_EXIST=25472]="RC_FRIEND_NOT_EXIST",F[F.RC_FRIEND_NOT_ALLOW_ADD_SELF=25473]="RC_FRIEND_NOT_ALLOW_ADD_SELF",F[F.SERVICE_INFORMATION_AUDIT_FAILED=25480]="SERVICE_INFORMATION_AUDIT_FAILED",F[F.PUSH_PARAMETER_INVALID=26001]="PUSH_PARAMETER_INVALID",F[F.USER_SETTING_SYNCED_ERROR=26002]="USER_SETTING_SYNCED_ERROR",F[F.CONVERSATION_TAG_OVERSIZE=26004]="CONVERSATION_TAG_OVERSIZE",F[F.RC_READ_RECEIPT_V4_INVALID=26005]="RC_READ_RECEIPT_V4_INVALID",F[F.RC_SERVER_DRIVE_UNREAD_COUNT_INVALID=26006]="RC_SERVER_DRIVE_UNREAD_COUNT_INVALID",F[F.RC_SERVER_PARAMETER_MESSAGEUIDS_CONFUSED=26007]="RC_SERVER_PARAMETER_MESSAGEUIDS_CONFUSED",F[F.RC_SERVER_PARAMETER_MESSAGEUID_INVALID=26009]="RC_SERVER_PARAMETER_MESSAGEUID_INVALID",F[F.RC_SERVER_PARAMETER_INVALID=26010]="RC_SERVER_PARAMETER_INVALID",F[F.RC_SUBSCRIBE_ONLINE_SERVICE_UNAVAILABLE=26020]="RC_SUBSCRIBE_ONLINE_SERVICE_UNAVAILABLE",F[F.RC_BESUBSCRIBED_USERIDS_COUNT_EXCEED_LIMIT=26021]="RC_BESUBSCRIBED_USERIDS_COUNT_EXCEED_LIMIT",F[F.RC_SUBSCRIBED_USERIDS_EXCEED_LIMIT=26022]="RC_SUBSCRIBED_USERIDS_EXCEED_LIMIT",F[F.RC_FILE_SIZE_EXCEED_LIMIT=26106]="RC_FILE_SIZE_EXCEED_LIMIT",F[F.INVALID_PARAMETER_SIZE_NOT_FOUND=26107]="INVALID_PARAMETER_SIZE_NOT_FOUND",F[F.RC_NET_CHANNEL_INVALID=30001]="RC_NET_CHANNEL_INVALID",F[F.RC_NET_UNAVAILABLE=30002]="RC_NET_UNAVAILABLE",F[F.RC_MSG_RESP_TIMEOUT=30003]="RC_MSG_RESP_TIMEOUT",F[F.RC_HTTP_SEND_FAIL=30004]="RC_HTTP_SEND_FAIL",F[F.RC_HTTP_REQ_FAIL=30005]="RC_HTTP_REQ_FAIL",F[F.RC_HTTP_RECV_FAIL=30006]="RC_HTTP_RECV_FAIL",F[F.RC_NAVI_REQ_FAILED=30007]="RC_NAVI_REQ_FAILED",F[F.RC_NODE_NOT_FOUND=30008]="RC_NODE_NOT_FOUND",F[F.RC_DOMAIN_NOT_RESOLVE=30009]="RC_DOMAIN_NOT_RESOLVE",F[F.RC_SOCKET_NOT_CREATED=30010]="RC_SOCKET_NOT_CREATED",F[F.RC_SOCKET_DISCONNECTED=30011]="RC_SOCKET_DISCONNECTED",F[F.RC_PING_EXCEED_LIMIT=30012]="RC_PING_EXCEED_LIMIT",F[F.PONG_RECEIVED_ERROR=30013]="PONG_RECEIVED_ERROR",F[F.RC_MSG_SEND_FAIL=30014]="RC_MSG_SEND_FAIL",F[F.CONNECT_OVER_FREQUENCY=30015]="CONNECT_OVER_FREQUENCY",F[F.RC_MSG_CONTENT_EXCEED_LIMIT=30016]="RC_MSG_CONTENT_EXCEED_LIMIT",F[F.MESSAGE_NOT_SUPPORT_SENDING=30017]="MESSAGE_NOT_SUPPORT_SENDING",F[F.RC_NETWORK_DOWN=30019]="RC_NETWORK_DOWN",F[F.RC_TCP_DISCONNECTED_NO_RMTP=30021]="RC_TCP_DISCONNECTED_NO_RMTP",F[F.RC_CONN_ACK_TIMEOUT=31e3]="RC_CONN_ACK_TIMEOUT",F[F.RC_CONN_PROTO_VERSION_ERROR=31001]="RC_CONN_PROTO_VERSION_ERROR",F[F.RC_CONN_IDENTIFIER_REJECTED=31002]="RC_CONN_IDENTIFIER_REJECTED",F[F.RC_CONN_SERVER_UNAVAILABLE=31003]="RC_CONN_SERVER_UNAVAILABLE",F[F.RC_CONN_TOKEN_INCORRECT=31004]="RC_CONN_TOKEN_INCORRECT",F[F.RC_CONN_NOT_AUTHRORIZED=31005]="RC_CONN_NOT_AUTHRORIZED",F[F.RC_CONN_REDIRECTED=31006]="RC_CONN_REDIRECTED",F[F.RC_CONN_PACKAGE_NAME_INVALID=31007]="RC_CONN_PACKAGE_NAME_INVALID",F[F.RC_CONN_APP_BLOCKED_OR_DELETED=31008]="RC_CONN_APP_BLOCKED_OR_DELETED",F[F.RC_CONN_USER_BLOCKED=31009]="RC_CONN_USER_BLOCKED",F[F.RC_DISCONN_KICK=31010]="RC_DISCONN_KICK",F[F.RC_DISCONN_EXCEPTION=31011]="RC_DISCONN_EXCEPTION",F[F.CONNECTION_ENCRYPT_AUTHORIZED_ERROR=31012]="CONNECTION_ENCRYPT_AUTHORIZED_ERROR",F[F.RC_CONN_TOKEN_EXPIRED=31020]="RC_CONN_TOKEN_EXPIRED",F[F.RC_CONN_DEVICE_ERROR=31021]="RC_CONN_DEVICE_ERROR",F[F.RC_CONN_HOSTNAME_ERROR=31022]="RC_CONN_HOSTNAME_ERROR",F[F.RC_DISCONN_SAME_CLIENT_ON_LINE=31023]="RC_DISCONN_SAME_CLIENT_ON_LINE",F[F.RC_LISCENSE_COUNT_OUT_OF_LIMIT=31024]="RC_LISCENSE_COUNT_OUT_OF_LIMIT",F[F.RC_CONN_WRONG_CLUSTER=31025]="RC_CONN_WRONG_CLUSTER",F[F.RC_APP_AUTH_NOT_PASS=31026]="RC_APP_AUTH_NOT_PASS",F[F.RC_OTP_USED=31027]="RC_OTP_USED",F[F.RC_PLATFORM_ERROR=31028]="RC_PLATFORM_ERROR",F[F.RC_ACCOUNT_CANCELLATION=31029]="RC_ACCOUNT_CANCELLATION",F[F.RC_LICENSE_EXPIRED=31030]="RC_LICENSE_EXPIRED",F[F.RC_QUERY_ACK_NO_DATA=32001]="RC_QUERY_ACK_NO_DATA",F[F.RC_MSG_DATA_INCOMPLETE=32002]="RC_MSG_DATA_INCOMPLETE",F[F.RC_UDP_DISCONNECTED=32011]="RC_UDP_DISCONNECTED",F[F.RC_TCP_RESET=32054]="RC_TCP_RESET",F[F.CONNECTION_REFUSED=32061]="CONNECTION_REFUSED",F[F.PROTOCOL_MESSAGE_SAVED_ERROR=33e3]="PROTOCOL_MESSAGE_SAVED_ERROR",F[F.BIZ_ERROR_CLIENT_NOT_INIT=33001]="BIZ_ERROR_CLIENT_NOT_INIT",F[F.BIZ_ERROR_DATABASE_ERROR=33002]="BIZ_ERROR_DATABASE_ERROR",F[F.BIZ_ERROR_INVALID_PARAMETER=33003]="BIZ_ERROR_INVALID_PARAMETER",F[F.BIZ_ERROR_NO_CHANNEL=33004]="BIZ_ERROR_NO_CHANNEL",F[F.BIZ_ERROR_RECONNECT_SUCCESS=33005]="BIZ_ERROR_RECONNECT_SUCCESS",F[F.BIZ_ERROR_CONNECTING=33006]="BIZ_ERROR_CONNECTING",F[F.MSG_ROAMING_SERVICE_UNAVAILABLE=33007]="MSG_ROAMING_SERVICE_UNAVAILABLE",F[F.MSG_INSERT_ERROR=33008]="MSG_INSERT_ERROR",F[F.MSG_DEL_ERROR=33009]="MSG_DEL_ERROR",F[F.TAG_NOT_EXIST=33100]="TAG_NOT_EXIST",F[F.TAG_EXISTS=33101]="TAG_EXISTS",F[F.NO_TAG_IN_CONVER=33102]="NO_TAG_IN_CONVER",F[F.RC_CONNECTION_EXIST=34001]="RC_CONNECTION_EXIST",F[F.PACKAGE_ENVIRONMENT_ERROR=34005]="PACKAGE_ENVIRONMENT_ERROR",F[F.CONNECTION_TIMEOUT=34006]="CONNECTION_TIMEOUT",F[F.MESSAGE_KV_NOT_SUPPORT=34008]="MESSAGE_KV_NOT_SUPPORT",F[F.MESSAGE_EXPANDED_ERROR=34009]="MESSAGE_EXPANDED_ERROR",F[F.EXPANSION_LIMIT_EXCEET=34010]="EXPANSION_LIMIT_EXCEET",F[F.UPLOAD_FAIL=34011]="UPLOAD_FAIL",F[F.CONVER_OUT_LIMIT_ERROR=34013]="CONVER_OUT_LIMIT_ERROR",F[F.READ_RECEIPT_ERROR=34014]="READ_RECEIPT_ERROR",F[F.PUSH_CONTENT_CONFIG_SERVICE_UNAVAILABLE=34016]="PUSH_CONTENT_CONFIG_SERVICE_UNAVAILABLE",F[F.MESSAGE_INTERCEPTION_PRODUCED_NULL_MESSAGE=34017]="MESSAGE_INTERCEPTION_PRODUCED_NULL_MESSAGE",F[F.MEDIA_EXCEPTION=34018]="MEDIA_EXCEPTION",F[F.MESSAGE_NOT_REGISTERED=34021]="MESSAGE_NOT_REGISTERED",F[F.METHOD_NOT_SUPPORT=34022]="METHOD_NOT_SUPPORT",F[F.ULTRA_GROUP_CHANNEL_NOT_EXIST=34024]="ULTRA_GROUP_CHANNEL_NOT_EXIST",F[F.INCONSISTENT_CONVERSATION_TYPE=34025]="INCONSISTENT_CONVERSATION_TYPE",F[F.CONVERSATION_TYPE_NOT_SUPPORT=34201]="CONVERSATION_TYPE_NOT_SUPPORT",F[F.INVALID_PARAMETER_TIMESTAMP=34202]="INVALID_PARAMETER_TIMESTAMP",F[F.INVALID_PARAMETER_MESSAGE_UID=34203]="INVALID_PARAMETER_MESSAGE_UID",F[F.INVALID_PARAMETER_MESSAGE_ID=34204]="INVALID_PARAMETER_MESSAGE_ID",F[F.INVALID_PARAMETER_MESSAGE_CONTENT=34205]="INVALID_PARAMETER_MESSAGE_CONTENT",F[F.MSG_LIMIT_ERROR=34206]="MSG_LIMIT_ERROR",F[F.INVALID_PARAMETER_MEDIA_TYPE=34207]="INVALID_PARAMETER_MEDIA_TYPE",F[F.INVALID_PARAMETER_CONVERSATION_TYPE=34209]="INVALID_PARAMETER_CONVERSATION_TYPE",F[F.INVALID_PARAMETER_TARGET_ID=34210]="INVALID_PARAMETER_TARGET_ID",F[F.INVALID_PARAMETER_CHANNEL_ID=34211]="INVALID_PARAMETER_CHANNEL_ID",F[F.INVALID_PARAMETER_TAG_ID=34212]="INVALID_PARAMETER_TAG_ID",F[F.INVALID_PARAMETER_TAG_NAME=34213]="INVALID_PARAMETER_TAG_NAME",F[F.INVALID_PARAMETER_USER_ID=34214]="INVALID_PARAMETER_USER_ID",F[F.INVALID_PARAMETER_USERIDLIST=34215]="INVALID_PARAMETER_USERIDLIST",F[F.INVALID_PARAMETER_DOWNLOADMEDIAFILENAME=34217]="INVALID_PARAMETER_DOWNLOADMEDIAFILENAME",F[F.INVALID_PARAMETER_MESSAGE_EXPANSION=34220]="INVALID_PARAMETER_MESSAGE_EXPANSION",F[F.INVALID_PARAMETER_TIMESTRING=34224]="INVALID_PARAMETER_TIMESTRING",F[F.INVALID_PARAMETER_CONVERSATION=34225]="INVALID_PARAMETER_CONVERSATION",F[F.INVALID_PARAMETER_NOTIFICATION_LEVEL=34228]="INVALID_PARAMETER_NOTIFICATION_LEVEL",F[F.INVALID_PARAMETER_MESSAGE_ARRAY=34229]="INVALID_PARAMETER_MESSAGE_ARRAY",F[F.INVALID_PARAMETER_RECEIVED_STATUS=34230]="INVALID_PARAMETER_RECEIVED_STATUS",F[F.INVALID_PARAMETER_CHANNEL_TYPE=34231]="INVALID_PARAMETER_CHANNEL_TYPE",F[F.INVALID_PARAMETER_COUNT=34232]="INVALID_PARAMETER_COUNT",F[F.INVALID_PARAMETER_MEDIA_URL=34235]="INVALID_PARAMETER_MEDIA_URL",F[F.INVALID_PARAMETER_UNIQUE_ID=34236]="INVALID_PARAMETER_UNIQUE_ID",F[F.INVALID_PARAMETER_PROXY=34238]="INVALID_PARAMETER_PROXY",F[F.INVALID_PARAMETER_TESTHOST=34239]="INVALID_PARAMETER_TESTHOST",F[F.INVALID_CONNECT_TESTHOST_FAILED=34240]="INVALID_CONNECT_TESTHOST_FAILED",F[F.INVALID_PARAMETER_CONVERSATIONS=34242]="INVALID_PARAMETER_CONVERSATIONS",F[F.INVALID_PARAMETER_SENT_STATUS=34244]="INVALID_PARAMETER_SENT_STATUS",F[F.RC_CONN_PROXY_UNAVAILABLE=34245]="RC_CONN_PROXY_UNAVAILABLE",F[F.INVALID_PARAMETER_RTCROOMID=34259]="INVALID_PARAMETER_RTCROOMID",F[F.INVALID_PARAMETER_KEY=34260]="INVALID_PARAMETER_KEY",F[F.INVALID_PARAMETER_KEYS=34261]="INVALID_PARAMETER_KEYS",F[F.INVALID_PARAMETER_VALUE=34262]="INVALID_PARAMETER_VALUE",F[F.INVALID_PARAMETER_ENTRIES=34263]="INVALID_PARAMETER_ENTRIES",F[F.INVALID_PARAMETER_NOTIFICATION_EXTRA=34264]="INVALID_PARAMETER_NOTIFICATION_EXTRA",F[F.INVALID_PARAMETER_MESSAGE_OBJECT_NAME=34271]="INVALID_PARAMETER_MESSAGE_OBJECT_NAME",F[F.INVALID_PARAMETER_BEFORE=34272]="INVALID_PARAMETER_BEFORE",F[F.INVALID_PARAMETER_AFTER=34273]="INVALID_PARAMETER_AFTER",F[F.INVALID_PARAMETER_KEYWORD=34274]="INVALID_PARAMETER_KEYWORD",F[F.INVALID_PARAMETER_MESSAGE_OBJECT_NAME_LIST=34275]="INVALID_PARAMETER_MESSAGE_OBJECT_NAME_LIST",F[F.INVALID_PARAMETER_OFFSET=34276]="INVALID_PARAMETER_OFFSET",F[F.INVALID_PARAMETER_START_TIME=34277]="INVALID_PARAMETER_START_TIME",F[F.INVALID_PARAMETER_END_TIME=34278]="INVALID_PARAMETER_END_TIME",F[F.INVALID_PARAMETER_LIMIT=34279]="INVALID_PARAMETER_LIMIT",F[F.INVALID_MESSAGE_DIRECTION=34280]="INVALID_MESSAGE_DIRECTION",F[F.INVALID_MESSAGE_SENT_STATUS=34281]="INVALID_MESSAGE_SENT_STATUS",F[F.INVALID_PARAMETER_TARGETID_LIST=34282]="INVALID_PARAMETER_TARGETID_LIST",F[F.INVALID_PARAMETER_SPAN_MINUTES=34283]="INVALID_PARAMETER_SPAN_MINUTES",F[F.INVALID_PARAMETER_CONVERSATION_TYPE_LIST=34284]="INVALID_PARAMETER_CONVERSATION_TYPE_LIST",F[F.INVALID_PARAMETER_CONVERSATION_LIST=34287]="INVALID_PARAMETER_CONVERSATION_LIST",F[F.INVALID_PARAMETER_CLEAR_MESSAGE_OPTION_LIST=34288]="INVALID_PARAMETER_CLEAR_MESSAGE_OPTION_LIST",F[F.INVALID_PARAMETER_START_MESSAGE_UID=34289]="INVALID_PARAMETER_START_MESSAGE_UID",F[F.INVALID_PARAMETER_END_MESSAGE_UID=34290]="INVALID_PARAMETER_END_MESSAGE_UID",F[F.READ_RECEIPT_V4_NOT_SUPPORT=34291]="READ_RECEIPT_V4_NOT_SUPPORT",F[F.READ_RECEIPT_V4_UPDATE_NOT_SUPPORT=34292]="READ_RECEIPT_V4_UPDATE_NOT_SUPPORT",F[F.RC_DIRECTIONAL_MESSAGE_INVALID_CONVERSATION_TYPE=34296]="RC_DIRECTIONAL_MESSAGE_INVALID_CONVERSATION_TYPE",F[F.RC_DB_NOT_INIT=34301]="RC_DB_NOT_INIT",F[F.RC_DB_CORRUPT=34302]="RC_DB_CORRUPT",F[F.RC_DB_SQL_ERROR=34303]="RC_DB_SQL_ERROR",F[F.RC_DB_DATA_NOT_FOUND=34304]="RC_DB_DATA_NOT_FOUND",F[F.RC_NET_DATA_ERROR=34305]="RC_NET_DATA_ERROR",F[F.INVALID_PARAMETER_SUBSCRIBE_TYPE=34306]="INVALID_PARAMETER_SUBSCRIBE_TYPE",F[F.INVALID_PARAMETER_SUBSCRIBE_EXPIRY=34307]="INVALID_PARAMETER_SUBSCRIBE_EXPIRY",F[F.INVALID_PARAMETER_SUBSCRIBE_PUBLISHER_USERIDS=34308]="INVALID_PARAMETER_SUBSCRIBE_PUBLISHER_USERIDS",F[F.INVALID_PARAMETER_SUBSCRIBE_PAGESIZE=34309]="INVALID_PARAMETER_SUBSCRIBE_PAGESIZE",F[F.SUB_PROCESS_EXIT=34310]="SUB_PROCESS_EXIT",F[F.ADDON_NOT_EXIST=34311]="ADDON_NOT_EXIST",F[F.INVALID_PARAMETER_USER_PROFILE=34312]="INVALID_PARAMETER_USER_PROFILE",F[F.INVALID_PARAMETER_USER_PROFILE_VISIBILITY=34313]="INVALID_PARAMETER_USER_PROFILE_VISIBILITY",F[F.INVALID_PARAMETER_EXTRA=34314]="INVALID_PARAMETER_EXTRA",F[F.DB_UPGRADE_FAILED=34315]="DB_UPGRADE_FAILED",F[F.INVALID_PARAMETER_GROUP_INFO=34318]="INVALID_PARAMETER_GROUP_INFO",F[F.INVALID_PARAMETER_GROUP_ID=34319]="INVALID_PARAMETER_GROUP_ID",F[F.INVALID_PARAMETER_GROUP_NAME=34320]="INVALID_PARAMETER_GROUP_NAME",F[F.INVALID_PARAMETER_GROUP_IDS=34321]="INVALID_PARAMETER_GROUP_IDS",F[F.INVALID_PARAMETER_GROUP_MEMBER_ROLE=34322]="INVALID_PARAMETER_GROUP_MEMBER_ROLE",F[F.INVALID_PARAMETER_GROUP_APPLICATION_STATUS=34323]="INVALID_PARAMETER_GROUP_APPLICATION_STATUS",F[F.INVALID_PARAMETER_GROUP_APPLICATION_DIRECTION=34324]="INVALID_PARAMETER_GROUP_APPLICATION_DIRECTION",F[F.INVALID_PARAMETER_NICK_NAME=34325]="INVALID_PARAMETER_NICK_NAME",F[F.INVALID_PARAMETER_REASON=34326]="INVALID_PARAMETER_REASON",F[F.INVALID_PARAMETER_REMARK=34327]="INVALID_PARAMETER_REMARK",F[F.INVALID_PARAMETER_PAGING_QUERY_OPTION=34328]="INVALID_PARAMETER_PAGING_QUERY_OPTION",F[F.NET_DATA_IS_SYNCHRONIZING=34329]="NET_DATA_IS_SYNCHRONIZING",F[F.INVALID_PARAMETER_QUERY_FRIENDS_DIRECTION_TYPE=34330]="INVALID_PARAMETER_QUERY_FRIENDS_DIRECTION_TYPE",F[F.INVALID_PARAMETER_DIRECTION_TYPE=34331]="INVALID_PARAMETER_DIRECTION_TYPE",F[F.INVALID_PARAMETER_FRIEND_APPLICATION_TYPE=34332]="INVALID_PARAMETER_FRIEND_APPLICATION_TYPE",F[F.INVALID_PARAMETER_FRIEND_APPLICATION_STATUS=34333]="INVALID_PARAMETER_FRIEND_APPLICATION_STATUS",F[F.INVALID_PARAMETER_FRIEND_ADD_PERMISSION=34334]="INVALID_PARAMETER_FRIEND_ADD_PERMISSION",F[F.INVALID_PARAMETER_FRIEND_INFO_EXT_FIELDS=34335]="INVALID_PARAMETER_FRIEND_INFO_EXT_FIELDS",F[F.RC_REAL_TIME_CONVERSATION_UNAVAILABLE=34336]="RC_REAL_TIME_CONVERSATION_UNAVAILABLE",F[F.GROUP_SYNC_ERROR=35001]="GROUP_SYNC_ERROR",F[F.GROUP_MATCH_ERROR=35002]="GROUP_MATCH_ERROR",F[F.NOT_SUPPORT=35004]="NOT_SUPPORT",F[F.MAIN_PROCESS_ERROR=35005]="MAIN_PROCESS_ERROR",F[F.CAN_NOT_RECONNECT=35007]="CAN_NOT_RECONNECT",F[F.SERVER_UNAVAILABLE=35008]="SERVER_UNAVAILABLE",F[F.HOSTNAME_ERROR=35009]="HOSTNAME_ERROR",F[F.HAS_OHTER_SAME_CLIENT_ON_LINE=35010]="HAS_OHTER_SAME_CLIENT_ON_LINE",F[F.METHOD_NOT_AVAILABLE=35011]="METHOD_NOT_AVAILABLE",F[F.METHOD_ONLY_SUPPORT_ULTRA_GROUP=35014]="METHOD_ONLY_SUPPORT_ULTRA_GROUP",F[F.DRAFT_SAVE_ERROR=35015]="DRAFT_SAVE_ERROR",F[F.DRAFT_REMOVE_ERROR=35016]="DRAFT_REMOVE_ERROR",F[F.CONVER_REMOVE_ERROR=35020]="CONVER_REMOVE_ERROR",F[F.CONVER_GET_ERROR=35021]="CONVER_GET_ERROR",F[F.SEARCH_PROPS_LIMIT_ERROR=35022]="SEARCH_PROPS_LIMIT_ERROR",F[F.INVALID_PARAMETER_MESSAGE_TYPE=35024]="INVALID_PARAMETER_MESSAGE_TYPE",F[F.INVALID_PARAMETER_ORDER=35025]="INVALID_PARAMETER_ORDER",F[F.INVALID_PARAMETER_DRAFT=35028]="INVALID_PARAMETER_DRAFT",F[F.INVALID_PARAMETER_MESSAGE=35029]="INVALID_PARAMETER_MESSAGE",F[F.INVALID_PARAMETER_PUSH_CONTENT=35030]="INVALID_PARAMETER_PUSH_CONTENT",F[F.INVALID_PARAMETER_SENDOPTIONS=35031]="INVALID_PARAMETER_SENDOPTIONS",F[F.INVALID_PARAMETER_CONTENT_DISPOSITION=35032]="INVALID_PARAMETER_CONTENT_DISPOSITION",F[F.INVALID_PARAMETER_SAVE_NAME=35033]="INVALID_PARAMETER_SAVE_NAME",F[F.INVALID_PARAMETER_SERVER_TYPE=35034]="INVALID_PARAMETER_SERVER_TYPE",F[F.INVALID_PARAMETER_CLEAN_SPACE=35035]="INVALID_PARAMETER_CLEAN_SPACE",F[F.INVALID_PARAMETER_CAN_INCLUDE_EXPANSION=35036]="INVALID_PARAMETER_CAN_INCLUDE_EXPANSION",F[F.INVALID_PARAMETER_DISABLE_NOTIFICATION=35037]="INVALID_PARAMETER_DISABLE_NOTIFICATION",F[F.INVALID_PARAMETER_CHECK_DUPLICATE=35038]="INVALID_PARAMETER_CHECK_DUPLICATE",F[F.INVALID_PARAMETER_IS_AUTO_DELETE=35039]="INVALID_PARAMETER_IS_AUTO_DELETE",F[F.INVALID_PARAMETER_IS_SEND_NOTIFICATION=35040]="INVALID_PARAMETER_IS_SEND_NOTIFICATION",F[F.INVALID_PARAMETER_IS_FORCE=35041]="INVALID_PARAMETER_IS_FORCE",F[F.INVALID_PARAMETER_IS_TOP=35042]="INVALID_PARAMETER_IS_TOP",F[F.INVALID_PARAMETER_IS_UPDATE_TIME=35043]="INVALID_PARAMETER_IS_UPDATE_TIME",F[F.INVALID_PARAMETER_CONTAIN_MUTED=35044]="INVALID_PARAMETER_CONTAIN_MUTED",F[F.INVALID_PARAMETER_IS_STATUS_MESSAGE=35045]="INVALID_PARAMETER_IS_STATUS_MESSAGE",F[F.INVALID_PARAMETER_IS_MENTIONED=35046]="INVALID_PARAMETER_IS_MENTIONED",F[F.INVALID_PARAMETER_IS_VOIP_PUSH=35047]="INVALID_PARAMETER_IS_VOIP_PUSH",F[F.INVALID_PARAMETER_MENTIONED_TYPE=35048]="INVALID_PARAMETER_MENTIONED_TYPE",F[F.INVALID_PARAMETER_PUSH_CONFIG=35049]="INVALID_PARAMETER_PUSH_CONFIG",F[F.INVALID_PARAMETER_PUSH_DATA=35050]="INVALID_PARAMETER_PUSH_DATA",F[F.DNS_PROXY_TIMEOUT=35051]="DNS_PROXY_TIMEOUT",F[F.DNS_PROXY_ERROR=35052]="DNS_PROXY_ERROR",F[F.DNS_PROXY_DATA_DESTRUCTUR_ERROR=35053]="DNS_PROXY_DATA_DESTRUCTUR_ERROR",F[F.INVALID_DISABLE_UPDATE_LAST_MESSAGE=35054]="INVALID_DISABLE_UPDATE_LAST_MESSAGE",F[F.ONLY_DEFAULT_CHANNEL_SUPPORTS_PINNING=35055]="ONLY_DEFAULT_CHANNEL_SUPPORTS_PINNING",F[F.SEND_READ_RECEIPT_CONF_ERROR=35056]="SEND_READ_RECEIPT_CONF_ERROR",F[F.CHATROOM_ID_ISNULL=36001]="CHATROOM_ID_ISNULL",F[F.CHARTOOM_JOIN_ERROR=36002]="CHARTOOM_JOIN_ERROR",F[F.CHATROOM_HISMESSAGE_ERROR=36003]="CHATROOM_HISMESSAGE_ERROR",F[F.CHATROOM_KV_NOT_FOUND=36004]="CHATROOM_KV_NOT_FOUND",F[F.BLACK_ADD_ERROR=37001]="BLACK_ADD_ERROR",F[F.BLACK_GETSTATUS_ERROR=37002]="BLACK_GETSTATUS_ERROR",F[F.BLACK_REMOVE_ERROR=37003]="BLACK_REMOVE_ERROR",F[F.DRAF_GET_ERROR=38001]="DRAF_GET_ERROR",F[F.STREAM_MESSAGE_DISABLE=39001]="STREAM_MESSAGE_DISABLE",F[F.STREAM_MESSAGE_REQUEST_COUNT_LIMIT_EXCEEDED=39002]="STREAM_MESSAGE_REQUEST_COUNT_LIMIT_EXCEEDED",F[F.STREAM_MESSAGE_EXPANSION_KEY_ERROR=39003]="STREAM_MESSAGE_EXPANSION_KEY_ERROR",F[F.STREAM_MESSAGE_REQUEST_FAIL=39005]="STREAM_MESSAGE_REQUEST_FAIL",F[F.STREAM_MESSAGE_REQUEST_IN_PROCESS=39006]="STREAM_MESSAGE_REQUEST_IN_PROCESS",F[F.STREAM_MESSAGE_SYNCED=39007]="STREAM_MESSAGE_SYNCED",F[F.QNTKN_GET_ERROR=41002]="QNTKN_GET_ERROR",F[F.TIMEOUT=-1]="TIMEOUT",exports.ConversationType=void 0,(B=exports.ConversationType||(exports.ConversationType={}))[B.NONE=0]="NONE",B[B.PRIVATE=1]="PRIVATE",B[B.DISCUSSION=2]="DISCUSSION",B[B.GROUP=3]="GROUP",B[B.CHATROOM=4]="CHATROOM",B[B.CUSTOMER_SERVICE=5]="CUSTOMER_SERVICE",B[B.SYSTEM=6]="SYSTEM",B[B.APP_PUBLIC_SERVICE=7]="APP_PUBLIC_SERVICE",B[B.PUBLIC_SERVICE=8]="PUBLIC_SERVICE",B[B.ULTRA_GROUP=10]="ULTRA_GROUP",B[B.RTC_ROOM=12]="RTC_ROOM";var q,Y,K,Q,W,J,z,Z,X,$,ee,te,re,ne,ie,oe,se,ae,ue,le,ce,de,pe,fe,he,ge=0,_e=1,be=2,Ee=3,ve=4,ye=function(e){var t=[exports.ConversationType.PRIVATE,exports.ConversationType.GROUP,exports.ConversationType.SYSTEM,exports.ConversationType.PUBLIC_SERVICE,exports.ConversationType.APP_PUBLIC_SERVICE];switch(e){case ge:return t;case _e:return[exports.ConversationType.PRIVATE,exports.ConversationType.GROUP];case be:return l(l([],u(t),!1),[exports.ConversationType.ULTRA_GROUP],!1);case Ee:return l(l([],u(t),!1),[exports.ConversationType.ULTRA_GROUP,exports.ConversationType.CHATROOM],!1);case ve:return l(l([],u(t),!1),[exports.ConversationType.ULTRA_GROUP,exports.ConversationType.CHATROOM,exports.ConversationType.RTC_ROOM,exports.ConversationType.CUSTOMER_SERVICE,exports.ConversationType.DISCUSSION],!1)}},me=function(e,t){return ye(t).includes(e)};!function(e){e[e.RMTP=1]="RMTP",e[e.TLS=2]="TLS",e[e.RPP=3]="RPP",e[e.QUIC=4]="QUIC",e[e.WS=5]="WS",e[e.WSS=6]="WSS",e[e.HTTP=11]="HTTP",e[e.HTTPS=12]="HTTPS"}(q||(q={})),exports.FileType=void 0,(Y=exports.FileType||(exports.FileType={}))[Y.IMAGE=1]="IMAGE",Y[Y.AUDIO=2]="AUDIO",Y[Y.VIDEO=3]="VIDEO",Y[Y.FILE=4]="FILE",Y[Y.SIGHT=5]="SIGHT",Y[Y.COMBINE_HTML=6]="COMBINE_HTML",exports.MentionedType=void 0,(K=exports.MentionedType||(exports.MentionedType={}))[K.ALL=1]="ALL",K[K.SINGAL=2]="SINGAL",exports.MessageType=void 0,(Q=exports.MessageType||(exports.MessageType={})).TextMessage="RC:TxtMsg",Q.VOICE="RC:VcMsg",Q.HQ_VOICE="RC:HQVCMsg",Q.IMAGE="RC:ImgMsg",Q.GIF="RC:GIFMsg",Q.RICH_CONTENT="RC:ImgTextMsg",Q.LOCATION="RC:LBSMsg",Q.FILE="RC:FileMsg",Q.SIGHT="RC:SightMsg",Q.COMBINE="RC:CombineMsg",Q.COMBINE_V2="RC:CombineV2Msg",Q.CHRM_KV_NOTIFY="RC:chrmKVNotiMsg",Q.LOG_COMMAND="RC:LogCmdMsg",Q.EXPANSION_NOTIFY="RC:MsgExMsg",Q.REFERENCE="RC:ReferenceMsg",Q.RECALL="RC:RcCmd",Q.RECALL_NOTIFICATION_MESSAGE="RC:RcNtf",Q.READ_RECEIPT="RC:ReadNtf",Q.READ_RECEIPT_REQUEST="RC:RRReqMsg",Q.READ_RECEIPT_RESPONSE="RC:RRRspMsg",Q.SYNC_READ_STATUS="RC:SRSMsg",Q.GROUP_READ_RECEIPT_REQUEST="RC:RRMsg",Q.READ_STATE="RC:RSMsg",Q.DELIVERED="RC:Delivered",Q.DELIVERED_MSG="RC:DRMsg",Q.CHATROOM_MERGE_CHANGE="RC:ChrmMemChange",Q.CHATROOM_SYNC_MSG="RC:ChrmSyncMsg",Q.CHATROOM_MERGE_BLOCK="RC:ChrmBlockMsg",Q.CHATROOM_MERGE_BAN="RC:ChrmBanMsg",Q.TYPING_STATUS="RC:TypSts",Q.INTERCEPT="RC:InterceptMsg",Q.CLOUD_CONTROL="RC:CCConfigChangeRequestMsg",Q.STREAM_MESSAGE="RC:StreamMsg",exports.UltraGroupChannelType=void 0,(W=exports.UltraGroupChannelType||(exports.UltraGroupChannelType={}))[W.PUBLIC=0]="PUBLIC",W[W.PRIVATE=1]="PRIVATE",exports.UltraGroupChannelChangeType=void 0,(J=exports.UltraGroupChannelChangeType||(exports.UltraGroupChannelChangeType={}))[J.PUBLIC_TO_PRIVATE=2]="PUBLIC_TO_PRIVATE",J[J.PRIVATE_TO_PUBLIC=3]="PRIVATE_TO_PUBLIC",J[J.PUBLIC_TO_PRIVATE_USER_NOT_IN=6]="PUBLIC_TO_PRIVATE_USER_NOT_IN",function(e){e[e.MSG_EXPANSION=1]="MSG_EXPANSION",e[e.MSG_MODIFY=2]="MSG_MODIFY",e[e.MSG_RECALL=3]="MSG_RECALL",e[e.CHANNEL_CHANGE=4]="CHANNEL_CHANGE",e[e.USER_GROUP_CHANGE=5]="USER_GROUP_CHANGE",e[e.UG_DEL=6]="UG_DEL"}(z||(z={})),function(e){e[e.CHANNEL_DELETE=1]="CHANNEL_DELETE",e[e.PUBLIC_TO_PRIVATE=2]="PUBLIC_TO_PRIVATE",e[e.PRIVATE_TO_PUBLIC=3]="PRIVATE_TO_PUBLIC",e[e.PRIVATE_CHANNEL_USER_JOIN_PUBLIC=4]="PRIVATE_CHANNEL_USER_JOIN_PUBLIC",e[e.CHANNEL_USER_KICKED=5]="CHANNEL_USER_KICKED",e[e.PUBLIC_TO_PRIVATE_USER_NOT_IN=6]="PUBLIC_TO_PRIVATE_USER_NOT_IN"}(Z||(Z={})),function(e){e[e.REMOVE_USER_GROUP=1]="REMOVE_USER_GROUP",e[e.JOIN_USER_GROUP=2]="JOIN_USER_GROUP",e[e.EXIT_USER_GROUP=3]="EXIT_USER_GROUP",e[e.CHANNEL_BIND_USER_GROUP=4]="CHANNEL_BIND_USER_GROUP",e[e.CHANNEL_UNBIND_USER_GROUP=5]="CHANNEL_UNBIND_USER_GROUP"}(X||(X={})),function(e){e[e.NOT_MENTIONED=0]="NOT_MENTIONED",e[e.ALL=1]="ALL",e[e.ME=2]="ME"}($||($={})),exports.SentStatus=void 0,(ee=exports.SentStatus||(exports.SentStatus={}))[ee.SENDING=10]="SENDING",ee[ee.FAILED=20]="FAILED",ee[ee.SENT=30]="SENT",ee[ee.RECEIVED=40]="RECEIVED",ee[ee.READ=50]="READ",ee[ee.DESTROYED=60]="DESTROYED",exports.OperateStatus=void 0,(te=exports.OperateStatus||(exports.OperateStatus={}))[te.typing=0]="typing",exports.OnlineStatus=void 0,(re=exports.OnlineStatus||(exports.OnlineStatus={}))[re.ONLINE=1]="ONLINE",re[re.OFFLINE=0]="OFFLINE",exports.PlatformInfo=void 0,(ne=exports.PlatformInfo||(exports.PlatformInfo={}))[ne.Other=0]="Other",ne[ne.iOS=1]="iOS",ne[ne.Android=2]="Android",ne[ne.Web=3]="Web",ne[ne.PC=4]="PC",ne[ne.Mini=5]="Mini",ne[ne.HarmonyOS=6]="HarmonyOS",exports.SubscribeType=void 0,(ie=exports.SubscribeType||(exports.SubscribeType={}))[ie.ONLINE_STATUS=1]="ONLINE_STATUS",ie[ie.USER_PROFILE=2]="USER_PROFILE",ie[ie.FRIEND_ONLINE_STATUS=3]="FRIEND_ONLINE_STATUS",ie[ie.FRIEND_USER_PROFILE=4]="FRIEND_USER_PROFILE",exports.SubscribeOperationType=void 0,(oe=exports.SubscribeOperationType||(exports.SubscribeOperationType={}))[oe.SUBSCRIBE=0]="SUBSCRIBE",oe[oe.UNSUBSCRIBE=1]="UNSUBSCRIBE",exports.UserProfileVisibility=void 0,(se=exports.UserProfileVisibility||(exports.UserProfileVisibility={}))[se.NOT_SET=0]="NOT_SET",se[se.INVISIBLE=1]="INVISIBLE",se[se.EVERYONE=2]="EVERYONE",se[se.FriendVisible=3]="FriendVisible",exports.RCConnectionStatus=void 0,(ae=exports.RCConnectionStatus||(exports.RCConnectionStatus={}))[ae.CONNECTED=0]="CONNECTED",ae[ae.CONNECTING=1]="CONNECTING",ae[ae.DISCONNECTED=2]="DISCONNECTED",ae[ae.SUSPENDED=3]="SUSPENDED",exports.MessageBlockType=void 0,(ue=exports.MessageBlockType||(exports.MessageBlockType={}))[ue.GLOBAL=1]="GLOBAL",ue[ue.CUSTOM=2]="CUSTOM",ue[ue.THIRD_PARTY=3]="THIRD_PARTY",exports.MessageBlockSourceType=void 0,(le=exports.MessageBlockSourceType||(exports.MessageBlockSourceType={}))[le.MSG_ORIGINAL=0]="MSG_ORIGINAL",le[le.MSG_EXPANSION=1]="MSG_EXPANSION",le[le.MSG_MODIFY=2]="MSG_MODIFY",exports.MessageDirection=void 0,(ce=exports.MessageDirection||(exports.MessageDirection={}))[ce.SEND=1]="SEND",ce[ce.RECEIVE=2]="RECEIVE",exports.PushImportanceHonor=void 0,(de=exports.PushImportanceHonor||(exports.PushImportanceHonor={})).NORMAL="NORMAL",de.LOW="LOW",function(e){e.IM_NAVI="IM-stats_navi-S",e.IM_WEBSOCKET="IM-stats_websocket-S",e.IM_CONNECTION_DURATION="IM-stats_con_dur-S",e.IM_CMP="IM-stats_cmp-S",e.IM_CMP_RMTP="IM-stats_cmp_rmtp-S",e.IM_STATS_CS="IM-stats_cs-S",e.IM_NETWORK_CHANGE="IM-stats_network_change-S",e.L_CLOUD_INFO_FETCH_T="L-cloud_info_fetch-T",e.L_CLOUD_INFO_FETCH_R="L-cloud_info_fetch-R",e.IM_MSG_SEND="IM-msg_send-S",e.IM_MSG_RECEIVE="IM-msg_receive-S"}(pe||(pe={})),exports.NotificationLevel=void 0,(fe=exports.NotificationLevel||(exports.NotificationLevel={}))[fe.ALL_MESSAGE=-1]="ALL_MESSAGE",fe[fe.NOT_SET=0]="NOT_SET",fe[fe.AT_MESSAGE_NOTIFICATION=1]="AT_MESSAGE_NOTIFICATION",fe[fe.AT_USER_NOTIFICATION=2]="AT_USER_NOTIFICATION",fe[fe.AT_GROUP_ALL_USER_NOTIFICATION=4]="AT_GROUP_ALL_USER_NOTIFICATION",fe[fe.NOT_MESSAGE_NOTIFICATION=5]="NOT_MESSAGE_NOTIFICATION",exports.NotificationStatus=void 0,(he=exports.NotificationStatus||(exports.NotificationStatus={}))[he.OPEN=1]="OPEN",he[he.CLOSE=2]="CLOSE";var Ie,Te,Re,Ce,Oe,Se,Ae,Pe,Ne,we,Me,Le=function(e){return e<=exports.NotificationLevel.NOT_SET?exports.NotificationStatus.CLOSE:exports.NotificationStatus.OPEN};exports.ReceivedStatus=void 0,(Ie=exports.ReceivedStatus||(exports.ReceivedStatus={}))[Ie.READ=1]="READ",Ie[Ie.LISTENED=2]="LISTENED",Ie[Ie.DOWNLOADED=4]="DOWNLOADED",Ie[Ie.RETRIEVED=8]="RETRIEVED",Ie[Ie.UNREAD=0]="UNREAD",function(e){e[e.PRIVATE=1]="PRIVATE",e[e.OPEN=0]="OPEN"}(Te||(Te={})),function(e){e[e.NAVI=1]="NAVI",e[e.TCP=2]="TCP",e[e.WS=3]="WS"}(Re||(Re={})),function(e){e[e.REQUEST=0]="REQUEST",e[e.LOCAL=1]="LOCAL"}(Ce||(Ce={})),function(e){e[e.CURRENT=2]="CURRENT"}(Oe||(Oe={})),function(e){e[e.CONNECT=0]="CONNECT",e[e.RECONNECT=1]="RECONNECT"}(Se||(Se={})),function(e){e[e.CONNECT=0]="CONNECT",e[e.RECONNECT=1]="RECONNECT",e[e.REDIRECTED=3]="REDIRECTED",e[e.TIMEOUT=4]="TIMEOUT"}(Ae||(Ae={})),exports.InterruptionLevel=void 0,(Pe=exports.InterruptionLevel||(exports.InterruptionLevel={})).PASSIVE="passive",Pe.ACTIVE="active",Pe.TIME_SENSITIVE="time-sensitive",Pe.CRITICAL="critical",exports.PushNotificationQuietHoursLevel=void 0,(Ne=exports.PushNotificationQuietHoursLevel||(exports.PushNotificationQuietHoursLevel={}))[Ne.PUSH_NOTIFICATION_QUIET_HOURS_LEVEL_DEFAULT=0]="PUSH_NOTIFICATION_QUIET_HOURS_LEVEL_DEFAULT",Ne[Ne.PUSH_NOTIFICATION_QUIET_HOURS_LEVEL_MENTION_MESSAGE=1]="PUSH_NOTIFICATION_QUIET_HOURS_LEVEL_MENTION_MESSAGE",Ne[Ne.PUSH_NOTIFICATION_QUIET_HOURS_LEVEL_BLOCKED=5]="PUSH_NOTIFICATION_QUIET_HOURS_LEVEL_BLOCKED",function(e){e.WIFI="wifi",e.FOUR_G="4g",e.THREE_G="3g",e.TWO_G="2g",e.FIVE_G="2g",e.THREE_GENT="3gnet",e.UNKONWN="unknown"}(we||(we={})),exports.HttpMethod=void 0,(Me=exports.HttpMethod||(exports.HttpMethod={})).GET="GET",Me.POST="POST",Me.PUT="PUT";var Ue=72e5,De=6e4,xe=131072,je="5.20.2-enterprise.10".replace(/-.+$/,""),Ve="rongcloudsystem",Ge=864e5,ke=function(e){return"navi_".concat(e)},Fe=function(e,t){return"RC-con-s-ver-".concat(e,"-").concat(t)},Be=function(e,t){return"RCV4-CONVER-".concat(e,"-").concat(t)},He=function(e,t){return"RCV4-ultragroupconversation-".concat(e,"-").concat(t)},qe=function(e,t){return"outbox_".concat(e,"_").concat(t)},Ye=function(e,t){return"inbox_".concat(e,"_").concat(t)},Ke=function(e,t){return"broadcastbox_".concat(e,"_").concat(t)},Qe=function(e,t){return"send_msg_".concat(e,"_").concat(t)},We=function(e,t){return"RC-us-".concat(e,"-").concat(t)},Je=function(e){return"rc-static-config-".concat(e)},ze=function(e){return"RC-cc-".concat(e)},Ze=function(e,t){return"RC-RR-".concat(e,"-").concat(t)},Xe=Math.pow(2,31)-1,$e="undefined"!=typeof window&&window?(window.__RCVersionInfo||(window.__RCVersionInfo={}),window.__RCVersionInfo):{};$e.engine="5.20.2-enterprise.10";var et=function(){function e(){}return Object.defineProperty(e,"add",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){["imlib-next","engine","electron-main","electron-renderer","imlib-v2-adapter","Global_IM_UIKit","IMKit","imkit-store","rtclib","calllib","callplus","plugin-wechat-rtc"].includes(e)&&($e[e]=t)}}),Object.defineProperty(e,"validEngine",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.match(/\d+\.\d+\.\d+/);if(!t)return!1;var r=t[0].split(".").map((function(e){return e.padStart(3,"0")})).join("");return $e.engine.match(/\d+\.\d+\.\d+/)[0].split(".").map((function(e){return e.padStart(3,"0")})).join("")>=r}}),Object.defineProperty(e,"getInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(){return $e}}),e}();var rt,nt={gen:function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var t=Math.floor(36*Math.random());return("x"===e?t:3&t|8).toString(36)}))},genWithLen:function(e){void 0===e&&(e=22);var t,r=Date.now(),n=r.toString(36),i=Math.floor(Math.random()*r).toString(36),o=e-n.length-i.length;return[i,n,o>0?(t=o,Array.from({length:t}).map((function(){return Math.floor(36*Math.random()).toString(36)})).join("")):""].join("").slice(0,e)}},it=nt.genWithLen(22),ot=Date.now(),st=function(e){function r(t){var r=e.call(this,t)||this;return r.name="CMSYError",r}return t(r,e),Object.defineProperty(r,"InvalidParameters",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return(null==e?void 0:e.length)?new r("Invalid parameter -> ".concat(e)):new r("Invalid parameters.")}}),Object.defineProperty(r,"ParameterTypeError",{enumerable:!1,configurable:!0,writable:!0,value:function(){return new r("Wrong parameter type")}}),r}(Error),at=function(){function e(){rt.set(this,!1)}return Object.defineProperty(e.prototype,"stopPropagation",{enumerable:!1,configurable:!0,writable:!0,value:function(){d(this,rt,!0,"f")}}),Object.defineProperty(e.prototype,"isStopPropagation",{get:function(){return c(this,rt,"f")},enumerable:!1,configurable:!0}),e}();rt=new WeakMap;var ut,lt,ct,dt,pt=function(){function e(){Object.defineProperty(this,"_map",{enumerable:!0,configurable:!0,writable:!0,value:new Map}),Object.defineProperty(this,"_piped",{enumerable:!0,configurable:!0,writable:!0,value:new Set})}return Object.defineProperty(e.prototype,"_addItem",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){void 0===i&&(i=0);var o=Symbol(),s=this._map.get(e)||this._map.set(e,[]).get(e),a={symbol:o,priority:Math.min(i,100),listener:t.bind(n),once:r},u=s.findIndex((function(e){return e.priority>i}));return-1===u?s.push(a):s.splice(u,0,a),o}}),Object.defineProperty(e.prototype,"on",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return void 0===n&&(n=0),this._addItem(e,t,!1,r,n)}}),Object.defineProperty(e.prototype,"once",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return void 0===n&&(n=0),this._addItem(e,t,!0,r,n)}}),Object.defineProperty(e.prototype,"off",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;try{for(var n=a(this._map),i=n.next();!i.done;i=n.next()){var o=u(i.value,2),s=(o[0],o[1]),l=s.findIndex((function(t){return t.symbol===e}));if(-1!==l)return void s.splice(l,1)}}catch(e){t={error:e}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(t)throw t.error}}}}),Object.defineProperty(e.prototype,"emit",{enumerable:!1,configurable:!0,writable:!0,value:function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];var n=this._map.get(e);if(n&&n.length>0)for(var i=new at,o=0;o<n.length;o+=1){var s=n[o],a=s.once,c=s.listener;a&&n.splice(o,1);try{c.apply(void 0,l([i],u(t),!1))}catch(e){null===console||void 0===console||console.error(e)}if(i.isStopPropagation)return}l([],u(this._piped.values()),!1).forEach((function(r){return r.emit.apply(r,l([e],u(t),!1))}))}}),Object.defineProperty(e.prototype,"removeAll",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._map.delete(e)}}),Object.defineProperty(e.prototype,"clear",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._piped.clear(),this._map.clear()}}),Object.defineProperty(e.prototype,"pipe",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._piped.add(e)}}),e}(),ft=function(){function e(e,t,r){Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"msg",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"isOk",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.isOk=0===e}return Object.defineProperty(e.prototype,"next",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){return s(this,(function(t){return this.isOk?[2,e(this.data)]:[2,this.wipe()]}))}))}}),Object.defineProperty(e.prototype,"or",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){return s(this,(function(t){return this.isOk?[2,this]:[2,e(this.code)]}))}))}}),Object.defineProperty(e.prototype,"orSync",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this.isOk?this:e(this.code)}}),Object.defineProperty(e.prototype,"trans",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this.isOk?ht(e(this.data)):this.wipe()}}),Object.defineProperty(e.prototype,"tryTrans",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this.isOk?e(this.data):this.wipe()}}),Object.defineProperty(e.prototype,"errmsg",{enumerable:!1,configurable:!0,writable:!0,value:function(){return JSON.stringify({code:this.code,msg:this.msg})}}),Object.defineProperty(e.prototype,"wipe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.isOk?ht(void 0,this.msg):gt(this.code,this.msg)}}),e}(),ht=function(e,t){return new ft(0,t||"success",e)},gt=function(e,t,r){return new ft(e,t||"fail: ".concat(e),r)},_t=function(){function e(e){var t=this;ut.add(this),Object.defineProperty(this,"_promise",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_resolve",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._promise=new Promise((function(e){t._resolve=e})),e&&c(this,ut,"m",lt).call(this,e)}return Object.defineProperty(e.prototype,"ok",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._resolve(ht(e))}}),Object.defineProperty(e.prototype,"fail",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._resolve(gt(e,"",t))}}),Object.defineProperty(e.prototype,"end",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._resolve(e)}}),Object.defineProperty(e.prototype,"result",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._promise}}),e}();ut=new WeakSet,lt=function(e){var t=this;e().then((function(e){return t._resolve(e)}))};var bt=function(e){function r(){var t=null!==e&&e.apply(this,arguments)||this;return ct.add(t),Object.defineProperty(t,"_versionQueue",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(t,"_pullingPromise",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(t,"_taskQueue",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(t,"_dataVersion",{enumerable:!0,configurable:!0,writable:!0,value:-1}),Object.defineProperty(t,"_invervalTimer",{enumerable:!0,configurable:!0,writable:!0,value:-1}),Object.defineProperty(t,"_started",{enumerable:!0,configurable:!0,writable:!0,value:!1}),t}return t(r,e),Object.defineProperty(r.prototype,"waitingQueueLength",{get:function(){return this._versionQueue.length},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"_isPulling",{get:function(){return null!==this._pullingPromise},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"setInitVersion",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){return s(this,(function(t){return-1!==this._dataVersion||(this._dataVersion=e),[2]}))}))}}),Object.defineProperty(r.prototype,"push",{enumerable:!1,configurable:!0,writable:!0,value:function(e){e<this._dataVersion||(this._versionQueue.push(e),-1!==this._dataVersion&&this._execPulling())}}),Object.defineProperty(r.prototype,"pushTask",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=new _t;return this._taskQueue.push({flag:r,handler:e,checkRetry:t,retryCount:0}),this._execPulling(),r.result()}}),Object.defineProperty(r.prototype,"_execPulling",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t,r,n,i,o,a;return s(this,(function(s){switch(s.label){case 0:return this._pullingPromise?[4,this._pullingPromise]:[3,2];case 1:return s.sent(),[2];case 2:return this._pullingPromise=this._handleSyncData(this._dataVersion),[4,this._pullingPromise];case 3:if(e=s.sent(),t=e.isOk,r=e.data,!t)return this._pullingPromise=null,[2];if(void 0===(null==r?void 0:r.version)||r.version<this._dataVersion)throw this._pullingPromise=null,new Error("version error, please check: lastVersion: ".concat(this._dataVersion,", newVersion: ").concat(null==r?void 0:r.version));return n=r.version,i=r.hasNext,o=this._versionQueue.filter((function(e){return e>n})),this._versionQueue=l([],u(o),!1),this._dataVersion=n,i?(this._pullingPromise=null,[2,this._execPulling()]):this._versionQueue.length>0?(this._versionQueue.length=0,this._pullingPromise=null,[2,this._execPulling()]):[4,c(this,ct,"m",dt).call(this)];case 4:return a=s.sent(),this._pullingPromise=null,a?[2,this._execPulling()]:[2]}}))}))}}),Object.defineProperty(r.prototype,"startInterval",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this;this._started||(this._started=!0,t&&this._execPulling(),this._invervalTimer=setInterval((function(){return r._execPulling()}),e))}}),Object.defineProperty(r.prototype,"stopInterval",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._started&&(this._started=!1,clearInterval(this._invervalTimer),this._invervalTimer=-1)}}),Object.defineProperty(r.prototype,"reset",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.stopInterval(),this._versionQueue.length=0,this._dataVersion=-1}}),r}(pt);ct=new WeakSet,dt=function(){return o(this,void 0,void 0,(function(){var e,t,r,n,i,o,a,u,l,c;return s(this,(function(s){switch(s.label){case 0:return 0===this._taskQueue.length?[2,!1]:(e=this._taskQueue.shift(),t=e.flag,r=e.handler,n=e.checkRetry,i=e.retryCount,[4,r(this._dataVersion)]);case 1:return(o=s.sent()).isOk?(a=o.data,u=a.version,l=a.data,t.ok(l),u>this._dataVersion&&(this._dataVersion=u),[2,!1]):((c=!!n&&n(o,i))&&(e.retryCount+=1,this._taskQueue.unshift(e)),[2,c])}}))}))};var Et=function(){function e(e,t){var r=this;Object.defineProperty(this,"_promise",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_resolve",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_onCancel",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._promise=new Promise((function(t){r._resolve=t,e(r._onResolve.bind(r))})),this._onCancel=t}return Object.defineProperty(e.prototype,"_onResolve",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._resolve(e)}}),Object.defineProperty(e.prototype,"result",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._promise}}),Object.defineProperty(e.prototype,"abort",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._onCancel(this._onResolve.bind(this))}}),e}();!function(){function e(e,t){var r=this;Object.defineProperty(this,"handler",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"validate",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"_data",{enumerable:!0,configurable:!0,writable:!0,value:new Set}),Object.defineProperty(this,"_handlerPromise",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_resolve",{enumerable:!0,configurable:!0,writable:!0,value:null}),this._handlerPromise=new Promise((function(e){r._resolve=e}))}Object.defineProperty(e.prototype,"add",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t;return o(this,void 0,void 0,(function(){return s(this,(function(r){if(!this._resolve)throw new Error("BatchSync is closed");return(null===(t=this.validate)||void 0===t?void 0:t.call(this,e))?(this._data.add(e),[2,this._handlerPromise]):[2]}))}))}}),Object.defineProperty(e.prototype,"start",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t;return s(this,(function(r){switch(r.label){case 0:if(!this._resolve)throw new Error("BatchSync is closed");return e=this._resolve,this._resolve=null,t=l([],u(this._data.values()),!1),this._data.clear(),t.length>0?[4,this.handler(t)]:[3,2];case 1:r.sent(),r.label=2;case 2:return e(),[2,Promise.resolve()]}}))}))}})}();var vt=function(){function e(e){Object.defineProperty(this,"_apiName",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"_isValid",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"_code",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_errmsg",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}return Object.defineProperty(e,"create",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return new e(t)}}),Object.defineProperty(e.prototype,"fail",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return this._isValid||0!==this._code||(this._code=e,this._errmsg=t||this._errmsg),this}}),Object.defineProperty(e.prototype,"result",{enumerable:!1,configurable:!0,writable:!0,value:function(){if(!this._isValid&&0===this._code)throw new Error("Validator: result() should not be called without fail()");return this._isValid?ht():gt(this._code,this._errmsg)}}),Object.defineProperty(e.prototype,"validate",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){if(void 0===n&&(n=!1),!this._isValid)return this;var i=n?r(t):null==t||r(t);return this._isValid=i,i||(this._errmsg="param '".concat(e,"' is invalid")),this}}),Object.defineProperty(e.prototype,"validate2",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){if(void 0===n&&(n=!1),!this._isValid)return this;if(!n&&null==t)return this;var i=r(t);return i.isOk||(this._isValid=!1,this.fail(i.code,i.msg||"param '".concat(e,"' is invalid"))),this}}),Object.defineProperty(e.prototype,"assert",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){if(void 0===n&&(n=!1),!this._isValid)return this;if(this.validate(e,t,r,n),!this._isValid)throw st.InvalidParameters("'".concat(e,"' at '").concat(this._apiName,"'"));return this}}),Object.defineProperty(e.prototype,"isString",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return void 0===r&&(r=!1),this.validate(e,t,(function(){return"string"==typeof t}),r)}}),Object.defineProperty(e.prototype,"assertString",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return void 0===r&&(r=!1),this.assert(e,t,(function(){return"string"==typeof t}),r)}}),Object.defineProperty(e.prototype,"isNotEmptyString",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return void 0===r&&(r=!1),this.isString(e,t,r).validate(e,t,(function(e){return e.trim().length>0}),r)}}),Object.defineProperty(e.prototype,"assertNotEmptyString",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return void 0===r&&(r=!1),this.assertString(e,t,r),this.assert(e,t,(function(e){return e.trim().length>0}),r)}}),Object.defineProperty(e.prototype,"isLimitedString",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){return void 0===i&&(i=!1),this.isString(e,t,i).validate(e,t,(function(e){return e.length>=r&&e.length<=n}),i)}}),Object.defineProperty(e.prototype,"assertLimitedString",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){return void 0===i&&(i=!1),this.assertString(e,t,i),this.assert(e,t,(function(e){return e.length>=r&&e.length<=n}),i)}}),Object.defineProperty(e.prototype,"isBoolean",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return void 0===r&&(r=!1),this.validate(e,t,(function(e){return"boolean"==typeof e}),r)}}),Object.defineProperty(e.prototype,"assertBoolean",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return void 0===r&&(r=!1),this.assert(e,t,(function(e){return"boolean"==typeof e}),r)}}),Object.defineProperty(e.prototype,"isNumber",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return void 0===r&&(r=!1),this.validate(e,t,(function(e){return"number"==typeof e&&!Number.isNaN(e)}),r)}}),Object.defineProperty(e.prototype,"assertNumber",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return void 0===r&&(r=!1),this.assert(e,t,(function(e){return"number"==typeof e&&!Number.isNaN(e)}),r)}}),Object.defineProperty(e.prototype,"isLimitedNumber",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){return void 0===i&&(i=!1),this.isNumber(e,t,i).validate(e,t,(function(e){return e>=r&&e<=n}),i)}}),Object.defineProperty(e.prototype,"assertLimitedNumber",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){return void 0===i&&(i=!1),this.assertNumber(e,t,i),this.assert(e,t,(function(e){return e>=r&&e<=n}),i)}}),Object.defineProperty(e.prototype,"isInteger",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return void 0===r&&(r=!1),this.validate(e,t,(function(e){return Number.isInteger(e)}),r)}}),Object.defineProperty(e.prototype,"assertInteger",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return void 0===r&&(r=!1),this.assert(e,t,(function(e){return Number.isInteger(e)}),r)}}),Object.defineProperty(e.prototype,"isLimitedInteger",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){return void 0===i&&(i=!1),this.isInteger(e,t,i).validate(e,t,(function(e){return e>=r&&e<=n}),i)}}),Object.defineProperty(e.prototype,"assertLimitedInteger",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){return void 0===i&&(i=!1),this.assertInteger(e,t,i),this.assert(e,t,(function(e){return e>=r&&e<=n}),i)}}),Object.defineProperty(e.prototype,"isArray",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return void 0===r&&(r=!1),this.validate(e,t,(function(e){return-1!==Object.prototype.toString.call(e).indexOf("Array")}),r)}}),Object.defineProperty(e.prototype,"assertArray",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return void 0===r&&(r=!1),this.assert(e,t,(function(e){return-1!==Object.prototype.toString.call(e).indexOf("Array")}),r)}}),Object.defineProperty(e.prototype,"isLimitedArray",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){return void 0===n&&(n=!1),void 0===i&&(i=1),this.isArray(e,t,n).validate(e,t,(function(e){return e.length>=i&&e.length<=r}),n)}}),Object.defineProperty(e.prototype,"assertLimitedArray",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){return void 0===n&&(n=!1),void 0===i&&(i=1),this.assertArray(e,t,n),this.assert(e,t,(function(e){return e.length>=i&&e.length<=r}),n)}}),Object.defineProperty(e.prototype,"isTypedArray",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return void 0===n&&(n=!1),this.isArray(e,t,n).validate(e,t,(function(e){return e.every(r)}),n)}}),Object.defineProperty(e.prototype,"assertTypedArray",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return void 0===n&&(n=!1),this.assertArray(e,t,n),this.assert(e,t,(function(e){return e.every(r)}),n)}}),Object.defineProperty(e.prototype,"isLimitedTypedArray",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i,o){return void 0===i&&(i=!1),void 0===o&&(o=1),this.isLimitedArray(e,t,r,i,o).validate(e,t,(function(e){return e.every(n)}),i)}}),Object.defineProperty(e.prototype,"assertLimitedTypedArray",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i,o){return void 0===i&&(i=!1),void 0===o&&(o=1),this.assertLimitedArray(e,t,r,i,o),this.assert(e,t,(function(e){return e.every(n)}),i)}}),Object.defineProperty(e.prototype,"isObject",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return void 0===r&&(r=!1),this.validate(e,t,(function(e){return"[object Object]"===Object.prototype.toString.call(e)}),r)}}),Object.defineProperty(e.prototype,"assertObject",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return void 0===r&&(r=!1),this.assert(e,t,(function(e){return"[object Object]"===Object.prototype.toString.call(e)}),r)}}),Object.defineProperty(e.prototype,"isValueOf",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return void 0===n&&(n=!1),this.validate(e,t,(function(){return Object.values(r).includes(t)}),n)}}),Object.defineProperty(e.prototype,"assertValueOf",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return void 0===n&&(n=!1),this.assert(e,t,(function(){return Object.values(r).includes(t)}),n)}}),Object.defineProperty(e.prototype,"isFunction",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return void 0===r&&(r=!1),this.validate(e,t,(function(e){return"function"==typeof e}),r)}}),Object.defineProperty(e.prototype,"assertFunction",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return void 0===r&&(r=!1),this.assert(e,t,(function(e){return"function"==typeof e}),r)}}),e}(),yt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function mt(e){var t,r,n,i,o,s,a="",u=0;for(e=e.replace(/[^A-Za-z0-9+/=]/g,"");u<e.length;)t=yt.indexOf(e.charAt(u++))<<2|(i=yt.indexOf(e.charAt(u++)))>>4,r=(15&i)<<4|(o=yt.indexOf(e.charAt(u++)))>>2,n=(3&o)<<6|(s=yt.indexOf(e.charAt(u++))),a+=String.fromCharCode(t),64!==o&&(a+=String.fromCharCode(r)),64!==s&&(a+=String.fromCharCode(n));return a}var It=function(){var e,t=new Promise((function(t){e=t}));return{resolve:e,promise:t}},Tt=function(e){return"string"==typeof e},Rt=function(e){return"number"==typeof e&&!Number.isNaN(e)},Ct=function(e){return function(t){return Number.isInteger(t)&&(void 0===e.min||t>=e.min)&&(void 0===e.max||t<=e.max)}},Ot=function(e){return-1!==Object.prototype.toString.call(e).indexOf("Array")},St=function(e){return function(t){return Tt(t)&&(void 0===e.isTrim||0===t.length||t.trim().length>0)&&(void 0===e.minLength||t.length>=e.minLength)&&(void 0===e.maxLength||t.length<=e.maxLength)&&(void 0===e.validator||e.validator(t))}},At=function(e){return Tt(e)&&e.length>0},Pt=function(e){return"[object Object]"===Object.prototype.toString.call(e)},Nt=function(e){return"function"==typeof e},wt=function(e){return void 0===e||"[object Undefined]"===Object.prototype.toString.call(e)},Mt=function(e){return Tt(e)&&/https?:\/\//.test(e)},Lt=function(e){for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!0;return!1},Ut=function(e){return Rt(e)&&Object.prototype.hasOwnProperty.call(exports.ConversationType,e)},Dt=function(e){var t=!1;return Tt(e)&&!/_/g.test(e)&&e.length<=20&&(t=!0),t},xt=function(e){return St({minLength:1,maxLength:64})(e)},jt=function(e){var t=!1,r=!1,n=!1;if(Pt(e)){var i=Object.keys(e).length;for(var o in t=i>20,e)if(r||(r=Tt(o)&&!/^[A-Za-z0-9_=+-]+$/.test(o)),!n){var s=e[o];n=o.length>32||s.length>4096}}return{isExceedLimit:t,isIllgalEx:r,isExKeyOrValLengthExceedLimit:n}},Vt=function(e,t,r){return Gt(vt.create(e),t,r)},Gt=function(e,t,r){return e.isObject("conversatino",t,!0).fail(exports.ErrorCode.INVALID_PARAMETER_CONVERSATION).validate("conversationType",null==t?void 0:t.conversationType,(function(){return me(t.conversationType,r)}),!0).fail(exports.ErrorCode.INVALID_PARAMETER_CONVERSATION_TYPE).validate("targetId",null==t?void 0:t.targetId,xt,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TARGET_ID).validate("channelId",null==t?void 0:t.channelId,Dt).fail(exports.ErrorCode.INVALID_PARAMETER_CHANNEL_ID)},kt=function(e){if(!Pt(e)||void 0===e.low||void 0===e.high)return e;var t=e.low;return t<0&&(t+=4294967296),t=t.toString(16),parseInt(e.high.toString(16)+"00000000".replace(new RegExp("0{".concat(t.length,"}$")),t),16)},Ft=function(){return"undefined"!=typeof RCCppEngine},Bt=function(e){return{isRead:(e&exports.ReceivedStatus.READ)===exports.ReceivedStatus.READ,isListened:(e&exports.ReceivedStatus.LISTENED)===exports.ReceivedStatus.LISTENED,isDownload:(e&exports.ReceivedStatus.DOWNLOADED)===exports.ReceivedStatus.DOWNLOADED,isRetrieved:(e&exports.ReceivedStatus.RETRIEVED)===exports.ReceivedStatus.RETRIEVED}},Ht=function(e){return[exports.PlatformInfo.Android,exports.PlatformInfo.iOS,exports.PlatformInfo.Web,exports.PlatformInfo.PC,exports.PlatformInfo.Mini,exports.PlatformInfo.HarmonyOS].map((function(t){var r=e.findIndex((function(e){return e.platform===t}));return-1===r?{platform:t,changeTime:0,eventValue:0}:e[r]}))},qt=function(e,t,r){var n=t.reduce((function(e,t){return["gender","role","level"].includes(t.key)?e[t.key]=Number(t.value):e[t.key]=t.value,e}),{});return n.userId=e,r.forEach((function(e){n.extraProfile=n.extraProfile||{},n.extraProfile[e.key]=e.value})),n},Yt=function(e,t,r){return t?1===r?q.TLS:q.RMTP:"http"===e?q.WS:q.WSS},Kt=function(e,t){var r=e.server,n=e.backupServer,i=e.bs,o=e.serverAddr,s=e.protocol,a=e.openTLS;if(o)return l([],u(o.filter((function(e){return e.addr}))),!1);var c=[],d=[];return r&&d.push(r),(n||i||"").split(",").forEach((function(e){d.indexOf(e)<0&&d.push(e)})),d.forEach((function(e,n){e&&c.push({addr:e,protocol:Yt(s,t,a),weight:r.length-n,race:!1})})),l([],u(c),!1)},Qt=function(e){return void 0===e&&(e=[]),e.map((function(e){var t,r,n,i,o,s,a,u,l,c=Xt(e.settingProfile)||{},d=e.extProfile||[],p=e.targetId,f=e.baseInfo,h=e.userInfo;return{groupId:p,groupName:null!==(t=c.name)&&void 0!==t?t:"",portraitUri:null!==(r=c.portraitUrl)&&void 0!==r?r:"",introduction:null!==(n=c.introduction)&&void 0!==n?n:"",notice:null!==(i=c.announcement)&&void 0!==i?i:"",extProfile:Xt(d),joinPermission:~~c.joinPerm,removeMemberPermission:~~c.removePerm,invitePermission:~~c.memInvitePerm,inviteHandlePermission:~~c.invitePerm,groupInfoEditPermission:~~c.profilePerm,memberInfoEditPermission:~~c.memProfilePerm,creatorId:null!==(o=null==f?void 0:f.creatorId)&&void 0!==o?o:"",ownerId:null!==(s=null==f?void 0:f.ownerId)&&void 0!==s?s:"",createTime:(null==f?void 0:f.createTime)?kt(f.createTime):0,membersCount:null!==(a=null==f?void 0:f.memberCount)&&void 0!==a?a:0,remark:null!==(u=null==h?void 0:h.remarkName)&&void 0!==u?u:"",joinedTime:(null==h?void 0:h.joinTime)?kt(h.joinTime):0,role:null!==(l=null==h?void 0:h.role)&&void 0!==l?l:exports.GroupMemberRole.UNDEF}}))},Wt=function(e){return void 0===e&&(e=[]),e.map((function(e){var t=Xt(e.settingProfile),r=e.extProfile||[],i=e.targetId,o=e.baseInfo,s=e.userInfo;return JSON.parse(JSON.stringify(n(n({groupId:i},zt(t)),{extProfile:r.length>0?Xt(r):void 0,creatorId:null==o?void 0:o.creatorId,ownerId:null==o?void 0:o.ownerId,createTime:(null==o?void 0:o.createTime)?kt(o.createTime):void 0,membersCount:null==o?void 0:o.memberCount,remark:null==s?void 0:s.remarkName})))}))},Jt=function(e){if(void 0!==e){var t=Number(e);return Number.isNaN(t)?void 0:t}},zt=function(e){return JSON.parse(JSON.stringify({groupName:e.name,portraitUri:e.portraitUrl,introduction:e.introduction,notice:e.announcement,joinPermission:Jt(e.joinPerm),removeMemberPermission:Jt(e.removePerm),invitePermission:Jt(e.memInvitePerm),inviteHandlePermission:Jt(e.invitePerm),groupInfoEditPermission:Jt(e.profilePerm),memberInfoEditPermission:Jt(e.memProfilePerm)}))},Zt=function(e){void 0===e&&(e=[]);var t=e.map((function(e){var t=e||{},r=t.ext,n=t.userId,i=t.name,o=t.portraitUrl,s=r||{},a=s.role,u=s.joinTime,l=s.channelNickName,c=s.additional;return{userId:n,name:i||"",portraitUri:o||"",nickname:l||"",role:a||exports.GroupMemberRole.UNDEF,joinedTime:kt(u)||0,extra:c||""}}));return t},Xt=function(e){var t={};return e&&0!==e.length?(e.forEach((function(e){t[e.key]=e.value})),t):t},$t=function(e){var t,r,n,i;return{userId:e.userId,name:e.name||"",portraitUri:e.portraitUrl||"",nickname:null===(t=e.ext)||void 0===t?void 0:t.channelNickName,extra:null===(r=e.ext)||void 0===r?void 0:r.additional,role:null===(n=e.ext)||void 0===n?void 0:n.role,joinedTime:null===(i=e.ext)||void 0===i?void 0:i.joinTime}},er=function(e){var t=e.joinUserInfo,r=e.inviterInfo,n=e.processInfo;return{groupId:e.targetId,joinMemberInfo:$t(t),inviterInfo:r&&r.userId?$t(r):void 0,operatorInfo:n&&n.userId?$t(n):void 0,status:e.status,direction:e.directionType,type:e.joinType,operationTime:e.applyTime||0,reason:e.detail||""}},tr=function(e,t){if(e=e.replace(/\?$/,""),!t)return e;var r=Object.keys(t).map((function(e){return"".concat(e,"=").concat(t[e])})).filter((function(e){return!!e}));return r.length?[e,r.join("&")].join("?"):e};function rr(e){for(var t=null===window||void 0===window?void 0:window.atob(e),r=new Uint8Array(t.length),n=0;n<t.length;n++)r[n]=t.charCodeAt(n);return r.buffer}var nr,ir=function(e,t){var r=Math.floor(1e3*Math.random()%1e4),n=nt.gen(),i=function(e){e=e||"-";var t=new Date,r=t.getFullYear(),n=t.getMonth()+1,i=t.getDate();return"".concat(r).concat(e).concat(n).concat(e).concat(i)}(),o=(new Date).getTime(),s="";if(t){var a=t.split(".");s=".".concat(a[a.length-1])}return"".concat(e,"__RC-").concat(i,"_").concat(r,"_").concat(o).concat(n).concat(s)},or=function(e,t,r){void 0===e&&(e=0);var i=function(e){return{isVoipPush:!!(1&e),isFilerWhiteBlacklist:!!(2&e),disablePushTitle:!!(4&e),forceShowDetailContent:!!(8&e)}}(e),o=i.disablePushTitle,s=i.forceShowDetailContent,a=sr(null==r?void 0:r.pushConfigs,null==r?void 0:r.pushId);return n({pushTitle:(null==r?void 0:r.title)||"",pushContent:t||"",pushData:"",disablePushTitle:o,forceShowDetailContent:s,templateId:null==r?void 0:r.templateId},a)},sr=function(e,t){var r={},n={notificationId:t||""},i={};if(!e)return{iOSConfig:r,androidConfig:n,harmonyOSConfig:i};try{var o=JSON.parse(e);null==o||o.forEach((function(e){var t,o,s,a,u,l,c,d,p,f,h,g,_=Object.keys(e);if(0!==_.length){var b=_[0];switch(b){case"HW":return n.channelIdHW=null===(t=e[b])||void 0===t?void 0:t.channelId,n.importanceHW=null===(o=e[b])||void 0===o?void 0:o.importance,n.imageUrlHW=null===(s=e[b])||void 0===s?void 0:s.image,void(n.categoryHW=null===(a=e[b])||void 0===a?void 0:a.category);case"MI":return void(n.channelIdMi=null===(u=e[b])||void 0===u?void 0:u.channelId);case"OPPO":return void(n.channelIdOPPO=null===(l=e[b])||void 0===l?void 0:l.channelId);case"VIVO":return n.typeVivo=null===(c=e[b])||void 0===c?void 0:c.classification,void(n.categoryVivo=null===(d=e[b])||void 0===d?void 0:d.category);case"APNS":return r.threadId=e[b]["thread-id"],r.apnsCollapseId=e[b]["apns-collapse-id"],r.category=e[b].category,r.richMediaUri=e[b].richMediaUri,void(r.interruptionLevel=e[b]["interruption-level"]);case"FCM":return void(n.googleConfig={collapseKey:e[b].collapse_key||"",imageUrl:e[b].imageUrl||"",priority:e[b].priority||""});case"HONOR":return n.importanceHonor=null===(p=e[b])||void 0===p?void 0:p.importance,void(n.imageUrlHonor=null===(f=e[b])||void 0===f?void 0:f.image);case"OHOS":i.category=null===(h=e[b])||void 0===h?void 0:h.category,i.image=null===(g=e[b])||void 0===g?void 0:g.image}}}))}catch(e){}return{iOSConfig:r,androidConfig:n,harmonyOSConfig:i}},ar=function(e){var t=/^[A-Za-z0-9_=+-]+$/.test(e),r=e.length;return t&&(r<=128&&r>=1)},ur=function(e){var t=e.length;return t<=4096&&t>=1},lr=(nr=0,function(){var e=((4294967295&Date.now())>>>0).toString(2),t=Math.floor(Math.random()*(Math.pow(2,8)-1)),r=e+nr.toString(2).padStart(11,"0")+t.toString(2).padStart(8,"0");return nr=2047&++nr,parseInt(r,2)}),cr=function(){var e=et.getInfo(),t="electron";for(var r in e)"engine"!==r&&(t=["imlib-v2-adapter","imlib-next"].includes(r)?r:"electron");return t},dr=function(e,t,r){return o(void 0,void 0,void 0,(function(){var n,i;return s(this,(function(o){switch(o.label){case 0:return[4,window.crypto.subtle.importKey("raw",(new TextEncoder).encode(t),"AES-CBC",!0,["decrypt"])];case 1:return n=o.sent(),[4,window.crypto.subtle.decrypt({name:"AES-CBC",iv:(new TextEncoder).encode(r)},n,rr(e))];case 2:return i=o.sent(),[2,(new TextDecoder).decode(i)]}}))}))};function pr(e,t){var r;if(!e)return"";var n="undefined"!=typeof window&&"https:"===(null===(r=null===window||void 0===window?void 0:window.location)||void 0===r?void 0:r.protocol);return/^https?:\/\//.test(e)?n?e.replace(/^https?:\/\//i,"https://"):e:t!==q.HTTP||n?"https://".concat(e):"http://".concat(e)}var fr,hr,gr,_r=function(e,t){if(!e)return"";var r=e.ossConfig,n=void 0===r?"":r,i="";try{var o=JSON.parse(n);if(o.length>0){var s=o.find((function(e){return e.minio}));s&&(i=s.minio)}}catch(e){t.warn(H.L_PARSE_JSON_E,JSON.stringify({ossConfig:n,error:e}))}return i};function br(e){var t=e.method||exports.HttpMethod.GET,r=e.timeout||De,n=e.headers,i=e.query,o=e.body,s=e.onProgress,a=tr(e.url,i),u=new XMLHttpRequest;if(u.open(t,a),n&&u.setRequestHeader)for(var l in n)u.setRequestHeader(l,n[l]);return function(e,t,r,n){return new Et((function(i){e.onreadystatechange=function(){4===e.readyState&&i({data:e.responseText,status:e.status,xhr:e})},e.onerror=function(){i({status:e.status})},n&&(e.upload.onprogress=function(e){return n(e)}),0!==t&&setTimeout((function(){e.abort(),i({status:e.status})}),t),e.send(r)}),(function(t){e.abort(),t({status:-1})}))}(u,r,o,s)}!function(e){e[e.add=1]="add",e[e.update=2]="update",e[e.delete=3]="delete"}(fr||(fr={})),exports.AreaCode=void 0,(gr=exports.AreaCode||(exports.AreaCode={}))[gr.BJ=1]="BJ",gr[gr.SG=2]="SG",gr[gr.NA=3]="NA",gr[gr.SG_A=4]="SG_A",gr[gr.SG_B=4]="SG_B",gr[gr.SA=5]="SA",(hr={})[exports.AreaCode.BJ]={naviUrlBase64:["ZHVhbHN0YWNrLW5hdi5yb25nLWVkZ2UuY29t","bmF2LWIucm9uZy1lZGdlLmNvbQ=="],logUrlBase64:[{addr:"ZHVhbHN0YWNrLWNvbGxlY3Rpb24ucm9uZy1lZGdlLmNvbQ==",protocol:q.HTTPS,weight:-1}],miniCmpBase64:["ZHVhbHN0YWNrLXdzLnJvbmctZWRnZS5jb20=","d3MtYi5yb25nLWVkZ2UuY29t"],staticConfigUrlBase64:["aHR0cHM6Ly9ib290c3RyYXBwcm9maWxlLWMtMS5vc3MtY24tYmVpamluZy5hbGl5dW5jcy5jb20="],cloudControllerUrlBase64:["ZHVhbHN0YWNrLWNsb3VkY29udHJvbC5yb25nLWVkZ2UuY29t","Y2xvdWRjb250cm9sLWIucm9uZy1lZGdlLmNvbQ=="],statsUrlBase64:["aHR0cHM6Ly9zdGF0cy5yb25nLWVkZ2UuY29t"]},hr[exports.AreaCode.SG]={naviUrlBase64:["ZHVhbHN0YWNrLW5hdi5zZy1saWdodC1lZGdlLmNvbQ==","bmF2LWIuc2ctbGlnaHQtZWRnZS5jb20="],logUrlBase64:[{addr:"ZHVhbHN0YWNrLWNvbGxlY3Rpb24uc2ctbGlnaHQtZWRnZS5jb20=",protocol:q.HTTPS,weight:-1}],miniCmpBase64:["ZHVhbHN0YWNrLXdzLnNnLWxpZ2h0LWVkZ2UuY29t","d3MtYi5zZy1saWdodC1lZGdlLmNvbQ=="],staticConfigUrlBase64:["aHR0cHM6Ly9ib290c3RyYXBwcm9maWxlLWItMi5zMy5hcC1zb3V0aGVhc3QtMS5hbWF6b25hd3MuY29t"],cloudControllerUrlBase64:["ZHVhbHN0YWNrLWNsb3VkY29udHJvbC5zZy1saWdodC1lZGdlLmNvbQ==","Y2xvdWRjb250cm9sLWIuc2ctbGlnaHQtZWRnZS5jb20="],statsUrlBase64:["aHR0cHM6Ly9zdGF0cy5zZy1saWdodC1lZGdlLmNvbQ=="]},hr[exports.AreaCode.NA]={naviUrlBase64:["ZHVhbHN0YWNrLW5hdi51cy1saWdodC1lZGdlLmNvbQ==","bmF2LWIudXMtbGlnaHQtZWRnZS5jb20="],logUrlBase64:[{addr:"ZHVhbHN0YWNrLWNvbGxlY3Rpb24udXMtbGlnaHQtZWRnZS5jb20=",protocol:q.HTTPS,weight:-1}],miniCmpBase64:["ZHVhbHN0YWNrLXdzLnVzLWxpZ2h0LWVkZ2UuY29t","d3MtYi51cy1saWdodC1lZGdlLmNvbQ=="],staticConfigUrlBase64:[],cloudControllerUrlBase64:["ZHVhbHN0YWNrLWNsb3VkY29udHJvbC51cy1saWdodC1lZGdlLmNvbQ==","Y2xvdWRjb250cm9sLWIudXMtbGlnaHQtZWRnZS5jb20="],statsUrlBase64:["aHR0cHM6Ly9zdGF0cy51cy1saWdodC1lZGdlLmNvbQ=="]},hr[exports.AreaCode.SG_B]={naviUrlBase64:["bmF2LnNnLWItbGlnaHQtZWRnZS5jb20=","bmF2LWIuc2ctYi1saWdodC1lZGdlLmNvbQ=="],logUrlBase64:[{addr:"Y29sbGVjdGlvbi5zZy1iLWxpZ2h0LWVkZ2UuY29t",protocol:q.HTTPS,weight:-1}],miniCmpBase64:["ZHVhbHN0YWNrLXdzLnNnLWItbGlnaHQtZWRnZS5jb20=","d3MtYi5zZy1iLWxpZ2h0LWVkZ2UuY29t"],staticConfigUrlBase64:[],cloudControllerUrlBase64:["ZHVhbHN0YWNrLWNsb3VkY29udHJvbC5zZy1iLWxpZ2h0LWVkZ2UuY29t","Y2xvdWRjb250cm9sLWIuc2ctYi1saWdodC1lZGdlLmNvbQ=="],statsUrlBase64:["aHR0cHM6Ly9zdGF0cy5zZy1iLWxpZ2h0LWVkZ2UuY29t"]},hr[exports.AreaCode.SA]={naviUrlBase64:["ZHVhbHN0YWNrLW5hdi5zYXUtbGlnaHQtZWRnZS5jb20=","bmF2LWIuc2F1LWxpZ2h0LWVkZ2UuY29t"],logUrlBase64:[{addr:"ZHVhbHN0YWNrLWNvbGxlY3Rpb24uc2F1LWxpZ2h0LWVkZ2UuY29t",protocol:q.HTTPS,weight:-1}],miniCmpBase64:["ZHVhbHN0YWNrLXdzLnNhdS1saWdodC1lZGdlLmNvbQ==","d3MtYi5zYXUtbGlnaHQtZWRnZS5jb20="],staticConfigUrlBase64:[],cloudControllerUrlBase64:["ZHVhbHN0YWNrLWNsb3VkY29udHJvbC5zYXUtbGlnaHQtZWRnZS5jb20=","Y2xvdWRjb250cm9sLWIuc2F1LWxpZ2h0LWVkZ2UuY29t"],statsUrlBase64:["aHR0cHM6Ly9zdGF0cy5zYXUtbGlnaHQtZWRnZS5jb20="]};var Er,vr=function(){function e(){Object.defineProperty(this,"initOption",{enumerable:!0,configurable:!0,writable:!0,value:{}})}return Object.defineProperty(e.prototype,"init",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this.initOption=e}}),Object.defineProperty(e.prototype,"getNaviUrlList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this.initOption||{};r.areaCode;var n=r.navigators,i=[].map((function(e){return mt(e)})),o=[],s=u(e.split("@"),2)[1];t&&(o=s?s.split(";"):[]);var a=n&&n.length>0?l(l([],u(o),!1),u(n),!1):l(l([],u(o),!1),u(i),!1);return a.filter((function(e,t){return a.indexOf(e)===t})).map((function(e){return pr(e)}))}}),Object.defineProperty(e.prototype,"getLogUrlPolicyList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=e||{},i=r.log,o=r.logPolicy,s=this.initOption||{};s.areaCode;var a=s.logServerUrl,c=[].map((function(e){return n(n({},e),{addr:mt(e.addr)})})),d=[],p={level:1,itv:6,times:5};if(i)d.push.apply(d,l([],u(i.addrs),!1)),Object.assign(p,i.policy);else if(o)try{var f=JSON.parse(o);d.push({addr:f.url,protocol:q.HTTPS,weight:1}),p.level=f.level,p.itv=f.itv,p.times=f.times}catch(r){t.warn(H.L_REPORT_LOG_POLICY_E,JSON.stringify({policy:e.logPolicy}))}var h=a?l([{addr:a,protocol:q.HTTPS,weight:101}],u(d),!1):l(l([],u(d),!1),u(c),!1);return{policy:p,addrs:h.filter((function(e,t){return h.findIndex((function(t){return t.addr===e.addr&&t.protocol===e.protocol}))===t})).map((function(e){return n(n({},e),{addr:pr(e.addr,e.protocol)})})).sort((function(e,t){return t.weight-e.weight}))}}}),Object.defineProperty(e.prototype,"getMiniCmpUrlList",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e,t=(null===(e=this.initOption)||void 0===e||e.areaCode,[]).map((function(e){return mt(e)})),r=(this.initOption||{}).miniCMPProxy;return r&&r.length>0?r:t}}),Object.defineProperty(e.prototype,"getStaticConfigUrl",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e;return(null===(e=this.initOption)||void 0===e||e.areaCode,[]).map((function(e){return mt(e)}))}}),Object.defineProperty(e.prototype,"getCloudControllerUrl",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t;return null!=e||null===(t=this.initOption)||void 0===t||t.areaCode,[].map((function(e){return mt(e)}))}}),Object.defineProperty(e.prototype,"getAreaCode",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e,t;return null!==(t=null===(e=this.initOption)||void 0===e?void 0:e.areaCode)&&void 0!==t?t:exports.AreaCode.BJ}}),Object.defineProperty(e.prototype,"setAreaCode",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return!(!e||!exports.AreaCode[e]||e===this.initOption.areaCode)&&(this.initOption.areaCode=e,!0)}}),Object.defineProperty(e.prototype,"getStatsUrlList",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r=e||{},n=r.active,i=r.activeServer,o=(null==n?void 0:n.addrs)||[],s=(null===(t=this.initOption)||void 0===t||t.areaCode,[]).map((function(e){return mt(e)})),a=[];return 0!==o.length?a.push.apply(a,l([],u(o.sort((function(e,t){return t.weight-e.weight})).map((function(e){return pr(e.addr,e.protocol)}))),!1)):i&&a.push(pr(i,q.HTTPS)),s.forEach((function(e){a.includes(e)||a.push(e)})),a}}),e}(),yr=new vr,mr=function(){function e(e,t){Object.defineProperty(this,"appkey",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"logger",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"staticUrls",{enumerable:!0,configurable:!0,writable:!0,value:[]})}return Object.defineProperty(e.prototype,"getStaticConfig",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e;return o(this,void 0,void 0,(function(){var t,r,n,i,o,a,u,l;return s(this,(function(s){switch(s.label){case 0:if(!(t=this.getCache()))return[3,6];s.label=1;case 1:return s.trys.push([1,4,,5]),r=JSON.parse(t),Date.now()-(null==r?void 0:r.time)<18e5?[4,this.decryptData(r.val)]:[3,3];case 2:return n=s.sent(),(i=n.resources.navi.slice()).sort((function(e,t){return t.weight-e.weight})),[2,{navi:i.map((function(e){return pr(e.addr,e.protocol)}))||[]}];case 3:return[3,5];case 4:return o=s.sent(),this.logger.error(H.L_GET_STATIC_CONF_E,JSON.stringify({error:null==o?void 0:o.stack})),[3,5];case 5:this.clearCache(),s.label=6;case 6:return[4,this._requestHandle()];case 7:return(a=s.sent())?[4,this.decryptData(a)]:[2];case 8:return(null==(u=s.sent())?void 0:u.areaCode)!==yr.getAreaCode()?[2]:(this.setCache(JSON.stringify({time:Date.now(),val:a})),this.staticUrls=(null==u?void 0:u.bootstrap)||[],(l=null===(e=null==u?void 0:u.resources)||void 0===e?void 0:e.navi.slice()).sort((function(e,t){return t.weight-e.weight})),[2,{navi:l.map((function(e){return pr(e.addr,e.protocol)}))||[]}])}}))}))}}),Object.defineProperty(e.prototype,"_requestHandle",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t,r,n,i,o,c,d,p,f,h;return s(this,(function(s){switch(s.label){case 0:e=(e=l(l([],u(this.staticUrls),!1),u(yr.getStaticConfigUrl()),!1).map((function(e){return pr(e)}))).filter((function(t,r){return e.indexOf(t)===r})),s.label=1;case 1:s.trys.push([1,6,7,8]),t=a(e),r=t.next(),s.label=2;case 2:return r.done?[3,5]:(n=r.value,this.logger.info(H.L_GET_STATIC_CONF_T,JSON.stringify({url:n})),i=Date.now(),[4,this.sendRequest("".concat(n,"/").concat(this.appkey))]);case 3:if(o=s.sent(),c=o.code,d=o.data,200===c)return this.logger.info(H.L_GET_STATIC_CONF_R,JSON.stringify({url:n,code:c,duration:Date.now()-i})),[2,d];this.logger.warn(H.L_GET_STATIC_CONF_R,JSON.stringify({url:n,code:c,duration:Date.now()-i})),s.label=4;case 4:return r=t.next(),[3,2];case 5:return[3,8];case 6:return p=s.sent(),f={error:p},[3,8];case 7:try{r&&!r.done&&(h=t.return)&&h.call(t)}finally{if(f)throw f.error}return[7];case 8:return[2]}}))}))}}),e}();exports.LogL=void 0,(Er=exports.LogL||(exports.LogL={}))[Er.STATISTICS=-2]="STATISTICS",Er[Er.RECORD=-1]="RECORD",Er[Er.FATAL=0]="FATAL",Er[Er.ERROR=1]="ERROR",Er[Er.WARN=2]="WARN",Er[Er.INFO=3]="INFO",Er[Er.DEBUG=4]="DEBUG";var Ir,Tr=function(){function e(e,t,r){Object.defineProperty(this,"_appkey",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"_id",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"_type",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"outputLevel",{enumerable:!0,configurable:!0,writable:!0,value:exports.LogL.WARN}),Object.defineProperty(this,"debug",{enumerable:!0,configurable:!0,writable:!0,value:this._log.bind(this,exports.LogL.DEBUG)}),Object.defineProperty(this,"info",{enumerable:!0,configurable:!0,writable:!0,value:this._log.bind(this,exports.LogL.INFO)}),Object.defineProperty(this,"warn",{enumerable:!0,configurable:!0,writable:!0,value:this._log.bind(this,exports.LogL.WARN)}),Object.defineProperty(this,"error",{enumerable:!0,configurable:!0,writable:!0,value:this._log.bind(this,exports.LogL.ERROR)}),Object.defineProperty(this,"__statistics",{enumerable:!0,configurable:!0,writable:!0,value:this._log.bind(this,exports.LogL.STATISTICS)}),Object.defineProperty(this,"record",{enumerable:!0,configurable:!0,writable:!0,value:this.__statistics})}return Object.defineProperty(e.prototype,"_write",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.tag,r=e.level,n=e.content,i=e.traceId;/^[\w-]+$/.test(t)?r!==exports.LogL.DEBUG&&this._handleWrite(e):console.error("".concat((new Date).toISOString(),"[").concat(this._id,"]['ERROR']: ").concat(t," | ").concat(n," | ").concat(i))}}),Object.defineProperty(e.prototype,"createTraceId",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"".concat(++e._traceIdCount)}}),Object.defineProperty(e.prototype,"getSessionId",{enumerable:!1,configurable:!0,writable:!0,value:function(){return it}}),Object.defineProperty(e.prototype,"_stdout",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.time,r=e.tag,n=e.content,i=e.traceId,o=e.level,s=e.loggerId;if(console&&!(o<=exports.LogL.FATAL||o>this.outputLevel)){var a=["error","warn","info","debug"][o-1],u="".concat(new Date(t).toISOString(),"[").concat(null!=s?s:this._id,"][").concat((a||"stat").toUpperCase(),"]: ").concat(r," | ").concat(n," | ").concat(i);console[a||"warn"](u)}}}),Object.defineProperty(e.prototype,"setOutputLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e){(function(e){return[exports.LogL.DEBUG,exports.LogL.INFO,exports.LogL.WARN,exports.LogL.ERROR].some((function(t){return t===e}))})(e)&&(this.outputLevel=e)}}),Object.defineProperty(e.prototype,"_log",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){var i={time:Date.now(),level:e,tag:t,content:r,traceId:n,loggerId:this._id,sessionId:this.getSessionId(),type:this._type};this._stdout(i),this._write(i)}}),Object.defineProperty(e.prototype,"summary",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,i,o,s){if(void 0===i&&(i={}),t.isOk){var a=null==o?void 0:o(t.data);this.info(e,JSON.stringify(n(n({isOk:!0},i),a)),r)}else{a=null==s?void 0:s(t.data);this.warn(e,JSON.stringify(n(n({code:t.code,msg:t.msg},i),a)),r)}}}),Object.defineProperty(e,"_traceIdCount",{enumerable:!0,configurable:!0,writable:!0,value:0}),e}(),Rr=function(){function e(e,t,r,n,i,o){void 0===o&&(o=!1),Object.defineProperty(this,"appkey",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"deviceId",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"deviceInfo",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"logDB",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(this,"logger",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"disableLogReport",{enumerable:!0,configurable:!0,writable:!0,value:o}),Object.defineProperty(this,"userId",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(this,"timer",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"started",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"reportFailedNumber",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"itvByNavi",{enumerable:!0,configurable:!0,writable:!0,value:6}),Object.defineProperty(this,"timesByNavi",{enumerable:!0,configurable:!0,writable:!0,value:5})}return Object.defineProperty(e.prototype,"checkStart",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i;return s(this,(function(o){return this.started?[2]:(this.userId=e.userId,!e.logSwitch||this.disableLogReport||(r=yr.getLogUrlPolicyList(e,this.logger),n=r.policy,i=r.addrs,this.started=!0,this.itvByNavi=n.itv,this.timesByNavi=n.times,i.length>0&&this.realtimeReport(i[0].addr,n.level,n.itv,t)),[2])}))}))}}),Object.defineProperty(e.prototype,"_sendLogs2Realtime",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return o(this,void 0,void 0,(function(){var i,o,a,u,l,c,d,p,f,h;return s(this,(function(s){switch(s.label){case 0:return this.logger.debug(H.L_REALTIME_LOG_O,"compress logs: ".concat(e.length)),[4,this.compressLogs(e)];case 1:return i=s.sent(),o=i.success,a=i.data,o?(this.logger.debug(H.L_REALTIME_LOG_O,"compress done",t),u=Mt(r)?r:"https://".concat(r),u+="?version=".concat("5.20.2-enterprise.10","&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:a,method:"POST"})]):(this.logger.warn(H.L_REALTIME_LOG_R,"compress failed",t),[2,{isOk:!1,itv:n}]);case 2:if(l=s.sent(),c=l.status,d=l.data,this.logger.debug(H.L_REALTIME_LOG_R,JSON.stringify({status:c,data:d}),t),200!==c)return this.reportFailedNumber>this.timesByNavi&&this.itvByNavi<60&&(n+=n),this.reportFailedNumber++,[2,{isOk:!1,itv:n}];if(this.reportFailedNumber=0,d)try{(h=JSON.parse(d)).nextTime&&(n=h.nextTime),p=h.level,f=h.logSwitch}catch(e){this.logger.warn(H.L_PARSE_JSON_E,JSON.stringify({error:null==e?void 0:e.stack}),t)}return[2,{isOk:!0,itv:n,level:p,logSwitch:f}]}}))}))}}),Object.defineProperty(e.prototype,"realtimeReport",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return o(this,void 0,void 0,(function(){var i,o,a,c,d,p,f,h,g,_,b,E,v=this;return s(this,(function(s){switch(s.label){case 0:return i=Date.now(),o=this.logDB.getTimestamp4RealtimeLog()||ot,a=Math.max(i-3e4,o+1),c=this.logger.createTraceId(),this.logger.debug(H.L_REALTIME_LOG_T,JSON.stringify({startTime:o,endTime:a,level:t,itv:r}),c),[4,this.logDB.getLogs(o,a,t,!0,n)];case 1:return d=s.sent(),p=d.dbReady,f=d.logs,p?[3,2]:(this.logger.warn(H.L_REALTIME_LOG_R,"get logs failed",c),[3,5]);case 2:return 0!==f.length?[3,3]:(this.logger.debug(H.L_REALTIME_LOG_R,"no logs",c),[3,5]);case 3:return f.length>0?[4,this._sendLogs2Realtime(f,c,e,r)]:[3,5];case 4:h=s.sent(),g=h.itv,_=h.level,b=h.logSwitch,h.isOk&&(E=Math.max.apply(Math,l([],u(f.map((function(e){return e.time}))),!1)),this.logDB.setTimestamp4RealtimeLog(E+1),0===b&&(this.started=!1),void 0!==_&&(t=_)),r=g,s.label=5;case 5:return this.started&&(r>=60&&this.itvByNavi<60&&(r=60),this.timer=setTimeout((function(){return v.realtimeReport(e,t,r,n)}),1e3*r)),[2]}}))}))}}),Object.defineProperty(e.prototype,"report",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i,a,u){return void 0===u&&(u=!1),o(this,void 0,void 0,(function(){var o,l,c,d,p,f,h,g,_,b;return s(this,(function(s){switch(s.label){case 0:return"web"!==r.toLowerCase()||this.disableLogReport?[2]:(o=this.logger.createTraceId(),this.logger.info(H.L_REPORT_FULL_LOG_T,JSON.stringify({startTime:e,endTime:t,logId:i,messageUId:a,isCloudControl:u}),o),[4,this.logDB.getLogs(e,t,exports.LogL.DEBUG,!1)]);case 1:return l=s.sent(),c=l.dbReady,d=l.logs,this.logger.info(H.L_REPORT_FULL_LOG_O,JSON.stringify({count:d.length}),o),p=Mt(n)?n:"https://".concat(n),p+="?version=".concat("5.20.2-enterprise.10","&appkey=").concat(this.appkey,"&userId=").concat(encodeURIComponent(this.userId),"&deviceId=").concat(this.deviceId,"&deviceInfo=").concat(this.deviceInfo,"&platform=Web&logId=").concat(i),c?d.length>0?[4,this.compressLogs(d)]:[3,3]:[3,5];case 2:return h=s.sent(),g=h.success,_=h.data,f=g?_:"compress failed",[3,4];case 3:f="no data",s.label=4;case 4:return[3,6];case 5:f="no database",s.label=6;case 6:return this.logger.debug(H.L_REPORT_FULL_LOG_O,"compress done",o),u&&(p+="&source=cloud"),[4,this.send({url:p,body:f,method:"POST"})];case 7:return b=s.sent().status,this.logger.info(H.L_REPORT_FULL_LOG_R,JSON.stringify({status:b}),o),[2]}}))}))}}),Object.defineProperty(e.prototype,"stop",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.timer&&(clearTimeout(this.timer),this.timer=null),this.started=!1}}),e}(),Cr=function(e){var t=e.sessionId,r=e.level,n=e.loggerId,i=e.traceId,o=e.time,s=e.tag,a=e.type,u=e.content;Tt(u)||(u=JSON.stringify(u));var l=r<0?u||"":JSON.stringify({content:u,traceId:i,from:n});return l='"'.concat(l.replace(/"/g,'""'),'"'),"".concat(t,",").concat(o,",").concat(a,",").concat(r,",").concat(s,",").concat(l,"\n")},Or=function(){function e(){}var t,r,n,i,o,s;return Object.defineProperty(e,"start",{enumerable:!1,configurable:!0,writable:!0,value:function(e){c(this,t,"f",r)||(d(this,t,e,"f",r),e.info(H.L_EVENT_LOOP_BLOCKING_S,"start"),c(this,t,"m",s).call(this))}}),Object.defineProperty(e,"stop",{enumerable:!1,configurable:!0,writable:!0,value:function(){c(this,t,"f",r)&&(c(this,t,"f",r).info(H.L_EVENT_LOOP_BLOCKING_S,"stop"),d(this,t,null,"f",r),c(this,t,"f",n)&&(clearTimeout(c(this,t,"f",n)),d(this,t,null,"f",n)))}}),t=e,s=function e(){var s=this,a=Date.now();d(this,t,setTimeout((function(){var n=Date.now()-a;n>=c(s,t,"f",o)&&c(s,t,"f",r).warn(H.L_EVENT_LOOP_BLOCKING_S,"delta time: ".concat(n,"ms")),c(s,t,"m",e).call(s)}),c(this,t,"f",i)),"f",n)},r={value:null},n={value:null},i={value:30},o={value:1500},e}();!function(e){e[e.init=1]="init",e[e.newWorkChange=2]="newWorkChange",e[e.other=3]="other"}(Ir||(Ir={}));var Sr=function(){function e(e){Object.defineProperty(this,"reporter",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"logId",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(this,"uploadTask",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"taskLock",{enumerable:!0,configurable:!0,writable:!0,value:!0})}return Object.defineProperty(e.prototype,"uploadLogCmdTask",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this.uploadTask.push(e),this.enqueueTask()}}),Object.defineProperty(e.prototype,"reportLogCmdTask",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r,n,i,o=this;this.taskLock=!1;var s=null!==(t=e.startTime)&&void 0!==t?t:0,a=null!==(r=e.endTime)&&void 0!==r?r:0,u=null!==(n=e.platform)&&void 0!==n?n:"",l=null!==(i=e.uri)&&void 0!==i?i:"";e.logId!==this.logId&&""!==l&&(this.logId=e.logId,this.reporter.report(s,a,u,l,e.logId,"",!0).finally((function(){o.taskLock=!0,o.uploadTask.length>0&&o.enqueueTask()})))}}),Object.defineProperty(e.prototype,"enqueueTask",{enumerable:!1,configurable:!0,writable:!0,value:function(){if(this.taskLock){var e=this.uploadTask.shift();e&&this.reportLogCmdTask(e)}}}),e}();var Ar,Pr,Nr,wr,Mr=function(){function e(e,t,r){Object.defineProperty(this,"logger",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"appkey",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"reporter",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"isEable",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"expire",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"interval",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"timestamp",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"lastRequestTime",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"uploadTaskManage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"changeAreaCode",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_cache",{enumerable:!0,configurable:!0,writable:!0,value:null}),this.uploadTaskManage=new Sr(r)}return Object.defineProperty(e.prototype,"init",{enumerable:!1,configurable:!0,writable:!0,value:function(){try{var e=this.getLocalCloudControllerCache();this._cache=e?JSON.parse(e):{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(e){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)))}}),Object.defineProperty(e.prototype,"isExire",{enumerable:!1,configurable:!0,writable:!0,value:function(){return(new Date).getTime()-this.timestamp<this.expire}}),Object.defineProperty(e.prototype,"isOverclock",{enumerable:!1,configurable:!0,writable:!0,value:function(){return(new Date).getTime()-this.lastRequestTime<this.interval}}),Object.defineProperty(e.prototype,"logCmdMsgTasks",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;e.uploadLog&&e.uploadLog.tasks.forEach((function(e){e.objectName===exports.MessageType.LOG_COMMAND&&t.uploadTaskManage.uploadLogCmdTask(e)}))}}),Object.defineProperty(e.prototype,"dataHandle",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this._cache;t.lastRequestTime=this.lastRequestTime,Lt(e)&&(t.timestamp=e.timestamp,e.uploadLog&&!e.uploadLog.temporary&&(t.uploadLog=e.uploadLog),e.cc&&!e.cc.temporary&&(t.cc=e.cc),e.mrtr&&!e.mrtr.temporary&&(t.mrtr=this._handleMrtrData(e.mrtr)),e.mrtr&&this.setMRTRConfig(this._handleMrtrData(e.mrtr))),this.setCloudControllerCache(t),this.expire=t.cc.expire,this.interval=t.cc.interval,this.timestamp=t.timestamp,this.logCmdMsgTasks(e)}}),Object.defineProperty(e.prototype,"request",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n,i,o,a,u,l,c,d,p,f;return s(this,(function(s){switch(s.label){case 0:return!this.isEable&&t===Ir.init&&this.isExire()?(this.logger.info(H.L_CLOUD_DISABLED,JSON.stringify({msg:"cloud controller is disabled"})),[2,this.timestamp]):!this.isEable&&t===Ir.newWorkChange&&this.isOverclock()?(this.logger.info(H.L_CLOUD_OVERCLOCK,JSON.stringify({msg:"cloud controller is overclock"})),[2,this.timestamp]):(n=pr(e),this.lastRequestTime=(new Date).getTime(),i="".concat(n,"/v1/config"),o={"Content-Type":"application/json","RC-App-Key":this.appkey},r&&(o["RC-Token"]=r),a={platform:"web",version:"5.20.2-enterprise.10",timestamp:this.timestamp},this.logger.record(pe.L_CLOUD_INFO_FETCH_T,JSON.stringify({appKey:this.appkey,timestamp:this.timestamp,token:!!r,uri:i})),[4,this.httpRequest(i,exports.HttpMethod.POST,o,a)]);case 1:return u=s.sent(),l=u.code,c=u.data,this.logger.record(pe.L_CLOUD_INFO_FETCH_R,JSON.stringify({appkey:this.appkey,info:c})),l===exports.ErrorCode.CLOUD_DATA_CENTER_INVALID&&c&&c.targetRegion?(d=c.targetRegion,this.changeAreaCode===d?[2,this.timestamp]:(p=yr.setAreaCode(d),this.logger.info(H.L_CLOUD_SET_AREA_CODE_O,JSON.stringify({isChangeSuccess:p,originAreaCode:yr.getAreaCode(),newAreaCode:d})),this.changeAreaCode=d,(f=yr.getCloudControllerUrl(d))[0]?[2,this.request(f[0],Ir.other)]:(this.logger.info(H.L_CLOUD_APPKEY_REGION_E,JSON.stringify({appkey:this.appkey,uri:i,msg:"appkey region error"})),[2,this.timestamp]))):(c&&this.dataHandle(c),[2,this.timestamp||this.lastRequestTime])}}))}))}}),Object.defineProperty(e.prototype,"_handleMrtrData",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return{chatroom:(null==e?void 0:e.chatroom)||0,group:(null==e?void 0:e.group)||0,private:(null==e?void 0:e.private)||0,ultraGroup:(null==e?void 0:e.ultraGroup)||0,temporary:!!(null==e?void 0:e.temporary)}}}),e}(),Lr=function(e){return e===exports.ErrorCode.RC_CONN_REDIRECTED},Ur=function(e){function r(t,r,n){var i=e.call(this)||this;return Ar.add(i),Object.defineProperty(i,"appkey",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(i,"navi",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(i,"logger",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(i,"_fromSuspend",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(i,"token",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(i,"curCmpUrl",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(i,"retryCount",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(i,"uuid",{enumerable:!0,configurable:!0,writable:!0,value:""}),wr.set(i,0),Object.defineProperty(i,"_doConnectReason",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(i,"_network",{enumerable:!0,configurable:!0,writable:!0,value:{status:!0,type:we.UNKONWN}}),Object.defineProperty(i,"_checkAliveTimer",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(i,"_crtConnectionStatus",{enumerable:!0,configurable:!0,writable:!0,value:exports.RCConnectionStatus.DISCONNECTED}),Object.defineProperty(i,"_crtUserId",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(i,"_openCallPlus",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(i,"cmpWeightCache",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(i,"_crtConnectionTask",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(i,"reconnectTimer",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(i,"_failedCount",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(i,"ALLOW_FAILED_TIMES",{enumerable:!0,configurable:!0,writable:!0,value:2}),i}return t(r,e),Object.defineProperty(r.prototype,"getToken",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.token}}),Object.defineProperty(r.prototype,"cid",{get:function(){return"".concat(this.uuid,"_").concat(this.retryCount)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"getCurrentUserId",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._crtUserId}}),Object.defineProperty(r.prototype,"setConnectionStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){if(this._crtConnectionStatus!==e){if(this._crtConnectionStatus===exports.RCConnectionStatus.DISCONNECTED&&e===exports.RCConnectionStatus.CONNECTING&&(this._doConnectReason=Ae.CONNECT,c(this,Ar,"m",Nr).call(this)),this._crtConnectionStatus===exports.RCConnectionStatus.CONNECTED&&e===exports.RCConnectionStatus.SUSPENDED&&(t===exports.ErrorCode.RC_PING_EXCEED_LIMIT?this._doConnectReason=Ae.TIMEOUT:t===exports.ErrorCode.RC_CONN_REDIRECTED?this._doConnectReason=Ae.REDIRECTED:this._doConnectReason=Ae.RECONNECT),this._crtConnectionStatus===exports.RCConnectionStatus.CONNECTED){var r={bid:cr(),cod:t,net:this.getNetwork().type,dur:Date.now()-c(this,wr,"f"),cid:this.cid};this.logger.record(pe.IM_CONNECTION_DURATION,JSON.stringify(r)),e===exports.RCConnectionStatus.SUSPENDED&&c(this,Ar,"m",Nr).call(this)}switch(this._crtConnectionStatus=e,e){case exports.RCConnectionStatus.CONNECTED:this.logger.info(H.L_CONNECT_S,"status: ".concat(e)),this.checkAlive(),c(this,Ar,"m",Pr).call(this).emit("onConnected",this._fromSuspend);break;case exports.RCConnectionStatus.CONNECTING:this.logger.warn(H.L_CONNECT_S,"status: ".concat(e)),c(this,Ar,"m",Pr).call(this).emit("onConnecting");break;case exports.RCConnectionStatus.SUSPENDED:this._fromSuspend=!0,this.logger.warn(H.L_CONNECT_S,"status: ".concat(e,", code: ").concat(t)),Lr(t)&&this.clearCmpWeightCache(),this._checkAliveTimer&&clearTimeout(this._checkAliveTimer),c(this,Ar,"m",Pr).call(this).emit("onSuspend",t);break;default:this._fromSuspend=!1,this._crtUserId="",this.logger.warn(H.L_CONNECT_S,"status: ".concat(e,", code: ").concat(t)),this.clearCmpWeightCache(),this._checkAliveTimer&&clearTimeout(this._checkAliveTimer),c(this,Ar,"m",Pr).call(this).emit("onDisconnected",t)}}}}),Object.defineProperty(r.prototype,"getConnectionStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._crtConnectionStatus}}),Object.defineProperty(r.prototype,"isConnected",{get:function(){return this._crtConnectionStatus===exports.RCConnectionStatus.CONNECTED},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"setNetwork",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){if(!t){var r={cid:this.cid,cn:e.type,on:this._network.type};this.logger.record(pe.IM_NETWORK_CHANGE,JSON.stringify(r))}this._network=e}}),Object.defineProperty(r.prototype,"getNetwork",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._network}}),Object.defineProperty(r.prototype,"connect",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return o(this,void 0,void 0,(function(){var i,o,a;return s(this,(function(s){switch(s.label){case 0:return this._crtConnectionStatus===exports.RCConnectionStatus.CONNECTED?[2,ht(this._crtUserId)]:this._crtConnectionTask?[2,this._crtConnectionTask]:(this._openCallPlus=r,this.token=e,this.setConnectionStatus(exports.RCConnectionStatus.CONNECTING),[4,this.try2Connect(e,t,!1,n,!0)]);case 1:return i=s.sent(),o=i.code,a=i.data,o!==exports.ErrorCode.SUCCESS?(this.setConnectionStatus(exports.RCConnectionStatus.DISCONNECTED,o),[2,gt(o)]):(this.setConnectionStatus(exports.RCConnectionStatus.CONNECTED),[2,ht(a)])}}))}))}}),Object.defineProperty(r.prototype,"try2Connect",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){return o(this,void 0,void 0,(function(){var o;return s(this,(function(s){switch(s.label){case 0:return this._crtConnectionTask?[2,this._crtConnectionTask]:(this._crtConnectionTask=this.createConnectionTask(e,t,r,n,i),[4,this._crtConnectionTask]);case 1:return o=s.sent(),this._crtConnectionTask=null,[2,o]}}))}))}}),Object.defineProperty(r.prototype,"createConnectionTask",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){return o(this,void 0,void 0,(function(){var o,a,u,l,c,p,f,h,g,_;return s(this,(function(s){switch(s.label){case 0:return o={cid:this.cid,reason:this._doConnectReason,net:this.getNetwork().type,spr:1,sts:Date.now(),timelimit:0},this.logger.record(pe.IM_STATS_CS,JSON.stringify(o)),a={retryCount:this.retryCount,uuid:this.uuid,type:this.getNetwork().type,reason:this._doConnectReason},[4,this.navi.request(e,r,!1,n,a)];case 1:return u=s.sent(),l=u.code,c=u.data,l!==exports.ErrorCode.SUCCESS?[2,gt(l)]:(p=c,this.logger.info(H.L_CONNECT_T,JSON.stringify({token:e,reconnectKickEnable:t}),n),[4,this._connectWithToken(e.replace(/@.+$/,"@"),p,t,n)]);case 2:return f=s.sent(),h=f.code,g=f.data,i||h===exports.ErrorCode.SUCCESS||(this.retryCount+=1),Lr(h)?(this.logger.warn(H.L_CONNECT_R,"redirect code: ".concat(h),n),this.clearCmpWeightCache(),[2,this.createConnectionTask(e,t,!0,n,i)]):[exports.ErrorCode.RC_TCP_RESET,exports.ErrorCode.RC_CONN_ACK_TIMEOUT,exports.ErrorCode.RC_TCP_DISCONNECTED_NO_RMTP,exports.ErrorCode.CONNECTION_REFUSED].includes(h)&&this.cmpWeightCache&&this.cmpWeightCache.length>1?(this.updateCmpWeight(this.curCmpUrl,!1),_=this.cmpWeightCache.every((function(e){return e.failed})),i&&_?(this.logger.warn(H.L_CONNECT_R,"cpp code:".concat(h,",reture code:").concat(exports.ErrorCode.SERVER_UNAVAILABLE),n),[2,gt(exports.ErrorCode.SERVER_UNAVAILABLE)]):(this.logger.warn(H.L_CONNECT_R,"cmp ack timeout, code: ".concat(h),n),this.setConnectionStatus(exports.RCConnectionStatus.SUSPENDED,h),this.setConnectionStatus(exports.RCConnectionStatus.CONNECTING),[2,this.createConnectionTask(e,t,!1,n,i)])):h!==exports.ErrorCode.SUCCESS?(this.logger.warn(H.L_CONNECT_R,"code: ".concat(h),n),[2,gt(h)]):(this.logger.info(H.L_CONNECT_R,"userId: ".concat(g),n),d(this,wr,Date.now(),"f"),this._crtUserId=g,[2,ht(g)])}}))}))}}),Object.defineProperty(r.prototype,"try2Reconnect",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i=this;return s(this,(function(a){return r=this.logger.createTraceId(),this.logger.debug(H.T,"try2Reconnect -> ignoreNaviCache: ".concat(e,", reason: ").concat(t),r),this.stopReconnectTimer(),n=function(){return o(i,void 0,void 0,(function(){var i;return s(this,(function(o){switch(o.label){case 0:return this._crtConnectionStatus!==exports.RCConnectionStatus.SUSPENDED?[2]:(this.setConnectionStatus(exports.RCConnectionStatus.CONNECTING,t),[4,this.try2Connect(this.token,!0,e,r,!1)]);case 1:return i=o.sent().code,this.reconnectTimer=null,i===exports.ErrorCode.SUCCESS?(this.setConnectionStatus(exports.RCConnectionStatus.CONNECTED),[2]):[exports.ErrorCode.SERVER_UNAVAILABLE,exports.ErrorCode.TIMEOUT,exports.ErrorCode.RC_SOCKET_DISCONNECTED,exports.ErrorCode.RC_SOCKET_NOT_CREATED,exports.ErrorCode.RC_CONN_ACK_TIMEOUT,exports.ErrorCode.RC_TCP_RESET,exports.ErrorCode.RC_NAVI_REQ_FAILED,exports.ErrorCode.RC_NETWORK_DOWN,exports.ErrorCode.RC_TCP_DISCONNECTED_NO_RMTP].includes(i)?(this._crtConnectionStatus!==exports.RCConnectionStatus.CONNECTING||(this.setConnectionStatus(exports.RCConnectionStatus.SUSPENDED,i),this.reconnectTimer=setTimeout(n,5e3)),[2]):(this.setConnectionStatus(exports.RCConnectionStatus.DISCONNECTED,i),[2])}}))}))},n(),[2]}))}))}}),Object.defineProperty(r.prototype,"onDisconnectByServer",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this;return Lr(e)?(this.setConnectionStatus(exports.RCConnectionStatus.SUSPENDED,e),void this.try2Reconnect(!0,e)):e===exports.ErrorCode.RC_UDP_DISCONNECTED?(this.setConnectionStatus(exports.RCConnectionStatus.SUSPENDED,e),void setTimeout((function(){r.try2Reconnect(!0,e)}),1e3*(t||0))):void this.setConnectionStatus(exports.RCConnectionStatus.DISCONNECTED,e)}}),Object.defineProperty(r.prototype,"onDisconenctUnusual",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this.setConnectionStatus(exports.RCConnectionStatus.SUSPENDED,e),this.try2Reconnect(!1,e)}}),Object.defineProperty(r.prototype,"checkAlive",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t,r=this;return s(this,(function(n){switch(n.label){case 0:return this._crtConnectionStatus!==exports.RCConnectionStatus.CONNECTED?(this._failedCount=0,this.logger.debug(H.L_CHECK_ALIVE_IM_S,"stop ping because of no connection"),[2]):(e=this.logger.createTraceId(),this.logger.debug(H.L_CHECK_ALIVE_IM_T,null,e),[4,this.sendPing(15e3)]);case 1:return(t=n.sent())===exports.ErrorCode.SUCCESS?(this.logger.debug(H.L_CHECK_ALIVE_IM_R,t,e),this._failedCount=0,this._checkAliveTimer=setTimeout((function(){return r.checkAlive()}),15e3),[2]):this._crtConnectionStatus!==exports.RCConnectionStatus.CONNECTED?[2]:(this._failedCount+=1,this.logger.debug(H.L_CHECK_ALIVE_IM_R,"code: ".concat(t,", count: ").concat(this._failedCount),e),this._failedCount<this.ALLOW_FAILED_TIMES?[2,this.checkAlive()]:(this._failedCount=0,this.logger.warn(H.L_CHECK_ALIVE_IM_S,"ping timeout, close connection to reconnect!"),[4,this.close(!0)]));case 2:return n.sent(),this.setConnectionStatus(exports.RCConnectionStatus.SUSPENDED,exports.ErrorCode.RC_PING_EXCEED_LIMIT),this.try2Reconnect(!1,exports.ErrorCode.RC_PING_EXCEED_LIMIT),[2]}}))}))}}),Object.defineProperty(r.prototype,"disconnect",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){return s(this,(function(r){switch(r.label){case 0:return this.stopReconnectTimer(),this._crtConnectionTask?[4,this._crtConnectionTask]:[3,2];case 1:r.sent(),r.label=2;case 2:return this.setConnectionStatus(exports.RCConnectionStatus.DISCONNECTED,exports.ErrorCode.ACTIVE_DISCONNECT),[2,this.close(!1,e,t)]}}))}))}}),Object.defineProperty(r.prototype,"stopReconnectTimer",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null)}}),Object.defineProperty(r.prototype,"getCmpList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){if(this.cmpWeightCache&&this.cmpWeightCache.length>0)return l([],u(this.cmpWeightCache),!1);var r=Kt(e,t);return this.cmpWeightCache=l([],u(r),!1),l([],u(r),!1)}}),Object.defineProperty(r.prototype,"updateCmpWeight",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){if(this.cmpWeightCache){var n=this.cmpWeightCache.find((function(t){return r?t.addr===e&&t.protocol===q.QUIC:t.addr===e}));if(n)if(t){var i=Math.max.apply(Math,l([],u(this.cmpWeightCache.map((function(e){return e.weight}))),!1));n.weight!==i&&(n.weight=i+1)}else{var o=Math.min.apply(Math,l([],u(this.cmpWeightCache.map((function(e){return e.weight}))),!1));n.weight!==o&&(n.weight=o-1),n.failed=!0}}}}),Object.defineProperty(r.prototype,"clearCmpWeightCache",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.cmpWeightCache=void 0}}),Object.defineProperty(r.prototype,"reconnect",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){this.token=e,this._openCallPlus=r,this.onDisconenctUnusual(n)}}),r}(pt);wr=new WeakMap,Ar=new WeakSet,Pr=function(){return this},Nr=function(){this.uuid=nt.gen(),this.retryCount=0};var Dr=function(e){return e.replace(/@.+$/,"@")},xr=function(){function e(e,t,r,n,i,o){void 0===n&&(n=!0),void 0===i&&(i=!0),void 0===o&&(o=!1),Object.defineProperty(this,"appkey",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"logger",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"staticConfigManager",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"isRequestProfile",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(this,"isUseDynamicNaviUrl",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"useNaviV2",{enumerable:!0,configurable:!0,writable:!0,value:o}),Object.defineProperty(this,"crtRequest",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"_environment",{enumerable:!0,configurable:!0,writable:!0,value:"default"})}return Object.defineProperty(e.prototype,"getCatchKey",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return e+(this._environment?"-".concat(this._environment):"")}}),Object.defineProperty(e.prototype,"request",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){return o(this,void 0,void 0,(function(){var o;return s(this,(function(s){switch(s.label){case 0:return this.crtRequest?[2,this.crtRequest]:(this.crtRequest=this.sendRequest(e,t,r,n,i),[4,this.crtRequest]);case 1:return o=s.sent(),this.crtRequest=null,[2,o]}}))}))}}),Object.defineProperty(e.prototype,"sendRequest",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){var a;return o(this,void 0,void 0,(function(){var o,u,l,c,d,p,f,h,g,_,b,E,v,y,m,I,T;return s(this,(function(s){switch(s.label){case 0:return o=Dr(e),u=this.getNaviCache(o),!t&&u&&(l=u.timestamp,c=u.naviInfo,r||Date.now()-l<Ue)?(this.logger.info(H.L_REQUEST_T,JSON.stringify({fromCache:!0,naviInfo:c}),n),i&&(d=i.uuid,p=i.retryCount,f=i.reason,h={bid:cr(),ptc:Re.NAVI,cod:exports.ErrorCode.SUCCESS,net:i.type,dur:0,spr:1,pr:null!==(a=c.type)&&void 0!==a?a:0,hos:"",cache:Ce.LOCAL,v:Oe.CURRENT,rsn:f,cid:"".concat(d,"_").concat(p),count:p},this.logger.record(pe.IM_NAVI,JSON.stringify(h),n)),[2,ht(c)]):(g=yr.getNaviUrlList(e,this.isUseDynamicNaviUrl),this.logger.info(H.L_GET_NAVI_T,JSON.stringify({token:e,uris:g}),n),[4,this.requestHandler(g,e,n,i)]);case 1:return _=s.sent(),b=_.code,E=_.data,b===exports.ErrorCode.RC_NAVI_REQ_FAILED&&this.isRequestProfile?[4,this.staticConfigManager.getStaticConfig()]:[3,4];case 2:return(null==(v=s.sent())?void 0:v.navi)&&(null==v?void 0:v.navi.length)>0?(y=v.navi,[4,this.requestHandler(y,e,n,i)]):[3,4];case 3:m=s.sent(),b=m.code,E=m.data,s.label=4;case 4:return b!==exports.ErrorCode.SUCCESS?(this.logger.warn(H.L_GET_NAVI_R,b,n),[2,gt(b)]):(I=E).code&&200!==I.code?(this.logger.warn(H.L_GET_NAVI_R,I.code,n),[2,gt(this.transHttpCode(I.code))]):Kt(I).length>0?(this.logger.info(H.L_GET_NAVI_R,JSON.stringify({naviInfo:I}),n),this.setNaviCache(o,I),[2,ht(I)]):(T={server:I.server,backupServer:I.backupServer,serverAddr:I.serverAddr,bs:I.bs},this.logger.warn(H.L_GET_NAVI_R,"navi server address invalid: ".concat(JSON.stringify(T)),n),[2,gt(exports.ErrorCode.SERVER_UNAVAILABLE)])}}))}))}}),Object.defineProperty(e.prototype,"requestHandler",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return o(this,void 0,void 0,(function(){var i,o,a,u,l,c,d,p,f;return s(this,(function(s){switch(s.label){case 0:i=0,o=e.length,s.label=1;case 1:return i<o?(a=i===e.length-1,u=this.useV2Navi()?this.httpRequestV2:this.httpRequest,l=Date.now(),[4,u.call(this,e[i],this.appkey,t,r,a)]):[3,4];case 2:if(c=s.sent(),d=c.code,p=c.data,f={bid:cr(),ptc:Re.NAVI,cod:d,net:null==n?void 0:n.type,dur:Date.now()-l,spr:1,pr:(null==p?void 0:p.type)||0,hos:e[i],cache:Ce.REQUEST,v:Oe.CURRENT,rsn:null==n?void 0:n.reason,cid:"".concat(null==n?void 0:n.uuid,"_").concat(null==n?void 0:n.retryCount),count:null==n?void 0:n.retryCount},this.logger.record(pe.IM_NAVI,JSON.stringify(f),r),[exports.ErrorCode.SUCCESS,exports.ErrorCode.RC_CONN_TOKEN_INCORRECT,exports.ErrorCode.RC_LICENSE_EXPIRED].includes(d))return[2,d===exports.ErrorCode.SUCCESS?ht(p):gt(d)];s.label=3;case 3:return i+=1,[3,1];case 4:return[2,gt(exports.ErrorCode.RC_NAVI_REQ_FAILED)]}}))}))}}),Object.defineProperty(e.prototype,"transHttpCode",{enumerable:!1,configurable:!0,writable:!0,value:function(e){switch(e){case 401:case 403:return exports.ErrorCode.RC_CONN_TOKEN_INCORRECT;case 416:return exports.ErrorCode.RC_LICENSE_EXPIRED;default:return exports.ErrorCode.RC_NAVI_REQ_FAILED}}}),Object.defineProperty(e.prototype,"getNaviInfoFromCache",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this.getNaviCache(Dr(e));return t?t.naviInfo:null}}),Object.defineProperty(e.prototype,"updateVoipCallInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this.getNaviInfoFromCache(e);r&&this.setNaviCache(Dr(e),n(n({},r),{voipCallInfo:t}))}}),Object.defineProperty(e.prototype,"getNaviV2RequestOption",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r=e.uri,n=e.token,i=e.platform,o=e.protocol,s=e.mac;t="".concat(r,"/v2/navi.json?cloud=").concat(1);var a="token=".concat(encodeURIComponent(n),"&v=").concat(je,"&platfrom=").concat(i);return s&&(a+="&m=".concat(s)),{method:"POST",headers:{"RC-Appkey":this.appkey,"Content-Type":"Application/x-www-form-urlencoded","RC-Negotiate":"conn=".concat(o,";rtc=4;log=2;iptype=v4,v6")},body:a,url:t,timeout:1e4}}}),Object.defineProperty(e.prototype,"useV2Navi",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.useNaviV2}}),e}(),jr=new Map([["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:StreamMsg",{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:RcNtf",{isCounted:!1,isPersited:!0}],["RC:CmdMsg",{isCounted:!1,isPersited:!1}],["RC:TypSts",{isCounted:!1,isPersited:!1,isStatusMessage:!0}],["RC:PSCmd",{isCounted:!1,isPersited:!1}],["RC:SRSMsg",{isCounted:!1,isPersited:!1}],["RC:RcCmd",{isCounted:!1,isPersited:!0}],["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,isStatusMessage:!0}],["RC:RLJoin",{isCounted:!1,isPersited:!1}],["RC:RLQuit",{isCounted:!1,isPersited:!1}],["RC:RL",{isCounted:!1,isPersited:!1,isStatusMessage:!0}],["RC:CCConfigChangeRequestMsg",{isCounted:!1,isPersited:!1}]]);function Vr(e){return jr.get(e)||{isCustom:!0,isPersited:!1,isCounted:!1,isStatusMessage:!1}}function Gr(e){return jr.has(e)}var kr,Fr,Br,Hr={TIMESTAMP:0,TOP:1,BLOCKED:2,UNREAD:3,ALL:4,PAGE_INDEX:5},qr=function(e,t){var r=vt.create(e).isObject("filter",t,!0).fail(exports.ErrorCode.CONVER_GET_ERROR,"filter must be an object").isValueOf("type",t.type,Hr,!0).fail(exports.ErrorCode.CONVER_GET_ERROR,"filter type invalid"),n=t.type,i=t.params;switch(n){case Hr.TIMESTAMP:!function(e,t){e.isObject("params",t,!0).fail(exports.ErrorCode.CONVER_GET_ERROR,"filter's params must be an object").isInteger("startTime",null==t?void 0:t.startTime,!0).fail(exports.ErrorCode.INVALID_PARAMETER_START_TIME).isInteger("count",null==t?void 0:t.count,!0).fail(exports.ErrorCode.INVALID_PARAMETER_COUNT).isLimitedInteger("order",null==t?void 0:t.order,0,1).fail(exports.ErrorCode.INVALID_PARAMETER_ORDER).validate("channelId",null==t?void 0:t.channelId,Dt).fail(exports.ErrorCode.INVALID_PARAMETER_CHANNEL_ID).isTypedArray("conversationTypes",null==t?void 0:t.conversationTypes,(function(e){return me(e,be)})).fail(exports.ErrorCode.INVALID_PARAMETER_CONVERSATION_TYPE_LIST)}(r,i);break;case Hr.BLOCKED:break;case Hr.TOP:!function(e,t){e.isObject("params",t).fail(exports.ErrorCode.CONVER_GET_ERROR,"filter's params must be an object or undefined").isTypedArray("conversationTypes",null==t?void 0:t.conversationTypes,(function(e){return me(e,be)})).fail(exports.ErrorCode.INVALID_PARAMETER_CONVERSATION_TYPE_LIST).validate("channelId",null==t?void 0:t.channelId,Dt).fail(exports.ErrorCode.INVALID_PARAMETER_CHANNEL_ID)}(r,i);break;case Hr.UNREAD:!function(e,t){e.isObject("params",t).fail(exports.ErrorCode.CONVER_GET_ERROR,"filter's params must be an object or undefined").isTypedArray("conversationTypes",null==t?void 0:t.conversationTypes,(function(e){return me(e,be)})).fail(exports.ErrorCode.INVALID_PARAMETER_CONVERSATION_TYPE_LIST)}(r,i);break;case Hr.ALL:!function(e,t){e.isObject("params",t).fail(exports.ErrorCode.CONVER_GET_ERROR,"filter's params must be an object or undefined").validate("channelId",null==t?void 0:t.channelId,Dt).fail(exports.ErrorCode.INVALID_PARAMETER_CHANNEL_ID)}(r,i);break;case Hr.PAGE_INDEX:!function(e,t){e.isObject("params",t).fail(exports.ErrorCode.CONVER_GET_ERROR,"filter's params must be an object or undefined").isInteger("index",null==t?void 0:t.index,!0).fail(exports.ErrorCode.CONVER_GET_ERROR,"page index must be an integer").isInteger("limit",null==t?void 0:t.limit,!0).fail(exports.ErrorCode.INVALID_PARAMETER_LIMIT).isTypedArray("conversationTypes",null==t?void 0:t.conversationTypes,(function(e){return me(e,be)})).fail(exports.ErrorCode.INVALID_PARAMETER_CONVERSATION_TYPE_LIST)}(r,i)}return r.result()},Yr=function(){return!("undefined"==typeof uni||!function(e){for(var t=["request","getSystemInfo"],r=0,n=t.length;r<n;r++)if(!e[t[r]])return!1;return!0}(uni))},Kr=function(){function e(e){kr.add(this),Fr.set(this,void 0),Object.defineProperty(this,"_logger",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),d(this,Fr,e,"f"),this._logger=e.logger}return Object.defineProperty(e.prototype,"open",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){return s(this,(function(t){return e=e.sort((function(e,t){return t.weight-e.weight})),[2,c(this,kr,"m",Br).call(this,e,c(this,Fr,"f"))]}))}))}}),e}();Fr=new WeakMap,kr=new WeakSet,Br=function e(t,r){return o(this,void 0,void 0,(function(){var n,i,a,u=this;return s(this,(function(l){switch(l.label){case 0:return 0===t.length?[2,gt(exports.ErrorCode.STREAM_MESSAGE_REQUEST_FAIL,"All addrs failed")]:(n=t.shift(),i=pr(n.addr,n.protocol),i="".concat(i,"/v3/message/get_stream.json?sdkVersion=").concat("5.20.2-enterprise.10","&platform=Websocket&messageUID=").concat(r.msgUId),this._logger.info(H.L_REQ_STREAM_MSG_CONTENT_O,"try open -> ".concat(i)),[4,this._openHandler(i,r)]);case 1:return[2,(a=l.sent()).or((function(n){return o(u,void 0,void 0,(function(){return s(this,(function(i){return-1===n?[2,c(this,kr,"m",e).call(this,t,r)]:[2,a]}))}))}))]}}))}))};var Qr=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return t(r,e),Object.defineProperty(r.prototype,"_openHandler",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i,o,a=this;return s(this,(function(s){return r=It(),n=r.resolve,i=r.promise,(o=new XMLHttpRequest).open("GET",e,!0),o.timeout=t.timeout,o.ontimeout=function(){a._logger.warn(H.L_REQ_STREAM_MSG_CONTENT_E,"timeout -> ".concat(e)),n(gt(-1,"timeout"))},o.onreadystatechange=function(r){if(o.readyState===XMLHttpRequest.HEADERS_RECEIVED){var i=o.getResponseHeader("Content-Type"),s=null==i?void 0:i.startsWith("text/event-stream");if(200===o.status&&s){n(ht());var u=0;o.onprogress=function(e){var r=o.response.slice(u);u=o.response.length,t.onRawContent(r)},o.onerror=function(r){a._logger.warn(H.L_REQ_STREAM_MSG_CONTENT_E,"network error in transit -> ".concat(e)),o.onprogress=null,o.abort(),t.onNetworkError(exports.ErrorCode.STREAM_MESSAGE_REQUEST_FAIL)}}else o.onloadend=function(){var e=JSON.parse(o.response);n(gt(e.code,e.message))}}},o.onerror=function(t){a._logger.warn(H.L_REQ_STREAM_MSG_CONTENT_E,"req fail -> ".concat(e)),n(gt(-1))},o.setRequestHeader("Content-Type","application/json;charset=UTF-8"),o.setRequestHeader("App-Key",t.appkey),o.setRequestHeader("Authorization","Bearer ".concat(t.token)),o.send(),[2,i]}))}))}}),r}(Kr),Wr=Yr();var Jr=null,zr=function(e){return o(void 0,void 0,void 0,(function(){var t;return s(this,(function(r){switch(r.label){case 0:return[4,Xr.getNetworkType()];case 1:return t=r.sent(),Jr({status:"online"===e.type,type:t}),[2]}}))}))};var Zr,Xr={tag:"browser",httpReq:function(e){return br(e).result()},localStorage:null===window||void 0===window?void 0:window.localStorage,sessionStorage:null===window||void 0===window?void 0:window.sessionStorage,useNavi:!0,connectPlatform:"",isFromUniapp:Wr,createWebSocket:function(e,t){var r=new WebSocket(e,t);return r.binaryType="arraybuffer",{id:Date.now(),onClose:function(e){r.onclose=function(t){var r=t.code,n=t.reason;e(r,n)}},onError:function(e){r.onerror=e},onMessage:function(e){r.onmessage=function(t){e(t.data)}},onOpen:function(e){r.onopen=e},send:function(e){r.send(e)},close:function(e,t){r.close()}}},getNetworkType:function(){var e=navigator.connection||navigator.mozConnection||navigator.webkitConnection||{effectiveType:we.UNKONWN},t=e.type,r=e.effectiveType,n=t||r||we.UNKONWN;return Promise.resolve(n)},setNetworkStatusListener:function(e){Jr=e,"undefined"!=typeof window&&window&&(window.addEventListener("offline",zr),window.addEventListener("online",zr))},removeNetworkStatusListener:function(){"undefined"!=typeof window&&window&&(window.removeEventListener("offline",zr),window.removeEventListener("online",zr)),Jr=null},createSSEClient:function(e){return ht(new Qr(e))},getApiVer:function(){var e=Xr.runtimeInfo,t=e.type,r=e.version;return"|".concat(t,"|").concat(r)},get runtimeInfo(){var e,t,r=navigator.userAgent,n={IE:/rv:([\d.]+)\) like Gecko|MSIE ([\d.]+)/,Edge:/Edge\/([\d.]+)/,Firefox:/Firefox\/([\d.]+)/,Opera:/(?:OPERA|OPR).([\d.]+)/,WeChat:/MicroMessenger\/([\d.]+)/,QQBrowser:/QQBrowser\/([\d.]+)/,Chrome:/Chrome\/([\d.]+)/,Safari:/Version\/([\d.]+).*Safari/,iOSChrome:/Mobile\/([\d.]+).*Safari/};for(var i in n)if(n.hasOwnProperty(i)){var o=r.match(n[i]);if(o){t=i,e=o[1]||o[2];break}}return{type:t||"Unknown",version:e||"Unknown"}}};!function(e){e[e.ppMsgP=1]="ppMsgP",e[e.ppMsgS=2]="ppMsgS",e[e.pgMsgS=3]="pgMsgS",e[e.pgMsgP=4]="pgMsgP",e[e.chatMsg=5]="chatMsg",e[e.pcMsgP=6]="pcMsgP",e[e.prMsgS=7]="prMsgS",e[e.pbMsgP=8]="pbMsgP",e[e.qryPMsg=9]="qryPMsg",e[e.qryGMsg=10]="qryGMsg",e[e.qryCHMsg=11]="qryCHMsg",e[e.qryCMsg=12]="qryCMsg",e[e.qrySMsg=13]="qrySMsg",e[e.qryMCMsg=14]="qryMCMsg",e[e.qryMPMsg=15]="qryMPMsg",e[e.recallMsg=16]="recallMsg",e[e.rrMsg=17]="rrMsg",e[e.rrList=18]="rrList",e[e.s_ntf=19]="s_ntf",e[e.s_msg=20]="s_msg",e[e.s_stat=21]="s_stat",e[e.s_cmd=22]="s_cmd",e[e.s_us=23]="s_us",e[e.pullUS=24]="pullUS",e[e.sendMsgRead=25]="sendMsgRead",e[e.qryMsgRead=26]="qryMsgRead",e[e.qryMsgReadCntBatch=27]="qryMsgReadCntBatch",e[e.updRTime=28]="updRTime",e[e.chatMsgS=29]="chatMsgS",e[e.qrySessionsAtt=30]="qrySessionsAtt",e[e.pullMsg=31]="pullMsg",e[e.qrySessions=32]="qrySessions",e[e.delSessions=33]="delSessions",e[e.delMsg=34]="delMsg",e[e.delUgMsg=35]="delUgMsg",e[e.delUgSe=36]="delUgSe",e[e.updRRTime=37]="updRRTime",e[e.qrySessionsUnread=38]="qrySessionsUnread",e[e.setTypeUnpush=39]="setTypeUnpush",e[e.chrmPull=40]="chrmPull",e[e.joinChrm=41]="joinChrm",e[e.joinChrmR=42]="joinChrmR",e[e.exitChrm=43]="exitChrm",e[e.queryChrmI=44]="queryChrmI",e[e.setKV=45]="setKV",e[e.delKV=46]="delKV",e[e.setKVS=47]="setKVS",e[e.delKVS=48]="delKVS",e[e.pullKV=49]="pullKV",e[e.qryRelation=50]="qryRelation",e[e.qryRelationR=51]="qryRelationR",e[e.delRelation=52]="delRelation",e[e.delRelationBatch=53]="delRelationBatch",e[e.pullSeAtts=54]="pullSeAtts",e[e.setSeAtt=55]="setSeAtt",e[e.qnTkn=56]="qnTkn",e[e.qnUrl=57]="qnUrl",e[e.aliUrl=58]="aliUrl",e[e.s3Url=59]="s3Url",e[e.stcUrl=60]="stcUrl",e[e.minioUrl=61]="minioUrl",e[e.cleanPMsg=62]="cleanPMsg",e[e.cleanGMsg=63]="cleanGMsg",e[e.cleanCMsg=64]="cleanCMsg",e[e.cleanSMsg=65]="cleanSMsg",e[e.cleanMCMsg=66]="cleanMCMsg",e[e.cleanMPMsg=67]="cleanMPMsg",e[e.cleanMsgBatch=68]="cleanMsgBatch",e[e.rtcPing=69]="rtcPing",e[e.rtc_ntf=70]="rtc_ntf",e[e.rtcSetOutData=71]="rtcSetOutData",e[e.rtcQryUserOutData=72]="rtcQryUserOutData",e[e.addSeTag=73]="addSeTag",e[e.delSeTag=74]="delSeTag",e[e.addTag=75]="addTag",e[e.delTag=76]="delTag",e[e.disTag=77]="disTag",e[e.reportsdk=78]="reportsdk",e[e.pullUgSes=79]="pullUgSes",e[e.pullUgMsg=80]="pullUgMsg",e[e.ugMsg=81]="ugMsg",e[e.qryUgMsg=82]="qryUgMsg",e[e.updUgRTime=83]="updUgRTime",e[e.upMsgEx=84]="upMsgEx",e[e.modifyMsg=85]="modifyMsg",e[e.qryMsgChange=86]="qryMsgChange",e[e.qryMsg=87]="qryMsg",e[e.operate=88]="operate",e[e.s_opNtf=89]="s_opNtf",e[e.ugUnpushQuery=90]="ugUnpushQuery",e[e.ugUnpushSet=91]="ugUnpushSet",e[e.setRtcRoomId=92]="setRtcRoomId",e[e.qryUgUal=93]="qryUgUal",e[e.updUserSub=94]="updUserSub",e[e.pullUserSub=95]="pullUserSub",e[e.pullSubData=96]="pullSubData",e[e.qrySubData=97]="qrySubData",e[e.pullUserProfile=98]="pullUserProfile",e[e.pullOwnProfile=99]="pullOwnProfile",e[e.updProfilePermiss=100]="updProfilePermiss",e[e.qProfilePermiss=101]="qProfilePermiss",e[e.searchUserProfile=102]="searchUserProfile",e[e.updUserProfile=103]="updUserProfile",e[e.pullEventChange=104]="pullEventChange",e[e.channelCreate=105]="channelCreate",e[e.upChannelInfo=106]="upChannelInfo",e[e.qChannelInfo=107]="qChannelInfo",e[e.channelMemKick=108]="channelMemKick",e[e.channelMemQuit=109]="channelMemQuit",e[e.channelDismiss=110]="channelDismiss",e[e.channelTransfer=111]="channelTransfer",e[e.upChannelManager=112]="upChannelManager",e[e.qChannelMem=113]="qChannelMem",e[e.qChannelSpeMem=114]="qChannelSpeMem",e[e.upChannelMem=115]="upChannelMem",e[e.channelMemJoin=116]="channelMemJoin",e[e.channelMemInvite=117]="channelMemInvite",e[e.channelApplyResp=118]="channelApplyResp",e[e.qChannelApplyList=119]="qChannelApplyList",e[e.qChannelMemJoin=120]="qChannelMemJoin",e[e.qChannelMemSpeJoin=121]="qChannelMemSpeJoin",e[e.upChannelRemark=122]="upChannelRemark",e[e.qChannelRemark=123]="qChannelRemark",e[e.upChannelFollow=124]="upChannelFollow",e[e.qChannelFollow=125]="qChannelFollow",e[e.qSimpleUserProfile=126]="qSimpleUserProfile",e[e.friendAdd=127]="friendAdd",e[e.friendDel=128]="friendDel",e[e.friendHandle=129]="friendHandle",e[e.friendSetPf=130]="friendSetPf",e[e.friendCheck=131]="friendCheck",e[e.friendsQuery=132]="friendsQuery",e[e.friendApplyDel=133]="friendApplyDel",e[e.friendsInfoQry=134]="friendsInfoQry",e[e.friendAuthSet=135]="friendAuthSet",e[e.friendAuthGet=136]="friendAuthGet",e[e.addUnpush=137]="addUnpush",e[e.qryUnpush=138]="qryUnpush",e[e.delUnpush=139]="delUnpush",e[e.s_pubCall=140]="s_pubCall",e[e.reqCall=141]="reqCall",e[e.pullKvMsg=142]="pullKvMsg",e[e.readReceipt=143]="readReceipt",e[e.qryReceipt=144]="qryReceipt"}(Zr||(Zr={}));var $r,en,tn,rn=function(e){var t=Zr[e];return t},nn=function(e){return Zr[e]};!function(e){e[e.AT_MOST_ONCE=0]="AT_MOST_ONCE",e[e.AT_LEAST_ONCE=1]="AT_LEAST_ONCE",e[e.EXACTLY_ONCE=2]="EXACTLY_ONCE",e[e.DEFAULT=3]="DEFAULT"}($r||($r={})),function(e){e[e.SYMMETRIC=0]="SYMMETRIC",e[e.CONNECT=1]="CONNECT",e[e.CONN_ACK=2]="CONN_ACK",e[e.PUBLISH=3]="PUBLISH",e[e.PUB_ACK=4]="PUB_ACK",e[e.QUERY=5]="QUERY",e[e.QUERY_ACK=6]="QUERY_ACK",e[e.QUERY_CONFIRM=7]="QUERY_CONFIRM",e[e.PING=12]="PING",e[e.PONG=13]="PONG",e[e.DISCONNECT=14]="DISCONNECT",e[e.PCONNECT=8]="PCONNECT",e[e.PCONNECT_ACK=9]="PCONNECT_ACK",e[e.RESERVED=10]="RESERVED",e[e.RESERVED_2=11]="RESERVED_2",e[e.RESERVED_3=15]="RESERVED_3"}(en||(en={})),function(e){e[e.V4=4]="V4",e[e.V3=3]="V3"}(tn||(tn={}));var on="rtcRJoin_data",sn="rtcRExit",an="rtcRInfo",un="rtcUData",ln="rtcUPut",cn="rtcUDel",dn="rtcSetData",pn="userSetData",fn="rtcQryData",hn="rtcDelData",gn="rtcToken",_n="rtcUserState",bn="rtcUList",En="viewerJoinR",vn="viewerExitR",yn="rtcPullKv",mn="rtcIdentityChange",In="rtcInvite",Tn="rtcCancelInvite",Rn="rtcInviteAnswer",Cn="rtcEndInvite",On="rtcQueryJoined",Sn=0,An=1,Pn=2,Nn=3,wn=4,Mn=5,Ln=6,Un=7,Dn=8,xn=9,jn=10,Vn=11,Gn=12,kn=13,Fn=14,Bn=15,Hn=16,qn=17,Yn=18,Kn=19,Qn=20,Wn=1,Jn=2,zn=4,Zn=5,Xn=6,$n=7,ei=8,ti=9,ri=function(){function e(){}return Object.defineProperty(e,"writeUTF",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){for(var r=this._getBackAndByteSize(e),n=r.back,i=r.byteSize,o=0,s=n.length;o<s;o++)n[o]>255&&(n[o]&=255);return t?n:i<=255?[0,i].concat(n):[i>>8,255&i].concat(n)}}),Object.defineProperty(e,"_getBackAndByteSize",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=[],r=0;if("string"==typeof e)for(var n=0,i=e.length;n<i;n++){var o=e.charCodeAt(n);o>=0&&o<=127?(r+=1,t.push(o)):o>=128&&o<=2047?(r+=2,t.push(192|31&o>>6),t.push(128|63&o)):o>=2048&&o<=65535&&(r+=3,t.push(224|15&o>>12),t.push(128|63&o>>6),t.push(128|63&o))}return{byteSize:r,back:t}}}),Object.defineProperty(e,"readUTF",{enumerable:!1,configurable:!0,writable:!0,value:function(e){for(var t,r,n=[],i=-1,o=e,s="";++i<o.length;){var a=Number(o[i]);if(a===(127&a)||(240&~a?224&~a?192&~a||(a=(a^=192)<<6|128^o[++i]):a=(a=(a^=224)<<6|128^o[++i])<<6|128^o[++i]:a=(a=(a=(a^=240)<<6|128^o[++i])<<6|128^o[++i])<<6|128^o[++i]),!Number.isFinite(a)||a<0||a>1114111||Math.floor(a)!==a)throw RangeError("Invalid code point: ".concat(a));a<=65535?n.push(a):(t=(a-=65536)>>10|55296,r=a%1024|56320,n.push(t,r)),(i+1===o.length||n.length>16384)&&(s+=String.fromCharCode.apply(null,n),n.length=0)}return s}}),e}(),ni=function(){function e(e){Object.defineProperty(this,"_pool",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_position",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_poolLen",{enumerable:!0,configurable:!0,writable:!0,value:0}),this._pool=e,this._poolLen=e.length}return Object.defineProperty(e.prototype,"check",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._position>=this._pool.length}}),Object.defineProperty(e.prototype,"read2Byte",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this;if(e.check())return-1;for(var t="",r=0;r<2;r++){var n=e._pool[e._position++].toString(16);1===n.length&&(n="0".concat(n)),t+=n.toString()}return parseInt(t,16)}}),Object.defineProperty(e.prototype,"readInt32",{enumerable:!1,configurable:!0,writable:!0,value:function(){return(this.readByte()<<24)+(this.readByte()<<16)+(this.readByte()<<8)+this.readByte()}}),Object.defineProperty(e.prototype,"readLong",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this;if(e.check())return-1;for(var t="",r=0;r<8;r++){var n=e._pool[e._position++].toString(16);1===n.length&&(n="0".concat(n)),t+=n}return parseInt(t,16)}}),Object.defineProperty(e.prototype,"readByte",{enumerable:!1,configurable:!0,writable:!0,value:function(){if(this.check())return-1;var e=this._pool[this._position++];return e>255&&(e&=255),e}}),Object.defineProperty(e.prototype,"readUTF",{enumerable:!1,configurable:!0,writable:!0,value:function(){if(this.check())return"";var e=this.readByte()<<8|this.readByte(),t=this._position;this._position+=e;var r=this._pool.subarray(t,this._position);return ri.readUTF(r)}}),Object.defineProperty(e.prototype,"readAll",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._pool.subarray(this._position,this._poolLen)}}),e}(),ii=function(){function e(){Object.defineProperty(this,"_pool",{enumerable:!0,configurable:!0,writable:!0,value:[]})}return Object.defineProperty(e.prototype,"writeByte",{enumerable:!1,configurable:!0,writable:!0,value:function(e){e>=0&&(e>255&&(e&=255),this._pool.push(e))}}),Object.defineProperty(e.prototype,"writeBuffer",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._pool=this._pool.concat(l([],u(new Int8Array(e)),!1))}}),Object.defineProperty(e.prototype,"writeArr",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._pool=this._pool.concat(e)}}),Object.defineProperty(e.prototype,"writeUTF",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=ri.writeUTF(e);this._pool=this._pool.concat(t)}}),Object.defineProperty(e.prototype,"getBytesArray",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._pool}}),e}(),oi=function(){function e(e,t,r,n,i){void 0===t&&(t=$r.AT_LEAST_ONCE),void 0===r&&(r=!1),void 0===n&&(n=!1),void 0===i&&(i=!1),Object.defineProperty(this,"command",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"qos",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"_retain",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"_dup",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(this,"syncMsg",{enumerable:!0,configurable:!0,writable:!0,value:i})}return Object.defineProperty(e,"parse",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return new e(t>>4&15,(6&t)>>1,(1&t)>0,(8&t)>0,!(8&~t))}}),Object.defineProperty(e.prototype,"encode",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this.command<<4;return e|=this._retain?1:0,e|=this.qos<<1,e|=this._dup?8:0}}),e}(),si=function(){function e(e){Object.defineProperty(this,"header",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"timestamp",{enumerable:!0,configurable:!0,writable:!0,value:0})}return Object.defineProperty(e.prototype,"read",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){this.readMessage(e,t,r)}}),Object.defineProperty(e.prototype,"readMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return{stream:e,length:t}}}),e}(),ai=function(){function e(e){Object.defineProperty(this,"_header",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"messageId",{enumerable:!0,configurable:!0,writable:!0,value:0}),this._header=new oi(e,$r.AT_MOST_ONCE)}return Object.defineProperty(e.prototype,"write",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this.getHeaderFlag();e.writeByte(t),this.writeMessage(e)}}),Object.defineProperty(e.prototype,"setHeaderQos",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._header.qos=e}}),Object.defineProperty(e.prototype,"getHeaderFlag",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._header.encode()}}),Object.defineProperty(e.prototype,"getArrayBuffer",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=new ii;this.write(e);var t=e.getBytesArray();return new Int8Array(t).buffer}}),e}(),ui=function(e){function r(){var t=null!==e&&e.apply(this,arguments)||this;return Object.defineProperty(t,"status",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(t,"userId",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(t,"timestamp",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(t,"messageId",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(t,"sessionId",{enumerable:!0,configurable:!0,writable:!0,value:""}),t}return t(r,e),Object.defineProperty(r.prototype,"readMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){if(e.readByte(),this.status=e.readByte(),t<=r.MESSAGE_LENGTH)return{stream:e,length:t};if(n===tn.V4){var i=e.readByte();1&i&&(this.userId=e.readUTF()),2&i&&(this.sessionId=e.readUTF()),4&i&&(this.timestamp=e.readLong()),8&i&&(this.messageId=e.read2Byte())}else this.userId=e.readUTF(),this.sessionId=e.readUTF(),this.timestamp=e.readLong();return{stream:e,length:t}}}),Object.defineProperty(r,"MESSAGE_LENGTH",{enumerable:!0,configurable:!0,writable:!0,value:2}),r}(si),li=function(e){function r(t){var r=e.call(this,en.DISCONNECT)||this;return Object.defineProperty(r,"status",{enumerable:!0,configurable:!0,writable:!0,value:t}),r}return t(r,e),Object.defineProperty(r.prototype,"writeMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){e.writeArr([0,this.status])}}),r}(ai),ci=function(e){function r(){var t=null!==e&&e.apply(this,arguments)||this;return Object.defineProperty(t,"status",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(t,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),t}return t(r,e),Object.defineProperty(r.prototype,"readMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return e.readByte(),this.status=e.readByte(),this.data=e.readAll(),{stream:e,length:t}}}),Object.defineProperty(r,"MESSAGE_LENGTH",{enumerable:!0,configurable:!0,writable:!0,value:2}),r}(si),di=function(e){function r(){return e.call(this,en.PING)||this}return t(r,e),Object.defineProperty(r.prototype,"writeMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){}}),r}(ai),pi=function(e){function r(t){return e.call(this,t)||this}return t(r,e),r}(si),fi=function(e){function r(){var t=null!==e&&e.apply(this,arguments)||this;return Object.defineProperty(t,"messageId",{enumerable:!0,configurable:!0,writable:!0,value:0}),t}return t(r,e),Object.defineProperty(r.prototype,"readMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=256*e.readByte()+e.readByte();return this.messageId=parseInt(r.toString(),10),{stream:e,length:t}}}),r}(si),hi=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return t(r,e),Object.defineProperty(r.prototype,"writeMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this.messageId,r=255&t,n=(65280&t)>>8;e.writeByte(n),e.writeByte(r)}}),r}(ai),gi=function(e){function r(t){var r=e.call(this,t)||this;return Object.defineProperty(r,"topic",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(r,"pbData",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(r,"targetId",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(r,"date",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(r,"syncMsg",{enumerable:!0,configurable:!0,writable:!0,value:!1}),r.syncMsg=t.syncMsg,r}return t(r,e),Object.defineProperty(r.prototype,"readMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){return this.date=t.readInt32(),this.topic=t.readUTF(),this.targetId=t.readUTF(),e.prototype.readMessage.call(this,t,r),this.pbData=t.readAll(),{stream:t,length:r}}}),r}(fi),_i=function(e){function r(t,r,n,i){var o=e.call(this,t)||this;return Object.defineProperty(o,"targetId",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(o,"pbData",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(o,"topic",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),o.topic="string"==typeof r?r:nn(r),o}return t(r,e),Object.defineProperty(r.prototype,"writeMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(t){t.writeUTF(this.topic),t.writeUTF(this.targetId),e.prototype.writeMessage.call(this,t),t.writeBuffer(this.pbData)}}),r}(hi),bi=function(e){function r(t,r,n){return e.call(this,en.QUERY,t,n,r)||this}return t(r,e),r}(_i),Ei=function(e){function r(t,r,n){return e.call(this,en.PUBLISH,t,n,r)||this}return t(r,e),r}(_i),vi=function(e){function r(){var t=null!==e&&e.apply(this,arguments)||this;return Object.defineProperty(t,"status",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(t,"date",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(t,"millisecond",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(t,"messageUId",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(t,"timestamp",{enumerable:!0,configurable:!0,writable:!0,value:0}),t}return t(r,e),Object.defineProperty(r.prototype,"readMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){return e.prototype.readMessage.call(this,t,r),this.date=t.readInt32(),this.status=256*t.readByte()+t.readByte(),this.millisecond=256*t.readByte()+t.readByte(),this.timestamp=1e3*this.date+this.millisecond,this.messageUId=t.readUTF(),{stream:t,length:r}}}),r}(fi),yi=function(e){function r(t){var r=e.call(this,en.PUB_ACK)||this;return r.messageId=t,r}return t(r,e),r}(hi),mi=function(e){function r(t){var r=e.call(this,en.QUERY_CONFIRM)||this;return r.messageId=t,r}return t(r,e),r}(hi),Ii=function(e){function r(){var t=null!==e&&e.apply(this,arguments)||this;return Object.defineProperty(t,"pbData",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(t,"status",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(t,"date",{enumerable:!0,configurable:!0,writable:!0,value:0}),t}return t(r,e),Object.defineProperty(r.prototype,"readMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){return e.prototype.readMessage.call(this,t,r),this.date=t.readInt32(),this.status=256*t.readByte()+t.readByte(),this.pbData=t.readAll(),{stream:t,length:r}}}),r}(fi),Ti=function(e,t){var r=new Uint8Array(e),n=new ni(r),i=n.readByte(),o=function(e){var t,r=e.command;switch(r){case en.CONN_ACK:t=new ui(e);break;case en.PUBLISH:t=new gi(e);break;case en.PUB_ACK:t=new vi(e);break;case en.QUERY_ACK:t=new Ii(e);break;case en.PONG:t=new pi(e);break;case en.DISCONNECT:t=new ci(e);break;default:console.error("No support for deserializing ".concat(r," messages"))}return t}(oi.parse(i));return o&&o.read(n,r.length-1,t),o},Ri=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return t(r,e),Object.defineProperty(r.prototype,"_openHandler",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=It(),n=r.resolve,i=r.promise,o=this._logger,s=wx.request({url:e,enableChunked:!0,method:"GET",timeout:t.timeout,header:{"Content-Type":"application/json;charset=UTF-8","App-Key":t.appkey,Authorization:"Bearer ".concat(t.token)},success:function(e){var t;if(200===e.statusCode&&(null===(t=e.header["Content-Type"])||void 0===t?void 0:t.startsWith("text/event-stream")))n(ht());else{var r=JSON.parse(e.data),i=r.code,o=r.message;n(gt(i,o))}},fail:function(t){var r=t.errMsg,i=t.errno;o.warn(H.L_REQ_STREAM_MSG_CONTENT_E,JSON.stringify({url:e,errMsg:r,errno:i})),n(gt(-1,t.errMsg))},complete:function(){o.debug(H.L_REQ_STREAM_MSG_CONTENT_O,"req complete -> ".concat(e))}});return s.onChunkReceived((function(e){var r=ri.readUTF(new Uint8Array(e.data));o.debug(H.L_REQ_STREAM_MSG_CONTENT_O,"chunk received -> ".concat(r)),t.onRawContent(r)})),i}}),r}(Kr),Ci=Yr(),Oi=function(e){return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];try{return wx[e].apply(wx,l([],u(t),!1))}catch(e){null===console||void 0===console||console.error(e)}}},Si={setItem:Oi("setStorageSync"),getItem:Oi("getStorageSync"),removeItem:Oi("removeStorageSync"),clear:Oi("clearStorageSync")},Ai=null,Pi=function(e){var t=e.isConnected,r=e.networkType;Ai({status:t,type:r})};var Ni={tag:"wechat",httpReq:function(e){var t=e.method||exports.HttpMethod.GET,r=e.timeout||De,n=e.headers,i=e.query,o=e.body,s=tr(e.url,i);return new Promise((function(e){wx.request({url:s,method:t,header:n,timeout:r,data:o,success:function(t){e({data:t.data,status:t.statusCode})},fail:function(){e({status:exports.ErrorCode.RC_HTTP_REQ_FAIL})}})}))},localStorage:Si,sessionStorage:Si,useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:Ci,createWebSocket:function(e,t){var r=wx.connectSocket({url:e,protocols:t});return{id:Date.now(),onClose:function(e){r.onClose((function(t){e(t.code,t.reason)}))},onError:function(e){r.onError((function(t){e(t.errMsg)}))},onMessage:function(e){r.onMessage((function(t){e(t.data)}))},onOpen:function(e){r.onOpen(e)},send:function(e){r.send({data:e})},close:function(e,t){r.close({code:e,reason:t})}}},getNetworkType:function(){return new Promise((function(e){wx.getNetworkType({success:function(t){var r=t.networkType;e(r)},fail:function(){e(we.UNKONWN)}})}))},setNetworkStatusListener:function(e){Ai=e,wx.onNetworkStatusChange(Pi)},removeNetworkStatusListener:function(){wx.offNetworkStatusChange(Pi),Ai=null},createSSEClient:function(e){return ht(new Ri(e))},get runtimeInfo(){return{type:Ni.tag,version:"Unknown"}}},wi=Yr(),Mi=function(e){return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];try{if("setStorageSync"===e)return my[e]({key:t[0],data:JSON.parse(t[1])});if("clearStorageSync"===e)return my[e]();if("removeStorageSync"===e)return my[e]({key:t[0]});var n=my[e]({key:t[0]}).data;return n?JSON.stringify(n):n}catch(e){}}},Li={setItem:Mi("setStorageSync"),getItem:Mi("getStorageSync"),removeItem:Mi("removeStorageSync"),clear:Mi("clearStorageSync")},Ui=null,Di=function(e){var t=e.isConnected,r=e.networkType;Ui({status:t,type:r})};var xi={tag:"alipay",httpReq:function(e){var t=e.method||exports.HttpMethod.GET,r=e.timeout||De,n=e.headers,i=e.query,o=e.body,s=tr(e.url,i),a=e.dataType||"json";return new Promise((function(e){my.request({url:s,method:t,headers:n,timeout:r,data:o,dataType:a,success:function(t){e({data:t.data,status:t.status})},fail:function(){e({status:exports.ErrorCode.RC_HTTP_REQ_FAIL})}})}))},localStorage:Li,sessionStorage:Li,useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:wi,createWebSocket:function(e){var t=my.connectSocket({url:e,multiple:!0});return{id:Date.now(),onClose:function(e){t.onClose(e)},onError:function(e){t.onError((function(t){e(t.errMsg)}))},onMessage:function(e){t.onMessage((function(t){t.data.isBuffer?e(my.base64ToArrayBuffer(t.data.data)):e(t.data.data)}))},onOpen:function(e){t.onOpen(e)},send:function(e){t.send({data:my.arrayBufferToBase64(e),isBuffer:!0})},close:function(){t.close()}}},getNetworkType:function(){return new Promise((function(e){my.getNetworkType({success:function(t){var r=t.networkType;e(r)},fail:function(){e(we.UNKONWN)}})}))},setNetworkStatusListener:function(e){Ui=e,my.onNetworkStatusChange(Di)},removeNetworkStatusListener:function(){my.offNetworkStatusChange(Di),Ui=null},createSSEClient:function(e){return gt(exports.ErrorCode.NOT_SUPPORT,"Not supported yet")},get runtimeInfo(){return{type:xi.tag,version:"Unknown"}}},ji=Yr(),Vi=function(e){return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];try{return tt[e].apply(tt,l([],u(t),!1))}catch(e){}}},Gi={setItem:Vi("setStorageSync"),getItem:Vi("getStorageSync"),removeItem:Vi("removeStorageSync"),clear:Vi("clearStorageSync")},ki=null,Fi=function(e){var t=e.isConnected,r=e.networkType;ki({status:t,type:r})};var Bi={tag:"toutiao",useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:ji,localStorage:Gi,sessionStorage:Gi,httpReq:function(e){return new Promise((function(t){tt.request({url:e.url,data:e.body,header:e.headers,method:e.method,success:function(e){var r=(null==e?void 0:e.data)||{},n={data:JSON.stringify(r),status:e.statusCode};t(n)},fail:function(e){t({status:exports.ErrorCode.RC_HTTP_REQ_FAIL})}})}))},createWebSocket:function(e,t){var r=tt.connectSocket({url:e,protocols:t});return{id:Date.now(),onOpen:function(e){r.onOpen(e)},onClose:function(e){r.onClose((function(t){return e(t.code,t.reason)}))},onError:function(e){r.onError((function(t){return e(t.errMsg)}))},onMessage:function(e){r.onMessage((function(t){return e(t.data)}))},send:function(e){r.send({data:e})},close:function(e,t){r.close({code:e,reason:t})}}},getNetworkType:function(){return new Promise((function(e){tt.getNetworkType({success:function(t){var r=t.networkType;e(r)},fail:function(){e(we.UNKONWN)}})}))},setNetworkStatusListener:function(e){ki=e,tt.onNetworkStatusChange(Fi)},removeNetworkStatusListener:function(){tt.offNetworkStatusChange(Fi),ki=null},createSSEClient:function(e){return gt(exports.ErrorCode.NOT_SUPPORT)},get runtimeInfo(){return{type:Bi.tag,version:"Unknown"}}},Hi=Yr(),qi=function(e){return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];try{return swan[e].apply(swan,l([],u(t),!1))}catch(e){}}},Yi={setItem:qi("setStorageSync"),getItem:qi("getStorageSync"),removeItem:qi("removeStorageSync"),clear:qi("clearStorageSync")},Ki=null,Qi=function(e){var t=e.isConnected,r=e.networkType;Ki({status:t,type:r})};var Wi={tag:"baidu",useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:Hi,localStorage:Yi,sessionStorage:Yi,httpReq:function(e){return new Promise((function(t){swan.request({url:e.url,data:e.body,header:e.headers,method:e.method,success:function(e){var r=(null==e?void 0:e.data)||{},n={data:JSON.stringify(r),status:e.statusCode};t(n)},fail:function(e){t({status:exports.ErrorCode.RC_HTTP_REQ_FAIL})}})}))},createWebSocket:function(e,t){var r=swan.connectSocket({url:e,protocols:t});return{id:Date.now(),onOpen:function(e){r.onOpen(e)},onClose:function(e){r.onClose((function(t){return e(t.code,t.reason)}))},onError:function(e){r.onError((function(t){return e(t.errMsg)}))},onMessage:function(e){r.onMessage((function(t){return e(t.data)}))},send:function(e){r.send({data:e})},close:function(e,t){r.close({code:e,reason:t})}}},getNetworkType:function(){return o(this,void 0,void 0,(function(){return s(this,(function(e){return[2,new Promise((function(e){swan.getNetworkType({success:function(t){var r=t.networkType;e(r)},fail:function(){e(we.UNKONWN)}})}))]}))}))},setNetworkStatusListener:function(e){Ki=e,swan.onNetworkStatusChange(Qi)},removeNetworkStatusListener:function(){swan.offNetworkStatusChange(Qi),Ki=null},createSSEClient:function(e){return gt(exports.ErrorCode.NOT_SUPPORT)},get runtimeInfo(){return{type:Wi.tag,version:"Unknown"}}},Ji=Yr(),zi=function(e){return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];try{return jd[e].apply(jd,l([],u(t),!1))}catch(e){null===console||void 0===console||console.error(e)}}},Zi={setItem:zi("setStorageSync"),getItem:zi("getStorageSync"),removeItem:zi("removeStorageSync"),clear:zi("clearStorageSync")},Xi=null,$i=function(e){var t=e.isConnected,r=e.networkType;Xi({status:t,type:r})};var eo={tag:"jingdong",httpReq:function(e){var t=e.method||exports.HttpMethod.GET,r=e.timeout||De,n=e.headers,i=e.query,o=e.body,s=tr(e.url,i);return new Promise((function(e){jd.request({url:s,method:t,header:n,timeout:r,data:o,success:function(t){e({data:t.data,status:t.statusCode})},fail:function(){e({status:exports.ErrorCode.RC_HTTP_REQ_FAIL})}})}))},localStorage:Zi,sessionStorage:Zi,useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:Ji,createWebSocket:function(e,t){return jd.connectSocket({url:e,protocols:t}),{id:Date.now(),onClose:function(e){jd.onSocketClose((function(t){e(t.code,t.reason)}))},onError:function(e){jd.onSocketError((function(t){e(t.errMsg)}))},onMessage:function(e){jd.onSocketMessage((function(t){e(t.data)}))},onOpen:function(e){jd.onSocketOpen(e)},send:function(e){jd.sendSocketMessage({data:e})},close:function(e,t){jd.closeSocket({code:e,reason:t})}}},getNetworkType:function(){return new Promise((function(e){jd.getNetworkType({success:function(t){var r=t.networkType;e(r)},fail:function(){e(we.UNKONWN)}})}))},setNetworkStatusListener:function(e){Xi=e,jd.onNetworkStatusChange($i)},removeNetworkStatusListener:function(){jd.offNetworkStatusChange($i),Xi=null},createSSEClient:function(e){return gt(exports.ErrorCode.NOT_SUPPORT)},get runtimeInfo(){return{type:eo.tag,version:"Unknown"}}},to=function(e){return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];try{return uni[e].apply(uni,l([],u(t),!1))}catch(e){null===console||void 0===console||console.error(e)}}},ro={setItem:to("setStorageSync"),getItem:to("getStorageSync"),removeItem:to("removeStorageSync"),clear:to("clearStorageSync")},no=null,io=function(e){var t=e.isConnected,r=e.networkType;no({status:t,type:r})};var oo,so,ao={tag:"uniapp",httpReq:function(e){var t=e.method||exports.HttpMethod.GET,r=e.timeout||De,n=e.headers,i=e.query,o=e.body,s=tr(e.url,i);return new Promise((function(e){uni.request({url:s,method:t,header:n,timeout:r,data:o,success:function(t){e({data:t.data,status:t.statusCode})},fail:function(){e({status:exports.ErrorCode.RC_HTTP_REQ_FAIL})}})}))},localStorage:ro,sessionStorage:ro,useNavi:!0,get connectPlatform(){var e=uni.getSystemInfoSync(),t=e.uniPlatform,r=e.osName;return["app","app-plus"].includes(t)&&r||""},isFromUniapp:!0,createWebSocket:function(e,t){var r={complete:function(){},url:e,protocols:t},n=uni.connectSocket(r);return{id:Date.now(),onClose:function(e){n.onClose((function(t){e(t.code,t.reason)}))},onError:function(e){n.onError((function(t){e(t.errMsg)}))},onMessage:function(e){n.onMessage((function(t){e(t.data)}))},onOpen:function(e){n.onOpen(e)},send:function(e){n.send({data:e})},close:function(e,t){n.close({code:e,reason:t})}}},getNetworkType:function(){return new Promise((function(e){uni.getNetworkType({success:function(t){var r=t.networkType;e(r)},fail:function(){e(we.UNKONWN)}})}))},setNetworkStatusListener:function(e){no=e,uni.onNetworkStatusChange(io)},removeNetworkStatusListener:function(){uni.offNetworkStatusChange(io),no=null},createSSEClient:function(e){return gt(exports.ErrorCode.NOT_SUPPORT)},getApiVer:function(){var e=uni.getSystemInfoSync(),t=e.osAndroidAPILevel,r=e.deviceModel,n=e.deviceBrand,i=e.osVersion,o="android"===e.osName?t:i;return"".concat(n||"","|").concat(r||"","|").concat(o||"","|||uniapp").replace(/-/g,"_")},get runtimeInfo(){return{type:ao.tag,version:"Unknown"}}},uo=function(e){return e&&e.request&&e.getSystemInfo},lo="undefined"!=typeof uni&&uo(uni)?function(){switch(process.env.VUE_APP_PLATFORM){case"app-plus":case"app":case"app-harmony":return ao;case"mp-jd":return eo;case"mp-baidu":return Wi;case"mp-toutiao":return Bi;case"mp-alipay":return xi;case"mp-weixin":return Ni;default:return Xr}}():"undefined"!=typeof jd&&uo(jd)?eo:"undefined"!=typeof my&&uo(my)?xi:"undefined"!=typeof tt&&uo(tt)?Bi:"undefined"!=typeof swan&&uo(swan)?Wi:"undefined"!=typeof wx&&uo(wx)?Ni:Xr;function co(e){var t=function(){function e(e,t,r){this.low=0|e,this.high=0|t,this.unsigned=!!r}function t(e){return!0===(e&&e.__isLong__)}function r(e,t){var r,n,o;return t?(o=(e>>>=0)>=0&&e<256)&&(n=u[e])?n:(r=i(e,(0|e)<0?-1:0,!0),o&&(u[e]=r),r):(o=(e|=0)>=-128&&e<128)&&(n=a[e])?n:(r=i(e,e<0?-1:0,!1),o&&(a[e]=r),r)}function n(e,t){if(isNaN(e)||!isFinite(e))return t?g:h;if(t){if(e<0)return g;if(e>=d)return y}else{if(-p>=e)return m;if(e+1>=p)return v}return e<0?n(-e,t).neg():i(0|e%c,0|e/c,t)}function i(t,r,n){return new e(t,r,n)}function o(e,t,r){var i,s,a,u,c,d,p;if(0===e.length)throw Error("empty string");if("NaN"===e||"Infinity"===e||"+Infinity"===e||"-Infinity"===e)return h;if("number"==typeof t?(r=t,t=!1):t=!!t,(r=r||10)<2||r>36)throw RangeError("radix");if((i=e.indexOf("-"))>0)throw Error("interior hyphen");if(0===i)return o(e.substring(1),t,r).neg();for(s=n(l(r,8)),a=h,u=0;u<e.length;u+=8)c=Math.min(8,e.length-u),d=parseInt(e.substring(u,u+c),r),c<8?(p=n(l(r,c)),a=a.mul(p).add(n(d))):a=(a=a.mul(s)).add(n(d));return a.unsigned=t,a}function s(t){return t instanceof e?t:"number"==typeof t?n(t):"string"==typeof t?o(t):i(t.low,t.high,t.unsigned)}var a,u,l,c,d,p,f,h,g,_,b,E,v,y,m,I;return e.prototype.__isLong__,Object.defineProperty(e.prototype,"__isLong__",{value:!0,enumerable:!1,configurable:!1}),e.isLong=t,a={},u={},e.fromInt=r,e.fromNumber=n,e.fromBits=i,l=Math.pow,e.fromString=o,e.fromValue=s,p=(d=(c=4294967296)*c)/2,f=r(16777216),h=r(0),e.ZERO=h,g=r(0,!0),e.UZERO=g,_=r(1),e.ONE=_,b=r(1,!0),e.UONE=b,E=r(-1),e.NEG_ONE=E,v=i(-1,2147483647,!1),e.MAX_VALUE=v,y=i(-1,-1,!0),e.MAX_UNSIGNED_VALUE=y,m=i(0,-2147483648,!1),e.MIN_VALUE=m,(I=e.prototype).toInt=function(){return this.unsigned?this.low>>>0:this.low},I.toNumber=function(){return this.unsigned?(this.high>>>0)*c+(this.low>>>0):this.high*c+(this.low>>>0)},I.toString=function(e){var t,r,i,o,s,a,u,c;if((e=e||10)<2||e>36)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative())return this.eq(m)?(t=n(e),i=(r=this.div(t)).mul(t).sub(this),r.toString(e)+i.toInt().toString(e)):"-"+this.neg().toString(e);for(o=n(l(e,6),this.unsigned),s=this,a="";;){if(u=s.div(o),c=(s.sub(u.mul(o)).toInt()>>>0).toString(e),(s=u).isZero())return c+a;for(;c.length<6;)c="0"+c;a=""+c+a}},I.getHighBits=function(){return this.high},I.getHighBitsUnsigned=function(){return this.high>>>0},I.getLowBits=function(){return this.low},I.getLowBitsUnsigned=function(){return this.low>>>0},I.getNumBitsAbs=function(){var e,t;if(this.isNegative())return this.eq(m)?64:this.neg().getNumBitsAbs();for(e=0!=this.high?this.high:this.low,t=31;t>0&&!(e&1<<t);t--);return 0!=this.high?t+33:t+1},I.isZero=function(){return 0===this.high&&0===this.low},I.isNegative=function(){return!this.unsigned&&this.high<0},I.isPositive=function(){return this.unsigned||this.high>=0},I.isOdd=function(){return!(1&~this.low)},I.isEven=function(){return!(1&this.low)},I.equals=function(e){return t(e)||(e=s(e)),(this.unsigned===e.unsigned||this.high>>>31!=1||e.high>>>31!=1)&&(this.high===e.high&&this.low===e.low)},I.eq=I.equals,I.notEquals=function(e){return!this.eq(e)},I.neq=I.notEquals,I.lessThan=function(e){return this.comp(e)<0},I.lt=I.lessThan,I.lessThanOrEqual=function(e){return this.comp(e)<=0},I.lte=I.lessThanOrEqual,I.greaterThan=function(e){return this.comp(e)>0},I.gt=I.greaterThan,I.greaterThanOrEqual=function(e){return this.comp(e)>=0},I.gte=I.greaterThanOrEqual,I.compare=function(e){if(t(e)||(e=s(e)),this.eq(e))return 0;var r=this.isNegative(),n=e.isNegative();return r&&!n?-1:!r&&n?1:this.unsigned?e.high>>>0>this.high>>>0||e.high===this.high&&e.low>>>0>this.low>>>0?-1:1:this.sub(e).isNegative()?-1:1},I.comp=I.compare,I.negate=function(){return!this.unsigned&&this.eq(m)?m:this.not().add(_)},I.neg=I.negate,I.add=function(e){var r,n,o,a,u,l,c,d,p,f,h;return t(e)||(e=s(e)),r=this.high>>>16,n=65535&this.high,o=this.low>>>16,a=65535&this.low,u=e.high>>>16,l=65535&e.high,c=e.low>>>16,d=0,p=0,f=0,h=0,f+=(h+=a+(65535&e.low))>>>16,p+=(f+=o+c)>>>16,d+=(p+=n+l)>>>16,d+=r+u,i((f&=65535)<<16|(h&=65535),(d&=65535)<<16|(p&=65535),this.unsigned)},I.subtract=function(e){return t(e)||(e=s(e)),this.add(e.neg())},I.sub=I.subtract,I.multiply=function(e){var r,o,a,u,l,c,d,p,g,_,b,E;return this.isZero()?h:(t(e)||(e=s(e)),e.isZero()?h:this.eq(m)?e.isOdd()?m:h:e.eq(m)?this.isOdd()?m:h:this.isNegative()?e.isNegative()?this.neg().mul(e.neg()):this.neg().mul(e).neg():e.isNegative()?this.mul(e.neg()).neg():this.lt(f)&&e.lt(f)?n(this.toNumber()*e.toNumber(),this.unsigned):(r=this.high>>>16,o=65535&this.high,a=this.low>>>16,u=65535&this.low,l=e.high>>>16,c=65535&e.high,d=e.low>>>16,g=0,_=0,b=0,E=0,b+=(E+=u*(p=65535&e.low))>>>16,_+=(b+=a*p)>>>16,b&=65535,_+=(b+=u*d)>>>16,g+=(_+=o*p)>>>16,_&=65535,g+=(_+=a*d)>>>16,_&=65535,g+=(_+=u*c)>>>16,g+=r*p+o*d+a*c+u*l,i((b&=65535)<<16|(E&=65535),(g&=65535)<<16|(_&=65535),this.unsigned)))},I.mul=I.multiply,I.divide=function(e){var r,i,o,a,u,c,d;if(t(e)||(e=s(e)),e.isZero())throw Error("division by zero");if(this.isZero())return this.unsigned?g:h;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return g;if(e.gt(this.shru(1)))return b;o=g}else{if(this.eq(m))return e.eq(_)||e.eq(E)?m:e.eq(m)?_:(r=this.shr(1).div(e).shl(1)).eq(h)?e.isNegative()?_:E:(i=this.sub(e.mul(r)),o=r.add(i.div(e)));if(e.eq(m))return this.unsigned?g:h;if(this.isNegative())return e.isNegative()?this.neg().div(e.neg()):this.neg().div(e).neg();if(e.isNegative())return this.div(e.neg()).neg();o=h}for(i=this;i.gte(e);){for(r=Math.max(1,Math.floor(i.toNumber()/e.toNumber())),u=(a=Math.ceil(Math.log(r)/Math.LN2))<=48?1:l(2,a-48),d=(c=n(r)).mul(e);d.isNegative()||d.gt(i);)d=(c=n(r-=u,this.unsigned)).mul(e);c.isZero()&&(c=_),o=o.add(c),i=i.sub(d)}return o},I.div=I.divide,I.modulo=function(e){return t(e)||(e=s(e)),this.sub(this.div(e).mul(e))},I.mod=I.modulo,I.not=function(){return i(~this.low,~this.high,this.unsigned)},I.and=function(e){return t(e)||(e=s(e)),i(this.low&e.low,this.high&e.high,this.unsigned)},I.or=function(e){return t(e)||(e=s(e)),i(this.low|e.low,this.high|e.high,this.unsigned)},I.xor=function(e){return t(e)||(e=s(e)),i(this.low^e.low,this.high^e.high,this.unsigned)},I.shiftLeft=function(e){return t(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?i(this.low<<e,this.high<<e|this.low>>>32-e,this.unsigned):i(0,this.low<<e-32,this.unsigned)},I.shl=I.shiftLeft,I.shiftRight=function(e){return t(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?i(this.low>>>e|this.high<<32-e,this.high>>e,this.unsigned):i(this.high>>e-32,this.high>=0?0:-1,this.unsigned)},I.shr=I.shiftRight,I.shiftRightUnsigned=function(e){var r;return t(e)&&(e=e.toInt()),0===(e&=63)?this:(r=this.high,e<32?i(this.low>>>e|r<<32-e,r>>>e,this.unsigned):i(32===e?r:r>>>e-32,0,this.unsigned))},I.shru=I.shiftRightUnsigned,I.toSigned=function(){return this.unsigned?i(this.low,this.high,!1):this},I.toUnsigned=function(){return this.unsigned?this:i(this.low,this.high,!0)},I.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()},I.toBytesLE=function(){var e=this.high,t=this.low;return[255&t,255&t>>>8,255&t>>>16,255&t>>>24,255&e,255&e>>>8,255&e>>>16,255&e>>>24]},I.toBytesBE=function(){var e=this.high,t=this.low;return[255&e>>>24,255&e>>>16,255&e>>>8,255&e,255&t>>>24,255&t>>>16,255&t>>>8,255&t]},e}(),r=function(e){function t(e){var t=0;return function(){return t<e.length?e.charCodeAt(t++):null}}function r(){var e=[],t=[];return function(){return 0===arguments.length?t.join("")+a.apply(String,e):(e.length+arguments.length>1024&&(t.push(a.apply(String,e)),e.length=0),void Array.prototype.push.apply(e,arguments))}}function n(e,t,r,n,i){var o,s,a=8*i-n-1,u=(1<<a)-1,l=u>>1,c=-7,d=r?i-1:0,p=r?-1:1,f=e[t+d];for(d+=p,o=f&(1<<-c)-1,f>>=-c,c+=a;c>0;o=256*o+e[t+d],d+=p,c-=8);for(s=o&(1<<-c)-1,o>>=-c,c+=n;c>0;s=256*s+e[t+d],d+=p,c-=8);if(0===o)o=1-l;else{if(o===u)return s?NaN:1/0*(f?-1:1);s+=Math.pow(2,n),o-=l}return(f?-1:1)*s*Math.pow(2,o-n)}function i(e,t,r,n,i,o){var s,a,u,l=8*o-i-1,c=(1<<l)-1,d=c>>1,p=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,f=n?0:o-1,h=n?1:-1,g=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||1/0===t?(a=isNaN(t)?1:0,s=c):(s=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-s))<1&&(s--,u*=2),(t+=s+d>=1?p/u:p*Math.pow(2,1-d))*u>=2&&(s++,u/=2),s+d>=c?(a=0,s=c):s+d>=1?(a=(t*u-1)*Math.pow(2,i),s+=d):(a=t*Math.pow(2,d-1)*Math.pow(2,i),s=0));i>=8;e[r+f]=255&a,f+=h,a/=256,i-=8);for(s=s<<i|a,l+=i;l>0;e[r+f]=255&s,f+=h,s/=256,l-=8);e[r+f-h]|=128*g}var o,s,a,u,l,c=function(e,t,r){if(void 0===e&&(e=c.DEFAULT_CAPACITY),void 0===t&&(t=c.DEFAULT_ENDIAN),void 0===r&&(r=c.DEFAULT_NOASSERT),!r){if((e|=0)<0)throw RangeError("Illegal capacity");t=!!t,r=!!r}this.buffer=0===e?s:new ArrayBuffer(e),this.view=0===e?null:new Uint8Array(this.buffer),this.offset=0,this.markedOffset=-1,this.limit=e,this.littleEndian=t,this.noAssert=r};return c.VERSION="5.0.1",c.LITTLE_ENDIAN=!0,c.BIG_ENDIAN=!1,c.DEFAULT_CAPACITY=16,c.DEFAULT_ENDIAN=c.BIG_ENDIAN,c.DEFAULT_NOASSERT=!1,c.Long=e||null,(o=c.prototype).__isByteBuffer__,Object.defineProperty(o,"__isByteBuffer__",{value:!0,enumerable:!1,configurable:!1}),s=new ArrayBuffer(0),a=String.fromCharCode,c.accessor=function(){return Uint8Array},c.allocate=function(e,t,r){return new c(e,t,r)},c.concat=function(e,t,r,n){var i,o,s,a,u,l;for(("boolean"==typeof t||"string"!=typeof t)&&(n=r,r=t,t=void 0),i=0,s=0,a=e.length;a>s;++s)c.isByteBuffer(e[s])||(e[s]=c.wrap(e[s],t)),(o=e[s].limit-e[s].offset)>0&&(i+=o);if(0===i)return new c(0,r,n);for(l=new c(i,r,n),s=0;a>s;)(o=(u=e[s++]).limit-u.offset)<=0||(l.view.set(u.view.subarray(u.offset,u.limit),l.offset),l.offset+=o);return l.limit=l.offset,l.offset=0,l},c.isByteBuffer=function(e){return!0===(e&&e.__isByteBuffer__)},c.type=function(){return ArrayBuffer},c.wrap=function(e,t,r,n){var i,s;if("string"!=typeof t&&(n=r,r=t,t=void 0),"string"==typeof e)switch(void 0===t&&(t="utf8"),t){case"base64":return c.fromBase64(e,r);case"hex":return c.fromHex(e,r);case"binary":return c.fromBinary(e,r);case"utf8":return c.fromUTF8(e,r);case"debug":return c.fromDebug(e,r);default:throw Error("Unsupported encoding: "+t)}if(null===e||"object"!=typeof e)throw TypeError("Illegal buffer");if(c.isByteBuffer(e))return(i=o.clone.call(e)).markedOffset=-1,i;if(e instanceof Uint8Array)i=new c(0,r,n),e.length>0&&(i.buffer=e.buffer,i.offset=e.byteOffset,i.limit=e.byteOffset+e.byteLength,i.view=new Uint8Array(e.buffer));else if(e instanceof ArrayBuffer)i=new c(0,r,n),e.byteLength>0&&(i.buffer=e,i.offset=0,i.limit=e.byteLength,i.view=e.byteLength>0?new Uint8Array(e):null);else{if("[object Array]"!==Object.prototype.toString.call(e))throw TypeError("Illegal buffer");for((i=new c(e.length,r,n)).limit=e.length,s=0;s<e.length;++s)i.view[s]=e[s]}return i},o.writeBitSet=function(e,t){var r,n,i,o,s,a,u=void 0===t;if(u&&(t=this.offset),!this.noAssert){if(!(e instanceof Array))throw TypeError("Illegal BitSet: Not an array");if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}for(n=t,o=(i=e.length)>>3,s=0,t+=this.writeVarint32(i,t);o--;)r=1&!!e[s++]|(1&!!e[s++])<<1|(1&!!e[s++])<<2|(1&!!e[s++])<<3|(1&!!e[s++])<<4|(1&!!e[s++])<<5|(1&!!e[s++])<<6|(1&!!e[s++])<<7,this.writeByte(r,t++);if(i>s){for(a=0,r=0;i>s;)r|=(1&!!e[s++])<<a++;this.writeByte(r,t++)}return u?(this.offset=t,this):t-n},o.readBitSet=function(e){var t,r,n,i,o,s,a,u=void 0===e;for(u&&(e=this.offset),i=(n=(r=this.readVarint32(e)).value)>>3,o=0,s=[],e+=r.length;i--;)t=this.readByte(e++),s[o++]=!!(1&t),s[o++]=!!(2&t),s[o++]=!!(4&t),s[o++]=!!(8&t),s[o++]=!!(16&t),s[o++]=!!(32&t),s[o++]=!!(64&t),s[o++]=!!(128&t);if(n>o)for(a=0,t=this.readByte(e++);n>o;)s[o++]=!!(1&t>>a++);return u&&(this.offset=e),s},o.readBytes=function(e,t){var r,n=void 0===t;if(n&&(t=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+e>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+"+e+") <= "+this.buffer.byteLength)}return r=this.slice(t,t+e),n&&(this.offset+=e),r},o.writeBytes=o.append,o.writeInt8=function(e,t){var r,n=void 0===t;if(n&&(t=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e|=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}return(t+=1)>(r=this.buffer.byteLength)&&this.resize((r*=2)>t?r:t),t-=1,this.view[t]=e,n&&(this.offset+=1),this},o.writeByte=o.writeInt8,o.readInt8=function(e){var t,r=void 0===e;if(r&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+1) <= "+this.buffer.byteLength)}return!(128&~(t=this.view[e]))&&(t=-(255-t+1)),r&&(this.offset+=1),t},o.readByte=o.readInt8,o.writeUint8=function(e,t){var r,n=void 0===t;if(n&&(t=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e>>>=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}return(t+=1)>(r=this.buffer.byteLength)&&this.resize((r*=2)>t?r:t),t-=1,this.view[t]=e,n&&(this.offset+=1),this},o.writeUInt8=o.writeUint8,o.readUint8=function(e){var t,r=void 0===e;if(r&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+1) <= "+this.buffer.byteLength)}return t=this.view[e],r&&(this.offset+=1),t},o.readUInt8=o.readUint8,o.writeInt16=function(e,t){var r,n=void 0===t;if(n&&(t=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e|=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}return(t+=2)>(r=this.buffer.byteLength)&&this.resize((r*=2)>t?r:t),t-=2,this.littleEndian?(this.view[t+1]=(65280&e)>>>8,this.view[t]=255&e):(this.view[t]=(65280&e)>>>8,this.view[t+1]=255&e),n&&(this.offset+=2),this},o.writeShort=o.writeInt16,o.readInt16=function(e){var t,r=void 0===e;if(r&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+2>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+2) <= "+this.buffer.byteLength)}return t=0,this.littleEndian?(t=this.view[e],t|=this.view[e+1]<<8):(t=this.view[e]<<8,t|=this.view[e+1]),!(32768&~t)&&(t=-(65535-t+1)),r&&(this.offset+=2),t},o.readShort=o.readInt16,o.writeUint16=function(e,t){var r,n=void 0===t;if(n&&(t=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e>>>=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}return(t+=2)>(r=this.buffer.byteLength)&&this.resize((r*=2)>t?r:t),t-=2,this.littleEndian?(this.view[t+1]=(65280&e)>>>8,this.view[t]=255&e):(this.view[t]=(65280&e)>>>8,this.view[t+1]=255&e),n&&(this.offset+=2),this},o.writeUInt16=o.writeUint16,o.readUint16=function(e){var t,r=void 0===e;if(r&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+2>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+2) <= "+this.buffer.byteLength)}return t=0,this.littleEndian?(t=this.view[e],t|=this.view[e+1]<<8):(t=this.view[e]<<8,t|=this.view[e+1]),r&&(this.offset+=2),t},o.readUInt16=o.readUint16,o.writeInt32=function(e,t){var r,n=void 0===t;if(n&&(t=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e|=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}return(t+=4)>(r=this.buffer.byteLength)&&this.resize((r*=2)>t?r:t),t-=4,this.littleEndian?(this.view[t+3]=255&e>>>24,this.view[t+2]=255&e>>>16,this.view[t+1]=255&e>>>8,this.view[t]=255&e):(this.view[t]=255&e>>>24,this.view[t+1]=255&e>>>16,this.view[t+2]=255&e>>>8,this.view[t+3]=255&e),n&&(this.offset+=4),this},o.writeInt=o.writeInt32,o.readInt32=function(e){var t,r=void 0===e;if(r&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+4>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+4) <= "+this.buffer.byteLength)}return t=0,this.littleEndian?(t=this.view[e+2]<<16,t|=this.view[e+1]<<8,t|=this.view[e],t+=this.view[e+3]<<24>>>0):(t=this.view[e+1]<<16,t|=this.view[e+2]<<8,t|=this.view[e+3],t+=this.view[e]<<24>>>0),t|=0,r&&(this.offset+=4),t},o.readInt=o.readInt32,o.writeUint32=function(e,t){var r,n=void 0===t;if(n&&(t=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e>>>=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}return(t+=4)>(r=this.buffer.byteLength)&&this.resize((r*=2)>t?r:t),t-=4,this.littleEndian?(this.view[t+3]=255&e>>>24,this.view[t+2]=255&e>>>16,this.view[t+1]=255&e>>>8,this.view[t]=255&e):(this.view[t]=255&e>>>24,this.view[t+1]=255&e>>>16,this.view[t+2]=255&e>>>8,this.view[t+3]=255&e),n&&(this.offset+=4),this},o.writeUInt32=o.writeUint32,o.readUint32=function(e){var t,r=void 0===e;if(r&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+4>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+4) <= "+this.buffer.byteLength)}return t=0,this.littleEndian?(t=this.view[e+2]<<16,t|=this.view[e+1]<<8,t|=this.view[e],t+=this.view[e+3]<<24>>>0):(t=this.view[e+1]<<16,t|=this.view[e+2]<<8,t|=this.view[e+3],t+=this.view[e]<<24>>>0),r&&(this.offset+=4),t},o.readUInt32=o.readUint32,e&&(o.writeInt64=function(t,r){var n,i,o,s=void 0===r;if(s&&(r=this.offset),!this.noAssert){if("number"==typeof t)t=e.fromNumber(t);else if("string"==typeof t)t=e.fromString(t);else if(!(t&&t instanceof e))throw TypeError("Illegal value: "+t+" (not an integer or Long)");if("number"!=typeof r||r%1!=0)throw TypeError("Illegal offset: "+r+" (not an integer)");if((r>>>=0)<0||r+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+r+" (+0) <= "+this.buffer.byteLength)}return"number"==typeof t?t=e.fromNumber(t):"string"==typeof t&&(t=e.fromString(t)),(r+=8)>(n=this.buffer.byteLength)&&this.resize((n*=2)>r?n:r),r-=8,i=t.low,o=t.high,this.littleEndian?(this.view[r+3]=255&i>>>24,this.view[r+2]=255&i>>>16,this.view[r+1]=255&i>>>8,this.view[r]=255&i,r+=4,this.view[r+3]=255&o>>>24,this.view[r+2]=255&o>>>16,this.view[r+1]=255&o>>>8,this.view[r]=255&o):(this.view[r]=255&o>>>24,this.view[r+1]=255&o>>>16,this.view[r+2]=255&o>>>8,this.view[r+3]=255&o,r+=4,this.view[r]=255&i>>>24,this.view[r+1]=255&i>>>16,this.view[r+2]=255&i>>>8,this.view[r+3]=255&i),s&&(this.offset+=8),this},o.writeLong=o.writeInt64,o.readInt64=function(t){var r,n,i,o=void 0===t;if(o&&(t=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+8>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+8) <= "+this.buffer.byteLength)}return r=0,n=0,this.littleEndian?(r=this.view[t+2]<<16,r|=this.view[t+1]<<8,r|=this.view[t],r+=this.view[t+3]<<24>>>0,t+=4,n=this.view[t+2]<<16,n|=this.view[t+1]<<8,n|=this.view[t],n+=this.view[t+3]<<24>>>0):(n=this.view[t+1]<<16,n|=this.view[t+2]<<8,n|=this.view[t+3],n+=this.view[t]<<24>>>0,t+=4,r=this.view[t+1]<<16,r|=this.view[t+2]<<8,r|=this.view[t+3],r+=this.view[t]<<24>>>0),i=new e(r,n,!1),o&&(this.offset+=8),i},o.readLong=o.readInt64,o.writeUint64=function(t,r){var n,i,o,s=void 0===r;if(s&&(r=this.offset),!this.noAssert){if("number"==typeof t)t=e.fromNumber(t);else if("string"==typeof t)t=e.fromString(t);else if(!(t&&t instanceof e))throw TypeError("Illegal value: "+t+" (not an integer or Long)");if("number"!=typeof r||r%1!=0)throw TypeError("Illegal offset: "+r+" (not an integer)");if((r>>>=0)<0||r+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+r+" (+0) <= "+this.buffer.byteLength)}return"number"==typeof t?t=e.fromNumber(t):"string"==typeof t&&(t=e.fromString(t)),(r+=8)>(n=this.buffer.byteLength)&&this.resize((n*=2)>r?n:r),r-=8,i=t.low,o=t.high,this.littleEndian?(this.view[r+3]=255&i>>>24,this.view[r+2]=255&i>>>16,this.view[r+1]=255&i>>>8,this.view[r]=255&i,r+=4,this.view[r+3]=255&o>>>24,this.view[r+2]=255&o>>>16,this.view[r+1]=255&o>>>8,this.view[r]=255&o):(this.view[r]=255&o>>>24,this.view[r+1]=255&o>>>16,this.view[r+2]=255&o>>>8,this.view[r+3]=255&o,r+=4,this.view[r]=255&i>>>24,this.view[r+1]=255&i>>>16,this.view[r+2]=255&i>>>8,this.view[r+3]=255&i),s&&(this.offset+=8),this},o.writeUInt64=o.writeUint64,o.readUint64=function(t){var r,n,i,o=void 0===t;if(o&&(t=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+8>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+8) <= "+this.buffer.byteLength)}return r=0,n=0,this.littleEndian?(r=this.view[t+2]<<16,r|=this.view[t+1]<<8,r|=this.view[t],r+=this.view[t+3]<<24>>>0,t+=4,n=this.view[t+2]<<16,n|=this.view[t+1]<<8,n|=this.view[t],n+=this.view[t+3]<<24>>>0):(n=this.view[t+1]<<16,n|=this.view[t+2]<<8,n|=this.view[t+3],n+=this.view[t]<<24>>>0,t+=4,r=this.view[t+1]<<16,r|=this.view[t+2]<<8,r|=this.view[t+3],r+=this.view[t]<<24>>>0),i=new e(r,n,!0),o&&(this.offset+=8),i},o.readUInt64=o.readUint64),o.writeFloat32=function(e,t){var r,n=void 0===t;if(n&&(t=this.offset),!this.noAssert){if("number"!=typeof e)throw TypeError("Illegal value: "+e+" (not a number)");if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}return(t+=4)>(r=this.buffer.byteLength)&&this.resize((r*=2)>t?r:t),t-=4,i(this.view,e,t,this.littleEndian,23,4),n&&(this.offset+=4),this},o.writeFloat=o.writeFloat32,o.readFloat32=function(e){var t,r=void 0===e;if(r&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+4>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+4) <= "+this.buffer.byteLength)}return t=n(this.view,e,this.littleEndian,23,4),r&&(this.offset+=4),t},o.readFloat=o.readFloat32,o.writeFloat64=function(e,t){var r,n=void 0===t;if(n&&(t=this.offset),!this.noAssert){if("number"!=typeof e)throw TypeError("Illegal value: "+e+" (not a number)");if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}return(t+=8)>(r=this.buffer.byteLength)&&this.resize((r*=2)>t?r:t),t-=8,i(this.view,e,t,this.littleEndian,52,8),n&&(this.offset+=8),this},o.writeDouble=o.writeFloat64,o.readFloat64=function(e){var t,r=void 0===e;if(r&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+8>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+8) <= "+this.buffer.byteLength)}return t=n(this.view,e,this.littleEndian,52,8),r&&(this.offset+=8),t},o.readDouble=o.readFloat64,c.MAX_VARINT32_BYTES=5,c.calculateVarint32=function(e){return(e>>>=0)<128?1:e<16384?2:1<<21>e?3:1<<28>e?4:5},c.zigZagEncode32=function(e){return((e|=0)<<1^e>>31)>>>0},c.zigZagDecode32=function(e){return e>>>1^-(1&e)},o.writeVarint32=function(e,t){var r,n,i,o=void 0===t;if(o&&(t=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e|=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}for((t+=n=c.calculateVarint32(e))>(i=this.buffer.byteLength)&&this.resize((i*=2)>t?i:t),t-=n,e>>>=0;e>=128;)r=128|127&e,this.view[t++]=r,e>>>=7;return this.view[t++]=e,o?(this.offset=t,this):n},o.writeVarint32ZigZag=function(e,t){return this.writeVarint32(c.zigZagEncode32(e),t)},o.readVarint32=function(e){var t,r,n,i,o=void 0===e;if(o&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+1) <= "+this.buffer.byteLength)}r=0,n=0;do{if(!this.noAssert&&e>this.limit)throw(i=Error("Truncated")).truncated=!0,i;t=this.view[e++],r<5&&(n|=(127&t)<<7*r),++r}while(128&t);return n|=0,o?(this.offset=e,n):{value:n,length:r}},o.readVarint32ZigZag=function(e){var t=this.readVarint32(e);return"object"==typeof t?t.value=c.zigZagDecode32(t.value):t=c.zigZagDecode32(t),t},e&&(c.MAX_VARINT64_BYTES=10,c.calculateVarint64=function(t){"number"==typeof t?t=e.fromNumber(t):"string"==typeof t&&(t=e.fromString(t));var r=t.toInt()>>>0,n=t.shiftRightUnsigned(28).toInt()>>>0,i=t.shiftRightUnsigned(56).toInt()>>>0;return 0==i?0==n?r<16384?r<128?1:2:1<<21>r?3:4:n<16384?n<128?5:6:1<<21>n?7:8:i<128?9:10},c.zigZagEncode64=function(t){return"number"==typeof t?t=e.fromNumber(t,!1):"string"==typeof t?t=e.fromString(t,!1):!1!==t.unsigned&&(t=t.toSigned()),t.shiftLeft(1).xor(t.shiftRight(63)).toUnsigned()},c.zigZagDecode64=function(t){return"number"==typeof t?t=e.fromNumber(t,!1):"string"==typeof t?t=e.fromString(t,!1):!1!==t.unsigned&&(t=t.toSigned()),t.shiftRightUnsigned(1).xor(t.and(e.ONE).toSigned().negate()).toSigned()},o.writeVarint64=function(t,r){var n,i,o,s,a,u=void 0===r;if(u&&(r=this.offset),!this.noAssert){if("number"==typeof t)t=e.fromNumber(t);else if("string"==typeof t)t=e.fromString(t);else if(!(t&&t instanceof e))throw TypeError("Illegal value: "+t+" (not an integer or Long)");if("number"!=typeof r||r%1!=0)throw TypeError("Illegal offset: "+r+" (not an integer)");if((r>>>=0)<0||r+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+r+" (+0) <= "+this.buffer.byteLength)}switch("number"==typeof t?t=e.fromNumber(t,!1):"string"==typeof t?t=e.fromString(t,!1):!1!==t.unsigned&&(t=t.toSigned()),n=c.calculateVarint64(t),i=t.toInt()>>>0,o=t.shiftRightUnsigned(28).toInt()>>>0,s=t.shiftRightUnsigned(56).toInt()>>>0,(r+=n)>(a=this.buffer.byteLength)&&this.resize((a*=2)>r?a:r),r-=n,n){case 10:this.view[r+9]=1&s>>>7;case 9:this.view[r+8]=9!==n?128|s:127&s;case 8:this.view[r+7]=8!==n?128|o>>>21:127&o>>>21;case 7:this.view[r+6]=7!==n?128|o>>>14:127&o>>>14;case 6:this.view[r+5]=6!==n?128|o>>>7:127&o>>>7;case 5:this.view[r+4]=5!==n?128|o:127&o;case 4:this.view[r+3]=4!==n?128|i>>>21:127&i>>>21;case 3:this.view[r+2]=3!==n?128|i>>>14:127&i>>>14;case 2:this.view[r+1]=2!==n?128|i>>>7:127&i>>>7;case 1:this.view[r]=1!==n?128|i:127&i}return u?(this.offset+=n,this):n},o.writeVarint64ZigZag=function(e,t){return this.writeVarint64(c.zigZagEncode64(e),t)},o.readVarint64=function(t){var r,n,i,o,s,a,u=void 0===t;if(u&&(t=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+1) <= "+this.buffer.byteLength)}if(r=t,n=0,i=0,o=0,s=0,n=127&(s=this.view[t++]),128&s&&(n|=(127&(s=this.view[t++]))<<7,(128&s||this.noAssert&&void 0===s)&&(n|=(127&(s=this.view[t++]))<<14,(128&s||this.noAssert&&void 0===s)&&(n|=(127&(s=this.view[t++]))<<21,(128&s||this.noAssert&&void 0===s)&&(i=127&(s=this.view[t++]),(128&s||this.noAssert&&void 0===s)&&(i|=(127&(s=this.view[t++]))<<7,(128&s||this.noAssert&&void 0===s)&&(i|=(127&(s=this.view[t++]))<<14,(128&s||this.noAssert&&void 0===s)&&(i|=(127&(s=this.view[t++]))<<21,(128&s||this.noAssert&&void 0===s)&&(o=127&(s=this.view[t++]),(128&s||this.noAssert&&void 0===s)&&(o|=(127&(s=this.view[t++]))<<7,128&s||this.noAssert&&void 0===s))))))))))throw Error("Buffer overrun");return a=e.fromBits(n|i<<28,i>>>4|o<<24,!1),u?(this.offset=t,a):{value:a,length:t-r}},o.readVarint64ZigZag=function(t){var r=this.readVarint64(t);return r&&r.value instanceof e?r.value=c.zigZagDecode64(r.value):r=c.zigZagDecode64(r),r}),o.writeCString=function(e,r){var n,i,o,s=void 0===r;if(s&&(r=this.offset),i=e.length,!this.noAssert){if("string"!=typeof e)throw TypeError("Illegal str: Not a string");for(n=0;i>n;++n)if(0===e.charCodeAt(n))throw RangeError("Illegal str: Contains NULL-characters");if("number"!=typeof r||r%1!=0)throw TypeError("Illegal offset: "+r+" (not an integer)");if((r>>>=0)<0||r+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+r+" (+0) <= "+this.buffer.byteLength)}return i=l.calculateUTF16asUTF8(t(e))[1],r+=i+1,o=this.buffer.byteLength,r>o&&this.resize((o*=2)>r?o:r),r-=i+1,l.encodeUTF16toUTF8(t(e),function(e){this.view[r++]=e}.bind(this)),this.view[r++]=0,s?(this.offset=r,this):i},o.readCString=function(e){var t,n,i,o=void 0===e;if(o&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+1) <= "+this.buffer.byteLength)}return t=e,i=-1,l.decodeUTF8toUTF16(function(){if(0===i)return null;if(e>=this.limit)throw RangeError("Illegal range: Truncated data, "+e+" < "+this.limit);return 0===(i=this.view[e++])?null:i}.bind(this),n=r(),!0),o?(this.offset=e,n()):{string:n(),length:e-t}},o.writeIString=function(e,r){var n,i,o,s=void 0===r;if(s&&(r=this.offset),!this.noAssert){if("string"!=typeof e)throw TypeError("Illegal str: Not a string");if("number"!=typeof r||r%1!=0)throw TypeError("Illegal offset: "+r+" (not an integer)");if((r>>>=0)<0||r+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+r+" (+0) <= "+this.buffer.byteLength)}if(i=r,n=l.calculateUTF16asUTF8(t(e),this.noAssert)[1],r+=4+n,o=this.buffer.byteLength,r>o&&this.resize((o*=2)>r?o:r),r-=4+n,this.littleEndian?(this.view[r+3]=255&n>>>24,this.view[r+2]=255&n>>>16,this.view[r+1]=255&n>>>8,this.view[r]=255&n):(this.view[r]=255&n>>>24,this.view[r+1]=255&n>>>16,this.view[r+2]=255&n>>>8,this.view[r+3]=255&n),r+=4,l.encodeUTF16toUTF8(t(e),function(e){this.view[r++]=e}.bind(this)),r!==i+4+n)throw RangeError("Illegal range: Truncated data, "+r+" == "+(r+4+n));return s?(this.offset=r,this):r-i},o.readIString=function(e){var t,r,n,i=void 0===e;if(i&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+4>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+4) <= "+this.buffer.byteLength)}return t=e,r=this.readUint32(e),n=this.readUTF8String(r,c.METRICS_BYTES,e+=4),e+=n.length,i?(this.offset=e,n.string):{string:n.string,length:e-t}},c.METRICS_CHARS="c",c.METRICS_BYTES="b",o.writeUTF8String=function(e,r){var n,i,o,s=void 0===r;if(s&&(r=this.offset),!this.noAssert){if("number"!=typeof r||r%1!=0)throw TypeError("Illegal offset: "+r+" (not an integer)");if((r>>>=0)<0||r+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+r+" (+0) <= "+this.buffer.byteLength)}return i=r,n=l.calculateUTF16asUTF8(t(e))[1],r+=n,o=this.buffer.byteLength,r>o&&this.resize((o*=2)>r?o:r),r-=n,l.encodeUTF16toUTF8(t(e),function(e){this.view[r++]=e}.bind(this)),s?(this.offset=r,this):r-i},o.writeString=o.writeUTF8String,c.calculateUTF8Chars=function(e){return l.calculateUTF16asUTF8(t(e))[0]},c.calculateUTF8Bytes=function(e){return l.calculateUTF16asUTF8(t(e))[1]},c.calculateString=c.calculateUTF8Bytes,o.readUTF8String=function(e,t,n){var i,o,s,a,u;if("number"==typeof t&&(n=t,t=void 0),(i=void 0===n)&&(n=this.offset),void 0===t&&(t=c.METRICS_CHARS),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal length: "+e+" (not an integer)");if(e|=0,"number"!=typeof n||n%1!=0)throw TypeError("Illegal offset: "+n+" (not an integer)");if((n>>>=0)<0||n+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+0) <= "+this.buffer.byteLength)}if(s=0,a=n,t===c.METRICS_CHARS){if(o=r(),l.decodeUTF8(function(){return e>s&&n<this.limit?this.view[n++]:null}.bind(this),(function(e){++s,l.UTF8toUTF16(e,o)})),s!==e)throw RangeError("Illegal range: Truncated data, "+s+" == "+e);return i?(this.offset=n,o()):{string:o(),length:n-a}}if(t===c.METRICS_BYTES){if(!this.noAssert){if("number"!=typeof n||n%1!=0)throw TypeError("Illegal offset: "+n+" (not an integer)");if((n>>>=0)<0||n+e>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+"+e+") <= "+this.buffer.byteLength)}if(u=n+e,l.decodeUTF8toUTF16(function(){return u>n?this.view[n++]:null}.bind(this),o=r(),this.noAssert),n!==u)throw RangeError("Illegal range: Truncated data, "+n+" == "+u);return i?(this.offset=n,o()):{string:o(),length:n-a}}throw TypeError("Unsupported metrics: "+t)},o.readString=o.readUTF8String,o.writeVString=function(e,r){var n,i,o,s,a=void 0===r;if(a&&(r=this.offset),!this.noAssert){if("string"!=typeof e)throw TypeError("Illegal str: Not a string");if("number"!=typeof r||r%1!=0)throw TypeError("Illegal offset: "+r+" (not an integer)");if((r>>>=0)<0||r+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+r+" (+0) <= "+this.buffer.byteLength)}if(o=r,n=l.calculateUTF16asUTF8(t(e),this.noAssert)[1],i=c.calculateVarint32(n),r+=i+n,s=this.buffer.byteLength,r>s&&this.resize((s*=2)>r?s:r),r-=i+n,r+=this.writeVarint32(n,r),l.encodeUTF16toUTF8(t(e),function(e){this.view[r++]=e}.bind(this)),r!==o+n+i)throw RangeError("Illegal range: Truncated data, "+r+" == "+(r+n+i));return a?(this.offset=r,this):r-o},o.readVString=function(e){var t,r,n,i=void 0===e;if(i&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+1) <= "+this.buffer.byteLength)}return t=e,r=this.readVarint32(e),n=this.readUTF8String(r.value,c.METRICS_BYTES,e+=r.length),e+=n.length,i?(this.offset=e,n.string):{string:n.string,length:e-t}},o.append=function(e,t,r){var n,i,o;if(("number"==typeof t||"string"!=typeof t)&&(r=t,t=void 0),(n=void 0===r)&&(r=this.offset),!this.noAssert){if("number"!=typeof r||r%1!=0)throw TypeError("Illegal offset: "+r+" (not an integer)");if((r>>>=0)<0||r+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+r+" (+0) <= "+this.buffer.byteLength)}return e instanceof c||(e=c.wrap(e,t)),(i=e.limit-e.offset)<=0||((r+=i)>(o=this.buffer.byteLength)&&this.resize((o*=2)>r?o:r),r-=i,this.view.set(e.view.subarray(e.offset,e.limit),r),e.offset+=i,n&&(this.offset+=i)),this},o.appendTo=function(e,t){return e.append(this,t),this},o.assert=function(e){return this.noAssert=!e,this},o.capacity=function(){return this.buffer.byteLength},o.clear=function(){return this.offset=0,this.limit=this.buffer.byteLength,this.markedOffset=-1,this},o.clone=function(e){var t=new c(0,this.littleEndian,this.noAssert);return e?(t.buffer=new ArrayBuffer(this.buffer.byteLength),t.view=new Uint8Array(t.buffer)):(t.buffer=this.buffer,t.view=this.view),t.offset=this.offset,t.markedOffset=this.markedOffset,t.limit=this.limit,t},o.compact=function(e,t){var r,n,i;if(void 0===e&&(e=this.offset),void 0===t&&(t=this.limit),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal begin: Not an integer");if(e>>>=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal end: Not an integer");if(t>>>=0,e<0||e>t||t>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+e+" <= "+t+" <= "+this.buffer.byteLength)}return 0===e&&t===this.buffer.byteLength?this:0===(r=t-e)?(this.buffer=s,this.view=null,this.markedOffset>=0&&(this.markedOffset-=e),this.offset=0,this.limit=0,this):(n=new ArrayBuffer(r),(i=new Uint8Array(n)).set(this.view.subarray(e,t)),this.buffer=n,this.view=i,this.markedOffset>=0&&(this.markedOffset-=e),this.offset=0,this.limit=r,this)},o.copy=function(e,t){if(void 0===e&&(e=this.offset),void 0===t&&(t=this.limit),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal begin: Not an integer");if(e>>>=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal end: Not an integer");if(t>>>=0,e<0||e>t||t>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+e+" <= "+t+" <= "+this.buffer.byteLength)}if(e===t)return new c(0,this.littleEndian,this.noAssert);var r=t-e,n=new c(r,this.littleEndian,this.noAssert);return n.offset=0,n.limit=r,n.markedOffset>=0&&(n.markedOffset-=e),this.copyTo(n,0,e,t),n},o.copyTo=function(e,t,r,n){var i,o,s;if(!this.noAssert&&!c.isByteBuffer(e))throw TypeError("Illegal target: Not a ByteBuffer");if(t=(o=void 0===t)?e.offset:0|t,r=(i=void 0===r)?this.offset:0|r,n=void 0===n?this.limit:0|n,t<0||t>e.buffer.byteLength)throw RangeError("Illegal target range: 0 <= "+t+" <= "+e.buffer.byteLength);if(r<0||n>this.buffer.byteLength)throw RangeError("Illegal source range: 0 <= "+r+" <= "+this.buffer.byteLength);return 0===(s=n-r)?e:(e.ensureCapacity(t+s),e.view.set(this.view.subarray(r,n),t),i&&(this.offset+=s),o&&(e.offset+=s),this)},o.ensureCapacity=function(e){var t=this.buffer.byteLength;return e>t?this.resize((t*=2)>e?t:e):this},o.fill=function(e,t,r){var n=void 0===t;if(n&&(t=this.offset),"string"==typeof e&&e.length>0&&(e=e.charCodeAt(0)),void 0===t&&(t=this.offset),void 0===r&&(r=this.limit),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e|=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal begin: Not an integer");if(t>>>=0,"number"!=typeof r||r%1!=0)throw TypeError("Illegal end: Not an integer");if(r>>>=0,t<0||t>r||r>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+t+" <= "+r+" <= "+this.buffer.byteLength)}if(t>=r)return this;for(;r>t;)this.view[t++]=e;return n&&(this.offset=t),this},o.flip=function(){return this.limit=this.offset,this.offset=0,this},o.mark=function(e){if(e=void 0===e?this.offset:e,!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+0) <= "+this.buffer.byteLength)}return this.markedOffset=e,this},o.order=function(e){if(!this.noAssert&&"boolean"!=typeof e)throw TypeError("Illegal littleEndian: Not a boolean");return this.littleEndian=!!e,this},o.LE=function(e){return this.littleEndian=void 0===e||!!e,this},o.BE=function(e){return this.littleEndian=void 0!==e&&!e,this},o.prepend=function(e,t,r){var n,i,o,s,a;if(("number"==typeof t||"string"!=typeof t)&&(r=t,t=void 0),(n=void 0===r)&&(r=this.offset),!this.noAssert){if("number"!=typeof r||r%1!=0)throw TypeError("Illegal offset: "+r+" (not an integer)");if((r>>>=0)<0||r+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+r+" (+0) <= "+this.buffer.byteLength)}return e instanceof c||(e=c.wrap(e,t)),(i=e.limit-e.offset)<=0||((o=i-r)>0?(s=new ArrayBuffer(this.buffer.byteLength+o),(a=new Uint8Array(s)).set(this.view.subarray(r,this.buffer.byteLength),i),this.buffer=s,this.view=a,this.offset+=o,this.markedOffset>=0&&(this.markedOffset+=o),this.limit+=o,r+=o):new Uint8Array(this.buffer),this.view.set(e.view.subarray(e.offset,e.limit),r-i),e.offset=e.limit,n&&(this.offset-=i)),this},o.prependTo=function(e,t){return e.prepend(this,t),this},o.printDebug=function(e){"function"!=typeof e&&(e=console.log.bind(console)),e(this.toString()+"\n-------------------------------------------------------------------\n"+this.toDebug(!0))},o.remaining=function(){return this.limit-this.offset},o.reset=function(){return this.markedOffset>=0?(this.offset=this.markedOffset,this.markedOffset=-1):this.offset=0,this},o.resize=function(e){var t,r;if(!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal capacity: "+e+" (not an integer)");if((e|=0)<0)throw RangeError("Illegal capacity: 0 <= "+e)}return this.buffer.byteLength<e&&(t=new ArrayBuffer(e),(r=new Uint8Array(t)).set(this.view),this.buffer=t,this.view=r),this},o.reverse=function(e,t){if(void 0===e&&(e=this.offset),void 0===t&&(t=this.limit),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal begin: Not an integer");if(e>>>=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal end: Not an integer");if(t>>>=0,e<0||e>t||t>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+e+" <= "+t+" <= "+this.buffer.byteLength)}return e===t||Array.prototype.reverse.call(this.view.subarray(e,t)),this},o.skip=function(e){if(!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal length: "+e+" (not an integer)");e|=0}var t=this.offset+e;if(!this.noAssert&&(t<0||t>this.buffer.byteLength))throw RangeError("Illegal length: 0 <= "+this.offset+" + "+e+" <= "+this.buffer.byteLength);return this.offset=t,this},o.slice=function(e,t){if(void 0===e&&(e=this.offset),void 0===t&&(t=this.limit),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal begin: Not an integer");if(e>>>=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal end: Not an integer");if(t>>>=0,e<0||e>t||t>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+e+" <= "+t+" <= "+this.buffer.byteLength)}var r=this.clone();return r.offset=e,r.limit=t,r},o.toBuffer=function(e){var t,r=this.offset,n=this.limit;if(!this.noAssert){if("number"!=typeof r||r%1!=0)throw TypeError("Illegal offset: Not an integer");if(r>>>=0,"number"!=typeof n||n%1!=0)throw TypeError("Illegal limit: Not an integer");if(n>>>=0,r<0||r>n||n>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+r+" <= "+n+" <= "+this.buffer.byteLength)}return e||0!==r||n!==this.buffer.byteLength?r===n?s:(t=new ArrayBuffer(n-r),new Uint8Array(t).set(new Uint8Array(this.buffer).subarray(r,n),0),t):this.buffer},o.toArrayBuffer=o.toBuffer,o.toString=function(e,t,r){if(void 0===e)return"ByteBufferAB(offset="+this.offset+",markedOffset="+this.markedOffset+",limit="+this.limit+",capacity="+this.capacity()+")";switch("number"==typeof e&&(r=t=e="utf8"),e){case"utf8":return this.toUTF8(t,r);case"base64":return this.toBase64(t,r);case"hex":return this.toHex(t,r);case"binary":return this.toBinary(t,r);case"debug":return this.toDebug();case"columns":return this.toColumns();default:throw Error("Unsupported encoding: "+e)}},u=function(){var e,t,r={},n=[65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,48,49,50,51,52,53,54,55,56,57,43,47],i=[];for(e=0,t=n.length;t>e;++e)i[n[e]]=e;return r.encode=function(e,t){for(var r,i;null!==(r=e());)t(n[63&r>>2]),i=(3&r)<<4,null!==(r=e())?(t(n[63&((i|=15&r>>4)|15&r>>4)]),i=(15&r)<<2,null!==(r=e())?(t(n[63&(i|3&r>>6)]),t(n[63&r])):(t(n[63&i]),t(61))):(t(n[63&i]),t(61),t(61))},r.decode=function(e,t){function r(e){throw Error("Illegal character code: "+e)}for(var n,o,s;null!==(n=e());)if(void 0===(o=i[n])&&r(n),null!==(n=e())&&(void 0===(s=i[n])&&r(n),t(o<<2>>>0|(48&s)>>4),null!==(n=e()))){if(void 0===(o=i[n])){if(61===n)break;r(n)}if(t((15&s)<<4>>>0|(60&o)>>2),null!==(n=e())){if(void 0===(s=i[n])){if(61===n)break;r(n)}t((3&o)<<6>>>0|s)}}},r.test=function(e){return/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/.test(e)},r}(),o.toBase64=function(e,t){if(void 0===e&&(e=this.offset),void 0===t&&(t=this.limit),t|=0,(e|=0)<0||t>this.capacity||e>t)throw RangeError("begin, end");var n;return u.encode(function(){return t>e?this.view[e++]:null}.bind(this),n=r()),n()},c.fromBase64=function(e,r){if("string"!=typeof e)throw TypeError("str");var n=new c(e.length/4*3,r),i=0;return u.decode(t(e),(function(e){n.view[i++]=e})),n.limit=i,n},c.btoa=function(e){return c.fromBinary(e).toBase64()},c.atob=function(e){return c.fromBase64(e).toBinary()},o.toBinary=function(e,t){if(void 0===e&&(e=this.offset),void 0===t&&(t=this.limit),t|=0,(e|=0)<0||t>this.capacity()||e>t)throw RangeError("begin, end");if(e===t)return"";for(var r=[],n=[];t>e;)r.push(this.view[e++]),r.length>=1024&&(n.push(String.fromCharCode.apply(String,r)),r=[]);return n.join("")+String.fromCharCode.apply(String,r)},c.fromBinary=function(e,t){if("string"!=typeof e)throw TypeError("str");for(var r,n=0,i=e.length,o=new c(i,t);i>n;){if((r=e.charCodeAt(n))>255)throw RangeError("illegal char code: "+r);o.view[n++]=r}return o.limit=i,o},o.toDebug=function(e){for(var t,r=-1,n=this.buffer.byteLength,i="",o="",s="";n>r;){if(-1!==r&&(i+=(t=this.view[r])<16?"0"+t.toString(16).toUpperCase():t.toString(16).toUpperCase(),e&&(o+=t>32&&t<127?String.fromCharCode(t):".")),++r,e&&r>0&&r%16==0&&r!==n){for(;i.length<51;)i+=" ";s+=i+o+"\n",i=o=""}i+=r===this.offset&&r===this.limit?r===this.markedOffset?"!":"|":r===this.offset?r===this.markedOffset?"[":"<":r===this.limit?r===this.markedOffset?"]":">":r===this.markedOffset?"'":e||0!==r&&r!==n?" ":""}if(e&&" "!==i){for(;i.length<51;)i+=" ";s+=i+o+"\n"}return e?s:i},c.fromDebug=function(e,t,r){for(var n,i,o=e.length,s=new c(0|(o+1)/3,t,r),a=0,u=0,l=!1,d=!1,p=!1,f=!1,h=!1;o>a;){switch(n=e.charAt(a++)){case"!":if(!r){if(d||p||f){h=!0;break}d=p=f=!0}s.offset=s.markedOffset=s.limit=u,l=!1;break;case"|":if(!r){if(d||f){h=!0;break}d=f=!0}s.offset=s.limit=u,l=!1;break;case"[":if(!r){if(d||p){h=!0;break}d=p=!0}s.offset=s.markedOffset=u,l=!1;break;case"<":if(!r){if(d){h=!0;break}d=!0}s.offset=u,l=!1;break;case"]":if(!r){if(f||p){h=!0;break}f=p=!0}s.limit=s.markedOffset=u,l=!1;break;case">":if(!r){if(f){h=!0;break}f=!0}s.limit=u,l=!1;break;case"'":if(!r){if(p){h=!0;break}p=!0}s.markedOffset=u,l=!1;break;case" ":l=!1;break;default:if(!r&&l){h=!0;break}if(i=parseInt(n+e.charAt(a++),16),!r&&(isNaN(i)||i<0||i>255))throw TypeError("Illegal str: Not a debug encoded string");s.view[u++]=i,l=!0}if(h)throw TypeError("Illegal str: Invalid symbol at "+a)}if(!r){if(!d||!f)throw TypeError("Illegal str: Missing offset or limit");if(u<s.buffer.byteLength)throw TypeError("Illegal str: Not a debug encoded string (is it hex?) "+u+" < "+o)}return s},o.toHex=function(e,t){if(e=void 0===e?this.offset:e,t=void 0===t?this.limit:t,!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal begin: Not an integer");if(e>>>=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal end: Not an integer");if(t>>>=0,e<0||e>t||t>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+e+" <= "+t+" <= "+this.buffer.byteLength)}for(var r,n=new Array(t-e);t>e;)(r=this.view[e++])<16?n.push("0",r.toString(16)):n.push(r.toString(16));return n.join("")},c.fromHex=function(e,t,r){var n,i,o,s,a;if(!r){if("string"!=typeof e)throw TypeError("Illegal str: Not a string");if(e.length%2!=0)throw TypeError("Illegal str: Length not a multiple of 2")}for(i=e.length,o=new c(0|i/2,t),s=0,a=0;i>s;s+=2){if(n=parseInt(e.substring(s,s+2),16),!r&&(!isFinite(n)||n<0||n>255))throw TypeError("Illegal str: Contains non-hex characters");o.view[a++]=n}return o.limit=a,o},l=function(){var e={MAX_CODEPOINT:1114111,encodeUTF8:function(e,t){var r=null;for("number"==typeof e&&(r=e,e=function(){return null});null!==r||null!==(r=e());)r<128?t(127&r):r<2048?(t(192|31&r>>6),t(128|63&r)):r<65536?(t(224|15&r>>12),t(128|63&r>>6),t(128|63&r)):(t(240|7&r>>18),t(128|63&r>>12),t(128|63&r>>6),t(128|63&r)),r=null},decodeUTF8:function(e,t){for(var r,n,i,o,s=function(e){e=e.slice(0,e.indexOf(null));var t=Error(e.toString());throw t.name="TruncatedError",t.bytes=e,t};null!==(r=e());)if(128&r)if(192==(224&r))null===(n=e())&&s([r,n]),t((31&r)<<6|63&n);else if(224==(240&r))(null===(n=e())||null===(i=e()))&&s([r,n,i]),t((15&r)<<12|(63&n)<<6|63&i);else{if(240!=(248&r))throw RangeError("Illegal starting byte: "+r);(null===(n=e())||null===(i=e())||null===(o=e()))&&s([r,n,i,o]),t((7&r)<<18|(63&n)<<12|(63&i)<<6|63&o)}else t(r)},UTF16toUTF8:function(e,t){for(var r,n=null;null!==(r=null!==n?n:e());)r>=55296&&r<=57343&&null!==(n=e())&&n>=56320&&n<=57343?(t(1024*(r-55296)+n-56320+65536),n=null):t(r);null!==n&&t(n)},UTF8toUTF16:function(e,t){var r=null;for("number"==typeof e&&(r=e,e=function(){return null});null!==r||null!==(r=e());)r<=65535?t(r):(t(55296+((r-=65536)>>10)),t(r%1024+56320)),r=null},encodeUTF16toUTF8:function(t,r){e.UTF16toUTF8(t,(function(t){e.encodeUTF8(t,r)}))},decodeUTF8toUTF16:function(t,r){e.decodeUTF8(t,(function(t){e.UTF8toUTF16(t,r)}))},calculateCodePoint:function(e){return e<128?1:e<2048?2:e<65536?3:4},calculateUTF8:function(e){for(var t,r=0;null!==(t=e());)r+=t<128?1:t<2048?2:t<65536?3:4;return r},calculateUTF16asUTF8:function(t){var r=0,n=0;return e.UTF16toUTF8(t,(function(e){++r,n+=e<128?1:e<2048?2:e<65536?3:4})),[r,n]}};return e}(),o.toUTF8=function(e,t){if(void 0===e&&(e=this.offset),void 0===t&&(t=this.limit),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal begin: Not an integer");if(e>>>=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal end: Not an integer");if(t>>>=0,e<0||e>t||t>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+e+" <= "+t+" <= "+this.buffer.byteLength)}var n;try{l.decodeUTF8toUTF16(function(){return t>e?this.view[e++]:null}.bind(this),n=r())}catch(r){if(e!==t)throw RangeError("Illegal range: Truncated data, "+e+" != "+t)}return n()},c.fromUTF8=function(e,r,n){if(!n&&"string"!=typeof e)throw TypeError("Illegal str: Not a string");var i=new c(l.calculateUTF16asUTF8(t(e),!0)[1],r,n),o=0;return l.encodeUTF16toUTF8(t(e),(function(e){i.view[o++]=e})),i.limit=o,i},c}(t),n=function(t,r){var n,i,o={};return o.ByteBuffer=t,o.c=t,n=t,o.Long=r||null,o.VERSION="5.0.1",o.WIRE_TYPES={},o.WIRE_TYPES.VARINT=0,o.WIRE_TYPES.BITS64=1,o.WIRE_TYPES.LDELIM=2,o.WIRE_TYPES.STARTGROUP=3,o.WIRE_TYPES.ENDGROUP=4,o.WIRE_TYPES.BITS32=5,o.PACKABLE_WIRE_TYPES=[o.WIRE_TYPES.VARINT,o.WIRE_TYPES.BITS64,o.WIRE_TYPES.BITS32],o.TYPES={int32:{name:"int32",wireType:o.WIRE_TYPES.VARINT,defaultValue:0},uint32:{name:"uint32",wireType:o.WIRE_TYPES.VARINT,defaultValue:0},sint32:{name:"sint32",wireType:o.WIRE_TYPES.VARINT,defaultValue:0},int64:{name:"int64",wireType:o.WIRE_TYPES.VARINT,defaultValue:o.Long?o.Long.ZERO:void 0},uint64:{name:"uint64",wireType:o.WIRE_TYPES.VARINT,defaultValue:o.Long?o.Long.UZERO:void 0},sint64:{name:"sint64",wireType:o.WIRE_TYPES.VARINT,defaultValue:o.Long?o.Long.ZERO:void 0},bool:{name:"bool",wireType:o.WIRE_TYPES.VARINT,defaultValue:!1},double:{name:"double",wireType:o.WIRE_TYPES.BITS64,defaultValue:0},string:{name:"string",wireType:o.WIRE_TYPES.LDELIM,defaultValue:""},bytes:{name:"bytes",wireType:o.WIRE_TYPES.LDELIM,defaultValue:null},fixed32:{name:"fixed32",wireType:o.WIRE_TYPES.BITS32,defaultValue:0},sfixed32:{name:"sfixed32",wireType:o.WIRE_TYPES.BITS32,defaultValue:0},fixed64:{name:"fixed64",wireType:o.WIRE_TYPES.BITS64,defaultValue:o.Long?o.Long.UZERO:void 0},sfixed64:{name:"sfixed64",wireType:o.WIRE_TYPES.BITS64,defaultValue:o.Long?o.Long.ZERO:void 0},float:{name:"float",wireType:o.WIRE_TYPES.BITS32,defaultValue:0},enum:{name:"enum",wireType:o.WIRE_TYPES.VARINT,defaultValue:0},message:{name:"message",wireType:o.WIRE_TYPES.LDELIM,defaultValue:null},group:{name:"group",wireType:o.WIRE_TYPES.STARTGROUP,defaultValue:null}},o.MAP_KEY_TYPES=[o.TYPES.int32,o.TYPES.sint32,o.TYPES.sfixed32,o.TYPES.uint32,o.TYPES.fixed32,o.TYPES.int64,o.TYPES.sint64,o.TYPES.sfixed64,o.TYPES.uint64,o.TYPES.fixed64,o.TYPES.bool,o.TYPES.string,o.TYPES.bytes],o.ID_MIN=1,o.ID_MAX=536870911,o.convertFieldsToCamelCase=!1,o.populateAccessors=!0,o.populateDefaults=!0,o.Util=function(){var e={};return e.IS_NODE=!("object"!=typeof process||process+""!="[object process]"||process.browser),e.XHR=function(){var e,t=[function(){return new XMLHttpRequest},function(){return new ActiveXObject("Msxml2.XMLHTTP")},function(){return new ActiveXObject("Msxml3.XMLHTTP")},function(){return new ActiveXObject("Microsoft.XMLHTTP")}],r=null;for(e=0;e<t.length;e++){try{r=t[e]()}catch(e){continue}break}if(!r)throw Error("XMLHttpRequest is not supported");return r},e.fetch=function(t,r){if(r&&"function"!=typeof r&&(r=null),e.IS_NODE)if(r)g.readFile(t,(function(e,t){r(e?null:""+t)}));else try{return g.readFileSync(t)}catch(e){return null}else{var n=e.XHR();if(n.open("GET",t,!!r),n.setRequestHeader("Accept","text/plain"),"function"==typeof n.overrideMimeType&&n.overrideMimeType("text/plain"),!r)return n.send(null),200==n.status||0==n.status&&"string"==typeof n.responseText?n.responseText:null;if(n.onreadystatechange=function(){4==n.readyState&&(200==n.status||0==n.status&&"string"==typeof n.responseText?r(n.responseText):r(null))},4==n.readyState)return;n.send(null)}},e.toCamelCase=function(e){return e.replace(/_([a-zA-Z])/g,(function(e,t){return t.toUpperCase()}))},e}(),o.Lang={DELIM:/[\s\{\}=;:\[\],'"\(\)<>]/g,RULE:/^(?:required|optional|repeated|map)$/,TYPE:/^(?:double|float|int32|uint32|sint32|int64|uint64|sint64|fixed32|sfixed32|fixed64|sfixed64|bool|string|bytes)$/,NAME:/^[a-zA-Z_][a-zA-Z_0-9]*$/,TYPEDEF:/^[a-zA-Z][a-zA-Z_0-9]*$/,TYPEREF:/^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)+$/,FQTYPEREF:/^(?:\.[a-zA-Z][a-zA-Z_0-9]*)+$/,NUMBER:/^-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+|([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?)|inf|nan)$/,NUMBER_DEC:/^(?:[1-9][0-9]*|0)$/,NUMBER_HEX:/^0[xX][0-9a-fA-F]+$/,NUMBER_OCT:/^0[0-7]+$/,NUMBER_FLT:/^([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?|inf|nan)$/,BOOL:/^(?:true|false)$/i,ID:/^(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,NEGID:/^\-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,WHITESPACE:/\s/,STRING:/(?:"([^"\\]*(?:\\.[^"\\]*)*)")|(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g,STRING_DQ:/(?:"([^"\\]*(?:\\.[^"\\]*)*)")/g,STRING_SQ:/(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g},o.DotProto=function(e,t){function r(e,r){var n=-1,i=1;if("-"==e.charAt(0)&&(i=-1,e=e.substring(1)),t.NUMBER_DEC.test(e))n=parseInt(e);else if(t.NUMBER_HEX.test(e))n=parseInt(e.substring(2),16);else{if(!t.NUMBER_OCT.test(e))throw Error("illegal id value: "+(i<0?"-":"")+e);n=parseInt(e.substring(1),8)}if(n=0|i*n,!r&&n<0)throw Error("illegal id value: "+(i<0?"-":"")+e);return n}function n(e){var r=1;if("-"==e.charAt(0)&&(r=-1,e=e.substring(1)),t.NUMBER_DEC.test(e))return r*parseInt(e,10);if(t.NUMBER_HEX.test(e))return r*parseInt(e.substring(2),16);if(t.NUMBER_OCT.test(e))return r*parseInt(e.substring(1),8);if("inf"===e)return 1/0*r;if("nan"===e)return NaN;if(t.NUMBER_FLT.test(e))return r*parseFloat(e);throw Error("illegal number value: "+(r<0?"-":"")+e)}function i(e,t,r){void 0===e[t]?e[t]=r:(Array.isArray(e[t])||(e[t]=[e[t]]),e[t].push(r))}var o,s,a={},u=function(e){this.source=e+"",this.index=0,this.line=1,this.stack=[],this._stringOpen=null},l=u.prototype;return l._readString=function(){var e,r='"'===this._stringOpen?t.STRING_DQ:t.STRING_SQ;if(r.lastIndex=this.index-1,!(e=r.exec(this.source)))throw Error("unterminated string");return this.index=r.lastIndex,this.stack.push(this._stringOpen),this._stringOpen=null,e[1]},l.next=function(){var e,r,n,i,o;if(this.stack.length>0)return this.stack.shift();if(this.index>=this.source.length)return null;if(null!==this._stringOpen)return this._readString();do{for(e=!1;t.WHITESPACE.test(n=this.source.charAt(this.index));)if("\n"===n&&++this.line,++this.index===this.source.length)return null;if("/"===this.source.charAt(this.index))if(++this.index,"/"===this.source.charAt(this.index)){for(;"\n"!==this.source.charAt(++this.index);)if(this.index==this.source.length)return null;++this.index,++this.line,e=!0}else{if("*"!==(n=this.source.charAt(this.index)))return"/";do{if("\n"===n&&++this.line,++this.index===this.source.length)return null;r=n,n=this.source.charAt(this.index)}while("*"!==r||"/"!==n);++this.index,e=!0}}while(e);if(this.index===this.source.length)return null;if(i=this.index,t.DELIM.lastIndex=0,!t.DELIM.test(this.source.charAt(i++)))for(;i<this.source.length&&!t.DELIM.test(this.source.charAt(i));)++i;return('"'===(o=this.source.substring(this.index,this.index=i))||"'"===o)&&(this._stringOpen=o),o},l.peek=function(){if(0===this.stack.length){var e=this.next();if(null===e)return null;this.stack.push(e)}return this.stack[0]},l.skip=function(e){var t=this.next();if(t!==e)throw Error("illegal '"+t+"', '"+e+"' expected")},l.omit=function(e){return this.peek()===e&&(this.next(),!0)},l.toString=function(){return"Tokenizer ("+this.index+"/"+this.source.length+" at line "+this.line+")"},a.Tokenizer=u,o=function(e){this.tn=new u(e),this.proto3=!1},(s=o.prototype).parse=function(){var e,r={name:"[ROOT]",package:null,messages:[],enums:[],imports:[],options:{},services:[]},n=!0;try{for(;e=this.tn.next();)switch(e){case"package":if(!n||null!==r.package)throw Error("unexpected 'package'");if(e=this.tn.next(),!t.TYPEREF.test(e))throw Error("illegal package name: "+e);this.tn.skip(";"),r.package=e;break;case"import":if(!n)throw Error("unexpected 'import'");"public"===(e=this.tn.peek())&&this.tn.next(),e=this._readString(),this.tn.skip(";"),r.imports.push(e);break;case"syntax":if(!n)throw Error("unexpected 'syntax'");this.tn.skip("="),"proto3"===(r.syntax=this._readString())&&(this.proto3=!0),this.tn.skip(";");break;case"message":this._parseMessage(r,null),n=!1;break;case"enum":this._parseEnum(r),n=!1;break;case"option":this._parseOption(r);break;case"service":this._parseService(r);break;case"extend":this._parseExtend(r);break;default:throw Error("unexpected '"+e+"'")}}catch(e){throw e.message="Parse error at line "+this.tn.line+": "+e.message,e}return delete r.name,r},o.parse=function(e){return new o(e).parse()},s._readString=function(){var e,t,r="";do{if("'"!==(t=this.tn.next())&&'"'!==t)throw Error("illegal string delimiter: "+t);r+=this.tn.next(),this.tn.skip(t),e=this.tn.peek()}while('"'===e||'"'===e);return r},s._readValue=function(e){var r=this.tn.peek();if('"'===r||"'"===r)return this._readString();if(this.tn.next(),t.NUMBER.test(r))return n(r);if(t.BOOL.test(r))return"true"===r.toLowerCase();if(e&&t.TYPEREF.test(r))return r;throw Error("illegal value: "+r)},s._parseOption=function(e,r){var n,i=this.tn.next(),o=!1;if("("===i&&(o=!0,i=this.tn.next()),!t.TYPEREF.test(i))throw Error("illegal option name: "+i);n=i,o&&(this.tn.skip(")"),n="("+n+")",i=this.tn.peek(),t.FQTYPEREF.test(i)&&(n+=i,this.tn.next())),this.tn.skip("="),this._parseOptionValue(e,n),r||this.tn.skip(";")},s._parseOptionValue=function(e,r){var n=this.tn.peek();if("{"!==n)i(e.options,r,this._readValue(!0));else for(this.tn.skip("{");"}"!==(n=this.tn.next());){if(!t.NAME.test(n))throw Error("illegal option name: "+r+"."+n);this.tn.omit(":")?i(e.options,r+"."+n,this._readValue(!0)):this._parseOptionValue(e,r+"."+n)}},s._parseService=function(e){var r,n=this.tn.next();if(!t.NAME.test(n))throw Error("illegal service name at line "+this.tn.line+": "+n);for(r={name:n,rpc:{},options:{}},this.tn.skip("{");"}"!==(n=this.tn.next());)if("option"===n)this._parseOption(r);else{if("rpc"!==n)throw Error("illegal service token: "+n);this._parseServiceRPC(r)}this.tn.omit(";"),e.services.push(r)},s._parseServiceRPC=function(e){var r,n,i="rpc",o=this.tn.next();if(!t.NAME.test(o))throw Error("illegal rpc service method name: "+o);if(r=o,n={request:null,response:null,request_stream:!1,response_stream:!1,options:{}},this.tn.skip("("),"stream"===(o=this.tn.next()).toLowerCase()&&(n.request_stream=!0,o=this.tn.next()),!t.TYPEREF.test(o))throw Error("illegal rpc service request type: "+o);if(n.request=o,this.tn.skip(")"),"returns"!==(o=this.tn.next()).toLowerCase())throw Error("illegal rpc service request type delimiter: "+o);if(this.tn.skip("("),"stream"===(o=this.tn.next()).toLowerCase()&&(n.response_stream=!0,o=this.tn.next()),n.response=o,this.tn.skip(")"),"{"===(o=this.tn.peek())){for(this.tn.next();"}"!==(o=this.tn.next());){if("option"!==o)throw Error("illegal rpc service token: "+o);this._parseOption(n)}this.tn.omit(";")}else this.tn.skip(";");void 0===e[i]&&(e[i]={}),e[i][r]=n},s._parseMessage=function(e,n){var i=!!n,o=this.tn.next(),s={name:"",fields:[],enums:[],messages:[],options:{},services:[],oneofs:{}};if(!t.NAME.test(o))throw Error("illegal "+(i?"group":"message")+" name: "+o);for(s.name=o,i&&(this.tn.skip("="),n.id=r(this.tn.next()),s.isGroup=!0),"["===(o=this.tn.peek())&&n&&this._parseFieldOptions(n),this.tn.skip("{");"}"!==(o=this.tn.next());)if(t.RULE.test(o))this._parseMessageField(s,o);else if("oneof"===o)this._parseMessageOneOf(s);else if("enum"===o)this._parseEnum(s);else if("message"===o)this._parseMessage(s);else if("option"===o)this._parseOption(s);else if("service"===o)this._parseService(s);else if("extensions"===o)s.extensions=this._parseExtensionRanges();else if("reserved"===o)this._parseIgnored();else if("extend"===o)this._parseExtend(s);else{if(!t.TYPEREF.test(o))throw Error("illegal message token: "+o);if(!this.proto3)throw Error("illegal field rule: "+o);this._parseMessageField(s,"optional",o)}return this.tn.omit(";"),e.messages.push(s),s},s._parseIgnored=function(){for(;";"!==this.tn.peek();)this.tn.next();this.tn.skip(";")},s._parseMessageField=function(e,n,i){var o,s,a;if(!t.RULE.test(n))throw Error("illegal message field rule: "+n);if(o={rule:n,type:"",name:"",options:{},id:0},"map"===n){if(i)throw Error("illegal type: "+i);if(this.tn.skip("<"),s=this.tn.next(),!t.TYPE.test(s)&&!t.TYPEREF.test(s))throw Error("illegal message field type: "+s);if(o.keytype=s,this.tn.skip(","),s=this.tn.next(),!t.TYPE.test(s)&&!t.TYPEREF.test(s))throw Error("illegal message field: "+s);if(o.type=s,this.tn.skip(">"),s=this.tn.next(),!t.NAME.test(s))throw Error("illegal message field name: "+s);o.name=s,this.tn.skip("="),o.id=r(this.tn.next()),"["===(s=this.tn.peek())&&this._parseFieldOptions(o),this.tn.skip(";")}else if("group"===(i=void 0!==i?i:this.tn.next())){if(a=this._parseMessage(e,o),!/^[A-Z]/.test(a.name))throw Error("illegal group name: "+a.name);o.type=a.name,o.name=a.name.toLowerCase(),this.tn.omit(";")}else{if(!t.TYPE.test(i)&&!t.TYPEREF.test(i))throw Error("illegal message field type: "+i);if(o.type=i,s=this.tn.next(),!t.NAME.test(s))throw Error("illegal message field name: "+s);o.name=s,this.tn.skip("="),o.id=r(this.tn.next()),"["===(s=this.tn.peek())&&this._parseFieldOptions(o),this.tn.skip(";")}return e.fields.push(o),o},s._parseMessageOneOf=function(e){var r,n,i,o=this.tn.next();if(!t.NAME.test(o))throw Error("illegal oneof name: "+o);for(n=o,i=[],this.tn.skip("{");"}"!==(o=this.tn.next());)(r=this._parseMessageField(e,"optional",o)).oneof=n,i.push(r.id);this.tn.omit(";"),e.oneofs[n]=i},s._parseFieldOptions=function(e){this.tn.skip("[");for(var t=!0;"]"!==this.tn.peek();)t||this.tn.skip(","),this._parseOption(e,!0),t=!1;this.tn.next()},s._parseEnum=function(e){var n,i={name:"",values:[],options:{}},o=this.tn.next();if(!t.NAME.test(o))throw Error("illegal name: "+o);for(i.name=o,this.tn.skip("{");"}"!==(o=this.tn.next());)if("option"===o)this._parseOption(i);else{if(!t.NAME.test(o))throw Error("illegal name: "+o);this.tn.skip("="),n={name:o,id:r(this.tn.next(),!0)},"["===(o=this.tn.peek())&&this._parseFieldOptions({options:{}}),this.tn.skip(";"),i.values.push(n)}this.tn.omit(";"),e.enums.push(i)},s._parseExtensionRanges=function(){var t,r,i,o=[];do{for(r=[];;){switch(t=this.tn.next()){case"min":i=e.ID_MIN;break;case"max":i=e.ID_MAX;break;default:i=n(t)}if(r.push(i),2===r.length)break;if("to"!==this.tn.peek()){r.push(i);break}this.tn.next()}o.push(r)}while(this.tn.omit(","));return this.tn.skip(";"),o},s._parseExtend=function(e){var r,n=this.tn.next();if(!t.TYPEREF.test(n))throw Error("illegal extend reference: "+n);for(r={ref:n,fields:[]},this.tn.skip("{");"}"!==(n=this.tn.next());)if(t.RULE.test(n))this._parseMessageField(r,n);else{if(!t.TYPEREF.test(n))throw Error("illegal extend token: "+n);if(!this.proto3)throw Error("illegal field rule: "+n);this._parseMessageField(r,"optional",n)}return this.tn.omit(";"),e.messages.push(r),r},s.toString=function(){return"Parser at line "+this.tn.line},a.Parser=o,a}(o,o.Lang),o.Reflect=function(e){function r(t,r){if(t&&"number"==typeof t.low&&"number"==typeof t.high&&"boolean"==typeof t.unsigned&&t.low==t.low&&t.high==t.high)return new e.Long(t.low,t.high,void 0===r?t.unsigned:r);if("string"==typeof t)return e.Long.fromString(t,r||!1,10);if("number"==typeof t)return e.Long.fromNumber(t,r||!1);throw Error("not convertible to Long")}function i(t,r){var n=r.readVarint32(),o=7&n,s=n>>>3;switch(o){case e.WIRE_TYPES.VARINT:do{n=r.readUint8()}while(!(128&~n));break;case e.WIRE_TYPES.BITS64:r.offset+=8;break;case e.WIRE_TYPES.LDELIM:n=r.readVarint32(),r.offset+=n;break;case e.WIRE_TYPES.STARTGROUP:i(s,r);break;case e.WIRE_TYPES.ENDGROUP:if(s===t)return!1;throw Error("Illegal GROUPEND after unknown group: "+s+" ("+t+" expected)");case e.WIRE_TYPES.BITS32:r.offset+=4;break;default:throw Error("Illegal wire type in unknown group "+t+": "+o)}return!0}var o,s,a,u,l,c,d,p,f,h,g,_,b,E,v,y,m={},I=function(e,t,r){this.builder=e,this.parent=t,this.name=r,this.className},T=I.prototype;return T.fqn=function(){for(var e=this.name,t=this;null!=(t=t.parent);)e=t.name+"."+e;return e},T.toString=function(e){return(e?this.className+" ":"")+this.fqn()},T.build=function(){throw Error(this.toString(!0)+" cannot be built directly")},m.T=I,o=function(e,t,r,n,i){I.call(this,e,t,r),this.className="Namespace",this.children=[],this.options=n||{},this.syntax=i||"proto2"},(s=o.prototype=Object.create(I.prototype)).getChildren=function(e){var t,r,n;if(null==(e=e||null))return this.children.slice();for(t=[],r=0,n=this.children.length;n>r;++r)this.children[r]instanceof e&&t.push(this.children[r]);return t},s.addChild=function(e){var t;if(t=this.getChild(e.name))if(t instanceof l.Field&&t.name!==t.originalName&&null===this.getChild(t.originalName))t.name=t.originalName;else{if(!(e instanceof l.Field&&e.name!==e.originalName&&null===this.getChild(e.originalName)))throw Error("Duplicate name in namespace "+this.toString(!0)+": "+e.name);e.name=e.originalName}this.children.push(e)},s.getChild=function(e){var t,r,n="number"==typeof e?"id":"name";for(t=0,r=this.children.length;r>t;++t)if(this.children[t][n]===e)return this.children[t];return null},s.resolve=function(e,t){var r,n="string"==typeof e?e.split("."):e,i=this,o=0;if(""===n[o]){for(;null!==i.parent;)i=i.parent;o++}do{do{if(!(i instanceof m.Namespace)){i=null;break}if(!((r=i.getChild(n[o]))&&r instanceof m.T&&(!t||r instanceof m.Namespace))){i=null;break}i=r,o++}while(o<n.length);if(null!=i)break;if(null!==this.parent)return this.parent.resolve(e,t)}while(null!=i);return i},s.qn=function(e){var t,r,n=[],i=e;do{n.unshift(i.name),i=i.parent}while(null!==i);for(t=1;t<=n.length;t++)if(r=n.slice(n.length-t),e===this.resolve(r,e instanceof m.Namespace))return r.join(".");return e.fqn()},s.build=function(){var e,t,r,n={},i=this.children;for(t=0,r=i.length;r>t;++t)(e=i[t])instanceof o&&(n[e.name]=e.build());return Object.defineProperty&&Object.defineProperty(n,"$options",{value:this.buildOpt()}),n},s.buildOpt=function(){var e,t,r,n,i={},o=Object.keys(this.options);for(e=0,t=o.length;t>e;++e)r=o[e],n=this.options[o[e]],i[r]=n;return i},s.getOption=function(e){return void 0===e?this.options:void 0!==this.options[e]?this.options[e]:null},m.Namespace=o,a=function(t,r,n,i){if(this.type=t,this.resolvedType=r,this.isMapKey=n,this.syntax=i,n&&e.MAP_KEY_TYPES.indexOf(t)<0)throw Error("Invalid map key type: "+t.name)},u=a.prototype,a.defaultFieldValue=function(t){if("string"==typeof t&&(t=e.TYPES[t]),void 0===t.defaultValue)throw Error("default value for type "+t.name+" is not supported");return t==e.TYPES.bytes?new n(0):t.defaultValue},u.verifyValue=function(n){var i,o,s,a=function(e,t){throw Error("Illegal value for "+this.toString(!0)+" of type "+this.type.name+": "+e+" ("+t+")")}.bind(this);switch(this.type){case e.TYPES.int32:case e.TYPES.sint32:case e.TYPES.sfixed32:return("number"!=typeof n||n==n&&n%1!=0)&&a(typeof n,"not an integer"),n>4294967295?0|n:n;case e.TYPES.uint32:case e.TYPES.fixed32:return("number"!=typeof n||n==n&&n%1!=0)&&a(typeof n,"not an integer"),n<0?n>>>0:n;case e.TYPES.int64:case e.TYPES.sint64:case e.TYPES.sfixed64:if(e.Long)try{return r(n,!1)}catch(e){a(typeof n,e.message)}else a(typeof n,"requires Long.js");case e.TYPES.uint64:case e.TYPES.fixed64:if(e.Long)try{return r(n,!0)}catch(e){a(typeof n,e.message)}else a(typeof n,"requires Long.js");case e.TYPES.bool:return"boolean"!=typeof n&&a(typeof n,"not a boolean"),n;case e.TYPES.float:case e.TYPES.double:return"number"!=typeof n&&a(typeof n,"not a number"),n;case e.TYPES.string:return"string"==typeof n||n&&n instanceof String||a(typeof n,"not a string"),""+n;case e.TYPES.bytes:return t.isByteBuffer(n)?n:t.wrap(n);case e.TYPES.enum:for(i=this.resolvedType.getChildren(e.Reflect.Enum.Value),s=0;s<i.length;s++){if(i[s].name==n)return i[s].id;if(i[s].id==n)return i[s].id}if("proto3"===this.syntax)return("number"!=typeof n||n==n&&n%1!=0)&&a(typeof n,"not an integer"),(n>4294967295||n<0)&&a(typeof n,"not in range for uint32"),n;a(n,"not a valid enum value");case e.TYPES.group:case e.TYPES.message:if(n&&"object"==typeof n||a(typeof n,"object expected"),n instanceof this.resolvedType.clazz)return n;if(n instanceof e.Builder.Message){for(s in o={},n)n.hasOwnProperty(s)&&(o[s]=n[s]);n=o}return new this.resolvedType.clazz(n)}throw Error("[INTERNAL] Illegal value for "+this.toString(!0)+": "+n+" (undefined type "+this.type+")")},u.calculateLength=function(t,r){if(null===r)return 0;var i;switch(this.type){case e.TYPES.int32:return r<0?n.calculateVarint64(r):n.calculateVarint32(r);case e.TYPES.uint32:return n.calculateVarint32(r);case e.TYPES.sint32:return n.calculateVarint32(n.zigZagEncode32(r));case e.TYPES.fixed32:case e.TYPES.sfixed32:case e.TYPES.float:return 4;case e.TYPES.int64:case e.TYPES.uint64:return n.calculateVarint64(r);case e.TYPES.sint64:return n.calculateVarint64(n.zigZagEncode64(r));case e.TYPES.fixed64:case e.TYPES.sfixed64:return 8;case e.TYPES.bool:return 1;case e.TYPES.enum:return n.calculateVarint32(r);case e.TYPES.double:return 8;case e.TYPES.string:return i=n.calculateUTF8Bytes(r),n.calculateVarint32(i)+i;case e.TYPES.bytes:if(r.remaining()<0)throw Error("Illegal value for "+this.toString(!0)+": "+r.remaining()+" bytes remaining");return n.calculateVarint32(r.remaining())+r.remaining();case e.TYPES.message:return i=this.resolvedType.calculate(r),n.calculateVarint32(i)+i;case e.TYPES.group:return(i=this.resolvedType.calculate(r))+n.calculateVarint32(t<<3|e.WIRE_TYPES.ENDGROUP)}throw Error("[INTERNAL] Illegal value to encode in "+this.toString(!0)+": "+r+" (unknown type)")},u.encodeValue=function(t,r,i){var o,s;if(null===r)return i;switch(this.type){case e.TYPES.int32:r<0?i.writeVarint64(r):i.writeVarint32(r);break;case e.TYPES.uint32:i.writeVarint32(r);break;case e.TYPES.sint32:i.writeVarint32ZigZag(r);break;case e.TYPES.fixed32:i.writeUint32(r);break;case e.TYPES.sfixed32:i.writeInt32(r);break;case e.TYPES.int64:case e.TYPES.uint64:i.writeVarint64(r);break;case e.TYPES.sint64:i.writeVarint64ZigZag(r);break;case e.TYPES.fixed64:i.writeUint64(r);break;case e.TYPES.sfixed64:i.writeInt64(r);break;case e.TYPES.bool:"string"==typeof r?i.writeVarint32("false"===r.toLowerCase()?0:!!r):i.writeVarint32(r?1:0);break;case e.TYPES.enum:i.writeVarint32(r);break;case e.TYPES.float:i.writeFloat32(r);break;case e.TYPES.double:i.writeFloat64(r);break;case e.TYPES.string:i.writeVString(r);break;case e.TYPES.bytes:if(r.remaining()<0)throw Error("Illegal value for "+this.toString(!0)+": "+r.remaining()+" bytes remaining");o=r.offset,i.writeVarint32(r.remaining()),i.append(r),r.offset=o;break;case e.TYPES.message:s=(new n).LE(),this.resolvedType.encode(r,s),i.writeVarint32(s.offset),i.append(s.flip());break;case e.TYPES.group:this.resolvedType.encode(r,i),i.writeVarint32(t<<3|e.WIRE_TYPES.ENDGROUP);break;default:throw Error("[INTERNAL] Illegal value to encode in "+this.toString(!0)+": "+r+" (unknown type)")}return i},u.decode=function(t,r,n){if(r!=this.type.wireType)throw Error("Unexpected wire type for element");var i,o;switch(this.type){case e.TYPES.int32:return 0|t.readVarint32();case e.TYPES.uint32:return t.readVarint32()>>>0;case e.TYPES.sint32:return 0|t.readVarint32ZigZag();case e.TYPES.fixed32:return t.readUint32()>>>0;case e.TYPES.sfixed32:return 0|t.readInt32();case e.TYPES.int64:return t.readVarint64();case e.TYPES.uint64:return t.readVarint64().toUnsigned();case e.TYPES.sint64:return t.readVarint64ZigZag();case e.TYPES.fixed64:return t.readUint64();case e.TYPES.sfixed64:return t.readInt64();case e.TYPES.bool:return!!t.readVarint32();case e.TYPES.enum:return t.readVarint32();case e.TYPES.float:return t.readFloat();case e.TYPES.double:return t.readDouble();case e.TYPES.string:return t.readVString();case e.TYPES.bytes:if(o=t.readVarint32(),t.remaining()<o)throw Error("Illegal number of bytes for "+this.toString(!0)+": "+o+" required but got only "+t.remaining());return(i=t.clone()).limit=i.offset+o,t.offset+=o,i;case e.TYPES.message:return o=t.readVarint32(),this.resolvedType.decode(t,o);case e.TYPES.group:return this.resolvedType.decode(t,-1,n)}throw Error("[INTERNAL] Illegal decode type")},u.valueFromString=function(t){if(!this.isMapKey)throw Error("valueFromString() called on non-map-key element");switch(this.type){case e.TYPES.int32:case e.TYPES.sint32:case e.TYPES.sfixed32:case e.TYPES.uint32:case e.TYPES.fixed32:return this.verifyValue(parseInt(t));case e.TYPES.int64:case e.TYPES.sint64:case e.TYPES.sfixed64:case e.TYPES.uint64:case e.TYPES.fixed64:return this.verifyValue(t);case e.TYPES.bool:return"true"===t;case e.TYPES.string:return this.verifyValue(t);case e.TYPES.bytes:return n.fromBinary(t)}},u.valueToString=function(t){if(!this.isMapKey)throw Error("valueToString() called on non-map-key element");return this.type===e.TYPES.bytes?t.toString("binary"):t.toString()},m.Element=a,l=function(e,t,r,n,i,s){o.call(this,e,t,r,n,s),this.className="Message",this.extensions=void 0,this.clazz=null,this.isGroup=!!i,this._fields=null,this._fieldsById=null,this._fieldsByName=null},(c=l.prototype=Object.create(o.prototype)).build=function(r){var i,o,s,a;if(this.clazz&&!r)return this.clazz;for(i=function(e,r){function i(t,r,o,s){var a,u,l,c,d,p,f;if(null===t||"object"!=typeof t)return s&&s instanceof e.Reflect.Enum&&null!==(a=e.Reflect.Enum.getName(s.object,t))?a:t;if(n.isByteBuffer(t))return r?t.toBase64():t.toBuffer();if(e.Long.isLong(t))return o?t.toString():e.Long.fromValue(t);if(Array.isArray(t))return u=[],t.forEach((function(e,t){u[t]=i(e,r,o,s)})),u;if(u={},t instanceof e.Map){for(c=(l=t.entries()).next();!c.done;c=l.next())u[t.keyElem.valueToString(c.value[0])]=i(c.value[1],r,o,t.valueElem.resolvedType);return u}for(f in d=t.$type,p=void 0,t)t.hasOwnProperty(f)&&(u[f]=d&&(p=d.getChild(f))?i(t[f],r,o,p.resolvedType):i(t[f],r,o));return u}var o,s,a=r.getChildren(e.Reflect.Message.Field),u=r.getChildren(e.Reflect.Message.OneOf),l=function(t){var i,o,s,c;for(e.Builder.Message.call(this),i=0,o=u.length;o>i;++i)this[u[i].name]=null;for(i=0,o=a.length;o>i;++i)this[(s=a[i]).name]=s.repeated?[]:s.map?new e.Map(s):null,!s.required&&"proto3"!==r.syntax||null===s.defaultValue||(this[s.name]=s.defaultValue);if(arguments.length>0)if(1!==arguments.length||null===t||"object"!=typeof t||!("function"!=typeof t.encode||t instanceof l)||Array.isArray(t)||t instanceof e.Map||n.isByteBuffer(t)||t instanceof ArrayBuffer||e.Long&&t instanceof e.Long)for(i=0,o=arguments.length;o>i;++i)void 0!==(c=arguments[i])&&this.$set(a[i].name,c);else this.$set(t)},c=l.prototype=Object.create(e.Builder.Message.prototype);for(c.add=function(t,n,i){var o=r._fieldsByName[t];if(!i){if(!o)throw Error(this+"#"+t+" is undefined");if(!(o instanceof e.Reflect.Message.Field))throw Error(this+"#"+t+" is not a field: "+o.toString(!0));if(!o.repeated)throw Error(this+"#"+t+" is not a repeated field");n=o.verifyValue(n,!0)}return null===this[t]&&(this[t]=[]),this[t].push(n),this},c.$add=c.add,c.set=function(t,n,i){var o,s,a;if(t&&"object"==typeof t){for(o in i=n,t)t.hasOwnProperty(o)&&void 0!==(n=t[o])&&this.$set(o,n,i);return this}if(s=r._fieldsByName[t],i)this[t]=n;else{if(!s)throw Error(this+"#"+t+" is not a field: undefined");if(!(s instanceof e.Reflect.Message.Field))throw Error(this+"#"+t+" is not a field: "+s.toString(!0));this[s.name]=n=s.verifyValue(n)}return s&&s.oneof&&(a=this[s.oneof.name],null!==n?(null!==a&&a!==s.name&&(this[a]=null),this[s.oneof.name]=s.name):a===t&&(this[s.oneof.name]=null)),this},c.$set=c.set,c.get=function(t,n){if(n)return this[t];var i=r._fieldsByName[t];if(!(i&&i instanceof e.Reflect.Message.Field))throw Error(this+"#"+t+" is not a field: undefined");if(!(i instanceof e.Reflect.Message.Field))throw Error(this+"#"+t+" is not a field: "+i.toString(!0));return this[i.name]},c.$get=c.get,o=0;o<a.length;o++)(s=a[o])instanceof e.Reflect.Message.ExtensionField||r.builder.options.populateAccessors&&function(e){var t,n,i,o=e.originalName.replace(/(_[a-zA-Z])/g,(function(e){return e.toUpperCase().replace("_","")}));o=o.substring(0,1).toUpperCase()+o.substring(1),t=e.originalName.replace(/([A-Z])/g,(function(e){return"_"+e})),n=function(t,r){return this[e.name]=r?t:e.verifyValue(t),this},i=function(){return this[e.name]},null===r.getChild("set"+o)&&(c["set"+o]=n),null===r.getChild("set_"+t)&&(c["set_"+t]=n),null===r.getChild("get"+o)&&(c["get"+o]=i),null===r.getChild("get_"+t)&&(c["get_"+t]=i)}(s);return c.encode=function(e,n){var i,o;"boolean"==typeof e&&(n=e,e=void 0),i=!1,e||(e=new t,i=!0),o=e.littleEndian;try{return r.encode(this,e.LE(),n),(i?e.flip():e).LE(o)}catch(t){throw e.LE(o),t}},l.encode=function(e,t,r){return new l(e).encode(t,r)},c.calculate=function(){return r.calculate(this)},c.encodeDelimited=function(e){var t,i=!1;return e||(e=new n,i=!0),t=(new n).LE(),r.encode(this,t).flip(),e.writeVarint32(t.remaining()),e.append(t),i?e.flip():e},c.encodeAB=function(){try{return this.encode().toArrayBuffer()}catch(e){throw e.encoded&&(e.encoded=e.encoded.toArrayBuffer()),e}},c.toArrayBuffer=c.encodeAB,c.encodeNB=function(){try{return this.encode().toBuffer()}catch(e){throw e.encoded&&(e.encoded=e.encoded.toBuffer()),e}},c.toBuffer=c.encodeNB,c.encode64=function(){try{return this.encode().toBase64()}catch(e){throw e.encoded&&(e.encoded=e.encoded.toBase64()),e}},c.toBase64=c.encode64,c.encodeHex=function(){try{return this.encode().toHex()}catch(e){throw e.encoded&&(e.encoded=e.encoded.toHex()),e}},c.toHex=c.encodeHex,c.toRaw=function(e,t){return i(this,!!e,!!t,this.$type)},c.encodeJSON=function(){return JSON.stringify(i(this,!0,!0,this.$type))},l.decode=function(e,t){var i,o;"string"==typeof e&&(e=n.wrap(e,t||"base64")),i=(e=n.isByteBuffer(e)?e:n.wrap(e)).littleEndian;try{return o=r.decode(e.LE()),e.LE(i),o}catch(t){throw e.LE(i),t}},l.decodeDelimited=function(e,t){var i,o,s;if("string"==typeof e&&(e=n.wrap(e,t||"base64")),(e=n.isByteBuffer(e)?e:n.wrap(e)).remaining()<1)return null;if(i=e.offset,o=e.readVarint32(),e.remaining()<o)return e.offset=i,null;try{return s=r.decode(e.slice(e.offset,e.offset+o).LE()),e.offset+=o,s}catch(t){throw e.offset+=o,t}},l.decode64=function(e){return l.decode(e,"base64")},l.decodeHex=function(e){return l.decode(e,"hex")},l.decodeJSON=function(e){return new l(JSON.parse(e))},c.toString=function(){return r.toString()},Object.defineProperty&&(Object.defineProperty(l,"$options",{value:r.buildOpt()}),Object.defineProperty(c,"$options",{value:l.$options}),Object.defineProperty(l,"$type",{value:r}),Object.defineProperty(c,"$type",{value:r})),l}(e,this),this._fields=[],this._fieldsById={},this._fieldsByName={},s=0,a=this.children.length;a>s;s++)if((o=this.children[s])instanceof g||o instanceof l||o instanceof E){if(i.hasOwnProperty(o.name))throw Error("Illegal reflect child of "+this.toString(!0)+": "+o.toString(!0)+" cannot override static property '"+o.name+"'");i[o.name]=o.build()}else if(o instanceof l.Field)o.build(),this._fields.push(o),this._fieldsById[o.id]=o,this._fieldsByName[o.name]=o;else if(!(o instanceof l.OneOf||o instanceof b))throw Error("Illegal reflect child of "+this.toString(!0)+": "+this.children[s].toString(!0));return this.clazz=i},c.encode=function(e,t,r){var n,i,o,s,a,u=null;for(o=0,s=this._fields.length;s>o;++o)i=e[(n=this._fields[o]).name],n.required&&null===i?null===u&&(u=n):n.encode(r?i:n.verifyValue(i),t,e);if(null!==u)throw(a=Error("Missing at least one required field for "+this.toString(!0)+": "+u)).encoded=t,a;return t},c.calculate=function(e){for(var t,r,n=0,i=0,o=this._fields.length;o>i;++i){if(r=e[(t=this._fields[i]).name],t.required&&null===r)throw Error("Missing at least one required field for "+this.toString(!0)+": "+t);n+=t.calculate(r,e)}return n},c.decode=function(t,r,n){var o,s,a,u,l,c,d,p,f,h,g,_;for(r="number"==typeof r?r:-1,l=t.offset,c=new this.clazz;t.offset<l+r||-1===r&&t.remaining()>0;){if(a=(o=t.readVarint32())>>>3,(s=7&o)===e.WIRE_TYPES.ENDGROUP){if(a!==n)throw Error("Illegal group end indicator for "+this.toString(!0)+": "+a+" ("+(n?n+" expected":"not a group")+")");break}if(u=this._fieldsById[a])u.repeated&&!u.options.packed?c[u.name].push(u.decode(s,t)):u.map?(p=u.decode(s,t),c[u.name].set(p[0],p[1])):(c[u.name]=u.decode(s,t),u.oneof&&(null!==(f=c[u.oneof.name])&&f!==u.name&&(c[f]=null),c[u.oneof.name]=u.name));else switch(s){case e.WIRE_TYPES.VARINT:t.readVarint32();break;case e.WIRE_TYPES.BITS32:t.offset+=4;break;case e.WIRE_TYPES.BITS64:t.offset+=8;break;case e.WIRE_TYPES.LDELIM:d=t.readVarint32(),t.offset+=d;break;case e.WIRE_TYPES.STARTGROUP:for(;i(a,t););break;default:throw Error("Illegal wire type for unknown field "+a+" in "+this.toString(!0)+"#decode: "+s)}}for(h=0,g=this._fields.length;g>h;++h)if(null===c[(u=this._fields[h]).name])if("proto3"===this.syntax)c[u.name]=u.defaultValue;else{if(u.required)throw(_=Error("Missing at least one required field for "+this.toString(!0)+": "+u.name)).decoded=c,_;e.populateDefaults&&null!==u.defaultValue&&(c[u.name]=u.defaultValue)}return c},m.Message=l,d=function(t,r,n,i,o,s,a,u,c,d){I.call(this,t,r,s),this.className="Message.Field",this.required="required"===n,this.repeated="repeated"===n,this.map="map"===n,this.keyType=i||null,this.type=o,this.resolvedType=null,this.id=a,this.options=u||{},this.defaultValue=null,this.oneof=c||null,this.syntax=d||"proto2",this.originalName=this.name,this.element=null,this.keyElement=null,!this.builder.options.convertFieldsToCamelCase||this instanceof l.ExtensionField||(this.name=e.Util.toCamelCase(this.name))},(p=d.prototype=Object.create(I.prototype)).build=function(){this.element=new a(this.type,this.resolvedType,!1,this.syntax),this.map&&(this.keyElement=new a(this.keyType,void 0,!0,this.syntax)),"proto3"!==this.syntax||this.repeated||this.map?void 0!==this.options.default&&(this.defaultValue=this.verifyValue(this.options.default)):this.defaultValue=a.defaultFieldValue(this.type)},p.verifyValue=function(t,r){var n,i,o;if(r=r||!1,n=function(e,t){throw Error("Illegal value for "+this.toString(!0)+" of type "+this.type.name+": "+e+" ("+t+")")}.bind(this),null===t)return this.required&&n(typeof t,"required"),"proto3"===this.syntax&&this.type!==e.TYPES.message&&n(typeof t,"proto3 field without field presence cannot be null"),null;if(this.repeated&&!r){for(Array.isArray(t)||(t=[t]),o=[],i=0;i<t.length;i++)o.push(this.element.verifyValue(t[i]));return o}return this.map&&!r?t instanceof e.Map?t:(t instanceof Object||n(typeof t,"expected ProtoBuf.Map or raw object for map field"),new e.Map(this,t)):(!this.repeated&&Array.isArray(t)&&n(typeof t,"no array expected"),this.element.verifyValue(t))},p.hasWirePresence=function(t,r){if("proto3"!==this.syntax)return null!==t;if(this.oneof&&r[this.oneof.name]===this.name)return!0;switch(this.type){case e.TYPES.int32:case e.TYPES.sint32:case e.TYPES.sfixed32:case e.TYPES.uint32:case e.TYPES.fixed32:return 0!==t;case e.TYPES.int64:case e.TYPES.sint64:case e.TYPES.sfixed64:case e.TYPES.uint64:case e.TYPES.fixed64:return 0!==t.low||0!==t.high;case e.TYPES.bool:return t;case e.TYPES.float:case e.TYPES.double:return 0!==t;case e.TYPES.string:return t.length>0;case e.TYPES.bytes:return t.remaining()>0;case e.TYPES.enum:return 0!==t;case e.TYPES.message:return null!==t;default:return!0}},p.encode=function(t,r,i){var o,s,a,u,l;if(null===this.type||"object"!=typeof this.type)throw Error("[INTERNAL] Unresolved type in "+this.toString(!0)+": "+this.type);if(null===t||this.repeated&&0==t.length)return r;try{if(this.repeated)if(this.options.packed&&e.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType)>=0){for(r.writeVarint32(this.id<<3|e.WIRE_TYPES.LDELIM),r.ensureCapacity(r.offset+=1),s=r.offset,o=0;o<t.length;o++)this.element.encodeValue(this.id,t[o],r);a=r.offset-s,(u=n.calculateVarint32(a))>1&&(l=r.slice(s,r.offset),s+=u-1,r.offset=s,r.append(l)),r.writeVarint32(a,s-u)}else for(o=0;o<t.length;o++)r.writeVarint32(this.id<<3|this.type.wireType),this.element.encodeValue(this.id,t[o],r);else this.map?t.forEach((function(t,i){var o=n.calculateVarint32(8|this.keyType.wireType)+this.keyElement.calculateLength(1,i)+n.calculateVarint32(16|this.type.wireType)+this.element.calculateLength(2,t);r.writeVarint32(this.id<<3|e.WIRE_TYPES.LDELIM),r.writeVarint32(o),r.writeVarint32(8|this.keyType.wireType),this.keyElement.encodeValue(1,i,r),r.writeVarint32(16|this.type.wireType),this.element.encodeValue(2,t,r)}),this):this.hasWirePresence(t,i)&&(r.writeVarint32(this.id<<3|this.type.wireType),this.element.encodeValue(this.id,t,r))}catch(e){throw Error("Illegal value for "+this.toString(!0)+": "+t+" ("+e+")")}return r},p.calculate=function(t,r){var i,o,s;if(t=this.verifyValue(t),null===this.type||"object"!=typeof this.type)throw Error("[INTERNAL] Unresolved type in "+this.toString(!0)+": "+this.type);if(null===t||this.repeated&&0==t.length)return 0;i=0;try{if(this.repeated)if(this.options.packed&&e.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType)>=0){for(i+=n.calculateVarint32(this.id<<3|e.WIRE_TYPES.LDELIM),s=0,o=0;o<t.length;o++)s+=this.element.calculateLength(this.id,t[o]);i+=n.calculateVarint32(s),i+=s}else for(o=0;o<t.length;o++)i+=n.calculateVarint32(this.id<<3|this.type.wireType),i+=this.element.calculateLength(this.id,t[o]);else this.map?t.forEach((function(t,r){var o=n.calculateVarint32(8|this.keyType.wireType)+this.keyElement.calculateLength(1,r)+n.calculateVarint32(16|this.type.wireType)+this.element.calculateLength(2,t);i+=n.calculateVarint32(this.id<<3|e.WIRE_TYPES.LDELIM),i+=n.calculateVarint32(o),i+=o}),this):this.hasWirePresence(t,r)&&(i+=n.calculateVarint32(this.id<<3|this.type.wireType),i+=this.element.calculateLength(this.id,t))}catch(e){throw Error("Illegal value for "+this.toString(!0)+": "+t+" ("+e+")")}return i},p.decode=function(t,r,n){var i,o,s,u,l,c,d;if(!(!this.map&&t==this.type.wireType||!n&&this.repeated&&this.options.packed&&t==e.WIRE_TYPES.LDELIM||this.map&&t==e.WIRE_TYPES.LDELIM))throw Error("Illegal wire type for field "+this.toString(!0)+": "+t+" ("+this.type.wireType+" expected)");if(t==e.WIRE_TYPES.LDELIM&&this.repeated&&this.options.packed&&e.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType)>=0&&!n){for(o=r.readVarint32(),o=r.offset+o,s=[];r.offset<o;)s.push(this.decode(this.type.wireType,r,!0));return s}if(this.map){if(u=a.defaultFieldValue(this.keyType),i=a.defaultFieldValue(this.type),o=r.readVarint32(),r.remaining()<o)throw Error("Illegal number of bytes for "+this.toString(!0)+": "+o+" required but got only "+r.remaining());for((l=r.clone()).limit=l.offset+o,r.offset+=o;l.remaining()>0;)if(t=7&(c=l.readVarint32()),1===(d=c>>>3))u=this.keyElement.decode(l,t,d);else{if(2!==d)throw Error("Unexpected tag in map field key/value submessage");i=this.element.decode(l,t,d)}return[u,i]}return this.element.decode(r,t,this.id)},m.Message.Field=d,f=function(e,t,r,n,i,o,s){d.call(this,e,t,r,null,n,i,o,s),this.extension},f.prototype=Object.create(d.prototype),m.Message.ExtensionField=f,h=function(e,t,r){I.call(this,e,t,r),this.fields=[]},m.Message.OneOf=h,g=function(e,t,r,n,i){o.call(this,e,t,r,n,i),this.className="Enum",this.object=null},g.getName=function(e,t){var r,n,i=Object.keys(e);for(n=0;n<i.length;++n)if(e[r=i[n]]===t)return r;return null},(g.prototype=Object.create(o.prototype)).build=function(t){var r,n,i,o;if(this.object&&!t)return this.object;for(r=new e.Builder.Enum,i=0,o=(n=this.getChildren(g.Value)).length;o>i;++i)r[n[i].name]=n[i].id;return Object.defineProperty&&Object.defineProperty(r,"$options",{value:this.buildOpt(),enumerable:!1}),this.object=r},m.Enum=g,_=function(e,t,r,n){I.call(this,e,t,r),this.className="Enum.Value",this.id=n},_.prototype=Object.create(I.prototype),m.Enum.Value=_,b=function(e,t,r,n){I.call(this,e,t,r),this.field=n},b.prototype=Object.create(I.prototype),m.Extension=b,E=function(e,t,r,n){o.call(this,e,t,r,n),this.className="Service",this.clazz=null},(E.prototype=Object.create(o.prototype)).build=function(t){return this.clazz&&!t?this.clazz:this.clazz=function(e,t){var r,i=function(t){e.Builder.Service.call(this),this.rpcImpl=t||function(e,t,r){setTimeout(r.bind(this,Error("Not implemented, see: https://github.com/dcodeIO/ProtoBuf.js/wiki/Services")),0)}},o=i.prototype=Object.create(e.Builder.Service.prototype),s=t.getChildren(e.Reflect.Service.RPCMethod);for(r=0;r<s.length;r++)!function(e){o[e.name]=function(r,i){try{try{r=e.resolvedRequestType.clazz.decode(n.wrap(r))}catch(e){if(!(e instanceof TypeError))throw e}if(null===r||"object"!=typeof r)throw Error("Illegal arguments");r instanceof e.resolvedRequestType.clazz||(r=new e.resolvedRequestType.clazz(r)),this.rpcImpl(e.fqn(),r,(function(r,n){if(!r){try{n=e.resolvedResponseType.clazz.decode(n)}catch(e){}return n&&n instanceof e.resolvedResponseType.clazz?void i(null,n):void i(Error("Illegal response type received in service method "+t.name+"#"+e.name))}i(r)}))}catch(e){setTimeout(i.bind(this,e),0)}},i[e.name]=function(t,r,n){new i(t)[e.name](r,n)},Object.defineProperty&&(Object.defineProperty(i[e.name],"$options",{value:e.buildOpt()}),Object.defineProperty(o[e.name],"$options",{value:i[e.name].$options}))}(s[r]);return Object.defineProperty&&(Object.defineProperty(i,"$options",{value:t.buildOpt()}),Object.defineProperty(o,"$options",{value:i.$options}),Object.defineProperty(i,"$type",{value:t}),Object.defineProperty(o,"$type",{value:t})),i}(e,this)},m.Service=E,v=function(e,t,r,n){I.call(this,e,t,r),this.className="Service.Method",this.options=n||{}},(v.prototype=Object.create(I.prototype)).buildOpt=s.buildOpt,m.Service.Method=v,y=function(e,t,r,n,i,o,s,a){v.call(this,e,t,r,a),this.className="Service.RPCMethod",this.requestName=n,this.responseName=i,this.requestStream=o,this.responseStream=s,this.resolvedRequestType=null,this.resolvedResponseType=null},y.prototype=Object.create(v.prototype),m.Service.RPCMethod=y,m}(o),o.Builder=function(e,t,r){function n(e){e.messages&&e.messages.forEach((function(t){t.syntax=e.syntax,n(t)})),e.enums&&e.enums.forEach((function(t){t.syntax=e.syntax}))}var i=function(e){this.ns=new r.Namespace(this,null,""),this.ptr=this.ns,this.resolved=!1,this.result=null,this.files={},this.importRoot=null,this.options=e||{}},o=i.prototype;return i.isMessage=function(e){return"string"==typeof e.name&&(void 0===e.values&&void 0===e.rpc)},i.isMessageField=function(e){return"string"==typeof e.rule&&"string"==typeof e.name&&"string"==typeof e.type&&void 0!==e.id},i.isEnum=function(e){return"string"==typeof e.name&&!(void 0===e.values||!Array.isArray(e.values)||0===e.values.length)},i.isService=function(e){return!("string"!=typeof e.name||"object"!=typeof e.rpc||!e.rpc)},i.isExtend=function(e){return"string"==typeof e.ref},o.reset=function(){return this.ptr=this.ns,this},o.define=function(e){if("string"!=typeof e||!t.TYPEREF.test(e))throw Error("illegal namespace: "+e);return e.split(".").forEach((function(e){var t=this.ptr.getChild(e);null===t&&this.ptr.addChild(t=new r.Namespace(this,this.ptr,e)),this.ptr=t}),this),this},o.create=function(t){var n,o,s,a,u;if(!t)return this;if(Array.isArray(t)){if(0===t.length)return this;t=t.slice()}else t=[t];for(n=[t];n.length>0;){if(t=n.pop(),!Array.isArray(t))throw Error("not a valid namespace: "+JSON.stringify(t));for(;t.length>0;){if(o=t.shift(),i.isMessage(o)){if(s=new r.Message(this,this.ptr,o.name,o.options,o.isGroup,o.syntax),a={},o.oneofs&&Object.keys(o.oneofs).forEach((function(e){s.addChild(a[e]=new r.Message.OneOf(this,s,e))}),this),o.fields&&o.fields.forEach((function(e){if(null!==s.getChild(0|e.id))throw Error("duplicate or invalid field id in "+s.name+": "+e.id);if(e.options&&"object"!=typeof e.options)throw Error("illegal field options in "+s.name+"#"+e.name);var t=null;if("string"==typeof e.oneof&&!(t=a[e.oneof]))throw Error("illegal oneof in "+s.name+"#"+e.name+": "+e.oneof);e=new r.Message.Field(this,s,e.rule,e.keytype,e.type,e.name,e.id,e.options,t,o.syntax),t&&t.fields.push(e),s.addChild(e)}),this),u=[],o.enums&&o.enums.forEach((function(e){u.push(e)})),o.messages&&o.messages.forEach((function(e){u.push(e)})),o.services&&o.services.forEach((function(e){u.push(e)})),o.extensions&&(s.extensions="number"==typeof o.extensions[0]?[o.extensions]:o.extensions),this.ptr.addChild(s),u.length>0){n.push(t),t=u,u=null,this.ptr=s,s=null;continue}u=null}else if(i.isEnum(o))s=new r.Enum(this,this.ptr,o.name,o.options,o.syntax),o.values.forEach((function(e){s.addChild(new r.Enum.Value(this,s,e.name,e.id))}),this),this.ptr.addChild(s);else if(i.isService(o))s=new r.Service(this,this.ptr,o.name,o.options),Object.keys(o.rpc).forEach((function(e){var t=o.rpc[e];s.addChild(new r.Service.RPCMethod(this,s,e,t.request,t.response,!!t.request_stream,!!t.response_stream,t.options))}),this),this.ptr.addChild(s);else{if(!i.isExtend(o))throw Error("not a valid definition: "+JSON.stringify(o));if(s=this.ptr.resolve(o.ref,!0))o.fields.forEach((function(t){var n,i,o,a;if(null!==s.getChild(0|t.id))throw Error("duplicate extended field id in "+s.name+": "+t.id);if(s.extensions&&(n=!1,s.extensions.forEach((function(e){t.id>=e[0]&&t.id<=e[1]&&(n=!0)})),!n))throw Error("illegal extended field id in "+s.name+": "+t.id+" (not within valid ranges)");i=t.name,this.options.convertFieldsToCamelCase&&(i=e.Util.toCamelCase(i)),o=new r.Message.ExtensionField(this,s,t.rule,t.type,this.ptr.fqn()+"."+i,t.id,t.options),a=new r.Extension(this,this.ptr,t.name,o),o.extension=a,this.ptr.addChild(a),s.addChild(o)}),this);else if(!/\.?google\.protobuf\./.test(o.ref))throw Error("extended message "+o.ref+" is not defined")}o=null,s=null}t=null,this.ptr=this.ptr.parent}return this.resolved=!1,this.result=null,this},o.import=function(t,r){var i,o,s,a,u,l,c,d,p="/";if("string"==typeof r){if(e.Util.IS_NODE,!0===this.files[r])return this.reset();this.files[r]=!0}else if("object"==typeof r){if(i=r.root,e.Util.IS_NODE,(i.indexOf("\\")>=0||r.file.indexOf("\\")>=0)&&(p="\\"),o=i+p+r.file,!0===this.files[o])return this.reset();this.files[o]=!0}if(t.imports&&t.imports.length>0){for(a=!1,"object"==typeof r?(this.importRoot=r.root,a=!0,s=this.importRoot,r=r.file,(s.indexOf("\\")>=0||r.indexOf("\\")>=0)&&(p="\\")):"string"==typeof r?this.importRoot?s=this.importRoot:r.indexOf("/")>=0?""===(s=r.replace(/\/[^\/]*$/,""))&&(s="/"):r.indexOf("\\")>=0?(s=r.replace(/\\[^\\]*$/,""),p="\\"):s=".":s=null,u=0;u<t.imports.length;u++)if("string"==typeof t.imports[u]){if(!s)throw Error("cannot determine import root");if("google/protobuf/descriptor.proto"===(l=t.imports[u]))continue;if(l=s+p+l,!0===this.files[l])continue;if(/\.proto$/i.test(l)&&!e.DotProto&&(l=l.replace(/\.proto$/,".json")),null===(c=e.Util.fetch(l)))throw Error("failed to import '"+l+"' in '"+r+"': file not found");/\.json$/i.test(l)?this.import(JSON.parse(c+""),l):this.import(e.DotProto.Parser.parse(c),l)}else r?/\.(\w+)$/.test(r)?this.import(t.imports[u],r.replace(/^(.+)\.(\w+)$/,(function(e,t,r){return t+"_import"+u+"."+r}))):this.import(t.imports[u],r+"_import"+u):this.import(t.imports[u]);a&&(this.importRoot=null)}return t.package&&this.define(t.package),t.syntax&&n(t),d=this.ptr,t.options&&Object.keys(t.options).forEach((function(e){d.options[e]=t.options[e]})),t.messages&&(this.create(t.messages),this.ptr=d),t.enums&&(this.create(t.enums),this.ptr=d),t.services&&(this.create(t.services),this.ptr=d),t.extends&&this.create(t.extends),this.reset()},o.resolveAll=function(){var n;if(null==this.ptr||"object"==typeof this.ptr.type)return this;if(this.ptr instanceof r.Namespace)this.ptr.children.forEach((function(e){this.ptr=e,this.resolveAll()}),this);else if(this.ptr instanceof r.Message.Field){if(t.TYPE.test(this.ptr.type))this.ptr.type=e.TYPES[this.ptr.type];else{if(!t.TYPEREF.test(this.ptr.type))throw Error("illegal type reference in "+this.ptr.toString(!0)+": "+this.ptr.type);if(!(n=(this.ptr instanceof r.Message.ExtensionField?this.ptr.extension.parent:this.ptr.parent).resolve(this.ptr.type,!0)))throw Error("unresolvable type reference in "+this.ptr.toString(!0)+": "+this.ptr.type);if(this.ptr.resolvedType=n,n instanceof r.Enum){if(this.ptr.type=e.TYPES.enum,"proto3"===this.ptr.syntax&&"proto3"!==n.syntax)throw Error("proto3 message cannot reference proto2 enum")}else{if(!(n instanceof r.Message))throw Error("illegal type reference in "+this.ptr.toString(!0)+": "+this.ptr.type);this.ptr.type=n.isGroup?e.TYPES.group:e.TYPES.message}}if(this.ptr.map){if(!t.TYPE.test(this.ptr.keyType))throw Error("illegal key type for map field in "+this.ptr.toString(!0)+": "+this.ptr.keyType);this.ptr.keyType=e.TYPES[this.ptr.keyType]}}else if(this.ptr instanceof e.Reflect.Service.Method){if(!(this.ptr instanceof e.Reflect.Service.RPCMethod))throw Error("illegal service type in "+this.ptr.toString(!0));if(!((n=this.ptr.parent.resolve(this.ptr.requestName,!0))&&n instanceof e.Reflect.Message))throw Error("Illegal type reference in "+this.ptr.toString(!0)+": "+this.ptr.requestName);if(this.ptr.resolvedRequestType=n,!((n=this.ptr.parent.resolve(this.ptr.responseName,!0))&&n instanceof e.Reflect.Message))throw Error("Illegal type reference in "+this.ptr.toString(!0)+": "+this.ptr.responseName);this.ptr.resolvedResponseType=n}else if(!(this.ptr instanceof e.Reflect.Message.OneOf||this.ptr instanceof e.Reflect.Extension||this.ptr instanceof e.Reflect.Enum.Value))throw Error("illegal object in namespace: "+typeof this.ptr+": "+this.ptr);return this.reset()},o.build=function(e){var t,r,n;if(this.reset(),this.resolved||(this.resolveAll(),this.resolved=!0,this.result=null),null===this.result&&(this.result=this.ns.build()),!e)return this.result;for(t="string"==typeof e?e.split("."):e,r=this.result,n=0;n<t.length;n++){if(!r[t[n]]){r=null;break}r=r[t[n]]}return r},o.lookup=function(e,t){return e?this.ns.resolve(e,t):this.ns},o.toString=function(){return"Builder"},i.Message=function(){},i.Enum=function(){},i.Service=function(){},i}(o,o.Lang,o.Reflect),o.Map=function(e,t){function r(e){var t=0;return{next:function(){return t<e.length?{done:!1,value:e[t++]}:{done:!0}}}}var n=function(e,r){var n,i,o,s;if(!e.map)throw Error("field is not a map");if(this.field=e,this.keyElem=new t.Element(e.keyType,null,!0,e.syntax),this.valueElem=new t.Element(e.type,e.resolvedType,!1,e.syntax),this.map={},Object.defineProperty(this,"size",{get:function(){return Object.keys(this.map).length}}),r)for(n=Object.keys(r),i=0;i<n.length;i++)o=this.keyElem.valueFromString(n[i]),s=this.valueElem.verifyValue(r[n[i]]),this.map[this.keyElem.valueToString(o)]={key:o,value:s}},i=n.prototype;return i.clear=function(){this.map={}},i.delete=function(e){var t=this.keyElem.valueToString(this.keyElem.verifyValue(e)),r=t in this.map;return delete this.map[t],r},i.entries=function(){var e,t,n=[],i=Object.keys(this.map);for(t=0;t<i.length;t++)n.push([(e=this.map[i[t]]).key,e.value]);return r(n)},i.keys=function(){var e,t=[],n=Object.keys(this.map);for(e=0;e<n.length;e++)t.push(this.map[n[e]].key);return r(t)},i.values=function(){var e,t=[],n=Object.keys(this.map);for(e=0;e<n.length;e++)t.push(this.map[n[e]].value);return r(t)},i.forEach=function(e,t){var r,n,i=Object.keys(this.map);for(n=0;n<i.length;n++)e.call(t,(r=this.map[i[n]]).value,r.key,this)},i.set=function(e,t){var r=this.keyElem.verifyValue(e),n=this.valueElem.verifyValue(t);return this.map[this.keyElem.valueToString(r)]={key:r,value:n},this},i.get=function(e){var t=this.keyElem.valueToString(this.keyElem.verifyValue(e));return t in this.map?this.map[t].value:void 0},i.has=function(e){return this.keyElem.valueToString(this.keyElem.verifyValue(e))in this.map},n}(0,o.Reflect),o.loadProto=function(e,t,r){return("string"==typeof t||t&&"string"==typeof t.file&&"string"==typeof t.root)&&(r=t,t=void 0),o.loadJson(o.DotProto.Parser.parse(e),t,r)},o.protoFromString=o.loadProto,o.loadProtoFile=function(e,t,r){if(t&&"object"==typeof t?(r=t,t=null):t&&"function"==typeof t||(t=null),t)return o.Util.fetch("string"==typeof e?e:e.root+"/"+e.file,(function(n){if(null!==n)try{t(null,o.loadProto(n,r,e))}catch(e){t(e)}else t(Error("Failed to fetch file"))}));var n=o.Util.fetch("object"==typeof e?e.root+"/"+e.file:e);return null===n?null:o.loadProto(n,r,e)},o.protoFromFile=o.loadProtoFile,o.newBuilder=function(e){return void 0===(e=e||{}).convertFieldsToCamelCase&&(e.convertFieldsToCamelCase=o.convertFieldsToCamelCase),void 0===e.populateAccessors&&(e.populateAccessors=o.populateAccessors),new o.Builder(e)},o.loadJson=function(e,t,r){return("string"==typeof t||t&&"string"==typeof t.file&&"string"==typeof t.root)&&(r=t,t=null),t&&"object"==typeof t||(t=o.newBuilder()),"string"==typeof e&&(e=JSON.parse(e)),t.import(e,r),t.resolveAll(),t},o.loadJsonFile=function(e,t,r){if(t&&"object"==typeof t?(r=t,t=null):t&&"function"==typeof t||(t=null),t)return o.Util.fetch("string"==typeof e?e:e.root+"/"+e.file,(function(n){if(null!==n)try{t(null,o.loadJson(JSON.parse(n),r,e))}catch(e){t(e)}else t(Error("Failed to fetch file"))}));var n=o.Util.fetch("object"==typeof e?e.root+"/"+e.file:e);return null===n?null:o.loadJson(JSON.parse(n),r,e)},i=e,o.loadProto(i,void 0,"").build("Modules").probuf}(r,t);return n}var po=function(){function e(e,t){oo.add(this),Object.defineProperty(this,"nestedMap",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"pbModules",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.pbModules=co(e)}return Object.defineProperty(e.prototype,"_encode",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n=this,i=new this.pbModules[e],o="";if(t)try{Object.keys(t).forEach((function(r){var s=t[r];if(void 0!==s){var a=n.nestedMap.get("".concat(e,"_").concat(r));if(o="set".concat(function(e,t,r){if(void 0===t||void 0===r)return e.toUpperCase();var n=e.slice(t,r);return e.replace(n,(function(e){return e.toUpperCase()}))}(r,0,1)),a){var u=s instanceof Array?s.map((function(e){return n._encode(a,e,!0)})):n._encode(a,s,!0);i[o](u)}else i[o](s)}}))}catch(t){var s="name: ".concat(e,", method: ").concat(o,", stack: ").concat(t.stack);null===console||void 0===console||console.error("pb encode error!",s)}return r?i:i.toArrayBuffer()}}),Object.defineProperty(e.prototype,"encode",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return this._encode(e,t)}}),Object.defineProperty(e.prototype,"decode",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this.pbModules[e].decode(t);return c(this,oo,"m",so).call(this,r)}}),Object.defineProperty(e.prototype,"getModule",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return new this.pbModules[e]}}),e}();oo=new WeakSet,so=function e(t){var r,n=this;if(t instanceof Array)return t.map((function(t){return c(n,oo,"m",e).call(n,t)}));if(r=t,"[object Object]"!==Object.prototype.toString.call(r))return t;if(t.buffer instanceof ArrayBuffer&&"number"==typeof t.offset&&"number"==typeof t.limit){var i=t.buffer,o=t.offset,s=t.limit;return i.slice(o,s)}if(void 0!==t.low&&void 0!==t.high&&Object.prototype.hasOwnProperty.call(t,"unsigned")){var a=t.low;return a<0&&(a+=4294967296),a=a.toString(16),parseInt(t.high.toString(16)+"00000000".replace(new RegExp("0{".concat(a.length,"}$")),a),16)}var u=t;return Object.keys(t).forEach((function(r){u[r]=c(n,oo,"m",e).call(n,t[r])})),u};var fo,ho,go,_o,bo="NotifyMsg",Eo="SyncRequestMsg",vo="UpStreamMessage",yo="PushExtra",mo="DownStreamMessages",Io="ChrmDownStreamMessages",To="DownStreamMessage",Ro="GetQNupTokenInput",Co="GetDownloadUrlInput",Oo="GetQNupTokenOutput",So="GetDownloadUrlOutput",Ao="ChrmInput",Po="ChrmOutput",No="ChrmPullMsg",wo="RelationQryInput",Mo="RelationsInput",Lo="RelationsOutput",Uo="QryRemindListReq",Do="QryRemindListResp",xo="CleanHisMsgInput",jo="CleanMsgBatchReq",Vo="QueryChatRoomInfoInput",Go="QueryChatRoomInfoOutput",ko="HistoryMsgInput",Fo="HistoryMsgOuput",Bo="SessionsAttQryInput",Ho="SessionsAttOutput",qo="SessionMsgReadInput",Yo="DeleteSessionsInput",Ko="SessionInfo",Qo="QuerySessionsInput",Wo="QuerySessionsOutPut",Jo="RelationDelBatchReq",zo="RelationOpInput",Zo="DeleteMsgInput",Xo="SetChrmKV",$o="SetChrmKVS",es="ChrmKVOutput",ts="ChrmKVSOutput",rs="QueryChrmKV",ns="SetUserSettingOutput",is="PullUserSettingInput",os="PullUserSettingOutput",ss="SessionReq",as="SessionStates",us="SessionState",ls="SessionStateItem",cs="SessionStateModifyReq",ds="GroupUnpushQuery",ps="GroupUnpushSet",fs="GroupUnpushResult",hs="SessionStateModifyResp",gs="TypeUnpushInput",_s="TypeUnpushOutput",bs="GrpReadReceiptMsg",Es="ReadReceipt",vs="QueryReceiptReq",ys="ReceiptResp",ms="GrpReadReceiptQryResp",Is="SessionTagAddInput",Ts="SessionTagItem",Rs="SessionTagDelInput",Cs="UserSettingNotification",Os="ReportSDKInput",Ss="UltraGrpPullSes",As="UltraGrpPullMsg",Ps="MsgChangeReq",Ns="QueryMsgChange",ws="EventChangeList",Ms="MsgChangeList",Ls="MsgQuery",Us="MsgQueryAck",Ds="OperateStatus",xs="OperateStatusNotify",js="SetRtcRoomIdInput",Vs="CallInfoUpStream",Gs="CallInfoDownStream",ks="KvInput",Fs="KvOutput",Bs="ReadReceiptMsg",Hs="ReceiptQryReq",qs="QueryReceiptResp",Ys="ReceiptCntQryReq",Ks="ReceiptCntQryResp",Qs="UpdateUserSubReq",Ws="UserSubDetail",Js="UpdateUserSubResp",zs="PullUserSubReq",Zs="PUllUserSubResp",Xs="PullSubDataReq",$s="PullSubDataResp",ea="SubDataDetail",ta="QrySubDataReq",ra="UserProfile",na="ProfileInfo",ia="SetUserProfileResp",oa="PullUserProfileReq",sa="UserProfiles",aa="UserProfileInput",ua="UserProfilePermission",la="SearchUserProfile",ca="ChannelsInput",da="ChannelsOutput",pa="MultiChannels",fa="ModifyChannelsInput",ha="QuitChannelsSetting",ga="ChannelsQueryInput",_a="ChannelsPageParam",ba="ChannelsListResult",Ea="ChannelsInviteStatusInfos",va="ChannelsUserInfos",ya="ChannelsJoinedInfos",ma="ChannelsMemberUpdateInput",Ia="ChannelsMemberResponseInput",Ta="ChannelsMembersInput",Ra="FriendInput",Ca="FriendsInput",Oa="FriendsCheckOutput",Sa="FriendProfileInput",Aa="FriendProfileOutput",Pa="FriendQueryInput",Na="FriendsListInput",wa="FriendLevelSet",Ma="FriendUserInfos",La="FriendInviteInfos",Ua="ChannelApplyInfo",Da="AddUnpushPeriodInput",xa="DeleteUnpushPeriodInput",ja="QueryUnpushPeriodInput",Va="QueryUnpushPeriodOutput",Ga="RelationDel",ka="MsgReadEvent",Fa=new Map([["UpStreamMessage_pushExt","PushExtra"],["DownStreamMessages_list","DownStreamMessage"],["DownStreamMessage_pushExt","PushExtra"],["ChannelInfosOutput_channels","ChannelInfoOutput"],["GroupMembersOutput_members","MemberInfo"],["GroupInput_groupInfo","GroupInfo"],["RelationsInput_msg","DownStreamMessage"],["RelationsOutput_info","RelationInfo"],["RelationInfo_msg","DownStreamMessage"],["RelationInfo_msgInfo","UnreadMsgInfo"],["QryRemindListResp_msgInfo","UnreadMsgInfo"],["CleanMsgBatchReq_input","CleanHisMsgInput"],["HistoryMessagesOuput_list","DownStreamMessage"],["QueryChatRoomInfoOutput_userInfos","ChrmMember"],["MPFollowOutput_info","MpInfo"],["MCFollowOutput_info","MpInfo"],["SearchMpOutput_info","MpInfo"],["PullMpOutput_info","MpInfo"],["HistoryMsgOuput_list","DownStreamMessage"],["DeleteSessionsInput_sessions","SessionInfo"],["QuerySessionsInput_sessions","SessionInfo"],["QuerySessionsOutPut_sessions","SessionInfo"],["RelationDelBatchReq_relation","RelationOpInput"],["DeleteMsgInput_msgs","DeleteMsg"],["SetChrmKV_entry","ChrmKVEntity"],["SetChrmKV_notification","UpStreamMessage"],["SetChrmKVS_entry","ChrmKVEntity"],["SetChrmKVS_notification","UpStreamMessage"],["DeleteChrmKVS_entry","ChrmKVEntity"],["DeleteChrmKVS_notification","UpStreamMessage"],["ChrmKVOutput_entries","ChrmKVEntity"],["ChrmKVSOutput_errorKeys","ChrmKVSOutputEntity"],["ChrmKVSOutput_keysVersion","ChrmKVSVersionEntity"],["PullUserSettingOutput_items","UserSettingItem"],["UserSettingItem_tags","SessionTagItem"],["SessionStates_state","SessionState"],["SessionState_stateItem","SessionStateItem"],["SessionStateItem_tags","SessionTagItem"],["SessionStateModifyReq_state","SessionState"],["ReceiptResp_resp","QueryReceiptRespItem"],["QueryReceiptRespItem_readUser","ReceiptUser"],["QueryReceiptRespItem_unreadUser","ReceiptUser"],["GrpReadReceiptQryResp_list","GrpMsgReadUser"],["SessionTagAddInput_tags","SessionTagItem"],["SessionTagDelInput_tags","SessionTagItem"],["EventChangeList_list","EventChange"],["MsgChangeList_list","MsgChange"],["MsgQuery_query","MessageQueryInfo"],["MsgQueryAck_list","DownStreamMessage"],["OperateStatusNotify_info","OperateInfo"],["OperateStatusNotify_summary","OperateSummary"],["KvOutput_info","KvInfo"],["QueryReceiptResp_list","ReceiptUser"],["ReceiptCntQryResp_result","MsgReadCnt"],["UpdateUserSubReq_subUsers","UserSubDetail"],["UpdateUserSubResp_subUsers","UserSubDetail"],["PUllUserSubResp_list","UserSubList"],["UserSubList_subUsers","UserSubDetail"],["PullSubDataResp_list","SubDataDetail"],["SubDataDetail_data","SubData"],["QrySubDataReq_subUsers","UserSubDetail"],["UserProfile_userProfile","ProfileInfo"],["UserProfile_userExtProfile","ProfileInfo"],["UserProfiles_UserProfile","UserProfile"],["ChannelsInput_settingProfile","ProfileInfo"],["ChannelsInput_extProfile","ProfileInfo"],["ChannelsInput_baseInfo","ChannelBaseInfo"],["ChannelsOutput_channelInfo","ChannelsJoinedInfo"],["ChannelsOutput_userInfos","ChannelsUserInfo"],["ChannelsOutput_friendInviteInfo","FriendInviteInfo"],["ChannelsOutput_friendUserInfo","FriendUserInfo"],["MultiChannels_list","ChannelsInput"],["ModifyChannelsInput_settingInfo","QuitChannelsSetting"],["ChannelsQueryInput_page","ChannelsPageParam"],["ChannelsListResult_page","ChannelsPageParam"],["ChannelsInviteStatusInfos_list","ChannelsInviteStatusInfo"],["ChannelsUserInfos_list","ChannelsUserInfo"],["ChannelsJoinedInfos_list","ChannelsJoinedInfo"],["ChannelsUserInfo_ext","ChannelsUserExtInfo"],["ChannelsJoinedInfo_settingProfile","ProfileInfo"],["ChannelsJoinedInfo_extProfile","ProfileInfo"],["ChannelsJoinedInfo_baseInfo","ChannelBaseInfo"],["ChannelsJoinedInfo_userInfo","ChannelsUserExtInfo"],["ChannelsInviteStatusInfo_joinUserInfo","ChannelsUserInfo"],["ChannelsInviteStatusInfo_inviterInfo","ChannelsUserInfo"],["ChannelsInviteStatusInfo_processInfo","ChannelsUserInfo"],["FriendsOutput_list","FriendOutput"],["FriendsCheckOutput_list","FriendCheckOutput"],["FriendProfileInput_extProfile","ProfileInfo"],["FriendQueryInput_page","ChannelsPageParam"],["FriendUserInfo_extProfile","ProfileInfo"],["FriendUserInfos_list","FriendUserInfo"],["FriendInviteInfos_list","FriendInviteInfo"],["UpdateChannnelInfo_channelInfo","ChannelsJoinedInfo"],["UpdateChannnelInfo_userInfo","ChannelsUserInfo"],["UpdateUserInfo_updatedUserInfo","ChannelsUserInfo"],["UpdateUserInfo_optUserInfo","ChannelsUserInfo"],["ChannelApplyInfo_statusInfo","ChannelsInviteStatusInfo"],["ChannelEventData_optUserInfo","ChannelsUserInfo"],["ChannelEventData_channelInfo","ChannelsJoinedInfo"],["ChannelEventData_userInfos","ChannelsUserInfo"],["ChannelEventData_channelFullInfo","ChannelsJoinedInfo"],["FriendUpdateEvent_extProfile","ProfileInfo"],["MsgReadEvent_readList","ReceiptUser"]]);!function(e){e[e.PERSON=1]="PERSON",e[e.PERSONS=2]="PERSONS",e[e.GROUP=3]="GROUP",e[e.TEMPGROUP=4]="TEMPGROUP",e[e.CUSTOMERSERVICE=5]="CUSTOMERSERVICE",e[e.NOTIFY=6]="NOTIFY",e[e.MC=7]="MC",e[e.MP=8]="MP",e[e.ULTRAGROUP=10]="ULTRAGROUP"}(fo||(fo={})),function(e){e[e.IMAGE=1]="IMAGE",e[e.AUDIO=2]="AUDIO",e[e.VIDEO=3]="VIDEO",e[e.FILE=4]="FILE",e[e.SIGHT=5]="SIGHT",e[e.COMBINE_HTML=6]="COMBINE_HTML"}(ho||(ho={})),function(e){e[e.GROUP_SUCCESS=0]="GROUP_SUCCESS",e[e.GROUP_FAILURE=1]="GROUP_FAILURE"}(go||(go={})),function(e){e[e.IsSilent=1]="IsSilent",e[e.IsTop=2]="IsTop",e[e.Tags=3]="Tags"}(_o||(_o={}));var Ba,Ha,qa,Ya,Ka,Qa,Wa,Ja,za,Za=new po("package Modules;\nmessage probuf {\n message SetUserStatusOutput {\n optional int32 nothing=1;\n }\n message GetUserStatusInput {\n optional int32 nothing=1;\n }\n message GetUserStatusOutput {\n optional string status=1;\n optional string subUserId=2;\n }\n message SubUserStatusInput {\n repeated string userid =1;\n }\n message SubUserStatusOutput {\n optional int32 nothing=1;\n }\n message VoipDynamicInput {\n required int32 engineType = 1;\n required string channelName = 2;\n optional string channelExtra = 3;\n }\n message VoipDynamicOutput {\n required string dynamicKey=1;\n }\n message NotifyMsg {\n required int32 type = 1;\n optional int64 time = 2;\n optional string chrmId=3;\n }\n message SyncRequestMsg {\n required int64 syncTime = 1;\n required bool ispolling = 2;\n optional bool isweb=3;\n optional bool isPullSend=4;\n optional bool isKeeping=5;\n optional int64 sendBoxSyncTime=6;\n optional int64 broadcastSyncTime=7;\n optional int64 endTime = 8;\n optional bool compressioEnabled = 9;\n }\n message UpStreamMessage {\n required int32 sessionId = 1;\n required string classname = 2;\n required string content = 3;\n optional string pushText = 4;\n optional string appData = 5;\n repeated string toUserIds = 6;\n optional int64 delMsgTime = 7;\n optional string delMsgId = 8;\n optional int32 configFlag = 9;\n optional int64 clientUniqueId = 10;\n optional string extraContent = 11;\n optional PushExtra pushExt = 12;\n optional string busChannel = 13;\n optional bool isResend = 14;\n optional string systemId = 16;\n optional string senderPortrait = 21;\n optional int64 optionBits = 22;\n }\n message PushExtra {\n optional string title = 1;\n optional int32 templateIdNoUse= 2;\n optional string pushId = 3;\n optional string pushConfigs = 4;\n optional string templateId = 5;\n }\n message DownStreamMessages {\n repeated DownStreamMessage list = 1;\n required int64 syncTime = 2;\n optional bool finished = 3;\n optional int64 broadcastSyncTime = 4;\n optional int64 systemTime = 5;\n optional int64 credibleStartTime = 6;\n optional int64 credibleEndTime = 7;\n optional bool compressioEnabled = 8;\n optional bytes compressedData = 9;\n }\n message ChrmDownStreamMessages {\n repeated bytes list = 1;\n required int64 syncTime = 2;\n optional bool compressioEnabled = 3;\n optional bytes compressedData = 4;\n }\n message DownStreamMessage {\n required string fromUserId = 1;\n required ChannelType type = 2;\n optional string groupId = 3;\n required string classname = 4;\n required string content = 5;\n required int64 dataTime = 6;\n required int64 status = 7;\n optional int64 extra = 8;\n optional string msgId = 9;\n optional int32 direction = 10;\n optional int32 plantform =11;\n optional int32 isRemoved = 12;\n optional string source = 13;\n optional int64 clientUniqueId = 14;\n optional string extraContent = 15;\n optional string pushContent = 16;\n optional int32 configFlag = 17;\n optional PushExtra pushExt = 18;\n optional string busChannel = 19;\n optional int64 extStatus = 20;\n repeated string toUserIds = 21;\n optional int32 groupUnpush = 22;\n optional int64 optionBits = 23;\n }\n enum ChannelType {\n PERSON = 1;\n PERSONS = 2;\n GROUP = 3;\n TEMPGROUP = 4;\n CUSTOMERSERVICE = 5;\n NOTIFY = 6;\n MC=7;\n MP=8;\n ULTRAGROUP = 10;\n }\n message CreateDiscussionInput {\n optional string name = 1;\n }\n message CreateDiscussionOutput {\n required string id = 1;\n }\n message ChannelInvitationInput {\n repeated string users = 1;\n }\n message LeaveChannelInput {\n required int32 nothing = 1;\n }\n message ChannelEvictionInput {\n required string user = 1;\n }\n message RenameChannelInput {\n required string name = 1;\n }\n message ChannelInfoInput {\n required int32 nothing = 1;\n }\n message ChannelInfoOutput {\n required ChannelType type = 1;\n required string channelId = 2;\n required string channelName = 3;\n required string adminUserId = 4;\n repeated string firstTenUserIds = 5;\n required int32 openStatus = 6;\n }\n message ChannelInfosInput {\n required int32 page = 1;\n optional int32 number = 2;\n }\n message ChannelInfosOutput {\n repeated ChannelInfoOutput channels = 1;\n required int32 total = 2;\n }\n message MemberInfo {\n required string userId = 1;\n required string userName = 2;\n required string userPortrait = 3;\n required string extension = 4;\n }\n message GroupMembersInput {\n required int32 page = 1;\n optional int32 number = 2;\n }\n message GroupMembersOutput {\n repeated MemberInfo members = 1;\n required int32 total = 2;\n }\n message GetUserInfoInput {\n required int32 nothing = 1;\n }\n message GetUserInfoOutput {\n required string userId = 1;\n required string userName = 2;\n required string userPortrait = 3;\n }\n message GetSessionIdInput {\n required int32 nothing = 1;\n }\n message GetSessionIdOutput {\n required int32 sessionId = 1;\n }\n enum FileType {\n IMAGE = 1;\n AUDIO = 2;\n VIDEO = 3;\n FILE = 4;\n SIGHT = 5;\n COMBINE_HTML = 6;\n }\n message GetQNupTokenInput {\n required FileType type = 1;\n optional string key = 2;\n optional string httpMethod = 3;\n optional string queryString = 4;\n optional string url = 5;\n optional string ext = 6;\n optional int64 size = 7;\n optional int32 ipType = 8;\n }\n message GetQNdownloadUrlInput {\n required FileType type = 1;\n required string key = 2;\n optional string fileName = 3;\n }\n message GetDownloadUrlInput {\n required FileType type = 1;\n required string key = 2;\n optional string fileName = 3;\n optional string ext = 4;\n optional int64 size = 5;\n optional int32 ipType = 6;\n }\n message GetQNupTokenOutput {\n required int64 deadline = 1;\n required string token = 2;\n optional string bosToken = 3;\n optional string bosDate = 4;\n optional string path = 5;\n\n optional string osskeyId = 6;\n optional string ossPolicy = 7;\n optional string ossSign = 8;\n optional string ossBucketName = 9;\n\n optional string s3Credential = 10;\n optional string s3Algorithm = 11;\n optional string s3Date = 12;\n optional string s3Policy = 13;\n optional string s3Signature = 14;\n optional string s3BucketName = 15;\n\n optional string stcAuthorization = 16;\n optional string stcContentSha256 = 17;\n optional string stcDate = 18;\n optional string stcBucketName = 19;\n\n optional string minioAuthorization = 20;\n optional string minioContentSha256 = 21;\n optional string minioDate = 22;\n optional string minioBucketName = 23;\n\n optional string downloadAuthInfo = 24;\n optional string ossConfig = 25;\n }\n message GetQNdownloadUrlOutput {\n required string downloadUrl = 1;\n }\n message GetDownloadUrlOutput {\n required string downloadUrl = 1;\n }\n message Add2BlackListInput {\n required string userId = 1;\n }\n message RemoveFromBlackListInput {\n required string userId = 1;\n }\n message QueryBlackListInput {\n required int32 nothing = 1;\n }\n message QueryBlackListOutput {\n repeated string userIds = 1;\n }\n message BlackListStatusInput {\n required string userId = 1;\n }\n message BlockPushInput {\n required string blockeeId = 1;\n }\n message ModifyPermissionInput {\n required int32 openStatus = 1;\n }\n message GroupInput {\n repeated GroupInfo groupInfo = 1;\n }\n message GroupOutput {\n required int32 nothing = 1;\n }\n message GroupInfo {\n required string id = 1;\n required string name = 2;\n }\n message GroupHashInput {\n required string userId = 1;\n required string groupHashCode = 2;\n }\n message GroupHashOutput {\n required GroupHashType result = 1;\n }\n enum GroupHashType {\n GROUP_SUCCESS = 0x00;\n GROUP_FAILURE = 0x01;\n }\n message ChrmInput {\n required int32 nothing = 1;\n optional string extra = 2;\n }\n message ChrmOutput {\n required int32 nothing = 1;\n optional string sessionId = 2;\n optional int64 joinTime = 3;\n optional int64 createTime = 4;\n optional int32 memberCount = 5;\n optional int32 chatroomBanState = 6;\n optional int32 whiteListState = 7;\n }\n message ChrmPullMsg {\n required int64 syncTime = 1;\n required int32 count = 2;\n optional int32 pullMsgType = 3;\n optional bool compressioEnabled = 4;\n }\n message ChrmPullMsgNew {\n required int32 count = 1;\n required int64 syncTime = 2;\n optional string chrmId=3;\n }\n message RelationQryInput {\n optional ChannelType type = 1;\n optional int32 count = 2;\n optional int64 startTime = 3;\n optional int32 order = 4;\n optional bool isEraseMsgContent = 5;\n optional int64 endTime = 6;\n optional bool compressioEnabled = 7;\n optional int32 qryType = 8;\n }\n message RelationsInput {\n required ChannelType type = 1;\n optional DownStreamMessage msg =2;\n optional int32 count = 3;\n repeated string busChannel = 4;\n optional int64 startTime = 5;\n optional int64 endTime = 6;\n }\n message RelationsOutput {\n repeated RelationInfo info = 1;\n optional bool isFinished = 2;\n optional int64 pullTime = 3;\n optional bool compressioEnabled = 4; \n optional bytes compressedData = 5;\n }\n message RelationInfo {\n required ChannelType type = 1;\n required string userId = 2;\n optional DownStreamMessage msg =3;\n optional int64 readMsgTime= 4;\n optional int64 unreadCount= 5;\n optional string busChannel = 6;\n optional int64 versionTime = 7;\n optional int64 remindCount = 8;\n optional int32 busChannelType = 9;\n optional UnreadMsgInfo msgInfo = 10;\n optional int32 remindMeCount = 11;\n }\n message UnreadMsgInfo {\n required string msgId = 1;\n required int64 msgTime= 2;\n optional int32 remindType= 3;\n optional string className = 4;\n }\n message QryRemindListReq {\n required string groupId = 1;\n optional string busChannel = 2;\n optional int64 msgTime = 3;\n optional int32 size = 4;\n }\n message QryRemindListResp {\n repeated UnreadMsgInfo msgInfo = 1;\n }\n message RelationInfoReadTime {\n required ChannelType type = 1;\n required int64 readMsgTime= 2;\n required string targetId = 3;\n }\n message CleanHisMsgInput {\n required string targetId = 1;\n required int64 dataTime = 2;\n optional int32 conversationType= 3;\n optional string busChannel = 4;\n }\n message CleanMsgBatchReq {\n repeated CleanHisMsgInput input = 1;\n }\n message HistoryMessageInput {\n required string targetId = 1;\n required int64 dataTime =2;\n required int32 size = 3;\n }\n\n message HistoryMessagesOuput {\n repeated DownStreamMessage list = 1;\n required int64 syncTime = 2;\n required int32 hasMsg = 3;\n optional int64 credibleStartTime = 4;\n optional int64 credibleEndTime = 5;\n optional bool compressioEnabled = 6; \n optional bytes compressedData = 7;\n }\n message QueryChatRoomInfoInput {\n required int32 count= 1;\n optional int32 order= 2;\n }\n\n message QueryChatRoomInfoOutput {\n optional int32 userTotalNums = 1;\n repeated ChrmMember userInfos = 2;\n }\n message ChrmMember {\n required int64 time = 1;\n required string id = 2;\n }\n message MPFollowInput {\n required string id = 1;\n }\n\n message MPFollowOutput {\n required int32 nothing = 1;\n optional MpInfo info =2;\n }\n\n message MCFollowOutput {\n required int32 nothing = 1;\n optional MpInfo info =2;\n }\n\n message MpInfo {\n required string mpid=1;\n required string name = 2;\n required string type = 3;\n required int64 time=4;\n optional string portraitUrl=5;\n optional string extra =6;\n }\n\n message SearchMpInput {\n required int32 type=1;\n required string id=2;\n }\n\n message SearchMpOutput {\n required int32 nothing=1;\n repeated MpInfo info = 2;\n }\n\n message PullMpInput {\n required int64 time=1;\n required string mpid=2;\n }\n\n message PullMpOutput {\n required int32 status=1;\n repeated MpInfo info = 2;\n }\n message HistoryMsgInput {\n optional string targetId = 1;\n optional int64 time = 2;\n optional int32 count = 3;\n optional int32 order = 4;\n optional string busChannel = 5;\n optional bool compressioEnabled = 6;\n }\n\n message HistoryMsgOuput {\n repeated DownStreamMessage list=1;\n required int64 syncTime=2;\n required int32 hasMsg=3;\n optional int64 credibleStartTime = 4;\n optional int64 credibleEndTime = 5;\n optional bool compressioEnabled = 6;\n optional bytes compressedData = 7;\n }\n message SessionsAttQryInput {\n required int32 nothing = 1;\n }\n message SessionsAttOutput {\n required int64 inboxTime = 1;\n required int64 sendboxTime = 2;\n required int64 totalUnreadCount = 3;\n }\n message SessionMsgReadInput {\n required ChannelType type = 1;\n required int64 msgTime = 2;\n required string channelId = 3;\n optional string busChannel = 4;\n }\n message SessionMsgReadOutput {\n optional int32 nothing=1;\n }\n message DeleteSessionsInput {\n repeated SessionInfo sessions = 1;\n }\n message SessionInfo {\n required ChannelType type = 1;\n required string channelId = 2;\n optional int64 unreadCount = 3;\n optional string busChannel = 4;\n }\n message QuerySessionsInput {\n repeated SessionInfo sessions = 1;\n }\n message QuerySessionsOutPut {\n repeated SessionInfo sessions = 1;\n }\n message DeleteSessionsOutput {\n optional int32 nothing=1;\n }\n message RelationDelBatchReq {\n repeated RelationOpInput relation = 1;\n }\n message RelationOpInput {\n required string conversationId = 1;\n required ChannelType conversationType = 2;\n optional string busChannel = 3;\n }\n message DeleteMsgInput {\n optional ChannelType type = 1;\n optional string conversationId = 2;\n repeated DeleteMsg msgs = 3;\n optional string busChannel = 4;\n }\n message DeleteMsg {\n optional string msgId = 1;\n optional int64 msgDataTime = 2;\n optional int32 direct = 3;\n }\n message ChrmKVEntity {\n required string key = 1;\n required string value = 2;\n optional int32 status = 3;\n optional int64 timestamp = 4;\n optional string uid = 5;\n optional int64 version = 6;\n }\n message SetChrmKV {\n required ChrmKVEntity entry = 1;\n optional bool bNotify = 2;\n optional UpStreamMessage notification = 3;\n optional ChannelType type = 4;\n }\n message SetChrmKVS {\n repeated ChrmKVEntity entry = 1;\n optional bool bNotify = 2;\n optional UpStreamMessage notification = 3;\n optional ChannelType type = 4;\n }\n message DeleteChrmKVS {\n repeated ChrmKVEntity entry = 1;\n optional bool bNotify = 2;\n optional UpStreamMessage notification = 3;\n optional ChannelType type = 4;\n }\n message ChrmKVOutput {\n repeated ChrmKVEntity entries = 1;\n optional bool bFullUpdate = 2;\n optional int64 syncTime = 3;\n optional bool compressioEnabled = 4; \n optional bytes compressedData = 5;\n }\n message ChrmKVSVersionEntity {\n optional int64 version = 1;\n optional string key = 2;\n }\n\n message ChrmKVSOutput {\n repeated ChrmKVSOutputEntity errorKeys = 1;\n repeated ChrmKVSVersionEntity keysVersion = 2;\n }\n message ChrmKVSOutputEntity {\n optional string key = 1;\n optional int32 errorCode = 2;\n }\n message QueryChrmKV {\n required int64 timestamp = 1;\n optional bool compressioEnabled = 2;\n }\n message SetUserSettingInput {\n required int64 version=1;\n required string value=2;\n }\n message SetUserSettingOutput {\n required int64 version=1;\n required bool reserve=2;\n }\n message PullUserSettingInput {\n required int64 version=1;\n optional bool reserve=2;\n optional int32 ipType = 3;\n }\n message PullUserSettingOutput {\n repeated UserSettingItem items = 1;\n required int64 version=2;\n }\n message UserSettingItem {\n required string targetId= 1;\n required ChannelType type = 2;\n required string key = 4;\n required bytes value = 5;\n required int64 version=6;\n required int32 status=7;\n repeated SessionTagItem tags= 8;\n }\n message SessionReq {\n required int64 time = 1;\n }\n message SessionStates {\n optional int64 version=1;\n repeated SessionState state= 2;\n }\n message SessionState {\n required ChannelType type = 1;\n required string channelId = 2;\n optional int64 time = 3;\n repeated SessionStateItem stateItem = 4;\n optional string busChannel = 5;\n }\n message SessionStateItem {\n required SessionStateType sessionStateType = 1;\n required string value = 2;\n repeated SessionTagItem tags = 3;\n }\n enum SessionStateType {\n IsSilent = 1;\n IsTop = 2;\n Tags = 3;\n }\n message SessionStateModifyReq {\n required int64 version=1;\n repeated SessionState state= 2;\n }\n message GroupUnpushQuery {\n optional string busChannel = 1;\n }\n message GroupUnpushSet{\n optional string busChannel = 1;\n required int32 unpushLevel = 2;\n }\n message GroupUnpushResult {\n required string groupId = 1;\n optional string busChannel = 2;\n required int32 unpushLevel = 3;\n }\n message SessionStateModifyResp {\n required int64 version=1;\n }\n message TypeUnpushInput {\n required ChannelType type = 1;\n required int64 version = 2;\n required int32 unpushLevel = 3;\n }\n message TypeUnpushOutput {\n required int64 version = 1;\n }\n message GrpReadReceiptMsg {\n repeated string msgId=1;\n optional string channelId = 2;\n }\n message GrpReadReceiptQryReq {\n repeated string msgId=1;\n optional string channelId = 2;\n }\n message ReadReceipt {\n optional string targetId = 1;\n optional int32 type = 2;\n optional string channelId = 3;\n optional int32 readType =4 ;\n repeated string msgIds= 5 ;\n optional string fromId = 6;\n }\n message QueryReceiptReq{ \n optional string targetId = 1;\n optional string busChannel =2;\n optional int32 type = 3;\n repeated string msgIds = 4;\n optional int32 qryType = 5;\n optional int32 order =6;\n optional bool compress = 7;\n optional int32 readType = 8;\n optional int32 pageType = 9; \n optional int32 pageSize = 10;\n optional string pageToken = 11;\n repeated string users = 12;\n }\n message ReceiptResp {\n repeated QueryReceiptRespItem resp = 1;\n optional bool compress = 2;\n optional bytes compressData = 3;\n optional string pageToken = 4;\n }\n message QueryReceiptRespItem {\n optional string msgId = 1;\n optional int64 msgTime = 2;\n optional int32 totalCnt = 3;\n optional int64 readCnt = 4;\n repeated ReceiptUser readUser = 5;\n repeated string unreadList = 6;\n optional int64 unreadCnt = 7;\n repeated ReceiptUser unreadUser = 8;\n }\n message GrpReadReceiptQryResp {\n required int32 totalMemberNum = 1;\n repeated GrpMsgReadUser list = 2;\n }\n message GrpMsgReadUser {\n required int64 readTime = 1;\n required string userId = 2;\n }\n message SessionTagAddInput {\n required int64 version=1;\n repeated SessionTagItem tags=2;\n }\n message SessionTagItem {\n required string tagId=1;\n optional string name=2;\n optional int64 createdTime=3;\n optional bool isTop=4;\n }\n message SessionTagDelInput {\n required int64 version=1;\n repeated SessionTagItem tags=2;\n }\n message SessionDisTagReq {\n repeated string tagId=1;\n }\n message UserSettingNotification {\n required int64 version=1;\n required bool reserve=2;\n }\n message ReportSDKInput {\n required string sdkInfo=1;\n }\n message ReportSDKOutput {\n optional int32 nothing=1;\n }\n message UltraGrpPullSes {\n required int64 syncTime = 1;\n optional bool isEraseMsgContent = 2;\n }\n message UltraGrpPullMsg {\n required int64 syncTime = 1;\n optional bool compressioEnabled = 2;\n }\n message MsgChangeReq {\n required string fromUserId = 1;\n required string targetId = 2;\n required ChannelType type = 3;\n required string msgUID = 4;\n required int64 msgTime = 5;\n optional string busChannel = 6;\n optional string content = 7;\n }\n message QueryMsgChange {\n required int64 syncTime = 1;\n optional int32 needCompress = 2;\n optional int64 onlineTime = 3;\n optional string targetId = 4;\n }\n message EventChangeList {\n repeated EventChange list = 1;\n required int64 syncTime = 2;\n optional bool hasNext = 3 ;\n optional string targetId = 4;\n optional bool isCompress = 5 ;\n }\n message EventChange {\n optional string businessId = 1;\n optional ChannelType channelType = 2;\n optional int64 time = 3;\n optional int32 changeType = 4;\n optional string originalId = 5;\n optional int64 originalTime = 6;\n optional string secondaryId = 7;\n optional bool isAdmin = 8;\n optional bool additionalMark = 9; \n optional string operatorId = 10;\n optional int32 subChangeType = 11;\n optional int32 secondaryType = 12;\n optional bool isRemindMe = 13;\n repeated string extIds = 14;\n optional int32 remindType = 15;\n optional bytes eventData = 16;\n }\n message MsgChangeList {\n repeated MsgChange list = 1;\n required int64 syncTime = 2;\n optional bool hasNext = 3 ;\n }\n message MsgChange {\n required string targetId = 1;\n required ChannelType type = 2;\n required int64 time = 3;\n required int32 changeType = 4;\n required string msgUID = 5;\n required int64 msgTime = 6;\n optional string busChannel = 7;\n optional bool isAdmin = 8;\n optional bool isDel = 9;\n optional string operatorId = 10;\n optional int32 subChangeType = 11;\n optional int32 busChannelType = 12;\n optional bool isRemindMe = 13;\n repeated string userGroupIds = 14;\n optional int32 remindType = 15;\n }\n message MsgQuery {\n required string targetId = 1;\n required ChannelType type = 2;\n repeated MessageQueryInfo query = 3; //\n }\n message MessageQueryInfo {\n required int64 msgTime = 1;\n required string msgUID = 2;\n optional string busChannel = 3;\n }\n message MsgQueryAck {\n repeated DownStreamMessage list = 1;\n }\n message OperateStatus {\n optional string targetId = 1;\n optional ChannelType type = 2;\n optional int32 opType = 3;\n optional string busChannel = 4;\n }\n message OperateStatusNotify {\n optional ChannelType type = 1;\n optional int64 notifyType = 2;\n repeated OperateInfo info = 3 ;\n repeated OperateSummary summary = 4 ;\n }\n message OperateInfo {\n optional string targetId = 1;\n optional string busChannel = 2;\n optional string userId = 3;\n optional int32 opType = 4;\n optional int64 optime = 5;\n }\n \n message OperateSummary {\n optional string targetId = 1;\n optional string busChannel = 2;\n optional int32 count = 3;\n optional int32 opType = 4;\n }\n\n message SetRtcRoomIdInput {\n required string rtcRoomId= 1;\n }\n message SetRtcRoomIdOutput {\n required int32 nothing = 1;\n }\n message CallInfoUpStream {\n required string key= 1;\n required string dataContent=2;\n }\n message CallInfoDownStream {\n required string key= 1;\n required string dataContent=2;\n required int64 maxTime=3;\n }\n message KvInput {\n required int64 syncTime = 1;\n }\n message KvOutput {\n required int64 maxTime = 1;\n repeated KvInfo info = 2;\n }\n message KvInfo {\n required string key =1;\n required string value =2;\n }\n message ReadReceiptMsg {\n required string targetId = 1;\n required ChannelType type = 2;\n optional string busChannel = 3;\n optional string startMsgId = 4;\n optional string endMsgId = 5;\n }\n message ReceiptQryReq {\n required string msgId = 1;\n optional string busChannel = 2;\n required string targetId = 3;\n }\n message QueryReceiptResp {\n optional int32 num = 1;\n repeated ReceiptUser list = 2;\n optional int32 readCnt = 3;\n }\n message ReceiptUser {\n optional int64 receiptTime = 1;\n optional string userId = 2;\n optional string name = 3;\n optional string portrait = 4;\n optional bool mentioned= 5;\n }\n message ReceiptCntQryReq {\n optional ChannelType type = 1;\n optional string channelId = 2;\n optional string busChannel = 3;\n repeated string msgId = 4;\n }\n message ReceiptCntQryResp {\n repeated MsgReadCnt result= 1;\n }\n\n message MsgReadCnt {\n optional string msgId = 1;\n optional int32 cnt = 2;\n optional int32 tmn = 3;\n }\n message UpdateUserSubReq {\n optional int32 subType = 1;\n repeated UserSubDetail subUsers = 2;\n optional int32 opType = 3;\n optional int32 expiry = 4;\n }\n message UserSubDetail {\n optional string subUserId = 1;\n }\n message UpdateUserSubResp {\n repeated UserSubDetail subUsers = 1;\n optional int64 subTime = 2;\n }\n message PullUserSubReq {\n optional int64 version = 1;\n optional string pageToken = 2;\n }\n message PUllUserSubResp {\n repeated UserSubList list = 1;\n optional int64 version = 2;\n optional bool hasNext = 3;\n optional string pageToken = 4;\n optional bool isFull = 5;\n }\n message UserSubList {\n repeated UserSubDetail subUsers = 1;\n optional int32 subType = 2;\n optional int64 subTime = 3;\n optional int32 expiry = 4;\n optional int32 opType = 5;\n }\n message PullSubDataReq {\n optional int64 versionTime = 1;\n optional bool needAllData = 2;\n optional string pageToken = 3;\n }\n message PullSubDataResp {\n repeated SubDataDetail list = 1;\n optional int64 versionTime = 2;\n optional bool hasNext = 3;\n optional string pageToken = 4;\n optional bool isFull = 5;\n }\n message SubDataDetail {\n optional string statusStr = 1;\n optional string subUserId = 2;\n repeated SubData data = 3;\n optional int32 subType = 4;\n }\n\n message SubData {\n optional int32 platformInfo = 1;\n optional int32 value = 2;\n optional int64 versionTime = 3;\n }\n message QrySubDataReq {\n optional int32 subType = 1;\n repeated UserSubDetail subUsers = 2;\n }\n message UserProfile {\n optional int64 version = 1;\n optional string userId = 2;\n repeated ProfileInfo userProfile = 3;\n repeated ProfileInfo userExtProfile = 4;\n }\n message ProfileInfo {\n optional string key = 1;\n optional string value = 2;\n }\n message SetUserProfileResp {\n optional int64 version = 1;\n optional string key = 2;\n repeated string censorFailedFields = 3;\n }\n message PullUserProfileReq {\n repeated string userId = 1;\n }\n message UserProfiles {\n repeated UserProfile UserProfile = 1;\n }\n message UserProfileInput {\n required int32 nothing = 1;\n }\n message UserProfilePermission {\n optional int32 permission = 1;\n }\n message UserProfileOutput {\n required int32 nothing = 1;\n }\n message SearchUserProfile {\n optional string uniqueId = 1;\n }\n message ChannelsInput {\n optional string targetId = 1;\n optional ChannelType type = 2;\n repeated ProfileInfo settingProfile = 3;\n repeated ProfileInfo extProfile = 4;\n optional ChannelBaseInfo baseInfo = 5;\n repeated string users = 6;\n }\n\n message ChannelBaseInfo {\n optional string creatorId = 1;\n optional string ownerId = 2;\n optional int64 createTime = 3;\n optional int32 memberCount = 4;\n }\n\n message ChannelsOutput {\n optional int64 operateTime = 1;\n optional int32 flag = 2;\n optional string msg = 3;\n optional int32 processCode = 4;\n optional ChannelsJoinedInfo channelInfo = 5;\n repeated ChannelsUserInfo userInfos = 6;\n optional FriendInviteInfo friendInviteInfo = 7;\n optional FriendUserInfo friendUserInfo = 8;\n repeated string censorFailedFields = 9;\n }\n\n message MultiChannels {\n optional ChannelType type = 1;\n repeated ChannelsInput list = 2;\n }\n\n message ModifyChannelsInput {\n optional string targetId = 1;\n optional ChannelType type = 2;\n optional QuitChannelsSetting settingInfo = 3;\n repeated string users = 4;\n optional int32 operateType = 5;\n }\n\n message QuitChannelsSetting {\n optional bool isQuit = 1;\n optional bool isDelBan = 2;\n optional bool isDelWhite = 3;\n optional bool isDelAttention = 4;\n }\n\n message ChannelsQueryInput {\n optional string targetId = 1;\n optional ChannelType type = 2;\n optional ChannelsPageParam page = 3;\n repeated string ids = 4;\n optional int32 roleType = 5;\n }\n\n message ChannelsPageParam {\n optional int32 size = 1;\n optional string pageToken = 2;\n optional bool hasNext = 3 ;\n optional int32 total = 4 ;\n optional int32 order = 5 ;\n }\n\n message ChannelsListResult {\n optional int32 listType = 1;\n optional bytes result = 2;\n optional ChannelsPageParam page = 3;\n }\n \n message ChannelsInviteStatusInfos {\n repeated ChannelsInviteStatusInfo list = 1;\n }\n \n message ChannelsUserInfos {\n repeated ChannelsUserInfo list = 1;\n }\n \n message ChannelsJoinedInfos {\n repeated ChannelsJoinedInfo list = 1;\n }\n\n message ChannelsUserInfo {\n optional string userId = 1;\n optional ChannelsUserExtInfo ext = 2;\n optional int64 opTime = 3;\n optional string name = 4;\n optional string portraitUrl = 5;\n }\n\n message ChannelsUserExtInfo {\n optional int32 role = 1;\n optional int64 joinTime = 2;\n optional string channelNickName = 3;\n optional string additional = 4;\n optional string remarkName = 5;\n }\n\n message ChannelsMemberUpdateInput {\n optional string targetId = 1;\n optional ChannelType type = 2;\n optional string userId = 3;\n optional string channelNickName = 4;\n optional string additional = 5;\n optional int32 operateType = 6;\n }\n message ChannelsJoinedInfo {\n optional string targetId = 1;\n repeated ProfileInfo settingProfile = 2;\n repeated ProfileInfo extProfile = 3;\n optional ChannelBaseInfo baseInfo = 4;\n optional ChannelsUserExtInfo userInfo = 5;\n }\n message ChannelsInviteStatusInfo {\n optional string targetId = 1;\n optional ChannelsUserInfo joinUserInfo = 2;\n optional ChannelsUserInfo inviterInfo = 3;\n optional int32 status = 4;\n optional int32 directionType = 5;\n optional int32 joinType = 6;\n optional string detail = 7;\n optional int64 applyTime = 8;\n optional ChannelsUserInfo processInfo = 9;\n optional int64 processTime = 10;\n }\n message ChannelsMemberResponseInput {\n optional string targetId = 1;\n optional ChannelType type = 2;\n optional int32 optType = 3;\n optional int32 optResult = 4;\n optional string joinUserId = 5;\n optional string inviterId = 6;\n optional string detail = 7;\n }\n message ChannelsMembersInput {\n optional string targetId = 1;\n optional ChannelType type = 2;\n repeated string userIds = 3;\n }\n message FriendInput {\n optional string targetId = 1;\n optional int32 type = 2;\n optional string info = 3;\n }\n message FriendsOutput {\n repeated FriendOutput list = 1;\n }\n message FriendOutput {\n optional string userId = 1;\n optional int64 operateTime = 2;\n optional string flag = 3;\n }\n message FriendsInput {\n repeated string targetId = 1;\n optional int32 type = 2;\n }\n message FriendsCheckOutput {\n repeated FriendCheckOutput list = 1;\n }\n\n message FriendCheckOutput {\n optional string targetId = 1;\n optional int32 status = 2;\n }\n message FriendProfileInput {\n optional string targetId = 1;\n optional string remarkName = 2;\n repeated ProfileInfo extProfile = 3;\n }\n message FriendProfileOutput {\n repeated string censorFailedFields = 1;\n }\n message FriendQueryInput {\n optional int32 queryType = 1;\n optional ChannelsPageParam page = 2;\n optional int32 friendType= 3;\n }\n message FriendUserInfo {\n optional string userId = 1;\n optional int64 relationTime = 2;\n optional int32 friendType = 3;\n optional int32 flag = 4;\n optional string remarkName = 5;\n optional string name = 6;\n optional string portraitUrl = 7;\n repeated ProfileInfo extProfile = 8;\n \n }\n message FriendInviteInfo {\n optional string userId = 1;\n optional string name = 2;\n optional string portraitUrl = 3;\n optional int32 type = 4;\n optional int32 status = 5;\n optional int64 operateTime = 6;\n optional string info = 7;\n optional int32 friendType = 8;\n }\n message FriendsListInput {\n repeated string targetId = 1;\n optional int32 type = 2;\n }\n message FriendLevelSet {\n optional int32 level = 1;\n }\n\n message FriendPageParam {\n optional int32 size = 1;\n optional string pageToken = 2;\n }\n message FriendUserInfos {\n repeated FriendUserInfo list = 1;\n }\n\n message FriendInviteInfos {\n repeated FriendInviteInfo list = 1;\n }\n \n message FriendApplyEvent {\n optional int32 applyType = 1;\n optional int32 friendType = 2;\n optional string info = 3;\n optional string name = 4;\n optional string portraitUrl = 5;\n }\n message UpdateChannnelInfo {\n optional ChannelsJoinedInfo channelInfo = 1;\n optional ChannelsUserInfo userInfo = 2;\n }\n message UpdateUserInfo {\n optional ChannelsUserInfo updatedUserInfo = 1;\n optional ChannelsUserInfo optUserInfo = 2;\n }\n message ChannelApplyInfo {\n repeated ChannelsInviteStatusInfo statusInfo = 1;\n }\n message ChannelEventData {\n optional ChannelsUserInfo optUserInfo = 1;\n optional ChannelsJoinedInfo channelInfo = 2;\n repeated ChannelsUserInfo userInfos = 3;\n optional ChannelsJoinedInfo channelFullInfo = 4;\n }\n message FriendTypeChangeEvent {\n optional string friendId = 1;\n optional int32 friendType = 2;\n }\n message FriendUpdateEvent {\n optional string remarkname = 1;\n repeated ProfileInfo extProfile = 2;\n }\n message AddUnpushPeriodInput {\n required string startTime = 1;\n required int32 spanMinutes = 2;\n optional int32 level = 3;\n optional string timezone = 4;\n }\n message DeleteUnpushPeriodInput {\n required int32 nothing = 1;\n }\n message QueryUnpushPeriodInput {\n required int32 nothing = 1;\n }\n message QueryUnpushPeriodOutput {\n required int32 isUnpush = 1;\n optional string startTime = 2;\n optional int32 spanMinutes = 3;\n optional int32 level = 4;\n optional string timezone = 5;\n }\n message RelationDel {\n optional string targetId = 1;\n optional ChannelType type = 2;\n repeated string busChannel = 3;\n optional bool cleanMsg = 4;\n }\n message MsgReadEvent {\n optional string msgId = 1;\n optional int64 msgTime = 2;\n optional int32 totalCnt = 3;\n optional int32 readCnt = 4;\n optional int32 unreadCnt = 5;\n repeated ReceiptUser readList =6;\n }\n}\n",Fa);exports.LogLevel=void 0,(Ba=exports.LogLevel||(exports.LogLevel={}))[Ba.LOG=0]="LOG",Ba[Ba.DEBUG=0]="DEBUG",Ba[Ba.INFO=1]="INFO",Ba[Ba.WARN=2]="WARN",Ba[Ba.ERROR=3]="ERROR",Ba[Ba.FATAL=4]="FATAL",Ba[Ba.STATISTICS=6]="STATISTICS",Ba[Ba.NONE=1e3]="NONE",exports.LogSource=void 0,(Ha=exports.LogSource||(exports.LogSource={})).IM="IM",Ha.RTC="RTC",exports.ConnectionStatus=void 0,(qa=exports.ConnectionStatus||(exports.ConnectionStatus={}))[qa.CONNECTED=0]="CONNECTED",qa[qa.CONNECTING=1]="CONNECTING",qa[qa.DISCONNECTED=2]="DISCONNECTED",qa[qa.NETWORK_UNAVAILABLE=3]="NETWORK_UNAVAILABLE",qa[qa.CONNECTION_CLOSED=4]="CONNECTION_CLOSED",qa[qa.KICKED_OFFLINE_BY_OTHER_CLIENT=6]="KICKED_OFFLINE_BY_OTHER_CLIENT",qa[qa.WEBSOCKET_UNAVAILABLE=7]="WEBSOCKET_UNAVAILABLE",qa[qa.WEBSOCKET_ERROR=8]="WEBSOCKET_ERROR",qa[qa.BLOCKED=9]="BLOCKED",qa[qa.DOMAIN_INCORRECT=12]="DOMAIN_INCORRECT",qa[qa.DISCONNECT_BY_SERVER=13]="DISCONNECT_BY_SERVER",qa[qa.REDIRECT=14]="REDIRECT",qa[qa.USER_LOGOUT=19]="USER_LOGOUT",qa[qa.APPKEY_IS_FAKE=20]="APPKEY_IS_FAKE",qa[qa.FORBID_RECONNECT_BY_OTHER_SAME_CLIENT=31023]="FORBID_RECONNECT_BY_OTHER_SAME_CLIENT",qa[qa.ULTRALIMIT=1101]="ULTRALIMIT",qa[qa.REQUEST_NAVI=201]="REQUEST_NAVI",qa[qa.RESPONSE_NAVI=202]="RESPONSE_NAVI",qa[qa.RESPONSE_NAVI_ERROR=203]="RESPONSE_NAVI_ERROR",qa[qa.RESPONSE_NAVI_TIMEOUT=204]="RESPONSE_NAVI_TIMEOUT",qa[qa.RC_LICENSE_EXPIRED=31030]="RC_LICENSE_EXPIRED",qa[qa.RC_CONN_USER_OR_PASSWD_ERROR=31004]="RC_CONN_USER_OR_PASSWD_ERROR",exports.RTCMode=void 0,(Ya=exports.RTCMode||(exports.RTCMode={}))[Ya.RTC=0]="RTC",Ya[Ya.LIVE=2]="LIVE",Ya[Ya.SIP=4]="SIP",Ya[Ya.CALL=5]="CALL",Ya[Ya.MEETING=6]="MEETING",Ya[Ya.CROSS_MUTI=7]="CROSS_MUTI",Ya[Ya.CROSS_LIVE=8]="CROSS_LIVE",function(e){e[e.AUDIO_AND_VIDEO=0]="AUDIO_AND_VIDEO",e[e.AUDIO=1]="AUDIO"}(Ka||(Ka={})),function(e){e[e.ANCHOR=1]="ANCHOR",e[e.AUDIENCE=2]="AUDIENCE"}(Qa||(Qa={})),exports.RTCApiType=void 0,(Wa=exports.RTCApiType||(exports.RTCApiType={}))[Wa.ROOM=1]="ROOM",Wa[Wa.PERSON=2]="PERSON",function(e){e[e.AnchorToViewer=1]="AnchorToViewer",e[e.ViewerToAnchor=2]="ViewerToAnchor"}(Ja||(Ja={})),exports.RTCJoinType=void 0,(za=exports.RTCJoinType||(exports.RTCJoinType={}))[za.KICK=0]="KICK",za[za.REFUSE=1]="REFUSE",za[za.COEXIST=2]="COEXIST";var Xa=null;function $a(e,t,r,n){void 0===r&&(r={});var i=["error","warn","info","debug"][3-e];if(Xa&&e<exports.LogLevel.FATAL)try{var o=JSON.stringify(r);Xa[i](t,o)}catch(e){console.error(e)}}var eu,tu,ru=$a.bind(null,exports.LogLevel.DEBUG),nu={init:function(e){Xa=e},info:$a.bind(null,exports.LogLevel.INFO),debug:ru,warn:$a.bind(null,exports.LogLevel.WARN),error:$a.bind(null,exports.LogLevel.ERROR),fatal:$a.bind(null,exports.LogLevel.FATAL)},iu=function(){function e(){Object.defineProperty(this,"_map",{enumerable:!0,configurable:!0,writable:!0,value:{}})}return Object.defineProperty(e.prototype,"on",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n=this._map[e]||(this._map[e]=[]);n.some((function(e){return e.listener===t&&e.target===r}))||n.push({listener:t,target:r})}}),Object.defineProperty(e.prototype,"once",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n=this._map[e]||(this._map[e]=[]);n.some((function(e){return e.listener===t&&e.target===r}))||n.push({listener:t,target:r,once:!0})}}),Object.defineProperty(e.prototype,"off",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n=this._map[e];n&&((n=n.filter((function(e){return e.listener!==t||e.target!==r}))).length?this._map[e]=n:delete this._map[e])}}),Object.defineProperty(e.prototype,"emit",{enumerable:!1,configurable:!0,writable:!0,value:function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];var n=this._map[e];if(n)for(var i=n.length-1;i>=0;i-=1){var o=n[i],s=o.target,a=o.once,c=o.listener;a&&n.splice(i,1);try{c.call.apply(c,l([s],u(t),!1))}catch(e){null===console||void 0===console||console.error(e)}}}}),Object.defineProperty(e.prototype,"removeAll",{enumerable:!1,configurable:!0,writable:!0,value:function(e){delete this._map[e]}}),Object.defineProperty(e.prototype,"clear",{enumerable:!1,configurable:!0,writable:!0,value:function(){Object.keys(this._map).forEach(this.removeAll,this)}}),e}(),ou=function(e,t,r){var n=null==r?void 0:r.isReverse;Pt(e)&&function(){for(var r in e)t(e[r],r,e)}(),(Ot(e)||Tt(e))&&function(){if(n)for(var r=e.length-1;r>=0;r--)t(e[r],r);else for(var i=0,o=e.length;i<o;i++)t(e[i],i)}()},su=function(e,t){return ou(e,(function(r,n){e[n]=t(r,n)})),e},au=function(){function e(e,t,r){Object.defineProperty(this,"pbmaps",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"logger",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"pbModules",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.pbModules=co(t)}return Object.defineProperty(e.prototype,"getModule",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return new this.pbModules[e]}}),Object.defineProperty(e.prototype,"encode",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n=new this.pbModules[e];if(t)try{this.pbmaps[e].forEach((function(e){var r=t[e];void 0!==r&&n["set".concat(function(e,t,r){if(void 0===t||void 0===r)return e.toUpperCase();var n=e.slice(t,r);return e.replace(n,(function(e){return e.toUpperCase()}))}(e,0,1))](r)}))}catch(t){var i="pbname: ".concat(e,", stack: ").concat(t.stack);this.logger?this.logger.error(H.L_PB_ENCODE_E,i):null===console||void 0===console||console.error(H.L_PB_ENCODE_E,i)}return r?n:n.toArrayBuffer()}}),Object.defineProperty(e.prototype,"decode",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this.pbModules[e].decode(t);return this.fixInt64Values(r)}}),Object.defineProperty(e.prototype,"fixInt64Values",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;if(e instanceof Array)return e.map((function(e){return t.fixInt64Values(e)}));if(!Pt(e))return e;if(void 0!==e.low&&void 0!==e.high&&Object.prototype.hasOwnProperty.call(e,"unsigned")){var r=e.low;return r<0&&(r+=4294967296),r=r.toString(16),parseInt(e.high.toString(16)+"00000000".replace(new RegExp("0{".concat(r.length,"}$")),r),16)}for(var n in e)e[n]=this.fixInt64Values(e[n]);return e}}),e}();!function(e){e.RtcInput="RtcInput",e.RtcUserListOutput="RtcUserListOutput",e.SetUserStatusInput="SetUserStatusInput",e.RtcSetDataInput="RtcSetDataInput",e.RtcUserSetDataInput="RtcUserSetDataInput",e.RtcDataInput="RtcDataInput",e.RtcSetOutDataInput="RtcSetOutDataInput",e.MCFollowInput="MCFollowInput",e.RtcTokenOutput="RtcTokenOutput",e.RtcQryOutput="RtcQryOutput",e.RtcQryUserOutDataInput="RtcQryUserOutDataInput",e.RtcUserOutDataOutput="RtcUserOutDataOutput",e.RtcQueryListInput="RtcQueryListInput",e.RtcRoomInfoOutput="RtcRoomInfoOutput",e.RtcValueInfo="RtcValueInfo",e.RtcKeyDeleteInput="RtcKeyDeleteInput",e.RtcNotifyMsg="RtcNotifyMsg",e.RtcPullKV="RtcPullKV",e.RtcKVOutput="RtcKVOutput",e.RtcQueryUserJoinedInput="RtcQueryUserJoinedInput",e.RtcQueryUserJoinedOutput="RtcQueryUserJoinedOutput",e.RtcViewerJoinedOutput="RtcViewerJoinedOutput",e.RtcInviteInput="RtcInviteInput",e.RtcCancelInviteInput="RtcCancelInviteInput",e.RtcInviteAnswerInput="RtcInviteAnswerInput",e.RtcEndInviteInput="RtcEndInviteInput",e.RtcOutput="RtcOutput"}(tu||(tu={}));var uu,lu,cu,du,pu,fu,hu,gu,_u,bu,Eu,vu=((eu={})[tu.RtcInput]=["roomType","broadcastType","extraInnerData","needSysChatroom","identityChangeType","joinType","innerDatas","outerDatas"],eu[tu.RtcUserListOutput]=["users","token","sessionId","roomInfo"],eu[tu.SetUserStatusInput]=["status"],eu[tu.RtcSetDataInput]=["interior","target","key","value","objectName","content"],eu[tu.RtcUserSetDataInput]=["valueInfo","objectName","content"],eu[tu.RtcDataInput]=["interior","target","key","objectName","content"],eu[tu.RtcSetOutDataInput]=["target","valueInfo","objectName","content"],eu[tu.MCFollowInput]=["state"],eu[tu.RtcTokenOutput]=["rtcToken"],eu[tu.RtcQryOutput]=["outInfo"],eu[tu.RtcQryUserOutDataInput]=["userId"],eu[tu.RtcUserOutDataOutput]=["user"],eu[tu.RtcQueryListInput]=["order"],eu[tu.RtcRoomInfoOutput]=["roomId","roomData","userCount","list"],eu[tu.RtcValueInfo]=["key","value"],eu[tu.RtcKeyDeleteInput]=["key"],eu[tu.RtcNotifyMsg]=["type","time","roomId"],eu[tu.RtcPullKV]=["timestamp","roomId"],eu[tu.RtcKVOutput]=["entries","bFullUpdate","syncTime"],eu[tu.RtcQueryUserJoinedInput]=["userId"],eu[tu.RtcQueryUserJoinedOutput]=["info"],eu[tu.RtcInviteInput]=["invitedUserId","timeoutTime","invitedRoomId","inviteInfo","inviteSessionId"],eu[tu.RtcCancelInviteInput]=["invitedUserId","invitedRoomId","inviteInfo","inviteSessionId"],eu[tu.RtcInviteAnswerInput]=["inviteUserId","answerCode","inviteRoomId","inviteSessionId","content","key","value"],eu[tu.RtcEndInviteInput]=["inviteRoomId","inviteSessionId","inviteContent","inviteRoomKeys"],eu),yu="\npackage Modules;\nmessage probuf {\n enum JoinType {\n KICK = 0; //踢前一个设备\n REFUSE = 1; //当前加入拒绝\n COEXIST = 2; //两个设备共存\n }\n enum targetType {\n ROOM =1 ;\n PERSON = 2;\n }\n message ".concat(tu.SetUserStatusInput,"\n {\n optional int32 status=1;\n }\n message ").concat(tu.MCFollowInput,"\n {\n required string state = 1;\n }\n message ").concat(tu.RtcQueryListInput,"{\n optional int32 order=1;\n }\n message ").concat(tu.RtcKeyDeleteInput,"{\n repeated string key=1;\n }\n message ").concat(tu.RtcValueInfo,"{\n required string key=1;\n required string value=2;\n }\n message RtcUserInfo{\n required string userId=1;\n repeated ").concat(tu.RtcValueInfo," userData=2; //用户资源信息\n }\n message ").concat(tu.RtcUserListOutput,"{\n repeated RtcUserInfo users=1;\n optional string token=2;\n optional string sessionId=3;\n repeated RtcValueInfo roomInfo = 4; //房间 key value\n repeated RtcKVEntity entries = 5;//直播 KV 属性对象集合\n optional int64 syncTime = 6;//所有属性的最大时间戳(下次拉取 KV 时用)。\n optional int32 offlineKickTime = 7;//server 超时踢人时间,默认 60s\n }\n message RtcRoomInfoOutput{\n optional string roomId = 1;\n repeated ").concat(tu.RtcValueInfo," roomData = 2;\n optional int32 userCount = 3;\n repeated RtcUserInfo list=4;\n }\n message ").concat(tu.RtcInput,"{\n required int32 roomType=1;\n optional int32 broadcastType=2;\n optional RtcValueInfo extraInnerData = 3;\n optional bool needSysChatroom = 4; //是否需要同步聊天室\n optional IdentityChangeType identityChangeType = 5; //身份变更类型\n optional JoinType joinType = 6; // 加入房间类型\n repeated ").concat(tu.RtcValueInfo," innerDatas = 7; //用户内部 inner 数据,角色或者连麦信息等\n repeated ").concat(tu.RtcValueInfo," outerDatas = 8; //用户内部 outer 数据,自定义数据结构 RtcInput。\n }\n message ").concat(tu.RtcQryOutput,"{\n repeated ").concat(tu.RtcValueInfo," outInfo=1;\n }\n message ").concat(tu.RtcDataInput,"{\n required bool interior=1;\n required targetType target=2;\n repeated string key=3;\n optional string objectName=4;\n optional string content=5;\n }\n message ").concat(tu.RtcSetDataInput,"{\n required bool interior=1;\n required targetType target=2;\n required string key=3;\n required string value=4;\n optional string objectName=5;\n optional string content=6;\n }\n message ").concat(tu.RtcUserSetDataInput," {\n repeated ").concat(tu.RtcValueInfo," valueInfo = 1;\n required string objectName = 2;\n repeated ").concat(tu.RtcValueInfo," content = 3;\n }\n message RtcQryInput{\n required bool isInterior=1;\n required targetType target=2;\n repeated string key=3;\n }\n message RtcDelDataInput{\n repeated string key=1;\n required bool isInterior=2;\n required targetType target=3;\n }\n message RtcOutput\n {\n optional int32 nothing=1;\n optional int64 version=2;\n }\n message ").concat(tu.RtcTokenOutput,"{\n required string rtcToken=1;\n }\n message ").concat(tu.RtcSetOutDataInput,"{\n required targetType target=1;\n repeated ").concat(tu.RtcValueInfo," valueInfo=2;\n optional string objectName=3;\n optional string content=4;\n }\n message ").concat(tu.RtcQryUserOutDataInput,"{\n repeated string userId = 1;\n }\n message ").concat(tu.RtcUserOutDataOutput,"{\n repeated RtcUserInfo user = 1;\n }\n message ").concat(tu.RtcNotifyMsg," \n {\n required int32 type= 1; //(通知类型 1:rtc 房间状态 KV 变更通知)\n optional int64 time= 2; //消息产生时间\n optional string roomId=3; //主播房间 id\n }\n message ").concat(tu.RtcPullKV,"\n {\n required int64 timestamp = 1;\n required string roomId = 2;\n }\n message RtcKVEntity \n {\n required string key = 1;\n required string value = 2;\n optional int32 status = 3;\n optional int64 timestamp = 4;\n optional string uid = 5;\n }\n message ").concat(tu.RtcKVOutput,"\n {\n repeated RtcKVEntity entries = 1;\n optional bool bFullUpdate = 2;\n optional int64 syncTime = 3; \n }\n enum IdentityChangeType \n {\n AnchorToViewer = 1; //1 为主播变观众\n ViewerToAnchor = 2; //2 为观众变主播\n }\n message ").concat(tu.RtcQueryUserJoinedInput,"\n {\n required string userId = 1;\n }\n message RtcJoinedInfo\n {\n required string deviceId = 1; //设备 ID\n required string roomId = 2; //加入的房间 ID\n optional int64 joinTime = 3; //加入的时间\n }\n message ").concat(tu.RtcQueryUserJoinedOutput,"\n {\n repeated RtcJoinedInfo info = 1;\n }\n message ").concat(tu.RtcViewerJoinedOutput,"\n {\n required string rtcToken=1;\n repeated RtcKVEntity entries = 2;//KV 属性对象集合\n optional int64 syncTime = 3;//所有属性的最大时间戳(下次拉取 KV 时用)。\n }\n message ").concat(tu.RtcInviteInput,"\n {\n required string invitedUserId=1; //被邀请的人的 uid\n optional int32 timeoutTime=2; //邀请超时时间 (秒),默认三十秒\n required string invitedRoomId=3; //被邀请的房间\n required string inviteInfo=4; //邀请的信息 (包含邀请人,被邀请人,各自 userid) 客户端定义好。协议栈和 server 透传\n required string inviteSessionId= 5; //客户端保证唯一性 (建议 roomid_userid_时间戳_随机数)\n }\n message ").concat(tu.RtcCancelInviteInput,"\n {\n required string invitedUserId=1; //被邀请的人的 uid\n required string invitedRoomId=2; //被邀请的房间\n required string inviteInfo=3; //取消邀请的信息 (包含邀请人,被邀请人,各自 userid) 客户端定义好。协议栈和 server 透传\n required string inviteSessionId=4; //邀请的 sessionId,客户端发起邀请时产生\n }\n message ").concat(tu.RtcInviteAnswerInput,"\n {\n required string inviteUserId=1; //邀请的人的 uid\n required int32 answerCode=2; //是否接受连麦邀请.0 为拒绝,1 为接受\n required string inviteRoomId=3; //邀请的房间\n required string inviteSessionId=4; //邀请的 sessionId\n required string content=5; //需要转发的 content\n optional string key=6; //如果接受的话,需要加这个字段,放在 room 级别的 k 和 v,新加入房间的能拉取到\n optional string value=7; //如果接受的话,需要加这个字段,放在 room 级别的 k 和 v,新加入房间的能拉取到\n }\n message ").concat(tu.RtcEndInviteInput,"\n {\n required string inviteRoomId=1; //邀请的房间\n required string inviteSessionId=2; //邀请的 sessionId\n required string inviteContent=3; //结束连麦的信息 (需要透传给房间内其他人)\n repeated string inviteRoomKeys=4; //需要删除连麦的信息的 key\n }\n}\n"),mu=function(e,t,r,n,i,o){var s=i?Object.keys(i).map((function(t){return e.encode(tu.RtcValueInfo,{key:t,value:i[t]},!0)})):void 0,a=o?Object.keys(o).map((function(t){return e.encode(tu.RtcValueInfo,{key:t,value:o[t]},!0)})):void 0;return e.encode(tu.RtcInput,{roomType:t,broadcastType:r,joinType:n,innerDatas:s,outerDatas:a})},Iu=function(e,t){var r=e.decode(tu.RtcUserListOutput,t),n=r.users,i=r.token,o=r.sessionId,s=r.roomInfo,a=r.entries,u=r.offlineKickTime,l={};return ou(n,(function(e){var t=e.userId,r=e.userData,n={};ou(r,(function(e){var t=e.key,r=e.value;n[t]=r})),l[t]=n})),{users:l,token:i,sessionId:o,roomInfo:s,kvEntries:a,offlineKickTime:u}},Tu=function(){function e(e){Object.defineProperty(this,"_pullQueue",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_isPulling",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_engine",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_pullTime",{enumerable:!0,configurable:!0,writable:!0,value:0}),this._engine=e}return Object.defineProperty(e.prototype,"_startPull",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t,r,n,i,o,a;return s(this,(function(s){switch(s.label){case 0:return this._isPulling||0===this._pullQueue.length?[2]:(this._isPulling=!0,e=this._pullQueue.splice(0,1)[0],t=e.roomId,r=e.timestamp,(n=this._pullTime)>r?(this._isPulling=!1,this._startPull(),[2]):[4,this._engine.pullRTCRoomEntry(t,n)]);case 1:return i=s.sent(),o=i.code,a=i.data,o===exports.ErrorCode.SUCCESS?(this._isPulling=!1,this._pullTime=a||0,this._startPull()):this._startPull(),[2]}}))}))}}),Object.defineProperty(e.prototype,"pullEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._pullQueue.push({roomId:e,timestamp:t}),this._startPull()}}),Object.defineProperty(e.prototype,"reset",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._pullTime=0,this._isPulling=!1}}),e}(),Ru=function(){function e(e,t,r,n){Object.defineProperty(this,"rtcCodec",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"_watcher",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"_options",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"logger",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(this,"_appkey",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_rtcKVManager",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_rtcSignalingListener",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._appkey=this._options.appkey,this._rtcKVManager=new Tu(this)}return Object.defineProperty(e.prototype,"registerRTCSignalingListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._rtcSignalingListener=e}}),Object.defineProperty(e.prototype,"getInnerLogger",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.logger}}),Object.defineProperty(e.prototype,"pullRTCRoomEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var t,r,i,o,a,u,l;return s(this,(function(s){switch(s.label){case 0:return t=this.rtcCodec.encode(tu.RtcPullKV,{timestamp:0,roomId:e}),[4,this.rtcSignaling(e,yn,!0,t)];case 1:return r=s.sent(),i=r.code,o=r.buffer,i!==exports.ErrorCode.SUCCESS?[2,{code:i}]:(a=this.rtcCodec.decode(tu.RtcKVOutput,o),u=a.entries,l=a.syncTime,u=(u||[]).map((function(e){return n(n({},e),{timestamp:kt(e.timestamp)})})),this._watcher.onRTCDataChange(u,e),[2,{code:i,data:l}])}}))}))}}),Object.defineProperty(e.prototype,"_receiveRtcKv",{enumerable:!1,configurable:!0,writable:!0,value:function(e){if(this._rtcSignalingListener)this._rtcSignalingListener(e);else{var t=this.rtcCodec.decode(tu.RtcNotifyMsg,e),r=t.time,n=t.type,i=t.roomId;1===n&&this._rtcKVManager.pullEntry(i,kt(r))}}}),Object.defineProperty(e.prototype,"destroy",{enumerable:!1,configurable:!0,writable:!0,value:function(){}}),e}();exports.StreamMessageResponseEventType=void 0,(uu=exports.StreamMessageResponseEventType||(exports.StreamMessageResponseEventType={})).INIT="INIT",uu.DATA="DATA",uu.END="END";var Cu=function(e){function r(t,r){var n=e.call(this)||this;return lu.add(n),cu.set(n,void 0),du.set(n,new Map),pu.set(n,void 0),d(n,cu,t,"f"),d(n,pu,r,"f"),n}return t(r,e),Object.defineProperty(r.prototype,"requestStreamMessageContent",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n=this;return s(this,(function(i){switch(i.label){case 0:return t=c(this,lu,"a",fu).createTraceId(),c(this,lu,"a",fu).info(H.L_REQ_STREAM_MSG_CONTENT_T,"messageUId: ".concat(e),t),[4,vt.create("requestStreamMessageContent").isLimitedString("messageUId",e,1,64,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_UID,"messageUId is invalid.").result().tryTrans(c(this,cu,"f").validateConnected).tryTrans((function(e){var t,r;return(null===(r=null===(t=null==e?void 0:e.streamServer)||void 0===t?void 0:t.addrs)||void 0===r?void 0:r.length)?ht(e.streamServer.addrs):gt(exports.ErrorCode.STREAM_MESSAGE_DISABLE)})).next((function(t){return c(n,lu,"m",Eu).call(n,e,t)}))];case 1:return r=i.sent(),c(this,lu,"a",fu).summary(H.L_REQ_STREAM_MSG_CONTENT_R,r,t,{messageUId:e}),[2,r.wipe()]}}))}))}}),r}(pt);cu=new WeakMap,du=new WeakMap,pu=new WeakMap,lu=new WeakSet,fu=function(){return c(this,cu,"f").logger},hu=function(e,t,r){var n=c(this,du,"f").get(e);n&&(c(this,du,"f").delete(e),c(this,lu,"m",gu).call(this,e,exports.StreamMessageResponseEventType.END,t,n.msg))},gu=function(e,t,r,n,i){this.emit("message",{code:r,messageUId:e,type:t,chunk:i,message:n})},_u=function(e,t){e.content=n(n({},e.content),t),c(this,cu,"f").setMessageContent(e.messageId,e.content,e.messageType)},bu=function(e,t,r){var n,i,o=c(this,du,"f").get(t);switch(e){case"init":o.msg&&c(this,lu,"m",_u).call(this,o.msg,{content:"",stopReason:0,completeReason:0,isSynced:!1}),c(this,lu,"m",gu).call(this,t,exports.StreamMessageResponseEventType.INIT,exports.ErrorCode.SUCCESS,o.msg);break;case"complete":i=(n=r.length?JSON.parse(r):{}).complete||!1,o.msg&&c(this,lu,"m",_u).call(this,o.msg,{stopReason:n.stopReason||0,completeReason:n.completeReason||0,complete:i,isSynced:i}),c(this,lu,"m",hu).call(this,t,n.stopReason||0,i);break;default:n=JSON.parse(r),o.cached+=n.content,o.msg&&c(this,lu,"m",_u).call(this,o.msg,{content:o.cached}),c(this,lu,"m",gu).call(this,t,exports.StreamMessageResponseEventType.DATA,exports.ErrorCode.SUCCESS,o.msg,{content:n.content,fullContent:o.cached})}},Eu=function(e,t){return o(this,void 0,void 0,(function(){var r,n,i,o,a,u,l,d=this;return s(this,(function(s){switch(s.label){case 0:return c(this,du,"f").has(e)?[2,gt(exports.ErrorCode.STREAM_MESSAGE_REQUEST_IN_PROCESS,"Request in process, msgUId: ".concat(e))]:c(this,du,"f").size>=3?[2,gt(exports.ErrorCode.STREAM_MESSAGE_REQUEST_COUNT_LIMIT_EXCEEDED,"The request queue is full")]:(r=lo.createSSEClient({logger:c(this,lu,"a",fu),msgUId:e,appkey:c(this,cu,"f").appkey,token:c(this,cu,"f").token,timeout:3e4,onRawContent:function(t){t.split("\n\n").forEach((function(t){if(0!==t.length){t.startsWith("data:")&&(t="event:delta\n".concat(t));var r=t.indexOf("\n"),n=t.slice(0,r).replace("event:",""),i=t.slice(r+1+5);c(d,lu,"m",bu).call(d,n,e,i.trim())}}))},onNetworkError:function(t){c(d,lu,"m",hu).call(d,e,t,!1)}}),r.isOk?(n=r.data,i={client:n,cached:"",msg:void 0},c(this,du,"f").set(e,i),c(this,pu,"f")?[4,c(this,cu,"f").getLocalMessage(e)]:[3,2]):[2,r.wipe()]);case 1:if(o=s.sent(),a=o.code,!(u=o.data))return c(this,du,"f").delete(e),[2,gt(a,"message not found, msgUId: ".concat(e))];if(u.content.isSynced)return c(this,du,"f").delete(e),[2,gt(exports.ErrorCode.STREAM_MESSAGE_SYNCED,"synced")];i.msg=u,s.label=2;case 2:return[4,n.open(t.slice())];case 3:return(l=s.sent()).isOk||c(this,du,"f").delete(e),[2,l.wipe()]}}))}))};var Ou,Su,Au=function(){function e(e){Object.defineProperty(this,"_context",{enumerable:!0,configurable:!0,writable:!0,value:e})}return Object.defineProperty(e.prototype,"__getContext",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._context}}),Object.defineProperty(e.prototype,"createCodec",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return new au(e,t)}}),Object.defineProperty(e.prototype,"createPBCodec",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return new po(e,t)}}),Object.defineProperty(e.prototype,"refetchNaviInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){return s(this,(function(e){return[2,this._context.refetchNaviInfo()]}))}))}}),Object.defineProperty(e.prototype,"getNaviInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._context.getNaviInfoFromCache()}}),Object.defineProperty(e.prototype,"getCoreVersion",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"5.20.2-enterprise.10"}}),Object.defineProperty(e.prototype,"getAPIVersion",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"5.20.2-enterprise.10"}}),Object.defineProperty(e.prototype,"getAppkey",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._context.appkey}}),Object.defineProperty(e.prototype,"getCurrentId",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._context.getCurrentUserId()}}),Object.defineProperty(e.prototype,"getUserToken",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._context.token}}),Object.defineProperty(e.prototype,"getConnectionStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._context.getConnectionStatus()}}),Object.defineProperty(e.prototype,"getDeviceId",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._context.getDeviceId()}}),Object.defineProperty(e.prototype,"setPushConfig",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._context.setPushConfig(e)}}),Object.defineProperty(e.prototype,"sendMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return this._context.sendMessage(e,t,r)}}),Object.defineProperty(e.prototype,"registerMessageType",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){void 0===n&&(n=[]),this._context.registerMessageType(e,t,r,n)}}),Object.defineProperty(e.prototype,"getServerTime",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._context.getServerTime()}}),Object.defineProperty(e.prototype,"getOSInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._context.getOSInfo()}}),Object.defineProperty(e.prototype,"getProcessInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._context.getProcessInfo()}}),Object.defineProperty(e.prototype,"getMainProcessInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._context.getMainProcessInfo()}}),Object.defineProperty(e.prototype,"setCallInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return this._context.setCallInfo(e,t,r)}}),Object.defineProperty(e.prototype,"createLogger",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return this._context.createLogger(e,t)}}),Object.defineProperty(e.prototype,"getStatsUrlList",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._context.getStatsUrlList()}}),e}(),Pu=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return t(r,e),Object.defineProperty(r.prototype,"joinRTCRoom",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i,a){return o(this,void 0,void 0,(function(){var o,u,l,c,d;return s(this,(function(s){switch(s.label){case 0:return o=mu(this._context.rtcCodec,t,r,n,i,a),[4,this.rtcSignaling(e,on,!0,o)];case 1:return u=s.sent(),l=u.code,c=u.buffer,l===exports.ErrorCode.SUCCESS&&c&&(d=Iu(this._context.rtcCodec,c)),[2,{code:l,data:d}]}}))}))}}),Object.defineProperty(r.prototype,"quitRTCRoom",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t;return s(this,(function(r){switch(r.label){case 0:return t=this._context.rtcCodec.encode(tu.SetUserStatusInput,{status:0}),[4,this.rtcSignaling(e,sn,!0,t)];case 1:return[2,r.sent().code]}}))}))}}),Object.defineProperty(r.prototype,"rtcPing",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){return s(this,(function(n){switch(n.label){case 0:return[4,this._context.rtcPing(e,t,r)];case 1:return[2,n.sent().code]}}))}))}}),Object.defineProperty(r.prototype,"rtcPingResVersion",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return this._context.rtcPing(e,t,r)}}),Object.defineProperty(r.prototype,"getRTCRoomInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,o;return s(this,(function(s){switch(s.label){case 0:return t=this._context.rtcCodec.encode(tu.RtcQueryListInput,{order:2}),[4,this.rtcSignaling(e,an,!0,t)];case 1:return r=s.sent(),n=r.code,i=r.buffer,n===exports.ErrorCode.SUCCESS&&i&&(o=this._context.rtcCodec.decode(tu.RtcRoomInfoOutput,i)),[2,{code:n,data:o}]}}))}))}}),Object.defineProperty(r.prototype,"getRTCUserInfoList",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,o,a;return s(this,(function(s){switch(s.label){case 0:return t=this._context.rtcCodec.encode(tu.RtcQueryListInput,{order:2}),[4,this.rtcSignaling(e,un,!0,t)];case 1:return r=s.sent(),n=r.code,i=r.buffer,n===exports.ErrorCode.SUCCESS&&i&&(a=Iu(this._context.rtcCodec,i),o={users:a.users}),[2,{code:n,data:o}]}}))}))}}),Object.defineProperty(r.prototype,"getRTCUserInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){throw new Error("Method not implemented.")}}),Object.defineProperty(r.prototype,"setRTCUserInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n;return s(this,(function(i){switch(i.label){case 0:return n=this._context.rtcCodec.encode(tu.RtcValueInfo,{key:t,value:r}),[4,this.rtcSignaling(e,ln,!0,n)];case 1:return[2,i.sent().code]}}))}))}}),Object.defineProperty(r.prototype,"removeRTCUserInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r;return s(this,(function(n){switch(n.label){case 0:return r=this._context.rtcCodec.encode(tu.RtcKeyDeleteInput,{key:t}),[4,this.rtcSignaling(e,cn,!1,r)];case 1:return[2,n.sent().code]}}))}))}}),Object.defineProperty(r.prototype,"setRTCData",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i,a){return o(this,void 0,void 0,(function(){var o;return s(this,(function(s){switch(s.label){case 0:return o=this._context.rtcCodec.encode(tu.RtcSetDataInput,{interior:n,target:i,key:t,value:r,objectName:null==a?void 0:a.name,content:null==a?void 0:a.content}),[4,this.rtcSignaling(e,dn,!1,o)];case 1:return[2,s.sent().code]}}))}))}}),Object.defineProperty(r.prototype,"setRTCTotalRes",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){return void 0===i&&(i=""),o(this,void 0,void 0,(function(){var o,a;return s(this,(function(s){switch(s.label){case 0:return o={objectName:n,content:this._context.rtcCodec.encode(tu.RtcValueInfo,{key:t.name,value:t.content},!0),valueInfo:[this._context.rtcCodec.encode(tu.RtcValueInfo,{key:"uris",value:r},!0),this._context.rtcCodec.encode(tu.RtcValueInfo,{key:"mcu_uris",value:i},!0)]},a=this._context.rtcCodec.encode(tu.RtcUserSetDataInput,o),[4,this.rtcSignaling(e,pn,!0,a)];case 1:return[2,s.sent().code]}}))}))}}),Object.defineProperty(r.prototype,"setRTCCDNUris",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n;return s(this,(function(i){switch(i.label){case 0:return n=this._context.rtcCodec.encode(tu.RtcUserSetDataInput,{objectName:t,valueInfo:this._context.rtcCodec.encode(tu.RtcValueInfo,{key:"cdn_uris",value:r},!0)}),[4,this.rtcSignaling(e,pn,!0,n)];case 1:return[2,i.sent().code]}}))}))}}),Object.defineProperty(r.prototype,"getRTCData",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return o(this,void 0,void 0,(function(){var i,o,a,u,l,c;return s(this,(function(s){switch(s.label){case 0:return i=this._context.rtcCodec.encode(tu.RtcDataInput,{interior:r,target:n,key:t}),[4,this.rtcSignaling(e,fn,!0,i)];case 1:return o=s.sent(),a=o.code,u=o.buffer,a===exports.ErrorCode.SUCCESS&&u?(l=this._context.rtcCodec.decode(tu.RtcQryOutput,u).outInfo,c={},l.forEach((function(e){c[e.key]=e.value})),[2,{code:a,data:c}]):[2,{code:a}]}}))}))}}),Object.defineProperty(r.prototype,"removeRTCData",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){return o(this,void 0,void 0,(function(){var o;return s(this,(function(s){switch(s.label){case 0:return o=this._context.rtcCodec.encode(tu.RtcDataInput,{interior:r,target:n,key:t,objectName:null==i?void 0:i.name,content:null==i?void 0:i.content}),[4,this.rtcSignaling(e,hn,!1,o)];case 1:return[2,s.sent().code]}}))}))}}),Object.defineProperty(r.prototype,"setRTCOutData",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return o(this,void 0,void 0,(function(){return s(this,(function(e){throw new Error("JSEngine's method not implemented.")}))}))}}),Object.defineProperty(r.prototype,"getRTCOutData",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){return s(this,(function(e){throw new Error("JSEngine's method not implemented.")}))}))}}),Object.defineProperty(r.prototype,"getRTCToken",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n,i,o,a,u;return s(this,(function(s){switch(s.label){case 0:return n=mu(this._context.rtcCodec,t,r),[4,this.rtcSignaling(e,gn,!0,n)];case 1:return i=s.sent(),o=i.code,a=i.buffer,o===exports.ErrorCode.SUCCESS&&a?(u=this._context.rtcCodec.decode(tu.RtcTokenOutput,a).rtcToken,[2,{code:o,data:{rtcToken:u}}]):[2,{code:o}]}}))}))}}),Object.defineProperty(r.prototype,"setRTCState",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r;return s(this,(function(n){switch(n.label){case 0:return r=this._context.rtcCodec.encode(tu.MCFollowInput,{state:t}),[4,this.rtcSignaling(e,_n,!0,r)];case 1:return[2,n.sent().code]}}))}))}}),Object.defineProperty(r.prototype,"getRTCUserList",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,o;return s(this,(function(s){switch(s.label){case 0:return t=this._context.rtcCodec.encode(tu.RtcQueryListInput,{order:2}),[4,this.rtcSignaling(e,bn,!0,t)];case 1:return r=s.sent(),n=r.code,i=r.buffer,n===exports.ErrorCode.SUCCESS&&i?(o=Iu(this._context.rtcCodec,i),[2,{code:n,data:o}]):[2,{code:n}]}}))}))}}),Object.defineProperty(r.prototype,"joinLivingRoomAsAudience",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n,i,o,a,u,l,c;return s(this,(function(s){switch(s.label){case 0:return n=mu(this._context.rtcCodec,t,r),[4,this.rtcSignaling(e,En,!0,n)];case 1:return i=s.sent(),o=i.code,a=i.buffer,o===exports.ErrorCode.SUCCESS&&a?(u=this._context.rtcCodec.decode(tu.RtcViewerJoinedOutput,a),l=u.rtcToken,c=u.entries,[2,{code:o,data:{token:l,kvEntries:c}}]):[2,{code:o}]}}))}))}}),Object.defineProperty(r.prototype,"quitLivingRoomAsAudience",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t;return s(this,(function(r){switch(r.label){case 0:return t=this._context.rtcCodec.encode(tu.SetUserStatusInput,{status:0}),[4,this.rtcSignaling(e,vn,!0,t)];case 1:return[2,r.sent().code]}}))}))}}),Object.defineProperty(r.prototype,"rtcIdentityChange",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n,i,o,a,u;return s(this,(function(s){switch(s.label){case 0:return n=this._context.rtcCodec.encode(tu.RtcInput,{roomType:exports.RTCMode.LIVE,broadcastType:r,identityChangeType:t,needSysChatroom:!1}),[4,this.rtcSignaling(e,mn,!0,n)];case 1:return i=s.sent(),o=i.code,a=i.buffer,o===exports.ErrorCode.SUCCESS&&a?(u=Iu(this._context.rtcCodec,a),[2,{code:o,data:u}]):[2,{code:o}]}}))}))}}),Object.defineProperty(r.prototype,"requestRoomPK",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,o,a,u;return s(this,(function(s){switch(s.label){case 0:return t=e.invitedRoomId,r=e.invitedUserId,n=e.inviteSessionId,i=e.inviteTimeout,o=e.inviteInfo,a=e.roomId,u=this._context.rtcCodec.encode(tu.RtcInviteInput,{invitedRoomId:t,invitedUserId:r,inviteSessionId:n,timeoutTime:i,inviteInfo:o}),[4,this.rtcSignaling(a,In,!0,u)];case 1:return[2,s.sent().code]}}))}))}}),Object.defineProperty(r.prototype,"cancelRoomPK",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,o,a;return s(this,(function(s){switch(s.label){case 0:return t=e.invitedRoomId,r=e.invitedUserId,n=e.inviteSessionId,i=e.inviteInfo,o=e.roomId,a=this._context.rtcCodec.encode(tu.RtcCancelInviteInput,{invitedRoomId:t,invitedUserId:r,inviteSessionId:n,inviteInfo:i}),[4,this.rtcSignaling(o,Tn,!0,a)];case 1:return[2,s.sent().code]}}))}))}}),Object.defineProperty(r.prototype,"responseRoomPK",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,o,a,u,l,c;return s(this,(function(s){switch(s.label){case 0:return t=e.inviteUserId,r=e.inviteRoomId,n=e.inviteSessionId,i=e.content,o=e.key,a=e.value,u=e.agree,l=e.roomId,c=this._context.rtcCodec.encode(tu.RtcInviteAnswerInput,{inviteUserId:t,inviteRoomId:r,inviteSessionId:n,content:i,key:o,value:a,answerCode:u?1:0}),[4,this.rtcSignaling(l,Rn,!0,c)];case 1:return[2,s.sent().code]}}))}))}}),Object.defineProperty(r.prototype,"endRoomPK",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,o,a;return s(this,(function(s){switch(s.label){case 0:return t=e.endRoomId,r=e.sessionId,n=e.content,i=e.keys,o=e.roomId,a=this._context.rtcCodec.encode(tu.RtcEndInviteInput,{inviteRoomId:t,inviteSessionId:r,inviteContent:n,inviteRoomKeys:i}),[4,this.rtcSignaling(o,Cn,!0,a)];case 1:return[2,s.sent().code]}}))}))}}),Object.defineProperty(r.prototype,"registerRTCSignalListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._context.registerRTCSignalingListener(e)}}),Object.defineProperty(r.prototype,"rtcSignaling",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return this._context.rtcSignaling(e,t,r,n)}}),Object.defineProperty(r.prototype,"getRTCJoinedUserInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,o;return s(this,(function(s){switch(s.label){case 0:return t=this._context.rtcCodec.encode(tu.RtcQueryUserJoinedInput,{userId:e}),[4,this.rtcSignaling("",On,!0,t)];case 1:return r=s.sent(),n=r.code,i=r.buffer,n===exports.ErrorCode.SUCCESS&&i?(o=this._context.rtcCodec.decode(tu.RtcQueryUserJoinedOutput,i).info||[],[2,{code:n,data:o.map((function(e){return{deviceId:e.deviceId,roomId:e.roomId,joinTime:e.joinTime}}))}]):[2,{code:n}]}}))}))}}),r}(Au),Nu={"set.proxy":exports.ErrorCode.INVALID_PARAMETER_PROXY,"test.proxy":exports.ErrorCode.INVALID_PARAMETER_TESTHOST,"test.proxy.socksHost":exports.ErrorCode.INVALID_PARAMETER_TESTHOST,"test.proxy.socksPort":exports.ErrorCode.INVALID_PARAMETER_TESTHOST,channelId:exports.ErrorCode.INVALID_PARAMETER_CHANNEL_ID,count:exports.ErrorCode.INVALID_PARAMETER_COUNT,startTime:exports.ErrorCode.INVALID_PARAMETER_START_TIME,endTime:exports.ErrorCode.INVALID_PARAMETER_END_TIME,offset:exports.ErrorCode.INVALID_PARAMETER_OFFSET,limit:exports.ErrorCode.INVALID_PARAMETER_LIMIT,keyword:exports.ErrorCode.INVALID_PARAMETER_KEYWORD,messageTypes:exports.ErrorCode.INVALID_PARAMETER_MESSAGE_TYPE,messageType:exports.ErrorCode.INVALID_PARAMETER_MESSAGE_TYPE,typingContentType:exports.ErrorCode.INVALID_PARAMETER_MESSAGE_TYPE,conversation:exports.ErrorCode.INVALID_PARAMETER_CONVERSATION,conversationType:exports.ErrorCode.INVALID_PARAMETER_CONVERSATION_TYPE,targetId:exports.ErrorCode.INVALID_PARAMETER_TARGET_ID,targetIds:exports.ErrorCode.INVALID_PARAMETER_TARGET_ID,userId:exports.ErrorCode.INVALID_PARAMETER_USER_ID,senderUserId:exports.ErrorCode.INVALID_PARAMETER_USER_ID,timestamp:exports.ErrorCode.INVALID_PARAMETER_TIMESTAMP,order:exports.ErrorCode.INVALID_PARAMETER_ORDER,messageId:exports.ErrorCode.INVALID_PARAMETER_MESSAGE_ID,receivedStatus:exports.ErrorCode.INVALID_PARAMETER_RECEIVED_STATUS,receivedStatusInfo:exports.ErrorCode.INVALID_PARAMETER_RECEIVED_STATUS,sentStatus:exports.ErrorCode.INVALID_PARAMETER_SENT_STATUS,content:exports.ErrorCode.INVALID_PARAMETER_MESSAGE_CONTENT,messageIds:exports.ErrorCode.INVALID_PARAMETER_MESSAGE_ARRAY,cleanSpace:exports.ErrorCode.INVALID_PARAMETER_CLEAN_SPACE,messageDirection:exports.ErrorCode.INVALID_MESSAGE_DIRECTION,canIncludeExpansion:exports.ErrorCode.INVALID_PARAMETER_CAN_INCLUDE_EXPANSION,expansion:exports.ErrorCode.INVALID_PARAMETER_MESSAGE_EXPANSION,disableNotification:exports.ErrorCode.INVALID_PARAMETER_DISABLE_NOTIFICATION,messages:exports.ErrorCode.MSG_LIMIT_ERROR,checkDuplicate:exports.ErrorCode.INVALID_PARAMETER_CHECK_DUPLICATE,messageUId:exports.ErrorCode.INVALID_PARAMETER_MESSAGE_UID,key:exports.ErrorCode.INVALID_PARAMETER_KEY,keys:exports.ErrorCode.INVALID_PARAMETER_KEYS,value:exports.ErrorCode.INVALID_PARAMETER_VALUE,isAutoDelete:exports.ErrorCode.INVALID_PARAMETER_IS_AUTO_DELETE,isSendNotification:exports.ErrorCode.INVALID_PARAMETER_IS_SEND_NOTIFICATION,notificationExtra:exports.ErrorCode.INVALID_PARAMETER_NOTIFICATION_EXTRA,entries:exports.ErrorCode.INVALID_PARAMETER_ENTRIES,isForce:exports.ErrorCode.INVALID_PARAMETER_IS_FORCE,rtcRoomId:exports.ErrorCode.INVALID_PARAMETER_RTCROOMID,token:exports.ErrorCode.RC_CONN_TOKEN_INCORRECT,conversations:exports.ErrorCode.INVALID_PARAMETER_CONVERSATIONS,draft:exports.ErrorCode.INVALID_PARAMETER_DRAFT,conversationTypes:exports.ErrorCode.INVALID_PARAMETER_CONVERSATION_TYPE_LIST,levels:exports.ErrorCode.INVALID_PARAMETER_NOTIFICATION_LEVEL,notificationLevel:exports.ErrorCode.INVALID_PARAMETER_NOTIFICATION_LEVEL,notificationLevels:exports.ErrorCode.INVALID_PARAMETER_NOTIFICATION_LEVEL,notificationStatus:exports.ErrorCode.INVALID_PARAMETER_NOTIFICATION_LEVEL,isTop:exports.ErrorCode.INVALID_PARAMETER_IS_TOP,isUpdateTime:exports.ErrorCode.INVALID_PARAMETER_IS_UPDATE_TIME,message:exports.ErrorCode.INVALID_PARAMETER_MESSAGE,mentionedUserIdList:exports.ErrorCode.INVALID_PARAMETER_USERIDLIST,directionalUserIdList:exports.ErrorCode.INVALID_PARAMETER_USERIDLIST,directedUserIds:exports.ErrorCode.INVALID_PARAMETER_USERIDLIST,isStatusMessage:exports.ErrorCode.INVALID_PARAMETER_IS_STATUS_MESSAGE,pushContent:exports.ErrorCode.INVALID_PARAMETER_PUSH_CONTENT,pushData:exports.ErrorCode.INVALID_PARAMETER_PUSH_DATA,isMentioned:exports.ErrorCode.INVALID_PARAMETER_IS_MENTIONED,mentionedType:exports.ErrorCode.INVALID_PARAMETER_MENTIONED_TYPE,isVoipPush:exports.ErrorCode.INVALID_PARAMETER_IS_VOIP_PUSH,pushConfig:exports.ErrorCode.INVALID_PARAMETER_PUSH_CONFIG,startMsgUId:exports.ErrorCode.INVALID_PARAMETER_START_MESSAGE_UID,endMsgUId:exports.ErrorCode.INVALID_PARAMETER_END_MESSAGE_UID,sentTime:exports.ErrorCode.INVALID_PARAMETER_TIMESTAMP,clearMessageOption:exports.ErrorCode.INVALID_PARAMETER_CLEAR_MESSAGE_OPTION_LIST,searchContent:exports.ErrorCode.SEARCH_PROPS_LIMIT_ERROR,tagId:exports.ErrorCode.INVALID_PARAMETER_TAG_ID,tagIds:exports.ErrorCode.INVALID_PARAMETER_TAG_ID,tagName:exports.ErrorCode.INVALID_PARAMETER_TAG_NAME,containMuted:exports.ErrorCode.INVALID_PARAMETER_CONTAIN_MUTED,channelType:exports.ErrorCode.INVALID_PARAMETER_CHANNEL_TYPE,file:exports.ErrorCode.MEDIA_EXCEPTION,fileType:exports.ErrorCode.INVALID_PARAMETER_MEDIA_TYPE,contentDisposition:exports.ErrorCode.INVALID_PARAMETER_CONTENT_DISPOSITION,mediaUrl:exports.ErrorCode.INVALID_PARAMETER_MEDIA_URL,filename:exports.ErrorCode.INVALID_PARAMETER_DOWNLOADMEDIAFILENAME,saveName:exports.ErrorCode.INVALID_PARAMETER_SAVE_NAME,serverType:exports.ErrorCode.INVALID_PARAMETER_SERVER_TYPE,subscribeType:exports.ErrorCode.INVALID_PARAMETER_SUBSCRIBE_TYPE,expiry:exports.ErrorCode.INVALID_PARAMETER_SUBSCRIBE_EXPIRY,subscribeUserIds:exports.ErrorCode.INVALID_PARAMETER_SUBSCRIBE_PUBLISHER_USERIDS,subscribePageSize:exports.ErrorCode.INVALID_PARAMETER_SUBSCRIBE_PAGESIZE,beforeCount:exports.ErrorCode.INVALID_PARAMETER_BEFORE,afterCount:exports.ErrorCode.INVALID_PARAMETER_AFTER,conversationList:exports.ErrorCode.INVALID_PARAMETER_CONVERSATION_LIST,conversationTypeNotSupport:exports.ErrorCode.CONVERSATION_TYPE_NOT_SUPPORT,profile:exports.ErrorCode.INVALID_PARAMETER_USER_PROFILE,userProfileVisibility:exports.ErrorCode.INVALID_PARAMETER_USER_PROFILE_VISIBILITY,uniqueId:exports.ErrorCode.INVALID_PARAMETER_UNIQUE_ID,extra:exports.ErrorCode.INVALID_PARAMETER_EXTRA,disableUpdateLastMessage:exports.ErrorCode.INVALID_DISABLE_UPDATE_LAST_MESSAGE};exports.AssertRules=void 0,(Su=exports.AssertRules||(exports.AssertRules={}))[Su.STRING=0]="STRING",Su[Su.ONLY_STRING=1]="ONLY_STRING",Su[Su.NUMBER=2]="NUMBER",Su[Su.BOOLEAN=3]="BOOLEAN",Su[Su.OBJECT=4]="OBJECT",Su[Su.ARRAY=5]="ARRAY",Su[Su.CALLBACK=6]="CALLBACK",Su[Su.CHANNEL_ID=7]="CHANNEL_ID",Su[Su.CONVERSATION=8]="CONVERSATION",Su[Su.CONVERSATION_TYPE=9]="CONVERSATION_TYPE";var wu,Mu=((Ou={})[exports.AssertRules.STRING]=At,Ou[exports.AssertRules.ONLY_STRING]=Tt,Ou[exports.AssertRules.NUMBER]=Rt,Ou[exports.AssertRules.BOOLEAN]=function(e){return"boolean"==typeof e},Ou[exports.AssertRules.OBJECT]=Pt,Ou[exports.AssertRules.ARRAY]=Ot,Ou[exports.AssertRules.CALLBACK]=function(e){var t=!0;return Pt(e)||(t=!1),(e=e||{}).onSuccess&&!Nt(e.onSuccess)&&(t=!1),e.onError&&!Nt(e.onError)&&(t=!1),t},Ou[exports.AssertRules.CHANNEL_ID]=Dt,Ou[exports.AssertRules.CONVERSATION]=function(e){var t=!0;return Pt(e)||(t=!1),Tt(e.targetId)||(t=!1),Ut(e.conversationType)||(t=!1),wt(e.channelId)||Dt(e.channelId)||(t=!1),t},Ou[exports.AssertRules.CONVERSATION_TYPE]=Ut,Ou),Lu=function(e){function r(t){var r=e.call(this,t)||this;return r.name="RCAssertError",r}return t(r,e),r}(Error),Uu=function(e,t,r,n){void 0===n&&(n=!1),r=Mu[r]||r;var i=n?r(t):wt(t)||null==t||r(t);return i||null===console||void 0===console||console.error("'".concat(e,"' is invalid: ").concat(JSON.stringify(t))),i},Du=function(){function e(e,t){var r,n;Object.defineProperty(this,"_logTagT",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"_logTagR",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"verificationFaileList",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"context",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"logger",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"option",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.context=eg.getContext(),this.logger=null===(r=this.context)||void 0===r?void 0:r.logger,this.option=null===(n=this.context)||void 0===n?void 0:n.getOptions()}return Object.defineProperty(e.prototype,"validate",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){if(void 0===n&&(n=!1),this.verificationFaileList.length>0)return this;r=Mu[r]||r;var o=n?r(t):wt(t)||null==t||r(t);if("object"==typeof o){var s=o.valid,a=o.errorKey;return!s&&a&&this.verificationFaileList.push({key:a,value:t,isValid:!1,message:i,code:Nu[a]}),this}return o||this.verificationFaileList.push({key:e,value:t,isValid:o,message:i,code:Nu[e]}),this}}),Object.defineProperty(e.prototype,"validateParameters",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i,o){if(void 0===i&&(i=!1),this.verificationFaileList.length>0)return this;r=Mu[r]||r;var s=i?r(t):wt(t)||null==t||r(t);if("object"==typeof s){var a=s.valid,u=s.errorKey,l=s.errorCode;return!a&&u&&this.verificationFaileList.push({key:u,value:t,code:l||n,message:o,isValid:!1}),this}return s||this.verificationFaileList.push({key:e,value:t,code:n,message:o,isValid:!1}),this}}),Object.defineProperty(e.prototype,"_getValidationResult",{enumerable:!1,configurable:!0,writable:!0,value:function(){if(this.verificationFaileList.length>0)return this.verificationFaileList[0]}}),Object.defineProperty(e.prototype,"ifReady",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t;if(!this.context)return Promise.resolve({code:exports.ErrorCode.BIZ_ERROR_CLIENT_NOT_INIT});var r=this._getValidationResult();if(r){var n=r.code,i=r.value,o=r.message,s=r.key;return null===(t=this.logger)||void 0===t||t.error(this._logTagR,JSON.stringify({code:n})),Promise.resolve({code:n,msg:"'".concat(s,"' is invalid: ").concat(o||JSON.stringify(i))})}var a=this.logger.createTraceId();return e(this.context,this.logger,this.option,a)}}),Object.defineProperty(e.prototype,"try2do",{enumerable:!1,configurable:!0,writable:!0,value:function(e){if(!this.context)throw new Error("Not initialized yet!");return e(this.context,this.logger,this.option)}}),Object.defineProperty(e.prototype,"ifReadySync",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t;if(!this.context)return{code:exports.ErrorCode.BIZ_ERROR_CLIENT_NOT_INIT};var r=this._getValidationResult();if(!r)return e(this.context,this.logger,this.option);var n=r.code,i=r.value,o=r.message,s=r.key;return null===(t=this.logger)||void 0===t||t.warn(this._logTagR,JSON.stringify({code:n})),{code:n,msg:"'".concat(s,"' is invalid: ").concat(o||i)}}}),e}(),xu=function(e,t){var r=Vr(e).searchProps;return r&&0!==r.length?r.every((function(e){return void 0!==t[e]}))?ht():gt(exports.ErrorCode.SEARCH_PROPS_LIMIT_ERROR):ht()},ju=function(){return wu||(wu={set:function(e,t){lo.localStorage.setItem(e,JSON.stringify(t))},get:function(e){var t;try{t=JSON.parse(lo.localStorage.getItem(e))}catch(e){t=null}return t},remove:function(e){return lo.localStorage.removeItem(e)},getKeys:function(){var e=[];for(var t in lo.localStorage)e.push(t);return e}}),wu},Vu=function(){function e(e){Object.defineProperty(this,"_caches",{enumerable:!0,configurable:!0,writable:!0,value:{}}),e&&(this._caches=e)}return Object.defineProperty(e.prototype,"set",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._caches[e]=t}}),Object.defineProperty(e.prototype,"remove",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this.get(e);return delete this._caches[e],t}}),Object.defineProperty(e.prototype,"get",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._caches[e]}}),Object.defineProperty(e.prototype,"getKeys",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=[];for(var t in this._caches)e.push(t);return e}}),e}(),Gu=function(){function e(e){var t;Object.defineProperty(this,"_cache",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_storageKey",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_rootStorage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._rootStorage=ju();var r=this._rootStorage.get(e)||{};this._cache=new Vu(((t={})[e]=r,t)),this._storageKey=e}return Object.defineProperty(e.prototype,"_get",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this._storageKey;return this._cache.get(e)||{}}}),Object.defineProperty(e.prototype,"_set",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this._storageKey;e=e||{},this._cache.set(t,e),this._rootStorage.set(t,e)}}),Object.defineProperty(e.prototype,"set",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this._get();r[e]=t,this._set(r)}}),Object.defineProperty(e.prototype,"remove",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this._get();delete t[e],this._set(t)}}),Object.defineProperty(e.prototype,"clear",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this._storageKey;this._rootStorage.remove(e),this._cache.remove(e)}}),Object.defineProperty(e.prototype,"get",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._get()[e]}}),Object.defineProperty(e.prototype,"getKeys",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this._get(),t=[];for(var r in e)t.push(r);return t}}),Object.defineProperty(e.prototype,"getValues",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._get()||{}}}),Object.defineProperty(e.prototype,"update",{enumerable:!1,configurable:!0,writable:!0,value:function(e){void 0===e&&(e={});var t=this._storageKey;this._cache.set(t,e),this._rootStorage.set(t,e)}}),e}(),ku="",Fu=function(){var e="";if(ku)return ku;if("browser"===lo.tag)return it;var t="RCDeviceId",r=ju(),n=r.get(t);return n?e=n:(e=nt.genWithLen(22),r.set(t,e)),e},Bu="",Hu=function(){return Bu},qu=function(e,t,r,n,i){var o=0;return e&&(o|=16),t&&(o|=32),r&&(o|=64),n&&(o|=512),i&&(o|=1024),o},Yu=function(e){var t;try{t=JSON.parse(e)}catch(r){t=e}if(t.user){var r=t.user,n=r.portrait,i=r.portraitUri,o=n||i;o&&(t.user.portrait=t.user.portraitUri=o)}return t},Ku=function(e){var t={};try{var r=JSON.parse(e);Object.entries(r).forEach((function(e){var r=u(e,2),n=r[0],i=r[1];t[n]=i.v}))}catch(t){console.error("parseMessageExpansion error: ".concat(e),t)}return t},Qu=function(e,t,r,n){var i,o,s=Za.decode(vo,e.pbData),a=rn(e.topic);if(a===Zr.recallMsg){var u=JSON.parse(s.content);i=u.conversationType,o=u.targetId}else i=function(e){var t;return((t={})[Zr.ppMsgP]=exports.ConversationType.PRIVATE,t[Zr.pgMsgP]=exports.ConversationType.GROUP,t[Zr.chatMsg]=exports.ConversationType.CHATROOM,t[Zr.ugMsg]=exports.ConversationType.ULTRA_GROUP,t[Zr.pcMsgP]=exports.ConversationType.CUSTOMER_SERVICE,t[Zr.pbMsgP]=exports.ConversationType.SYSTEM,t)[e]||exports.ConversationType.PRIVATE}(a),o=e.targetId;var l=![exports.ConversationType.GROUP,exports.ConversationType.CHATROOM,exports.ConversationType.RTC_ROOM,exports.ConversationType.ULTRA_GROUP].includes(i),c=l?o:t,d=l?"":o,p=Ju(s.sessionId),f=p.isPersited,h=p.isCounted,g=p.isMentioned,_=p.disableNotification,b=p.canIncludeExpansion;return{fromUserId:c,type:i,groupId:d,classname:s.classname,content:s.content,dataTime:r,status:qu(f,h,g,_,b),msgId:n,direction:exports.MessageDirection.SEND,clientUniqueId:s.clientUniqueId,extraContent:s.extraContent,pushContent:s.pushText,configFlag:s.configFlag,pushExt:s.pushExt,busChannel:s.busChannel,toUserIds:s.toUserIds,optionBits:s.optionBits}},Wu=function(e,t,r,n){var i,o,s,a=e.type,u=![exports.ConversationType.GROUP,exports.ConversationType.CHATROOM,exports.ConversationType.RTC_ROOM,exports.ConversationType.ULTRA_GROUP].includes(a)?n||e.fromUserId:e.groupId||n,l={isPersited:!!(16&(i=e.status)),isCounted:!!(32&i),isMentioned:!!(64&i),disableNotification:!!(512&i),receivedStatus:2&i?exports.ReceivedStatus.RETRIEVED:exports.ReceivedStatus.READ,canIncludeExpansion:!!(1024&i)},c=l.isMentioned,d=l.disableNotification,p=l.receivedStatus,f=l.canIncludeExpansion,h=e.direction===exports.MessageDirection.SEND?exports.MessageDirection.SEND:exports.MessageDirection.RECEIVE,g=or(e.configFlag||0,e.pushContent,e.pushExt),_=(o=e.extStatus,{isInterrupt:!!(2&(s=o||0)),isModifyMessage:!!(4&s),isPrivateChannel:!!(8&s),isStatusMessage:!!(64&s)}),b=_.isInterrupt,E=_.isModifyMessage,v=_.isPrivateChannel,y=_.isStatusMessage,m=Vr(e.classname),I=m.isCounted,T=m.isPersited,R=m.isStatusMessage;return{conversationType:a,targetId:u,senderUserId:h===exports.MessageDirection.SEND?t:e.fromUserId,messageType:e.classname,messageUId:e.msgId,isPersited:T,isCounted:I,isMentioned:c,sentTime:e.dataTime,messageDirection:h,receivedTime:Date.now(),disableNotification:d,receivedStatus:p,receivedStatusInfo:Bt(p),canIncludeExpansion:f,content:Yu(e.content),expansion:e.extraContent?Ku(e.extraContent):null,pushConfig:g,channelId:e.busChannel||"",isInterrupt:b,isModifyMessage:E,messageId:e.clientUniqueId||0,sentStatus:exports.SentStatus.SENT,isOffLineMessage:e.dataTime<r,channelType:v?exports.UltraGroupChannelType.PRIVATE:exports.UltraGroupChannelType.PUBLIC,isStatusMessage:y||!!R,readReceiptInfo:void 0,directedUserIds:e.toUserIds,disableUpdateLastMessage:!!(1&(e.optionBits||0)),needReceipt:!!(2&(e.optionBits||0)),sendReceipt:!!(4&(e.optionBits||0))||void 0}},Ju=function(e){return{isPersited:!!(1&e),isCounted:!!(2&e),disableNotification:!!(32&e),canIncludeExpansion:!!(64&e),isMentioned:!!(4&e)}};function zu(e){return 1&~((null==e?void 0:e.sessionMode)||0)?gt(exports.ErrorCode.RC_REAL_TIME_CONVERSATION_UNAVAILABLE):ht()}var Zu=function(){function e(){}return Object.defineProperty(e,"enable",{enumerable:!1,configurable:!0,writable:!0,value:function(){return!0}}),e}(),Xu=48,$u=64,el=80,tl=96,rl="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",nl=function(e){for(var t={},r=0;r<e.length-1;r++){var n=e.charAt(r)+e.charAt(r+1);t.hasOwnProperty(n)?t[n].push(r):t[n]=[r]}for(var i=[],o=[],s=function(){if(o.length>0){var e=o.join("");if(o=[],e.length>26){var t=ol(e.length),r=String.fromCharCode(el|t.length);i.push(r+t)}else{var n=String.fromCharCode(tl|e.length);i.push(n)}i.push(e)}},a=0;a<e.length;){var u=il(t,e,a);if(u.length<2)o.push(e.charAt(a++));else if(u.length<4)o.push(e.substr(a,u.length)),a+=u.length;else{var l=ol(a-u.offset),c=ol(u.length);if(l.length+c.length>=u.length)o.push(e.substr(a,u.length)),a+=u.length;else{s();var d=String.fromCharCode($u|l.length<<2|c.length);i.push(d+l+c),a+=u.length}}}s();var p=ol(e.length),f=String.fromCharCode(Xu|p.length);return i.push(f+p),i.join("")},il=function(e,t,r){var n={length:0,offset:-1};if(t.length,r>=t.length-1)return n;var i=e[t.charAt(r)+t.charAt(r+1)];if(i[0]===r)return n;for(var o=t.length-r,s=0,a=i.length;s<a;s++){var u=i[s],l=r-u;if(!(l>238327)){var c=Math.min(o,l);if(c<=n.length)break;if(!(n.length>2&&t.charAt(u+n.length-1)!==t.charAt(r+n.length-1))){for(var d=2,p=d;p<c&&t.charAt(u+p)===t.charAt(r+p);p++)d++;d>=n.length&&(n.length=d,n.offset=u)}}}return n},ol=function(e){var t=[],r=0;do{r=e%62,t.push(rl.charAt(r)),e=(e-r)/62}while(e>0);return t.join("")},sl={_caches:{},set:function(e,t){this._caches[e]=t},get:function(e){return this._caches[e]||0},clear:function(e){this._caches[e]=0}},al=function(){function e(e,t,r){Object.defineProperty(this,"logger",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"_chatroomId",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_currentUserId",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_kvCaches",{enumerable:!0,configurable:!0,writable:!0,value:{}}),this._chatroomId=t,this._currentUserId=r}return Object.defineProperty(e.prototype,"_add",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.key;e.isDeleted=!1,this._kvCaches[t]=e}}),Object.defineProperty(e.prototype,"_remove",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.key,r=this._kvCaches[t];r&&(r.isDeleted=!0,this._kvCaches[t]=r)}}),Object.defineProperty(e.prototype,"_setEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=e.key,n=e.type,i=e.isOverwrite,o=e.userId,s=this._getSetUserId(r),a=n===exports.ChatroomEntryType.DELETE,u=s===o,l=!this._isExisted(r),c=a?this._remove:this._add;(t||i||u||l)&&c.call(this,e)}}),Object.defineProperty(e.prototype,"getValue",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this._kvCaches[e]||{};return t.isDeleted?null:t.value}}),Object.defineProperty(e.prototype,"getVersion",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this._kvCaches[e]||{};return t.isDeleted?null:t.version}}),Object.defineProperty(e.prototype,"getAllValue",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e={};for(var t in this._kvCaches)this._kvCaches[t].isDeleted||(e[t]=this._kvCaches[t].value);return e}}),Object.defineProperty(e.prototype,"_getSetUserId",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return(this._kvCaches[e]||{}).userId}}),Object.defineProperty(e.prototype,"_isExisted",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this._kvCaches[e]||{},r=t.value,n=t.isDeleted;return r&&!n}}),Object.defineProperty(e.prototype,"setEntries",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this,r=e.kvEntries,n=e.isFullUpdate;r=r||[],(n=n||!1)&&this.clear(),r.forEach((function(e){t._setEntry(e,n)}))}}),Object.defineProperty(e.prototype,"clear",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._kvCaches={}}}),e}(),ul=function(){function e(e){Object.defineProperty(this,"_pullQueue",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_isPulling",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_engine",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_storeCaches",{enumerable:!0,configurable:!0,writable:!0,value:{}}),this._engine=e}return Object.defineProperty(e.prototype,"_startPull",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t,r,n,i,o,a;return s(this,(function(s){switch(s.label){case 0:return this._isPulling||0===this._pullQueue.length?[2]:(this._isPulling=!0,e=this._pullQueue.splice(0,1)[0],t=e.chrmId,r=e.timestamp,(n=sl.get(t))>r?(this._isPulling=!1,this._startPull(),[2]):[4,this._engine.pullChatroomEntry(t,n)]);case 1:return i=s.sent(),o=i.code,a=i.data,this._isPulling=!1,o===exports.ErrorCode.SUCCESS?(sl.set(t,a.syncTime||0),this._startPull()):this._startPull(),[2]}}))}))}}),Object.defineProperty(e.prototype,"reset",{enumerable:!1,configurable:!0,writable:!0,value:function(e){sl.clear(e);var t=this._storeCaches[e];null==t||t.clear()}}),Object.defineProperty(e.prototype,"pullEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._pullQueue.push({chrmId:e,timestamp:t}),this._startPull()}}),Object.defineProperty(e.prototype,"setLocal",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n=this._storeCaches[e];Lt(n)||(n=new al(this._engine.getInnerLogger(),e,r)),n.setEntries(t),this._storeCaches[e]=n}}),Object.defineProperty(e.prototype,"getValue",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this._storeCaches[e];return r?r.getValue(t):null}}),Object.defineProperty(e.prototype,"getVersion",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this._storeCaches[e];return r?r.getVersion(t):null}}),Object.defineProperty(e.prototype,"getAll",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this._storeCaches[e],r={};return t&&(r=t.getAllValue()),r}}),e}(),ll=function(){function e(e){Object.defineProperty(this,"_canJoinMulipleChrm",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"_joinedChrmsInfo",{enumerable:!0,configurable:!0,writable:!0,value:{}})}return Object.defineProperty(e.prototype,"set",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){void 0===t&&(t=10),void 0===r&&(r=""),this._canJoinMulipleChrm||(this._joinedChrmsInfo={}),this._joinedChrmsInfo[e]={count:t,extra:r}}}),Object.defineProperty(e.prototype,"get",{enumerable:!1,configurable:!0,writable:!0,value:function(){return JSON.parse(JSON.stringify(this._joinedChrmsInfo))}}),Object.defineProperty(e.prototype,"remove",{enumerable:!1,configurable:!0,writable:!0,value:function(e){delete this._joinedChrmsInfo[e]}}),Object.defineProperty(e.prototype,"clear",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._joinedChrmsInfo={}}}),e}(),cl=function(){function e(){Object.defineProperty(this,"_callerQueue",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_isCalling",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_retryCount",{enumerable:!0,configurable:!0,writable:!0,value:0})}return Object.defineProperty(e.prototype,"pushTask",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;return new Promise((function(r){t._callerQueue.push({task:e,resolve:r}),t._startCall()}))}}),Object.defineProperty(e.prototype,"_startCall",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t;return s(this,(function(r){switch(r.label){case 0:return this._isCalling||0===this._callerQueue.length?[2]:(this._isCalling=!0,e=this._callerQueue.shift(),[4,this._callHandler(e)]);case 1:return t=r.sent(),e.resolve(t),this._isCalling=!1,this._startCall(),[2]}}))}))}}),Object.defineProperty(e.prototype,"_callHandler",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n;return s(this,(function(i){switch(i.label){case 0:return t=e.task,r=this.getVersion(),[4,t(r)];case 1:return(n=i.sent()).code===exports.ErrorCode.USER_SETTING_SYNCED_ERROR&&this._retryCount<5?(this._retryCount++,[4,this._triggerPull(r)]):[3,3];case 2:return i.sent(),[2,this._callHandler(e)];case 3:return this._retryCount=0,[2,n]}}))}))}}),Object.defineProperty(e.prototype,"stopAllTask",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._callerQueue.forEach((function(e){e.resolve({code:exports.ErrorCode.RC_NET_UNAVAILABLE})})),this._callerQueue=[]}}),e}(),dl=function(e){function r(t,r,n,i){var o=e.call(this)||this;return Object.defineProperty(o,"_storage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(o,"_tagKey",{enumerable:!0,configurable:!0,writable:!0,value:"tags"}),Object.defineProperty(o,"_versionKey",{enumerable:!0,configurable:!0,writable:!0,value:"version"}),Object.defineProperty(o,"_storageKey",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(o,"_pullQueue",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(o,"_isPulling",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(o,"_engine",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(o,"_tagWatcherFunc",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(o,"_pullPromise",{enumerable:!0,configurable:!0,writable:!0,value:null}),o._storageKey=We(r,n),o._storage=new Gu(o._storageKey),o._engine=t,o._tagWatcherFunc=i,o}return t(r,e),Object.defineProperty(r.prototype,"_updateTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t={};e.forEach((function(e){t[e.tagId]={tagName:e.name,createdTime:e.createdTime}})),this._storage.set(this._tagKey,t),this._tagWatcherFunc()}}),Object.defineProperty(r.prototype,"addTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r,n=this._storage.get(this._tagKey)||{};e.forEach((function(e){var t,r=(null===(t=n[e.tagId])||void 0===t?void 0:t.createdTime)||e.createdTime||0;n[e.tagId]={tagName:e.tagName,createdTime:r}})),this._storage.update(((r={})[this._tagKey]=n,r[this._versionKey]=t,r))}}),Object.defineProperty(r.prototype,"deleteTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r,n=this._storage.get(this._tagKey)||{};e.forEach((function(e){delete n[e]})),this._storage.update(((r={})[this._tagKey]=n,r[this._versionKey]=t,r))}}),Object.defineProperty(r.prototype,"getTagsInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._storage.get(this._tagKey)||{}}}),Object.defineProperty(r.prototype,"getTags",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this._storage.get(this._tagKey)||{},t=[];for(var r in e)t.push({tagId:r,tagName:e[r].tagName,createdTime:e[r].createdTime,conversationCount:0});return t.sort((function(e,t){return(e.createdTime||0)-(t.createdTime||0)}))}}),Object.defineProperty(r.prototype,"getTagById",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this._storage.get(this._tagKey)||{};return t[e]?{tagId:e,tagName:t[e].tagName,createdTime:t[e].createdTime,conversationCount:0}:null}}),Object.defineProperty(r.prototype,"_startPull",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t,r,n,i;return s(this,(function(o){switch(o.label){case 0:return this._isPulling||0===this._pullQueue.length?[2,this._pullPromise]:(this._isPulling=!0,this._pullQueue.shift(),e=this.getVersion(),this._pullPromise=this._engine.pullUserSettings(e),[4,this._pullPromise]);case 1:return t=o.sent(),this._isPulling=!1,this._pullPromise=null,t.isOk&&(r=t.data,n=r.tags,i=r.version,r.changed&&(this._updateTag(n),this._storage.set(this._versionKey,i)),this._pullQueue=this._pullQueue.filter((function(e){return e>i}))),0===this._pullQueue.length?this._startCall():this._startPull(),[2]}}))}))}}),Object.defineProperty(r.prototype,"_startCall",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){return s(this,(function(t){return this._isPulling||e.prototype._startCall.call(this),[2]}))}))}}),Object.defineProperty(r.prototype,"pullUserSettings",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this.getVersion();(e>t||0===e)&&(this._pullQueue.push(t),this._startPull())}}),Object.defineProperty(r.prototype,"_triggerPull",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return this._pullQueue.push(e),[4,this._startPull()];case 1:return t.sent(),[2]}}))}))}}),Object.defineProperty(r.prototype,"getVersion",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._storage.get(this._versionKey)||0}}),Object.defineProperty(r.prototype,"updateVersion",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._storage.set(this._versionKey,e)}}),r}(cl),pl={};function fl(){return{code:200,protocol:"https",server:"",voipCallInfo:"",kvStorage:0,openHttpDNS:!1,historyMsg:!1,chatroomMsg:!1,location:"",monitor:0,joinMChrm:!1,openMp:0,openUS:0,grpMsgLimit:0,isFormatted:0,gifSize:2048,logSwitch:0,logPolicy:"",compDays:0,msgAck:"",activeServer:"",qnAddr:"",extkitSwitch:0,alone:!1,voipServer:"",offlinelogserver:"",backupServer:yr.getMiniCmpUrlList().join(",")}}var hl=function(e){function r(t,r,n,i,o){void 0===i&&(i="default");var s=e.call(this,t,r,n,!1,lo.useNavi,o)||this;return s._environment=i,s}return t(r,e),Object.defineProperty(r.prototype,"httpRequest",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){return o(this,void 0,void 0,(function(){var o,a,u,l;return s(this,(function(s){switch(s.label){case 0:return o="".concat(e,"/navi.js?appId=").concat(t,"&token=").concat(encodeURIComponent(r),"&callBack=x&v=").concat(je,"&r=").concat(Date.now(),"&env=").concat(this._environment,"&p=").concat(lo.tag),this.logger.debug(H.L_REQUEST_T,"req navi => ".concat(o),n),[4,lo.httpReq({url:o,timeout:1e4,dataType:"text"})];case 1:if(200!==(a=s.sent()).status)return this.logger.debug(H.L_REQUEST_R,"request navi failed: ".concat(a.status),n),!lo.useNavi&&i?[2,ht(fl())]:[2,gt(this.transHttpCode(a.status))];try{return 0===(u=a.data.match(/{[\d\D]+}/)[0]).indexOf('{\\"code\\":')&&(u=JSON.parse('"'.concat(u,'"'))),(l=JSON.parse(u)).protocol=/^https/.test(o)?"https":"http",l.code&&200!==l.code?[2,gt(this.transHttpCode(l.code))]:(lo.useNavi||(l.server="",l.backupServer=yr.getMiniCmpUrlList().join(","),l.logSwitch=0),[2,ht(l)])}catch(e){this.logger.error(H.L_PARSE_NAVI_E,a.data,n)}return[2,gt(exports.ErrorCode.RC_NAVI_REQ_FAILED)]}}))}))}}),Object.defineProperty(r.prototype,"httpRequestV2",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){return o(this,void 0,void 0,(function(){var o,a,u,l,c;return s(this,(function(s){switch(s.label){case 0:return o=this.getNaviV2RequestOption({appkey:t,token:r,uri:e,platform:lo.tag,protocol:(/^https/.test(e)?q.WSS:q.WS).toString()}),this.logger.debug(H.L_REQUEST_T,"req navi => ".concat(o.url),n),[4,lo.httpReq(o)];case 1:if(200!==(a=s.sent()).status)return this.logger.debug(H.L_REQUEST_R,"request navi failed: ".concat(a.status),n),!lo.useNavi&&i?[2,ht(fl())]:[2,gt(this.transHttpCode(a.status))];try{return u=a.data,(l="object"!=typeof u?JSON.parse(u):u).protocol=/^https/.test(o.url)?"https":"http",lo.useNavi||(l.logSwitch=0,c=yr.getMiniCmpUrlList(),l.serverAddr=c.map((function(e,t){return{addr:e,protocol:/^https/.test(o.url)?q.WSS:q.WS,weight:c.length-t}}))),[2,ht(l)]}catch(e){this.logger.error(H.L_PARSE_NAVI_E,a.data,n)}return[2,gt(exports.ErrorCode.RC_NAVI_REQ_FAILED)]}}))}))}}),Object.defineProperty(r.prototype,"getNaviCache",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this,r=this.getCatchKey(e);if(pl[r])return pl[r];var n,i=ke(this.appkey),o=lo.localStorage;try{var s=o.getItem(i);n=s?JSON.parse(s):[]}catch(e){n=[]}if(0===n.length)return null;var a=n.find((function(r){return r.token===e&&r.environment===t._environment}))||null;return pl[r]=a,a}}),Object.defineProperty(r.prototype,"setNaviCache",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r,n=this,i=ke(this.appkey),o=lo.localStorage;try{var s=o.getItem(i);r=s?JSON.parse(s):[]}catch(e){r=[]}var a=Date.now();r.length>0&&(r=r.filter((function(t){return a-t.timestamp<Ue&&(e!==t.token||n._environment!==t.environment)})));var u={timestamp:a,naviInfo:t,token:e,environment:this._environment};r.push(u),o.setItem(i,JSON.stringify(r)),pl[this.getCatchKey(e)]=u}}),r}(xr),gl=function(){function e(e){Object.defineProperty(this,"_appkey",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"_sendMessageMap",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_userId",{enumerable:!0,configurable:!0,writable:!0,value:""})}return Object.defineProperty(e.prototype,"init",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._userId=e;var t=Qe(this._appkey,e);this._sendMessageMap=this._getLocalInfo(t)}}),Object.defineProperty(e.prototype,"_getLocalInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=lo.localStorage.getItem(e);try{return t?JSON.parse(t):{}}catch(e){return{}}}}),Object.defineProperty(e.prototype,"setMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._sendMessageMap[e]=t;var r=Qe(this._appkey,this._userId),n=this._getLocalInfo(r);n[e]=t,lo.localStorage.setItem(r,JSON.stringify(n))}}),Object.defineProperty(e.prototype,"getSendMessageMap",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._sendMessageMap}}),Object.defineProperty(e.prototype,"removeByUID",{enumerable:!1,configurable:!0,writable:!0,value:function(e){delete this._sendMessageMap[e]}}),Object.defineProperty(e.prototype,"removeByTimestamp",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=Qe(this._appkey,this._userId),r=this._getLocalInfo(t);Object.keys(r).forEach((function(t){r[t]<e&&delete r[t]})),lo.localStorage.setItem(t,JSON.stringify(r))}}),e}(),_l=function(){function e(e){var t;Object.defineProperty(this,"_delayTime",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"subscribeData",{enumerable:!0,configurable:!0,writable:!0,value:(t={},t[exports.SubscribeType.ONLINE_STATUS]={},t[exports.SubscribeType.USER_PROFILE]={},t)}),Object.defineProperty(this,"_ownProfile",{enumerable:!0,configurable:!0,writable:!0,value:null})}return Object.defineProperty(e.prototype,"clearSubscribeRelation",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e;this.subscribeData=((e={})[exports.SubscribeType.ONLINE_STATUS]={},e[exports.SubscribeType.USER_PROFILE]={},e)}}),Object.defineProperty(e.prototype,"clearSubscribeStatusData",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;e===exports.SubscribeType.ONLINE_STATUS?Object.keys(this.subscribeData[e]).forEach((function(r){t.subscribeData[e][r].statusMap={}})):e===exports.SubscribeType.USER_PROFILE&&Object.keys(this.subscribeData[e]).forEach((function(r){t.subscribeData[e][r].profile=void 0}))}}),Object.defineProperty(e.prototype,"getSubscribeUserData",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this.subscribeData[e][t];return r?n({},r):void 0}}),Object.defineProperty(e.prototype,"removeSubscribeUserData",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){delete this.subscribeData[e][t]}}),Object.defineProperty(e.prototype,"updateSubscribeUserData",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){this.subscribeData[e][t]=r}}),Object.defineProperty(e.prototype,"clearExpiredData",{enumerable:!1,configurable:!0,writable:!0,value:function(e){for(var t in this.subscribeData[e]){var r=this.subscribeData[e][t];r.expiry<(Date.now()+this._delayTime-r.subscribeTime)/1e3&&delete this.subscribeData[e][t]}}}),Object.defineProperty(e.prototype,"getSubscribeUserList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return l([],u(Object.values(this.subscribeData[e])),!1).sort((function(e,t){return e.subscribeTime-t.subscribeTime})).slice(r,r+t)}}),Object.defineProperty(e.prototype,"updateOwnProfile",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r=n(n({},null===(t=this._ownProfile)||void 0===t?void 0:t.extraProfile),e.extraProfile);this._ownProfile=n(n(n({},this._ownProfile),e),{extraProfile:r})}}),Object.defineProperty(e.prototype,"getOwnProfile",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._ownProfile?n(n({},this._ownProfile),{extraProfile:n({},this._ownProfile.extraProfile)}):null}}),e}(),bl=function(){function e(e){Object.defineProperty(this,"_delayTime",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"_relationshipStatusVersion",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_subUserStatusVersion",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_ownProfileVersion",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_subStore",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._subStore=new _l(e)}return Object.defineProperty(e.prototype,"updateRelationshipStatusVersion",{enumerable:!1,configurable:!0,writable:!0,value:function(e){e>this._relationshipStatusVersion&&(this._relationshipStatusVersion=e)}}),Object.defineProperty(e.prototype,"getRelationshipStatusVersion",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._relationshipStatusVersion}}),Object.defineProperty(e.prototype,"updateSubscribeUserStatusVersion",{enumerable:!1,configurable:!0,writable:!0,value:function(e){e>this._subUserStatusVersion&&(this._subUserStatusVersion=e)}}),Object.defineProperty(e.prototype,"getSubscribeUserStatusVersion",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subUserStatusVersion}}),Object.defineProperty(e.prototype,"_filterSubscribeRelationData",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return e.reduce((function(e,t){return t.subUsers.forEach((function(r){var n=e.find((function(e){return e.subscribeType===t.subType&&e.userId===r.subUserId}));n?n.subscribeTime<t.subTime&&(n.expiry=t.expiry,n.operationType=t.opType,n.subscribeTime=t.subTime):e.push({userId:r.subUserId,subscribeTime:t.subTime,subscribeType:t.subType,expiry:t.expiry,operationType:t.opType})})),e}),[])}}),Object.defineProperty(e.prototype,"updateSubscribeRelation",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this;void 0===t&&(t=!1);var n=[],i=[],o=[];return t&&this._subStore.clearSubscribeRelation(),this._filterSubscribeRelationData(e).forEach((function(e){var t,s,a=e.userId,u=e.subscribeTime,l=e.subscribeType,c=e.expiry;if(e.operationType===exports.SubscribeOperationType.UNSUBSCRIBE)return r._subStore.removeSubscribeUserData(l,a),void o.push(e);var d=r._subStore.getSubscribeUserData(l,a);if(!(d&&d.subscribeTime>=u)){if(l===exports.SubscribeType.ONLINE_STATUS){n.push(a);var p=(null===(t=d)||void 0===t?void 0:t.statusMap)||{};r._subStore.updateSubscribeUserData(l,a,{subscribeTime:u,expiry:c,userId:a,subscribeType:l,statusMap:p})}else{i.push(a);var f=null===(s=d)||void 0===s?void 0:s.profile;r._subStore.updateSubscribeUserData(l,a,{subscribeTime:u,expiry:c,userId:a,subscribeType:l,profile:f,isSubscribed:!0})}o.push(e)}})),{newSubscribeOnlineStatusList:n,newSubscribeUserProfileList:i,subscribeUserChangeList:o}}}),Object.defineProperty(e.prototype,"clearSubscribeStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._subStore.clearSubscribeStatusData(exports.SubscribeType.ONLINE_STATUS),this._subStore.clearSubscribeStatusData(exports.SubscribeType.USER_PROFILE)}}),Object.defineProperty(e.prototype,"updateSubscribeUserOnlineStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this,r=[];return e.forEach((function(e){var i=e.subUserId,o=e.data,s=t._subStore.getSubscribeUserData(exports.SubscribeType.ONLINE_STATUS,i);if(s){var a=[],u=n({},s.statusMap);o.forEach((function(e){var t=u[e.platformInfo];if(!(t&&t.changeTime>e.versionTime)){var r={eventValue:e.value,changeTime:e.versionTime};u[e.platformInfo]=r,a.push(n(n({},r),{platform:e.platformInfo}))}})),t._subStore.updateSubscribeUserData(exports.SubscribeType.ONLINE_STATUS,i,{subscribeTime:s.subscribeTime,expiry:s.expiry,userId:i,subscribeType:exports.SubscribeType.ONLINE_STATUS,statusMap:u}),r.push({userId:i,subscribeType:exports.SubscribeType.ONLINE_STATUS,subscribeTime:s.subscribeTime,expiry:s.expiry,details:a})}})),r}}),Object.defineProperty(e.prototype,"updateSubscribeUserProfile",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this,r=[];return e.forEach((function(e){var i=e.userId,o=e.version,s=e.userProfile,a=e.userExtProfile,u=t._subStore.getSubscribeUserData(exports.SubscribeType.USER_PROFILE,i),l=qt(i,s,a);u?u.profile&&u.profile.version>=o||(t._subStore.updateSubscribeUserData(exports.SubscribeType.USER_PROFILE,i,{subscribeTime:u.subscribeTime,expiry:u.expiry,userId:i,subscribeType:exports.SubscribeType.USER_PROFILE,profile:{info:l,version:o},isSubscribed:u.isSubscribed}),u.isSubscribed&&r.push({userId:i,subscribeType:exports.SubscribeType.USER_PROFILE,subscribeTime:u.subscribeTime,expiry:u.expiry,userProfile:n({},l)})):t._subStore.updateSubscribeUserData(exports.SubscribeType.USER_PROFILE,i,{subscribeTime:0,expiry:0,userId:i,subscribeType:exports.SubscribeType.USER_PROFILE,profile:{info:l,version:o},isSubscribed:!1})})),r}}),Object.defineProperty(e.prototype,"getSubscribeUserStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this,i=[];return t.forEach((function(t){var o=r._subStore.getSubscribeUserData(e,t);if(!o||o.expiry<(Date.now()+r._delayTime-o.subscribeTime)/1e3)r._subStore.removeSubscribeUserData(e,t);else{var s={subscribeTime:o.subscribeTime,expiry:o.expiry,userId:o.userId,subscribeType:o.subscribeType};if(e===exports.SubscribeType.ONLINE_STATUS){var a=o.statusMap,u=Object.keys(a).map((function(e){return n({platform:~~e},a[~~e])}));s.details=Ht(u)}else if(e===exports.SubscribeType.USER_PROFILE&&!o.isSubscribed)return;i.push(s)}})),i}}),Object.defineProperty(e.prototype,"getUserProfiles",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this,r=[],i=[];return e.forEach((function(e){var o=t._subStore.getSubscribeUserData(exports.SubscribeType.USER_PROFILE,e);if(o&&o.profile){var s=o.profile,a=s.version,u=s.info;if(o.isSubscribed)return t._delayTime+Date.now()-a>6048e5?void i.push(e):void r.push(n(n({},u),{extraProfile:n({},u.extraProfile)}));t._delayTime+Date.now()-a>6e5?i.push(e):r.push(n(n({},u),{extraProfile:n({},u.extraProfile)}))}else i.push(e)})),{list:r,needQueryUserIds:i}}}),Object.defineProperty(e.prototype,"getSubscribeUserList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return this._subStore.clearExpiredData(e),this._subStore.getSubscribeUserList(e,t,r).map((function(t){var r={subscribeTime:t.subscribeTime,expiry:t.expiry,userId:t.userId,subscribeType:t.subscribeType};if(e===exports.SubscribeType.ONLINE_STATUS){var i=Object.keys(t.statusMap).map((function(e){return n({platform:~~e},t.statusMap[~~e])}));r.details=Ht(i)}return r}))}}),Object.defineProperty(e.prototype,"updateOwnProfile",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._ownProfileVersion>t||this._subStore.updateOwnProfile(e)}}),Object.defineProperty(e.prototype,"getOwnProfile",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subStore.getOwnProfile()}}),e}(),El=function(){function e(e,t,r,n,i,o,s){Object.defineProperty(this,"_connectManager",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"_event",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"_currentUserId",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"_delayTime",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(this,"_logger",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"_isOpenUserProfile",{enumerable:!0,configurable:!0,writable:!0,value:o}),Object.defineProperty(this,"_subDriven",{enumerable:!0,configurable:!0,writable:!0,value:s}),Object.defineProperty(this,"_isPullingRelationship",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_pullRelationshipQueue",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_pullRelationshipFailTime",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_isPullingSubUserStatus",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_pullSubUserStatusQueue",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_pullSubUserStatusFailTime",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_subscribeService",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._subscribeService=new bl(n)}return Object.defineProperty(e.prototype,"syncData",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return this._subDriven?[4,this._syncSubscribeRelationship(!1)]:[3,3];case 1:return e.sent(),[4,this._syncSubscribeUserStatus(!0)];case 2:e.sent(),e.label=3;case 3:return this._isOpenUserProfile?[4,this.syncOwnProfile()]:[3,5];case 4:e.sent(),e.label=5;case 5:return 1&this._subDriven&&this._event.syncSubscribeUserStatusFinished(exports.SubscribeType.ONLINE_STATUS),2&this._subDriven&&this._event.syncSubscribeUserStatusFinished(exports.SubscribeType.USER_PROFILE),3&this._subDriven&&this._event.syncSubscribeUserStatusFinished(exports.SubscribeType.FRIEND_ONLINE_STATUS),4&this._subDriven&&this._event.syncSubscribeUserStatusFinished(exports.SubscribeType.FRIEND_USER_PROFILE),[2]}}))}))}}),Object.defineProperty(e.prototype,"startSyncSubscribeRelationship",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){return s(this,(function(t){return this._pullRelationshipQueue.push(e),this._syncSubscribeRelationship(),[2]}))}))}}),Object.defineProperty(e.prototype,"_syncSubscribeRelationship",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return void 0===e&&(e=!0),o(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return this._isPullingRelationship?[2]:(this._isPullingRelationship=!0,[4,this._pullSubscribeRelationship(e)]);case 1:return t.sent(),this._isPullingRelationship=!1,this._pullRelationshipQueue.length>0?(this._pullRelationshipQueue.length=0,[4,this._syncSubscribeRelationship(e)]):[3,3];case 2:t.sent(),t.label=3;case 3:return[2]}}))}))}}),Object.defineProperty(e.prototype,"_pullSubscribeRelationship",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return void 0===t&&(t=""),o(this,void 0,void 0,(function(){var r,n,i,o,a,u,l,c,d,p,f,h,g,_,b;return s(this,(function(s){switch(s.label){case 0:return r=this._subscribeService.getRelationshipStatusVersion(),n=this._logger.createTraceId(),this._logger.info(H.L_PULL_SUBSCRIBED_USER_RELATION_T,JSON.stringify({version:r,_pageToken:t}),n),i=this._connectManager.codec.encodePullUserSubReq({version:r,pageToken:t}),o=new bi(Zr.pullUserSub,i,this._currentUserId),[4,this._connectManager.send(o,Zs)];case 1:return a=s.sent(),u=a.code,l=a.data,u===exports.ErrorCode.SUCCESS&&l?(this._pullRelationshipFailTime=0,c=l.list,d=l.version,p=l.hasNext,f=l.pageToken,d=kt(d),c.forEach((function(e){e.subTime=kt(e.subTime)})),this._logger.info(H.L_PULL_SUBSCRIBED_USER_RELATION_R,JSON.stringify({code:u,data:l}),n),e?(h=this._subscribeService.updateSubscribeRelation(c),g=h.newSubscribeOnlineStatusList,_=h.newSubscribeUserProfileList,(b=h.subscribeUserChangeList).length>0&&this._event.subscribeRelationChanged(b),g.length>0&&this._queryAndUpdateUserOnlineStatus(g),_.length>0&&this._queryAndUpdateUserProfile(_)):this._subscribeService.updateSubscribeRelation(c,!t),this._subscribeService.updateRelationshipStatusVersion(d),this._pullRelationshipQueue=this._pullRelationshipQueue.filter((function(e){return e>d})),p?[4,this._pullSubscribeRelationship(e,f)]:[3,3]):(this._logger.error(H.L_PULL_SUBSCRIBED_USER_RELATION_R,JSON.stringify({code:u,failTime:this._pullRelationshipFailTime}),n),this._pullRelationshipFailTime++,this._pullRelationshipFailTime>5?(this._pullRelationshipFailTime=0,[2]):[2,this._pullSubscribeRelationship(e,t)]);case 2:s.sent(),s.label=3;case 3:return[2]}}))}))}}),Object.defineProperty(e.prototype,"startsyncSubscribeUserStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){return s(this,(function(t){return this._pullSubUserStatusQueue.push(e),this._syncSubscribeUserStatus(),[2]}))}))}}),Object.defineProperty(e.prototype,"_syncSubscribeUserStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return void 0===e&&(e=!1),o(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return this._isPullingSubUserStatus?[2]:(this._isPullingSubUserStatus=!0,[4,this._pullSubscribeUserStatus(e)]);case 1:return t.sent(),this._isPullingSubUserStatus=!1,this._pullSubUserStatusQueue.length>0?(this._pullSubUserStatusQueue.length=0,[4,this._syncSubscribeUserStatus(e)]):[3,3];case 2:t.sent(),t.label=3;case 3:return[2]}}))}))}}),Object.defineProperty(e.prototype,"_pullSubscribeUserStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return void 0===e&&(e=!1),void 0===t&&(t=""),o(this,void 0,void 0,(function(){var r,n,i,o,a,u,l,c,d,p,f,h,g,_;return s(this,(function(s){switch(s.label){case 0:return r=this._subscribeService.getSubscribeUserStatusVersion(),n=this._logger.createTraceId(),this._logger.info(H.L_PULL_SUBSCRIBED_USER_STATUS_T,JSON.stringify({version:r,_pageToken:t,needAllData:e}),n),i=this._connectManager.codec.encodePullSubDataReq({version:r,needAllData:e,pageToken:t}),o=new bi(Zr.pullSubData,i,this._currentUserId),[4,this._connectManager.send(o,$s)];case 1:return a=s.sent(),u=a.code,l=a.data,u===exports.ErrorCode.SUCCESS&&l?(this._pullSubUserStatusFailTime=0,c=l.list,d=l.versionTime,p=l.hasNext,f=l.pageToken,h=l.isFull,d=kt(d),this._logger.info(H.L_PULL_SUBSCRIBED_USER_STATUS_R,JSON.stringify({code:u,data:l}),n),c.forEach((function(e){e.data.forEach((function(e){e.versionTime=kt(e.versionTime)}))})),this._pullSubUserStatusQueue=this._pullSubUserStatusQueue.filter((function(e){return e>d})),this._subscribeService.updateSubscribeUserStatusVersion(d),g=[],_=[],c.forEach((function(e){e.subType===exports.SubscribeType.ONLINE_STATUS?g.push(e):e.subType===exports.SubscribeType.USER_PROFILE&&_.push(e.subUserId)})),h&&""===t&&this._subscribeService.clearSubscribeStatus(),g.length>0&&this._updateUserOnlineStatus(g,!h),_.length>0?[4,this._queryAndUpdateUserProfile(_,!h)]:[3,3]):(this._logger.warn(H.L_PULL_SUBSCRIBED_USER_STATUS_R,JSON.stringify({code:u,failTime:this._pullSubUserStatusFailTime}),n),this._pullSubUserStatusFailTime++,this._pullSubUserStatusFailTime>5?(this._pullSubUserStatusFailTime=0,[2]):[2,this._pullSubscribeUserStatus(e,t)]);case 2:s.sent(),s.label=3;case 3:return p?[4,this._pullSubscribeUserStatus(e,f)]:[3,5];case 4:s.sent(),s.label=5;case 5:return[2]}}))}))}}),Object.defineProperty(e.prototype,"_queryAndUpdateUserOnlineStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,o,a;return s(this,(function(s){switch(s.label){case 0:return t=this._logger.createTraceId(),this._logger.info(H.L_QUERY_SUBSCRIBE_DATA_T,JSON.stringify(e),t),r=this._connectManager.codec.encodeQrySubDataReq(exports.SubscribeType.ONLINE_STATUS,e),n=new bi(Zr.qrySubData,r,this._currentUserId),[4,this._connectManager.send(n,$s)];case 1:return i=s.sent(),o=i.code,a=i.data,this._logger.info(H.L_QUERY_SUBSCRIBE_DATA_R,JSON.stringify({code:o,data:a}),t),o===exports.ErrorCode.SUCCESS&&a?(this._updateUserOnlineStatus(a.list),[2]):[2]}}))}))}}),Object.defineProperty(e.prototype,"_updateUserOnlineStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){void 0===t&&(t=!0),e.forEach((function(e){e.data.forEach((function(e){e.versionTime=kt(e.versionTime)}))}));var r=this._subscribeService.updateSubscribeUserOnlineStatus(e);r=r.filter((function(e){return e.details&&e.details.length>0})),t&&r.length>0&&this._event.subscribeUserStatusChanged(r)}}),Object.defineProperty(e.prototype,"_queryAndUpdateUserProfile",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return void 0===t&&(t=!0),o(this,void 0,void 0,(function(){var r,n,i,o,a,u,l;return s(this,(function(s){switch(s.label){case 0:return r=this._logger.createTraceId(),this._logger.info(H.L_PULL_USER_PROFILE_T,JSON.stringify(e),r),n=this._connectManager.codec.encodePullUserProfileReq(e),i=new bi(Zr.pullUserProfile,n,this._currentUserId),[4,this._connectManager.send(i,sa)];case 1:return o=s.sent(),a=o.code,u=o.data,this._logger.info(H.L_PULL_USER_PROFILE_R,JSON.stringify({code:a,data:u}),r),a===exports.ErrorCode.SUCCESS&&u?(u.UserProfile.forEach((function(e){e.version=kt(e.version)})),l=this._subscribeService.updateSubscribeUserProfile(u.UserProfile),t&&l.length>0&&this._event.subscribeUserStatusChanged(l),[2,{code:a,data:u.UserProfile}]):[2,{code:a}]}}))}))}}),Object.defineProperty(e.prototype,"updateUserStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i;return s(this,(function(o){switch(o.label){case 0:return(t=this._connectManager.codec.decodeByPBName(e.pbData,ea)).subType!==exports.SubscribeType.ONLINE_STATUS?[3,1]:(this._updateUserOnlineStatus([t]),[3,5]);case 1:return t.subType!==exports.SubscribeType.USER_PROFILE?[3,2]:(this._queryAndUpdateUserProfile([t.subUserId]),[3,5]);case 2:return t.subType!==exports.SubscribeType.FRIEND_ONLINE_STATUS?[3,3]:(r=t.data.map((function(e){return{changeTime:kt(e.versionTime),eventValue:e.value,platform:e.platformInfo}})),this._event.subscribeUserStatusChanged([{userId:t.subUserId,subscribeType:t.subType,subscribeTime:0,expiry:0,details:r}]),[3,5]);case 3:return t.subType!==exports.SubscribeType.FRIEND_USER_PROFILE?[3,5]:[4,this._queryAndUpdateUserProfile([t.subUserId])];case 4:n=o.sent(),(i=n.data)&&this._event.subscribeUserStatusChanged([{userId:t.subUserId,subscribeType:t.subType,subscribeTime:0,expiry:0,userProfile:qt(t.subUserId,i[0].userProfile,i[0].userExtProfile)}]),o.label=5;case 5:return[2]}}))}))}}),Object.defineProperty(e.prototype,"getSubscribeUserStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return this._subscribeService.getSubscribeUserStatus(e,t)}}),Object.defineProperty(e.prototype,"getSubscribeUserList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return this._subscribeService.getSubscribeUserList(e,t,r)}}),Object.defineProperty(e.prototype,"updateSubscribeRelation",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return void 0===n&&(n=0),o(this,void 0,void 0,(function(){var i,o,a,u,l,c;return s(this,(function(s){switch(s.label){case 0:return i=this._connectManager.codec.encodeUpdateUserSubReq(t,e,r,n),o=new bi(Zr.updUserSub,i,this._currentUserId),[4,this._connectManager.send(o,Js)];case 1:return a=s.sent(),u=a.code,l=a.data,u===exports.ErrorCode.RC_BESUBSCRIBED_USERIDS_COUNT_EXCEED_LIMIT&&l?[2,{code:u,data:l.subUsers.map((function(e){return e.subUserId}))}]:u===exports.ErrorCode.SUCCESS&&l?(c=l.subTime,this._subscribeService.updateSubscribeRelation([{subType:t,subTime:c,expiry:n,opType:r,subUsers:e.map((function(e){return{subUserId:e}}))}]),r===exports.SubscribeOperationType.SUBSCRIBE&&(t===exports.SubscribeType.ONLINE_STATUS?this._queryAndUpdateUserOnlineStatus(e):t===exports.SubscribeType.USER_PROFILE&&this._queryAndUpdateUserProfile(e,!1)),[2,{code:u}]):[2,{code:u}]}}))}))}}),Object.defineProperty(e.prototype,"getUserProfiles",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,o,a,c;return s(this,(function(s){switch(s.label){case 0:return t=this._subscribeService.getUserProfiles(e),r=t.needQueryUserIds,n=t.list,0===r.length?[2,Promise.resolve({code:exports.ErrorCode.SUCCESS,data:n})]:[4,this._queryAndUpdateUserProfile(r,!1)];case 1:return i=s.sent(),o=i.code,a=i.data,o===exports.ErrorCode.SUCCESS&&a?(c=a.map((function(e){return qt(e.userId,e.userProfile,e.userExtProfile)})),[2,{code:o,data:l(l([],u(n),!1),u(c),!1)}]):[2,{code:o,data:l([],u(n),!1)}]}}))}))}}),Object.defineProperty(e.prototype,"syncOwnProfile",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return void 0===e&&(e=!1),o(this,void 0,void 0,(function(){var t,r,n,i,o,a,u,l,c,d,p,f;return s(this,(function(s){switch(s.label){case 0:return this._isOpenUserProfile?(t=this._logger.createTraceId(),this._logger.info(H.L_PULL_OWN_PROFILE_T,"",t),r=this._connectManager.codec.encodeUserProfileInput(),n=new bi(Zr.pullOwnProfile,r,this._currentUserId),[4,this._connectManager.send(n,ra)]):[2,Promise.resolve({code:exports.ErrorCode.RC_USER_PROFILE_SERVICE_UNAVAILABLE})];case 1:return i=s.sent(),o=i.code,a=i.data,this._logger.info(H.L_PULL_OWN_PROFILE_R,JSON.stringify({code:o,data:a}),t),o===exports.ErrorCode.SUCCESS&&a?(u=a.userExtProfile,l=a.userProfile,c=a.version,d=a.userId,p=kt(c),f=qt(d,l,u),this._subscribeService.updateOwnProfile(f,p),e&&this._event.ownUserProfileChanged(f),[2,{code:o,data:f}]):[2,{code:o}]}}))}))}}),Object.defineProperty(e.prototype,"getOwnProfile",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e;return s(this,(function(t){return(e=this._subscribeService.getOwnProfile())?[2,{code:exports.ErrorCode.SUCCESS,data:e}]:[2,this.syncOwnProfile()]}))}))}}),Object.defineProperty(e.prototype,"updateOwnProfile",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){return s(this,(function(r){return this._subscribeService.updateOwnProfile(e,t),[2]}))}))}}),e}(),vl=function(){function e(e,t,r){Object.defineProperty(this,"_storage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_delayTime",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._storage=new Gu(Ze(e,t)),this._delayTime=r,this.clear()}return Object.defineProperty(e.prototype,"_getConversationKey",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return"".concat(e.targetId,"_").concat(e.channelId)}}),Object.defineProperty(e.prototype,"_removeExcessData",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r,n=Object.keys(e).map((function(t){return{key:t,value:e[t]}})).sort((function(e,t){return e.value.t-t.value.t})).slice(-30),i={};try{for(var o=a(n),s=o.next();!s.done;s=o.next()){var u=s.value;i[u.key]=u.value}}catch(e){t={error:e}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}return i}}),Object.defineProperty(e.prototype,"insert",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,i,o){var s;if(!(i<Date.now()-this._delayTime-Ge)){var a=this._getConversationKey(e),u=this._storage.get(a)||{};if(!u[t]){var l={t:i,d:r};o&&(l.sId=o);var c=n(n({},u),((s={})[t]=l,s));Object.keys(c).length>30&&(c=this._removeExcessData(c)),this._storage.set(a,c)}}}}),Object.defineProperty(e.prototype,"addReadedUser",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var i,o=this._getConversationKey(e),s=this._storage.get(o)||{},a=s[t];if(a){if(a.us){if(a.us.includes(r))return}else a.us=[];a.us.push(r),this._storage.set(o,n(n({},s),((i={})[t]=a,i)))}}}),Object.defineProperty(e.prototype,"getReadReceiptInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this._getConversationKey(e),n=(this._storage.get(r)||{})[t];return n?{time:n.t,direction:n.d,users:n.us||[],senderId:n.sId}:null}}),Object.defineProperty(e.prototype,"getReceiptMessageDic",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this._getConversationKey(e),r=this._storage.get(t)||{},n={};for(var i in r){var o=r[i];o.d===exports.MessageDirection.RECEIVE&&(n[o.sId]||(n[o.sId]=[]),n[o.sId].push(i))}return n}}),Object.defineProperty(e.prototype,"remove",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this._getConversationKey(e),n=this._storage.get(r)||{};n[t]&&(delete n[t],0===Object.keys(n).length?this._storage.remove(r):this._storage.set(r,n))}}),Object.defineProperty(e.prototype,"clear",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this._storage.getValues(),t={};for(var r in e){var n=e[r],i={};for(var o in n){var s=n[o];Date.now()-this._delayTime-s.t<Ge&&(i[o]=s)}Object.keys(i).length&&(t[r]=i)}this._storage.update(t)}}),e}(),yl=function(e){function r(t,r){var n=e.call(this,t,r)||this;return Object.defineProperty(n,"appkey",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(n,"logger",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(n,"_storageKey",{enumerable:!0,configurable:!0,writable:!0,value:""}),n._storageKey=Je(t),n}return t(r,e),Object.defineProperty(r.prototype,"getCache",{enumerable:!1,configurable:!0,writable:!0,value:function(){return lo.localStorage.getItem(this._storageKey)}}),Object.defineProperty(r.prototype,"setCache",{enumerable:!1,configurable:!0,writable:!0,value:function(e){lo.localStorage.setItem(this._storageKey,e)}}),Object.defineProperty(r.prototype,"clearCache",{enumerable:!1,configurable:!0,writable:!0,value:function(){lo.localStorage.removeItem(this._storageKey)}}),Object.defineProperty(r.prototype,"sendRequest",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n;return s(this,(function(i){switch(i.label){case 0:return[4,lo.httpReq({url:e})];case 1:return t=i.sent(),r=t.status,n=t.data,[2,{code:r,data:n}]}}))}))}}),Object.defineProperty(r.prototype,"decryptData",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r;return s(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,dr(e,"cd4936151214ce45dc1d12673a59d94c","51ad078e5eb17a91")];case 1:return t=n.sent(),[2,JSON.parse(t)];case 2:return r=n.sent(),this.logger.error(H.L_GET_STATIC_CONF_E,JSON.stringify({error:null==r?void 0:r.stack})),[3,3];case 3:return[2]}}))}))}}),r}(mr);function ml(e){let t=e.length;for(;--t>=0;)e[t]=0}const Il=256,Tl=286,Rl=30,Cl=15,Ol=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),Sl=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),Al=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),Pl=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Nl=new Array(576);ml(Nl);const wl=new Array(60);ml(wl);const Ml=new Array(512);ml(Ml);const Ll=new Array(256);ml(Ll);const Ul=new Array(29);ml(Ul);const Dl=new Array(Rl);function xl(e,t,r,n,i){this.static_tree=e,this.extra_bits=t,this.extra_base=r,this.elems=n,this.max_length=i,this.has_stree=e&&e.length}let jl,Vl,Gl;function kl(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}ml(Dl);const Fl=e=>e<256?Ml[e]:Ml[256+(e>>>7)],Bl=(e,t)=>{e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255},Hl=(e,t,r)=>{e.bi_valid>16-r?(e.bi_buf|=t<<e.bi_valid&65535,Bl(e,e.bi_buf),e.bi_buf=t>>16-e.bi_valid,e.bi_valid+=r-16):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=r)},ql=(e,t,r)=>{Hl(e,r[2*t],r[2*t+1])},Yl=(e,t)=>{let r=0;do{r|=1&e,e>>>=1,r<<=1}while(--t>0);return r>>>1},Kl=(e,t,r)=>{const n=new Array(16);let i,o,s=0;for(i=1;i<=Cl;i++)s=s+r[i-1]<<1,n[i]=s;for(o=0;o<=t;o++){let t=e[2*o+1];0!==t&&(e[2*o]=Yl(n[t]++,t))}},Ql=e=>{let t;for(t=0;t<Tl;t++)e.dyn_ltree[2*t]=0;for(t=0;t<Rl;t++)e.dyn_dtree[2*t]=0;for(t=0;t<19;t++)e.bl_tree[2*t]=0;e.dyn_ltree[512]=1,e.opt_len=e.static_len=0,e.sym_next=e.matches=0},Wl=e=>{e.bi_valid>8?Bl(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0},Jl=(e,t,r,n)=>{const i=2*t,o=2*r;return e[i]<e[o]||e[i]===e[o]&&n[t]<=n[r]},zl=(e,t,r)=>{const n=e.heap[r];let i=r<<1;for(;i<=e.heap_len&&(i<e.heap_len&&Jl(t,e.heap[i+1],e.heap[i],e.depth)&&i++,!Jl(t,n,e.heap[i],e.depth));)e.heap[r]=e.heap[i],r=i,i<<=1;e.heap[r]=n},Zl=(e,t,r)=>{let n,i,o,s,a=0;if(0!==e.sym_next)do{n=255&e.pending_buf[e.sym_buf+a++],n+=(255&e.pending_buf[e.sym_buf+a++])<<8,i=e.pending_buf[e.sym_buf+a++],0===n?ql(e,i,t):(o=Ll[i],ql(e,o+Il+1,t),s=Ol[o],0!==s&&(i-=Ul[o],Hl(e,i,s)),n--,o=Fl(n),ql(e,o,r),s=Sl[o],0!==s&&(n-=Dl[o],Hl(e,n,s)))}while(a<e.sym_next);ql(e,256,t)},Xl=(e,t)=>{const r=t.dyn_tree,n=t.stat_desc.static_tree,i=t.stat_desc.has_stree,o=t.stat_desc.elems;let s,a,u,l=-1;for(e.heap_len=0,e.heap_max=573,s=0;s<o;s++)0!==r[2*s]?(e.heap[++e.heap_len]=l=s,e.depth[s]=0):r[2*s+1]=0;for(;e.heap_len<2;)u=e.heap[++e.heap_len]=l<2?++l:0,r[2*u]=1,e.depth[u]=0,e.opt_len--,i&&(e.static_len-=n[2*u+1]);for(t.max_code=l,s=e.heap_len>>1;s>=1;s--)zl(e,r,s);u=o;do{s=e.heap[1],e.heap[1]=e.heap[e.heap_len--],zl(e,r,1),a=e.heap[1],e.heap[--e.heap_max]=s,e.heap[--e.heap_max]=a,r[2*u]=r[2*s]+r[2*a],e.depth[u]=(e.depth[s]>=e.depth[a]?e.depth[s]:e.depth[a])+1,r[2*s+1]=r[2*a+1]=u,e.heap[1]=u++,zl(e,r,1)}while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],((e,t)=>{const r=t.dyn_tree,n=t.max_code,i=t.stat_desc.static_tree,o=t.stat_desc.has_stree,s=t.stat_desc.extra_bits,a=t.stat_desc.extra_base,u=t.stat_desc.max_length;let l,c,d,p,f,h,g=0;for(p=0;p<=Cl;p++)e.bl_count[p]=0;for(r[2*e.heap[e.heap_max]+1]=0,l=e.heap_max+1;l<573;l++)c=e.heap[l],p=r[2*r[2*c+1]+1]+1,p>u&&(p=u,g++),r[2*c+1]=p,c>n||(e.bl_count[p]++,f=0,c>=a&&(f=s[c-a]),h=r[2*c],e.opt_len+=h*(p+f),o&&(e.static_len+=h*(i[2*c+1]+f)));if(0!==g){do{for(p=u-1;0===e.bl_count[p];)p--;e.bl_count[p]--,e.bl_count[p+1]+=2,e.bl_count[u]--,g-=2}while(g>0);for(p=u;0!==p;p--)for(c=e.bl_count[p];0!==c;)d=e.heap[--l],d>n||(r[2*d+1]!==p&&(e.opt_len+=(p-r[2*d+1])*r[2*d],r[2*d+1]=p),c--)}})(e,t),Kl(r,l,e.bl_count)},$l=(e,t,r)=>{let n,i,o=-1,s=t[1],a=0,u=7,l=4;for(0===s&&(u=138,l=3),t[2*(r+1)+1]=65535,n=0;n<=r;n++)i=s,s=t[2*(n+1)+1],++a<u&&i===s||(a<l?e.bl_tree[2*i]+=a:0!==i?(i!==o&&e.bl_tree[2*i]++,e.bl_tree[32]++):a<=10?e.bl_tree[34]++:e.bl_tree[36]++,a=0,o=i,0===s?(u=138,l=3):i===s?(u=6,l=3):(u=7,l=4))},ec=(e,t,r)=>{let n,i,o=-1,s=t[1],a=0,u=7,l=4;for(0===s&&(u=138,l=3),n=0;n<=r;n++)if(i=s,s=t[2*(n+1)+1],!(++a<u&&i===s)){if(a<l)do{ql(e,i,e.bl_tree)}while(0!=--a);else 0!==i?(i!==o&&(ql(e,i,e.bl_tree),a--),ql(e,16,e.bl_tree),Hl(e,a-3,2)):a<=10?(ql(e,17,e.bl_tree),Hl(e,a-3,3)):(ql(e,18,e.bl_tree),Hl(e,a-11,7));a=0,o=i,0===s?(u=138,l=3):i===s?(u=6,l=3):(u=7,l=4)}};let tc=!1;const rc=(e,t,r,n)=>{Hl(e,0+(n?1:0),3),Wl(e),Bl(e,r),Bl(e,~r),r&&e.pending_buf.set(e.window.subarray(t,t+r),e.pending),e.pending+=r};var nc=(e,t,r,n)=>{let i,o,s=0;e.level>0?(2===e.strm.data_type&&(e.strm.data_type=(e=>{let t,r=4093624447;for(t=0;t<=31;t++,r>>>=1)if(1&r&&0!==e.dyn_ltree[2*t])return 0;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return 1;for(t=32;t<Il;t++)if(0!==e.dyn_ltree[2*t])return 1;return 0})(e)),Xl(e,e.l_desc),Xl(e,e.d_desc),s=(e=>{let t;for($l(e,e.dyn_ltree,e.l_desc.max_code),$l(e,e.dyn_dtree,e.d_desc.max_code),Xl(e,e.bl_desc),t=18;t>=3&&0===e.bl_tree[2*Pl[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t})(e),i=e.opt_len+3+7>>>3,o=e.static_len+3+7>>>3,o<=i&&(i=o)):i=o=r+5,r+4<=i&&-1!==t?rc(e,t,r,n):4===e.strategy||o===i?(Hl(e,2+(n?1:0),3),Zl(e,Nl,wl)):(Hl(e,4+(n?1:0),3),((e,t,r,n)=>{let i;for(Hl(e,t-257,5),Hl(e,r-1,5),Hl(e,n-4,4),i=0;i<n;i++)Hl(e,e.bl_tree[2*Pl[i]+1],3);ec(e,e.dyn_ltree,t-1),ec(e,e.dyn_dtree,r-1)})(e,e.l_desc.max_code+1,e.d_desc.max_code+1,s+1),Zl(e,e.dyn_ltree,e.dyn_dtree)),Ql(e),n&&Wl(e)},ic={_tr_init:e=>{tc||((()=>{let e,t,r,n,i;const o=new Array(16);for(r=0,n=0;n<28;n++)for(Ul[n]=r,e=0;e<1<<Ol[n];e++)Ll[r++]=n;for(Ll[r-1]=n,i=0,n=0;n<16;n++)for(Dl[n]=i,e=0;e<1<<Sl[n];e++)Ml[i++]=n;for(i>>=7;n<Rl;n++)for(Dl[n]=i<<7,e=0;e<1<<Sl[n]-7;e++)Ml[256+i++]=n;for(t=0;t<=Cl;t++)o[t]=0;for(e=0;e<=143;)Nl[2*e+1]=8,e++,o[8]++;for(;e<=255;)Nl[2*e+1]=9,e++,o[9]++;for(;e<=279;)Nl[2*e+1]=7,e++,o[7]++;for(;e<=287;)Nl[2*e+1]=8,e++,o[8]++;for(Kl(Nl,287,o),e=0;e<Rl;e++)wl[2*e+1]=5,wl[2*e]=Yl(e,5);jl=new xl(Nl,Ol,257,Tl,Cl),Vl=new xl(wl,Sl,0,Rl,Cl),Gl=new xl(new Array(0),Al,0,19,7)})(),tc=!0),e.l_desc=new kl(e.dyn_ltree,jl),e.d_desc=new kl(e.dyn_dtree,Vl),e.bl_desc=new kl(e.bl_tree,Gl),e.bi_buf=0,e.bi_valid=0,Ql(e)},_tr_stored_block:rc,_tr_flush_block:nc,_tr_tally:(e,t,r)=>(e.pending_buf[e.sym_buf+e.sym_next++]=t,e.pending_buf[e.sym_buf+e.sym_next++]=t>>8,e.pending_buf[e.sym_buf+e.sym_next++]=r,0===t?e.dyn_ltree[2*r]++:(e.matches++,t--,e.dyn_ltree[2*(Ll[r]+Il+1)]++,e.dyn_dtree[2*Fl(t)]++),e.sym_next===e.sym_end),_tr_align:e=>{Hl(e,2,3),ql(e,256,Nl),(e=>{16===e.bi_valid?(Bl(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)})(e)}};var oc=(e,t,r,n)=>{let i=65535&e,o=e>>>16&65535,s=0;for(;0!==r;){s=r>2e3?2e3:r,r-=s;do{i=i+t[n++]|0,o=o+i|0}while(--s);i%=65521,o%=65521}return i|o<<16};const sc=new Uint32Array((()=>{let e,t=[];for(var r=0;r<256;r++){e=r;for(var n=0;n<8;n++)e=1&e?3988292384^e>>>1:e>>>1;t[r]=e}return t})());var ac=(e,t,r,n)=>{const i=sc,o=n+r;e^=-1;for(let r=n;r<o;r++)e=e>>>8^i[255&(e^t[r])];return~e},uc={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},lc={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8};const{_tr_init:cc,_tr_stored_block:dc,_tr_flush_block:pc,_tr_tally:fc,_tr_align:hc}=ic,{Z_NO_FLUSH:gc,Z_PARTIAL_FLUSH:_c,Z_FULL_FLUSH:bc,Z_FINISH:Ec,Z_BLOCK:vc,Z_OK:yc,Z_STREAM_END:mc,Z_STREAM_ERROR:Ic,Z_DATA_ERROR:Tc,Z_BUF_ERROR:Rc,Z_DEFAULT_COMPRESSION:Cc,Z_FILTERED:Oc,Z_HUFFMAN_ONLY:Sc,Z_RLE:Ac,Z_FIXED:Pc,Z_DEFAULT_STRATEGY:Nc,Z_UNKNOWN:wc,Z_DEFLATED:Mc}=lc,Lc=258,Uc=262,Dc=42,xc=113,jc=666,Vc=(e,t)=>(e.msg=uc[t],t),Gc=e=>2*e-(e>4?9:0),kc=e=>{let t=e.length;for(;--t>=0;)e[t]=0},Fc=e=>{let t,r,n,i=e.w_size;t=e.hash_size,n=t;do{r=e.head[--n],e.head[n]=r>=i?r-i:0}while(--t);t=i,n=t;do{r=e.prev[--n],e.prev[n]=r>=i?r-i:0}while(--t)};let Bc=(e,t,r)=>(t<<e.hash_shift^r)&e.hash_mask;const Hc=e=>{const t=e.state;let r=t.pending;r>e.avail_out&&(r=e.avail_out),0!==r&&(e.output.set(t.pending_buf.subarray(t.pending_out,t.pending_out+r),e.next_out),e.next_out+=r,t.pending_out+=r,e.total_out+=r,e.avail_out-=r,t.pending-=r,0===t.pending&&(t.pending_out=0))},qc=(e,t)=>{pc(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,Hc(e.strm)},Yc=(e,t)=>{e.pending_buf[e.pending++]=t},Kc=(e,t)=>{e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t},Qc=(e,t,r,n)=>{let i=e.avail_in;return i>n&&(i=n),0===i?0:(e.avail_in-=i,t.set(e.input.subarray(e.next_in,e.next_in+i),r),1===e.state.wrap?e.adler=oc(e.adler,t,i,r):2===e.state.wrap&&(e.adler=ac(e.adler,t,i,r)),e.next_in+=i,e.total_in+=i,i)},Wc=(e,t)=>{let r,n,i=e.max_chain_length,o=e.strstart,s=e.prev_length,a=e.nice_match;const u=e.strstart>e.w_size-Uc?e.strstart-(e.w_size-Uc):0,l=e.window,c=e.w_mask,d=e.prev,p=e.strstart+Lc;let f=l[o+s-1],h=l[o+s];e.prev_length>=e.good_match&&(i>>=2),a>e.lookahead&&(a=e.lookahead);do{if(r=t,l[r+s]===h&&l[r+s-1]===f&&l[r]===l[o]&&l[++r]===l[o+1]){o+=2,r++;do{}while(l[++o]===l[++r]&&l[++o]===l[++r]&&l[++o]===l[++r]&&l[++o]===l[++r]&&l[++o]===l[++r]&&l[++o]===l[++r]&&l[++o]===l[++r]&&l[++o]===l[++r]&&o<p);if(n=Lc-(p-o),o=p-Lc,n>s){if(e.match_start=t,s=n,n>=a)break;f=l[o+s-1],h=l[o+s]}}}while((t=d[t&c])>u&&0!=--i);return s<=e.lookahead?s:e.lookahead},Jc=e=>{const t=e.w_size;let r,n,i;do{if(n=e.window_size-e.lookahead-e.strstart,e.strstart>=t+(t-Uc)&&(e.window.set(e.window.subarray(t,t+t-n),0),e.match_start-=t,e.strstart-=t,e.block_start-=t,e.insert>e.strstart&&(e.insert=e.strstart),Fc(e),n+=t),0===e.strm.avail_in)break;if(r=Qc(e.strm,e.window,e.strstart+e.lookahead,n),e.lookahead+=r,e.lookahead+e.insert>=3)for(i=e.strstart-e.insert,e.ins_h=e.window[i],e.ins_h=Bc(e,e.ins_h,e.window[i+1]);e.insert&&(e.ins_h=Bc(e,e.ins_h,e.window[i+3-1]),e.prev[i&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=i,i++,e.insert--,!(e.lookahead+e.insert<3)););}while(e.lookahead<Uc&&0!==e.strm.avail_in)},zc=(e,t)=>{let r,n,i,o=e.pending_buf_size-5>e.w_size?e.w_size:e.pending_buf_size-5,s=0,a=e.strm.avail_in;do{if(r=65535,i=e.bi_valid+42>>3,e.strm.avail_out<i)break;if(i=e.strm.avail_out-i,n=e.strstart-e.block_start,r>n+e.strm.avail_in&&(r=n+e.strm.avail_in),r>i&&(r=i),r<o&&(0===r&&t!==Ec||t===gc||r!==n+e.strm.avail_in))break;s=t===Ec&&r===n+e.strm.avail_in?1:0,dc(e,0,0,s),e.pending_buf[e.pending-4]=r,e.pending_buf[e.pending-3]=r>>8,e.pending_buf[e.pending-2]=~r,e.pending_buf[e.pending-1]=~r>>8,Hc(e.strm),n&&(n>r&&(n=r),e.strm.output.set(e.window.subarray(e.block_start,e.block_start+n),e.strm.next_out),e.strm.next_out+=n,e.strm.avail_out-=n,e.strm.total_out+=n,e.block_start+=n,r-=n),r&&(Qc(e.strm,e.strm.output,e.strm.next_out,r),e.strm.next_out+=r,e.strm.avail_out-=r,e.strm.total_out+=r)}while(0===s);return a-=e.strm.avail_in,a&&(a>=e.w_size?(e.matches=2,e.window.set(e.strm.input.subarray(e.strm.next_in-e.w_size,e.strm.next_in),0),e.strstart=e.w_size,e.insert=e.strstart):(e.window_size-e.strstart<=a&&(e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,e.insert>e.strstart&&(e.insert=e.strstart)),e.window.set(e.strm.input.subarray(e.strm.next_in-a,e.strm.next_in),e.strstart),e.strstart+=a,e.insert+=a>e.w_size-e.insert?e.w_size-e.insert:a),e.block_start=e.strstart),e.high_water<e.strstart&&(e.high_water=e.strstart),s?4:t!==gc&&t!==Ec&&0===e.strm.avail_in&&e.strstart===e.block_start?2:(i=e.window_size-e.strstart,e.strm.avail_in>i&&e.block_start>=e.w_size&&(e.block_start-=e.w_size,e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,i+=e.w_size,e.insert>e.strstart&&(e.insert=e.strstart)),i>e.strm.avail_in&&(i=e.strm.avail_in),i&&(Qc(e.strm,e.window,e.strstart,i),e.strstart+=i,e.insert+=i>e.w_size-e.insert?e.w_size-e.insert:i),e.high_water<e.strstart&&(e.high_water=e.strstart),i=e.bi_valid+42>>3,i=e.pending_buf_size-i>65535?65535:e.pending_buf_size-i,o=i>e.w_size?e.w_size:i,n=e.strstart-e.block_start,(n>=o||(n||t===Ec)&&t!==gc&&0===e.strm.avail_in&&n<=i)&&(r=n>i?i:n,s=t===Ec&&0===e.strm.avail_in&&r===n?1:0,dc(e,e.block_start,r,s),e.block_start+=r,Hc(e.strm)),s?3:1)},Zc=(e,t)=>{let r,n;for(;;){if(e.lookahead<Uc){if(Jc(e),e.lookahead<Uc&&t===gc)return 1;if(0===e.lookahead)break}if(r=0,e.lookahead>=3&&(e.ins_h=Bc(e,e.ins_h,e.window[e.strstart+3-1]),r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),0!==r&&e.strstart-r<=e.w_size-Uc&&(e.match_length=Wc(e,r)),e.match_length>=3)if(n=fc(e,e.strstart-e.match_start,e.match_length-3),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=3){e.match_length--;do{e.strstart++,e.ins_h=Bc(e,e.ins_h,e.window[e.strstart+3-1]),r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart}while(0!=--e.match_length);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=Bc(e,e.ins_h,e.window[e.strstart+1]);else n=fc(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(n&&(qc(e,!1),0===e.strm.avail_out))return 1}return e.insert=e.strstart<2?e.strstart:2,t===Ec?(qc(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(qc(e,!1),0===e.strm.avail_out)?1:2},Xc=(e,t)=>{let r,n,i;for(;;){if(e.lookahead<Uc){if(Jc(e),e.lookahead<Uc&&t===gc)return 1;if(0===e.lookahead)break}if(r=0,e.lookahead>=3&&(e.ins_h=Bc(e,e.ins_h,e.window[e.strstart+3-1]),r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=2,0!==r&&e.prev_length<e.max_lazy_match&&e.strstart-r<=e.w_size-Uc&&(e.match_length=Wc(e,r),e.match_length<=5&&(e.strategy===Oc||3===e.match_length&&e.strstart-e.match_start>4096)&&(e.match_length=2)),e.prev_length>=3&&e.match_length<=e.prev_length){i=e.strstart+e.lookahead-3,n=fc(e,e.strstart-1-e.prev_match,e.prev_length-3),e.lookahead-=e.prev_length-1,e.prev_length-=2;do{++e.strstart<=i&&(e.ins_h=Bc(e,e.ins_h,e.window[e.strstart+3-1]),r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart)}while(0!=--e.prev_length);if(e.match_available=0,e.match_length=2,e.strstart++,n&&(qc(e,!1),0===e.strm.avail_out))return 1}else if(e.match_available){if(n=fc(e,0,e.window[e.strstart-1]),n&&qc(e,!1),e.strstart++,e.lookahead--,0===e.strm.avail_out)return 1}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(n=fc(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<2?e.strstart:2,t===Ec?(qc(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(qc(e,!1),0===e.strm.avail_out)?1:2};function $c(e,t,r,n,i){this.good_length=e,this.max_lazy=t,this.nice_length=r,this.max_chain=n,this.func=i}const ed=[new $c(0,0,0,0,zc),new $c(4,4,8,4,Zc),new $c(4,5,16,8,Zc),new $c(4,6,32,32,Zc),new $c(4,4,16,16,Xc),new $c(8,16,32,32,Xc),new $c(8,16,128,128,Xc),new $c(8,32,128,256,Xc),new $c(32,128,258,1024,Xc),new $c(32,258,258,4096,Xc)];function td(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=Mc,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(1146),this.dyn_dtree=new Uint16Array(122),this.bl_tree=new Uint16Array(78),kc(this.dyn_ltree),kc(this.dyn_dtree),kc(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(16),this.heap=new Uint16Array(573),kc(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),kc(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}const rd=e=>{if(!e)return 1;const t=e.state;return!t||t.strm!==e||t.status!==Dc&&57!==t.status&&69!==t.status&&73!==t.status&&91!==t.status&&103!==t.status&&t.status!==xc&&t.status!==jc?1:0},nd=e=>{if(rd(e))return Vc(e,Ic);e.total_in=e.total_out=0,e.data_type=wc;const t=e.state;return t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=2===t.wrap?57:t.wrap?Dc:xc,e.adler=2===t.wrap?0:1,t.last_flush=-2,cc(t),yc},id=e=>{const t=nd(e);var r;return t===yc&&((r=e.state).window_size=2*r.w_size,kc(r.head),r.max_lazy_match=ed[r.level].max_lazy,r.good_match=ed[r.level].good_length,r.nice_match=ed[r.level].nice_length,r.max_chain_length=ed[r.level].max_chain,r.strstart=0,r.block_start=0,r.lookahead=0,r.insert=0,r.match_length=r.prev_length=2,r.match_available=0,r.ins_h=0),t},od=(e,t,r,n,i,o)=>{if(!e)return Ic;let s=1;if(t===Cc&&(t=6),n<0?(s=0,n=-n):n>15&&(s=2,n-=16),i<1||i>9||r!==Mc||n<8||n>15||t<0||t>9||o<0||o>Pc||8===n&&1!==s)return Vc(e,Ic);8===n&&(n=9);const a=new td;return e.state=a,a.strm=e,a.status=Dc,a.wrap=s,a.gzhead=null,a.w_bits=n,a.w_size=1<<a.w_bits,a.w_mask=a.w_size-1,a.hash_bits=i+7,a.hash_size=1<<a.hash_bits,a.hash_mask=a.hash_size-1,a.hash_shift=~~((a.hash_bits+3-1)/3),a.window=new Uint8Array(2*a.w_size),a.head=new Uint16Array(a.hash_size),a.prev=new Uint16Array(a.w_size),a.lit_bufsize=1<<i+6,a.pending_buf_size=4*a.lit_bufsize,a.pending_buf=new Uint8Array(a.pending_buf_size),a.sym_buf=a.lit_bufsize,a.sym_end=3*(a.lit_bufsize-1),a.level=t,a.strategy=o,a.method=r,id(e)};var sd={deflateInit:(e,t)=>od(e,t,Mc,15,8,Nc),deflateInit2:od,deflateReset:id,deflateResetKeep:nd,deflateSetHeader:(e,t)=>rd(e)||2!==e.state.wrap?Ic:(e.state.gzhead=t,yc),deflate:(e,t)=>{if(rd(e)||t>vc||t<0)return e?Vc(e,Ic):Ic;const r=e.state;if(!e.output||0!==e.avail_in&&!e.input||r.status===jc&&t!==Ec)return Vc(e,0===e.avail_out?Rc:Ic);const n=r.last_flush;if(r.last_flush=t,0!==r.pending){if(Hc(e),0===e.avail_out)return r.last_flush=-1,yc}else if(0===e.avail_in&&Gc(t)<=Gc(n)&&t!==Ec)return Vc(e,Rc);if(r.status===jc&&0!==e.avail_in)return Vc(e,Rc);if(r.status===Dc&&0===r.wrap&&(r.status=xc),r.status===Dc){let t=Mc+(r.w_bits-8<<4)<<8,n=-1;if(n=r.strategy>=Sc||r.level<2?0:r.level<6?1:6===r.level?2:3,t|=n<<6,0!==r.strstart&&(t|=32),t+=31-t%31,Kc(r,t),0!==r.strstart&&(Kc(r,e.adler>>>16),Kc(r,65535&e.adler)),e.adler=1,r.status=xc,Hc(e),0!==r.pending)return r.last_flush=-1,yc}if(57===r.status)if(e.adler=0,Yc(r,31),Yc(r,139),Yc(r,8),r.gzhead)Yc(r,(r.gzhead.text?1:0)+(r.gzhead.hcrc?2:0)+(r.gzhead.extra?4:0)+(r.gzhead.name?8:0)+(r.gzhead.comment?16:0)),Yc(r,255&r.gzhead.time),Yc(r,r.gzhead.time>>8&255),Yc(r,r.gzhead.time>>16&255),Yc(r,r.gzhead.time>>24&255),Yc(r,9===r.level?2:r.strategy>=Sc||r.level<2?4:0),Yc(r,255&r.gzhead.os),r.gzhead.extra&&r.gzhead.extra.length&&(Yc(r,255&r.gzhead.extra.length),Yc(r,r.gzhead.extra.length>>8&255)),r.gzhead.hcrc&&(e.adler=ac(e.adler,r.pending_buf,r.pending,0)),r.gzindex=0,r.status=69;else if(Yc(r,0),Yc(r,0),Yc(r,0),Yc(r,0),Yc(r,0),Yc(r,9===r.level?2:r.strategy>=Sc||r.level<2?4:0),Yc(r,3),r.status=xc,Hc(e),0!==r.pending)return r.last_flush=-1,yc;if(69===r.status){if(r.gzhead.extra){let t=r.pending,n=(65535&r.gzhead.extra.length)-r.gzindex;for(;r.pending+n>r.pending_buf_size;){let i=r.pending_buf_size-r.pending;if(r.pending_buf.set(r.gzhead.extra.subarray(r.gzindex,r.gzindex+i),r.pending),r.pending=r.pending_buf_size,r.gzhead.hcrc&&r.pending>t&&(e.adler=ac(e.adler,r.pending_buf,r.pending-t,t)),r.gzindex+=i,Hc(e),0!==r.pending)return r.last_flush=-1,yc;t=0,n-=i}let i=new Uint8Array(r.gzhead.extra);r.pending_buf.set(i.subarray(r.gzindex,r.gzindex+n),r.pending),r.pending+=n,r.gzhead.hcrc&&r.pending>t&&(e.adler=ac(e.adler,r.pending_buf,r.pending-t,t)),r.gzindex=0}r.status=73}if(73===r.status){if(r.gzhead.name){let t,n=r.pending;do{if(r.pending===r.pending_buf_size){if(r.gzhead.hcrc&&r.pending>n&&(e.adler=ac(e.adler,r.pending_buf,r.pending-n,n)),Hc(e),0!==r.pending)return r.last_flush=-1,yc;n=0}t=r.gzindex<r.gzhead.name.length?255&r.gzhead.name.charCodeAt(r.gzindex++):0,Yc(r,t)}while(0!==t);r.gzhead.hcrc&&r.pending>n&&(e.adler=ac(e.adler,r.pending_buf,r.pending-n,n)),r.gzindex=0}r.status=91}if(91===r.status){if(r.gzhead.comment){let t,n=r.pending;do{if(r.pending===r.pending_buf_size){if(r.gzhead.hcrc&&r.pending>n&&(e.adler=ac(e.adler,r.pending_buf,r.pending-n,n)),Hc(e),0!==r.pending)return r.last_flush=-1,yc;n=0}t=r.gzindex<r.gzhead.comment.length?255&r.gzhead.comment.charCodeAt(r.gzindex++):0,Yc(r,t)}while(0!==t);r.gzhead.hcrc&&r.pending>n&&(e.adler=ac(e.adler,r.pending_buf,r.pending-n,n))}r.status=103}if(103===r.status){if(r.gzhead.hcrc){if(r.pending+2>r.pending_buf_size&&(Hc(e),0!==r.pending))return r.last_flush=-1,yc;Yc(r,255&e.adler),Yc(r,e.adler>>8&255),e.adler=0}if(r.status=xc,Hc(e),0!==r.pending)return r.last_flush=-1,yc}if(0!==e.avail_in||0!==r.lookahead||t!==gc&&r.status!==jc){let n=0===r.level?zc(r,t):r.strategy===Sc?((e,t)=>{let r;for(;;){if(0===e.lookahead&&(Jc(e),0===e.lookahead)){if(t===gc)return 1;break}if(e.match_length=0,r=fc(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,r&&(qc(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,t===Ec?(qc(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(qc(e,!1),0===e.strm.avail_out)?1:2})(r,t):r.strategy===Ac?((e,t)=>{let r,n,i,o;const s=e.window;for(;;){if(e.lookahead<=Lc){if(Jc(e),e.lookahead<=Lc&&t===gc)return 1;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=3&&e.strstart>0&&(i=e.strstart-1,n=s[i],n===s[++i]&&n===s[++i]&&n===s[++i])){o=e.strstart+Lc;do{}while(n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&i<o);e.match_length=Lc-(o-i),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=3?(r=fc(e,1,e.match_length-3),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(r=fc(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),r&&(qc(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,t===Ec?(qc(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(qc(e,!1),0===e.strm.avail_out)?1:2})(r,t):ed[r.level].func(r,t);if(3!==n&&4!==n||(r.status=jc),1===n||3===n)return 0===e.avail_out&&(r.last_flush=-1),yc;if(2===n&&(t===_c?hc(r):t!==vc&&(dc(r,0,0,!1),t===bc&&(kc(r.head),0===r.lookahead&&(r.strstart=0,r.block_start=0,r.insert=0))),Hc(e),0===e.avail_out))return r.last_flush=-1,yc}return t!==Ec?yc:r.wrap<=0?mc:(2===r.wrap?(Yc(r,255&e.adler),Yc(r,e.adler>>8&255),Yc(r,e.adler>>16&255),Yc(r,e.adler>>24&255),Yc(r,255&e.total_in),Yc(r,e.total_in>>8&255),Yc(r,e.total_in>>16&255),Yc(r,e.total_in>>24&255)):(Kc(r,e.adler>>>16),Kc(r,65535&e.adler)),Hc(e),r.wrap>0&&(r.wrap=-r.wrap),0!==r.pending?yc:mc)},deflateEnd:e=>{if(rd(e))return Ic;const t=e.state.status;return e.state=null,t===xc?Vc(e,Tc):yc},deflateSetDictionary:(e,t)=>{let r=t.length;if(rd(e))return Ic;const n=e.state,i=n.wrap;if(2===i||1===i&&n.status!==Dc||n.lookahead)return Ic;if(1===i&&(e.adler=oc(e.adler,t,r,0)),n.wrap=0,r>=n.w_size){0===i&&(kc(n.head),n.strstart=0,n.block_start=0,n.insert=0);let e=new Uint8Array(n.w_size);e.set(t.subarray(r-n.w_size,r),0),t=e,r=n.w_size}const o=e.avail_in,s=e.next_in,a=e.input;for(e.avail_in=r,e.next_in=0,e.input=t,Jc(n);n.lookahead>=3;){let e=n.strstart,t=n.lookahead-2;do{n.ins_h=Bc(n,n.ins_h,n.window[e+3-1]),n.prev[e&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=e,e++}while(--t);n.strstart=e,n.lookahead=2,Jc(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=2,n.match_available=0,e.next_in=s,e.input=a,e.avail_in=o,n.wrap=i,yc},deflateInfo:"pako deflate (from Nodeca project)"};const ad=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var ud={assign:function(e){const t=Array.prototype.slice.call(arguments,1);for(;t.length;){const r=t.shift();if(r){if("object"!=typeof r)throw new TypeError(r+"must be non-object");for(const t in r)ad(r,t)&&(e[t]=r[t])}}return e},flattenChunks:e=>{let t=0;for(let r=0,n=e.length;r<n;r++)t+=e[r].length;const r=new Uint8Array(t);for(let t=0,n=0,i=e.length;t<i;t++){let i=e[t];r.set(i,n),n+=i.length}return r}};let ld=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(e){ld=!1}const cd=new Uint8Array(256);for(let e=0;e<256;e++)cd[e]=e>=252?6:e>=248?5:e>=240?4:e>=224?3:e>=192?2:1;cd[254]=cd[254]=1;var dd={string2buf:e=>{if("function"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(e);let t,r,n,i,o,s=e.length,a=0;for(i=0;i<s;i++)r=e.charCodeAt(i),55296==(64512&r)&&i+1<s&&(n=e.charCodeAt(i+1),56320==(64512&n)&&(r=65536+(r-55296<<10)+(n-56320),i++)),a+=r<128?1:r<2048?2:r<65536?3:4;for(t=new Uint8Array(a),o=0,i=0;o<a;i++)r=e.charCodeAt(i),55296==(64512&r)&&i+1<s&&(n=e.charCodeAt(i+1),56320==(64512&n)&&(r=65536+(r-55296<<10)+(n-56320),i++)),r<128?t[o++]=r:r<2048?(t[o++]=192|r>>>6,t[o++]=128|63&r):r<65536?(t[o++]=224|r>>>12,t[o++]=128|r>>>6&63,t[o++]=128|63&r):(t[o++]=240|r>>>18,t[o++]=128|r>>>12&63,t[o++]=128|r>>>6&63,t[o++]=128|63&r);return t},buf2string:(e,t)=>{const r=t||e.length;if("function"==typeof TextDecoder&&TextDecoder.prototype.decode)return(new TextDecoder).decode(e.subarray(0,t));let n,i;const o=new Array(2*r);for(i=0,n=0;n<r;){let t=e[n++];if(t<128){o[i++]=t;continue}let s=cd[t];if(s>4)o[i++]=65533,n+=s-1;else{for(t&=2===s?31:3===s?15:7;s>1&&n<r;)t=t<<6|63&e[n++],s--;s>1?o[i++]=65533:t<65536?o[i++]=t:(t-=65536,o[i++]=55296|t>>10&1023,o[i++]=56320|1023&t)}}return((e,t)=>{if(t<65534&&e.subarray&&ld)return String.fromCharCode.apply(null,e.length===t?e:e.subarray(0,t));let r="";for(let n=0;n<t;n++)r+=String.fromCharCode(e[n]);return r})(o,i)},utf8border:(e,t)=>{(t=t||e.length)>e.length&&(t=e.length);let r=t-1;for(;r>=0&&128==(192&e[r]);)r--;return r<0||0===r?t:r+cd[e[r]]>t?r:t}};var pd=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0};const fd=Object.prototype.toString,{Z_NO_FLUSH:hd,Z_SYNC_FLUSH:gd,Z_FULL_FLUSH:_d,Z_FINISH:bd,Z_OK:Ed,Z_STREAM_END:vd,Z_DEFAULT_COMPRESSION:yd,Z_DEFAULT_STRATEGY:md,Z_DEFLATED:Id}=lc;function Td(e){this.options=ud.assign({level:yd,method:Id,chunkSize:16384,windowBits:15,memLevel:8,strategy:md},e||{});let t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new pd,this.strm.avail_out=0;let r=sd.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(r!==Ed)throw new Error(uc[r]);if(t.header&&sd.deflateSetHeader(this.strm,t.header),t.dictionary){let e;if(e="string"==typeof t.dictionary?dd.string2buf(t.dictionary):"[object ArrayBuffer]"===fd.call(t.dictionary)?new Uint8Array(t.dictionary):t.dictionary,r=sd.deflateSetDictionary(this.strm,e),r!==Ed)throw new Error(uc[r]);this._dict_set=!0}}Td.prototype.push=function(e,t){const r=this.strm,n=this.options.chunkSize;let i,o;if(this.ended)return!1;for(o=t===~~t?t:!0===t?bd:hd,"string"==typeof e?r.input=dd.string2buf(e):"[object ArrayBuffer]"===fd.call(e)?r.input=new Uint8Array(e):r.input=e,r.next_in=0,r.avail_in=r.input.length;;)if(0===r.avail_out&&(r.output=new Uint8Array(n),r.next_out=0,r.avail_out=n),(o===gd||o===_d)&&r.avail_out<=6)this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;else{if(i=sd.deflate(r,o),i===vd)return r.next_out>0&&this.onData(r.output.subarray(0,r.next_out)),i=sd.deflateEnd(this.strm),this.onEnd(i),this.ended=!0,i===Ed;if(0!==r.avail_out){if(o>0&&r.next_out>0)this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;else if(0===r.avail_in)break}else this.onData(r.output)}return!0},Td.prototype.onData=function(e){this.chunks.push(e)},Td.prototype.onEnd=function(e){e===Ed&&(this.result=ud.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};const Rd=16209;var Cd=function(e,t){let r,n,i,o,s,a,u,l,c,d,p,f,h,g,_,b,E,v,y,m,I,T,R,C;const O=e.state;r=e.next_in,R=e.input,n=r+(e.avail_in-5),i=e.next_out,C=e.output,o=i-(t-e.avail_out),s=i+(e.avail_out-257),a=O.dmax,u=O.wsize,l=O.whave,c=O.wnext,d=O.window,p=O.hold,f=O.bits,h=O.lencode,g=O.distcode,_=(1<<O.lenbits)-1,b=(1<<O.distbits)-1;e:do{f<15&&(p+=R[r++]<<f,f+=8,p+=R[r++]<<f,f+=8),E=h[p&_];t:for(;;){if(v=E>>>24,p>>>=v,f-=v,v=E>>>16&255,0===v)C[i++]=65535&E;else{if(!(16&v)){if(64&v){if(32&v){O.mode=16191;break e}e.msg="invalid literal/length code",O.mode=Rd;break e}E=h[(65535&E)+(p&(1<<v)-1)];continue t}for(y=65535&E,v&=15,v&&(f<v&&(p+=R[r++]<<f,f+=8),y+=p&(1<<v)-1,p>>>=v,f-=v),f<15&&(p+=R[r++]<<f,f+=8,p+=R[r++]<<f,f+=8),E=g[p&b];;){if(v=E>>>24,p>>>=v,f-=v,v=E>>>16&255,16&v){if(m=65535&E,v&=15,f<v&&(p+=R[r++]<<f,f+=8,f<v&&(p+=R[r++]<<f,f+=8)),m+=p&(1<<v)-1,m>a){e.msg="invalid distance too far back",O.mode=Rd;break e}if(p>>>=v,f-=v,v=i-o,m>v){if(v=m-v,v>l&&O.sane){e.msg="invalid distance too far back",O.mode=Rd;break e}if(I=0,T=d,0===c){if(I+=u-v,v<y){y-=v;do{C[i++]=d[I++]}while(--v);I=i-m,T=C}}else if(c<v){if(I+=u+c-v,v-=c,v<y){y-=v;do{C[i++]=d[I++]}while(--v);if(I=0,c<y){v=c,y-=v;do{C[i++]=d[I++]}while(--v);I=i-m,T=C}}}else if(I+=c-v,v<y){y-=v;do{C[i++]=d[I++]}while(--v);I=i-m,T=C}for(;y>2;)C[i++]=T[I++],C[i++]=T[I++],C[i++]=T[I++],y-=3;y&&(C[i++]=T[I++],y>1&&(C[i++]=T[I++]))}else{I=i-m;do{C[i++]=C[I++],C[i++]=C[I++],C[i++]=C[I++],y-=3}while(y>2);y&&(C[i++]=C[I++],y>1&&(C[i++]=C[I++]))}break}if(64&v){e.msg="invalid distance code",O.mode=Rd;break e}E=g[(65535&E)+(p&(1<<v)-1)]}}break}}while(r<n&&i<s);y=f>>3,r-=y,f-=y<<3,p&=(1<<f)-1,e.next_in=r,e.next_out=i,e.avail_in=r<n?n-r+5:5-(r-n),e.avail_out=i<s?s-i+257:257-(i-s),O.hold=p,O.bits=f};const Od=15,Sd=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),Ad=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),Pd=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),Nd=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]);var wd=(e,t,r,n,i,o,s,a)=>{const u=a.bits;let l,c,d,p,f,h,g=0,_=0,b=0,E=0,v=0,y=0,m=0,I=0,T=0,R=0,C=null;const O=new Uint16Array(16),S=new Uint16Array(16);let A,P,N,w=null;for(g=0;g<=Od;g++)O[g]=0;for(_=0;_<n;_++)O[t[r+_]]++;for(v=u,E=Od;E>=1&&0===O[E];E--);if(v>E&&(v=E),0===E)return i[o++]=20971520,i[o++]=20971520,a.bits=1,0;for(b=1;b<E&&0===O[b];b++);for(v<b&&(v=b),I=1,g=1;g<=Od;g++)if(I<<=1,I-=O[g],I<0)return-1;if(I>0&&(0===e||1!==E))return-1;for(S[1]=0,g=1;g<Od;g++)S[g+1]=S[g]+O[g];for(_=0;_<n;_++)0!==t[r+_]&&(s[S[t[r+_]]++]=_);if(0===e?(C=w=s,h=20):1===e?(C=Sd,w=Ad,h=257):(C=Pd,w=Nd,h=0),R=0,_=0,g=b,f=o,y=v,m=0,d=-1,T=1<<v,p=T-1,1===e&&T>852||2===e&&T>592)return 1;for(;;){A=g-m,s[_]+1<h?(P=0,N=s[_]):s[_]>=h?(P=w[s[_]-h],N=C[s[_]-h]):(P=96,N=0),l=1<<g-m,c=1<<y,b=c;do{c-=l,i[f+(R>>m)+c]=A<<24|P<<16|N}while(0!==c);for(l=1<<g-1;R&l;)l>>=1;if(0!==l?(R&=l-1,R+=l):R=0,_++,0==--O[g]){if(g===E)break;g=t[r+s[_]]}if(g>v&&(R&p)!==d){for(0===m&&(m=v),f+=b,y=g-m,I=1<<y;y+m<E&&(I-=O[y+m],!(I<=0));)y++,I<<=1;if(T+=1<<y,1===e&&T>852||2===e&&T>592)return 1;d=R&p,i[d]=v<<24|y<<16|f-o}}return 0!==R&&(i[f+R]=g-m<<24|64<<16),a.bits=v,0};const{Z_FINISH:Md,Z_BLOCK:Ld,Z_TREES:Ud,Z_OK:Dd,Z_STREAM_END:xd,Z_NEED_DICT:Vd,Z_STREAM_ERROR:Gd,Z_DATA_ERROR:kd,Z_MEM_ERROR:Fd,Z_BUF_ERROR:Bd,Z_DEFLATED:Hd}=lc,qd=16180,Yd=16190,Kd=16191,Qd=16192,Wd=16194,Jd=16199,zd=16200,Zd=16206,Xd=16209,$d=e=>(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24);function ep(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const tp=e=>{if(!e)return 1;const t=e.state;return!t||t.strm!==e||t.mode<qd||t.mode>16211?1:0},rp=e=>{if(tp(e))return Gd;const t=e.state;return e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=qd,t.last=0,t.havedict=0,t.flags=-1,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new Int32Array(852),t.distcode=t.distdyn=new Int32Array(592),t.sane=1,t.back=-1,Dd},np=e=>{if(tp(e))return Gd;const t=e.state;return t.wsize=0,t.whave=0,t.wnext=0,rp(e)},ip=(e,t)=>{let r;if(tp(e))return Gd;const n=e.state;return t<0?(r=0,t=-t):(r=5+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?Gd:(null!==n.window&&n.wbits!==t&&(n.window=null),n.wrap=r,n.wbits=t,np(e))},op=(e,t)=>{if(!e)return Gd;const r=new ep;e.state=r,r.strm=e,r.window=null,r.mode=qd;const n=ip(e,t);return n!==Dd&&(e.state=null),n};let sp,ap,up=!0;const lp=e=>{if(up){sp=new Int32Array(512),ap=new Int32Array(32);let t=0;for(;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(wd(1,e.lens,0,288,sp,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;wd(2,e.lens,0,32,ap,0,e.work,{bits:5}),up=!1}e.lencode=sp,e.lenbits=9,e.distcode=ap,e.distbits=5},cp=(e,t,r,n)=>{let i;const o=e.state;return null===o.window&&(o.wsize=1<<o.wbits,o.wnext=0,o.whave=0,o.window=new Uint8Array(o.wsize)),n>=o.wsize?(o.window.set(t.subarray(r-o.wsize,r),0),o.wnext=0,o.whave=o.wsize):(i=o.wsize-o.wnext,i>n&&(i=n),o.window.set(t.subarray(r-n,r-n+i),o.wnext),(n-=i)?(o.window.set(t.subarray(r-n,r),0),o.wnext=n,o.whave=o.wsize):(o.wnext+=i,o.wnext===o.wsize&&(o.wnext=0),o.whave<o.wsize&&(o.whave+=i))),0};var dp={inflateReset:np,inflateReset2:ip,inflateResetKeep:rp,inflateInit:e=>op(e,15),inflateInit2:op,inflate:(e,t)=>{let r,n,i,o,s,a,u,l,c,d,p,f,h,g,_,b,E,v,y,m,I,T,R=0;const C=new Uint8Array(4);let O,S;const A=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(tp(e)||!e.output||!e.input&&0!==e.avail_in)return Gd;r=e.state,r.mode===Kd&&(r.mode=Qd),s=e.next_out,i=e.output,u=e.avail_out,o=e.next_in,n=e.input,a=e.avail_in,l=r.hold,c=r.bits,d=a,p=u,T=Dd;e:for(;;)switch(r.mode){case qd:if(0===r.wrap){r.mode=Qd;break}for(;c<16;){if(0===a)break e;a--,l+=n[o++]<<c,c+=8}if(2&r.wrap&&35615===l){0===r.wbits&&(r.wbits=15),r.check=0,C[0]=255&l,C[1]=l>>>8&255,r.check=ac(r.check,C,2,0),l=0,c=0,r.mode=16181;break}if(r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&l)<<8)+(l>>8))%31){e.msg="incorrect header check",r.mode=Xd;break}if((15&l)!==Hd){e.msg="unknown compression method",r.mode=Xd;break}if(l>>>=4,c-=4,I=8+(15&l),0===r.wbits&&(r.wbits=I),I>15||I>r.wbits){e.msg="invalid window size",r.mode=Xd;break}r.dmax=1<<r.wbits,r.flags=0,e.adler=r.check=1,r.mode=512&l?16189:Kd,l=0,c=0;break;case 16181:for(;c<16;){if(0===a)break e;a--,l+=n[o++]<<c,c+=8}if(r.flags=l,(255&r.flags)!==Hd){e.msg="unknown compression method",r.mode=Xd;break}if(57344&r.flags){e.msg="unknown header flags set",r.mode=Xd;break}r.head&&(r.head.text=l>>8&1),512&r.flags&&4&r.wrap&&(C[0]=255&l,C[1]=l>>>8&255,r.check=ac(r.check,C,2,0)),l=0,c=0,r.mode=16182;case 16182:for(;c<32;){if(0===a)break e;a--,l+=n[o++]<<c,c+=8}r.head&&(r.head.time=l),512&r.flags&&4&r.wrap&&(C[0]=255&l,C[1]=l>>>8&255,C[2]=l>>>16&255,C[3]=l>>>24&255,r.check=ac(r.check,C,4,0)),l=0,c=0,r.mode=16183;case 16183:for(;c<16;){if(0===a)break e;a--,l+=n[o++]<<c,c+=8}r.head&&(r.head.xflags=255&l,r.head.os=l>>8),512&r.flags&&4&r.wrap&&(C[0]=255&l,C[1]=l>>>8&255,r.check=ac(r.check,C,2,0)),l=0,c=0,r.mode=16184;case 16184:if(1024&r.flags){for(;c<16;){if(0===a)break e;a--,l+=n[o++]<<c,c+=8}r.length=l,r.head&&(r.head.extra_len=l),512&r.flags&&4&r.wrap&&(C[0]=255&l,C[1]=l>>>8&255,r.check=ac(r.check,C,2,0)),l=0,c=0}else r.head&&(r.head.extra=null);r.mode=16185;case 16185:if(1024&r.flags&&(f=r.length,f>a&&(f=a),f&&(r.head&&(I=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Uint8Array(r.head.extra_len)),r.head.extra.set(n.subarray(o,o+f),I)),512&r.flags&&4&r.wrap&&(r.check=ac(r.check,n,f,o)),a-=f,o+=f,r.length-=f),r.length))break e;r.length=0,r.mode=16186;case 16186:if(2048&r.flags){if(0===a)break e;f=0;do{I=n[o+f++],r.head&&I&&r.length<65536&&(r.head.name+=String.fromCharCode(I))}while(I&&f<a);if(512&r.flags&&4&r.wrap&&(r.check=ac(r.check,n,f,o)),a-=f,o+=f,I)break e}else r.head&&(r.head.name=null);r.length=0,r.mode=16187;case 16187:if(4096&r.flags){if(0===a)break e;f=0;do{I=n[o+f++],r.head&&I&&r.length<65536&&(r.head.comment+=String.fromCharCode(I))}while(I&&f<a);if(512&r.flags&&4&r.wrap&&(r.check=ac(r.check,n,f,o)),a-=f,o+=f,I)break e}else r.head&&(r.head.comment=null);r.mode=16188;case 16188:if(512&r.flags){for(;c<16;){if(0===a)break e;a--,l+=n[o++]<<c,c+=8}if(4&r.wrap&&l!==(65535&r.check)){e.msg="header crc mismatch",r.mode=Xd;break}l=0,c=0}r.head&&(r.head.hcrc=r.flags>>9&1,r.head.done=!0),e.adler=r.check=0,r.mode=Kd;break;case 16189:for(;c<32;){if(0===a)break e;a--,l+=n[o++]<<c,c+=8}e.adler=r.check=$d(l),l=0,c=0,r.mode=Yd;case Yd:if(0===r.havedict)return e.next_out=s,e.avail_out=u,e.next_in=o,e.avail_in=a,r.hold=l,r.bits=c,Vd;e.adler=r.check=1,r.mode=Kd;case Kd:if(t===Ld||t===Ud)break e;case Qd:if(r.last){l>>>=7&c,c-=7&c,r.mode=Zd;break}for(;c<3;){if(0===a)break e;a--,l+=n[o++]<<c,c+=8}switch(r.last=1&l,l>>>=1,c-=1,3&l){case 0:r.mode=16193;break;case 1:if(lp(r),r.mode=Jd,t===Ud){l>>>=2,c-=2;break e}break;case 2:r.mode=16196;break;case 3:e.msg="invalid block type",r.mode=Xd}l>>>=2,c-=2;break;case 16193:for(l>>>=7&c,c-=7&c;c<32;){if(0===a)break e;a--,l+=n[o++]<<c,c+=8}if((65535&l)!=(l>>>16^65535)){e.msg="invalid stored block lengths",r.mode=Xd;break}if(r.length=65535&l,l=0,c=0,r.mode=Wd,t===Ud)break e;case Wd:r.mode=16195;case 16195:if(f=r.length,f){if(f>a&&(f=a),f>u&&(f=u),0===f)break e;i.set(n.subarray(o,o+f),s),a-=f,o+=f,u-=f,s+=f,r.length-=f;break}r.mode=Kd;break;case 16196:for(;c<14;){if(0===a)break e;a--,l+=n[o++]<<c,c+=8}if(r.nlen=257+(31&l),l>>>=5,c-=5,r.ndist=1+(31&l),l>>>=5,c-=5,r.ncode=4+(15&l),l>>>=4,c-=4,r.nlen>286||r.ndist>30){e.msg="too many length or distance symbols",r.mode=Xd;break}r.have=0,r.mode=16197;case 16197:for(;r.have<r.ncode;){for(;c<3;){if(0===a)break e;a--,l+=n[o++]<<c,c+=8}r.lens[A[r.have++]]=7&l,l>>>=3,c-=3}for(;r.have<19;)r.lens[A[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,O={bits:r.lenbits},T=wd(0,r.lens,0,19,r.lencode,0,r.work,O),r.lenbits=O.bits,T){e.msg="invalid code lengths set",r.mode=Xd;break}r.have=0,r.mode=16198;case 16198:for(;r.have<r.nlen+r.ndist;){for(;R=r.lencode[l&(1<<r.lenbits)-1],_=R>>>24,b=R>>>16&255,E=65535&R,!(_<=c);){if(0===a)break e;a--,l+=n[o++]<<c,c+=8}if(E<16)l>>>=_,c-=_,r.lens[r.have++]=E;else{if(16===E){for(S=_+2;c<S;){if(0===a)break e;a--,l+=n[o++]<<c,c+=8}if(l>>>=_,c-=_,0===r.have){e.msg="invalid bit length repeat",r.mode=Xd;break}I=r.lens[r.have-1],f=3+(3&l),l>>>=2,c-=2}else if(17===E){for(S=_+3;c<S;){if(0===a)break e;a--,l+=n[o++]<<c,c+=8}l>>>=_,c-=_,I=0,f=3+(7&l),l>>>=3,c-=3}else{for(S=_+7;c<S;){if(0===a)break e;a--,l+=n[o++]<<c,c+=8}l>>>=_,c-=_,I=0,f=11+(127&l),l>>>=7,c-=7}if(r.have+f>r.nlen+r.ndist){e.msg="invalid bit length repeat",r.mode=Xd;break}for(;f--;)r.lens[r.have++]=I}}if(r.mode===Xd)break;if(0===r.lens[256]){e.msg="invalid code -- missing end-of-block",r.mode=Xd;break}if(r.lenbits=9,O={bits:r.lenbits},T=wd(1,r.lens,0,r.nlen,r.lencode,0,r.work,O),r.lenbits=O.bits,T){e.msg="invalid literal/lengths set",r.mode=Xd;break}if(r.distbits=6,r.distcode=r.distdyn,O={bits:r.distbits},T=wd(2,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,O),r.distbits=O.bits,T){e.msg="invalid distances set",r.mode=Xd;break}if(r.mode=Jd,t===Ud)break e;case Jd:r.mode=zd;case zd:if(a>=6&&u>=258){e.next_out=s,e.avail_out=u,e.next_in=o,e.avail_in=a,r.hold=l,r.bits=c,Cd(e,p),s=e.next_out,i=e.output,u=e.avail_out,o=e.next_in,n=e.input,a=e.avail_in,l=r.hold,c=r.bits,r.mode===Kd&&(r.back=-1);break}for(r.back=0;R=r.lencode[l&(1<<r.lenbits)-1],_=R>>>24,b=R>>>16&255,E=65535&R,!(_<=c);){if(0===a)break e;a--,l+=n[o++]<<c,c+=8}if(b&&!(240&b)){for(v=_,y=b,m=E;R=r.lencode[m+((l&(1<<v+y)-1)>>v)],_=R>>>24,b=R>>>16&255,E=65535&R,!(v+_<=c);){if(0===a)break e;a--,l+=n[o++]<<c,c+=8}l>>>=v,c-=v,r.back+=v}if(l>>>=_,c-=_,r.back+=_,r.length=E,0===b){r.mode=16205;break}if(32&b){r.back=-1,r.mode=Kd;break}if(64&b){e.msg="invalid literal/length code",r.mode=Xd;break}r.extra=15&b,r.mode=16201;case 16201:if(r.extra){for(S=r.extra;c<S;){if(0===a)break e;a--,l+=n[o++]<<c,c+=8}r.length+=l&(1<<r.extra)-1,l>>>=r.extra,c-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=16202;case 16202:for(;R=r.distcode[l&(1<<r.distbits)-1],_=R>>>24,b=R>>>16&255,E=65535&R,!(_<=c);){if(0===a)break e;a--,l+=n[o++]<<c,c+=8}if(!(240&b)){for(v=_,y=b,m=E;R=r.distcode[m+((l&(1<<v+y)-1)>>v)],_=R>>>24,b=R>>>16&255,E=65535&R,!(v+_<=c);){if(0===a)break e;a--,l+=n[o++]<<c,c+=8}l>>>=v,c-=v,r.back+=v}if(l>>>=_,c-=_,r.back+=_,64&b){e.msg="invalid distance code",r.mode=Xd;break}r.offset=E,r.extra=15&b,r.mode=16203;case 16203:if(r.extra){for(S=r.extra;c<S;){if(0===a)break e;a--,l+=n[o++]<<c,c+=8}r.offset+=l&(1<<r.extra)-1,l>>>=r.extra,c-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){e.msg="invalid distance too far back",r.mode=Xd;break}r.mode=16204;case 16204:if(0===u)break e;if(f=p-u,r.offset>f){if(f=r.offset-f,f>r.whave&&r.sane){e.msg="invalid distance too far back",r.mode=Xd;break}f>r.wnext?(f-=r.wnext,h=r.wsize-f):h=r.wnext-f,f>r.length&&(f=r.length),g=r.window}else g=i,h=s-r.offset,f=r.length;f>u&&(f=u),u-=f,r.length-=f;do{i[s++]=g[h++]}while(--f);0===r.length&&(r.mode=zd);break;case 16205:if(0===u)break e;i[s++]=r.length,u--,r.mode=zd;break;case Zd:if(r.wrap){for(;c<32;){if(0===a)break e;a--,l|=n[o++]<<c,c+=8}if(p-=u,e.total_out+=p,r.total+=p,4&r.wrap&&p&&(e.adler=r.check=r.flags?ac(r.check,i,p,s-p):oc(r.check,i,p,s-p)),p=u,4&r.wrap&&(r.flags?l:$d(l))!==r.check){e.msg="incorrect data check",r.mode=Xd;break}l=0,c=0}r.mode=16207;case 16207:if(r.wrap&&r.flags){for(;c<32;){if(0===a)break e;a--,l+=n[o++]<<c,c+=8}if(4&r.wrap&&l!==(4294967295&r.total)){e.msg="incorrect length check",r.mode=Xd;break}l=0,c=0}r.mode=16208;case 16208:T=xd;break e;case Xd:T=kd;break e;case 16210:return Fd;default:return Gd}return e.next_out=s,e.avail_out=u,e.next_in=o,e.avail_in=a,r.hold=l,r.bits=c,(r.wsize||p!==e.avail_out&&r.mode<Xd&&(r.mode<Zd||t!==Md))&&cp(e,e.output,e.next_out,p-e.avail_out),d-=e.avail_in,p-=e.avail_out,e.total_in+=d,e.total_out+=p,r.total+=p,4&r.wrap&&p&&(e.adler=r.check=r.flags?ac(r.check,i,p,e.next_out-p):oc(r.check,i,p,e.next_out-p)),e.data_type=r.bits+(r.last?64:0)+(r.mode===Kd?128:0)+(r.mode===Jd||r.mode===Wd?256:0),(0===d&&0===p||t===Md)&&T===Dd&&(T=Bd),T},inflateEnd:e=>{if(tp(e))return Gd;let t=e.state;return t.window&&(t.window=null),e.state=null,Dd},inflateGetHeader:(e,t)=>{if(tp(e))return Gd;const r=e.state;return 2&r.wrap?(r.head=t,t.done=!1,Dd):Gd},inflateSetDictionary:(e,t)=>{const r=t.length;let n,i,o;return tp(e)?Gd:(n=e.state,0!==n.wrap&&n.mode!==Yd?Gd:n.mode===Yd&&(i=1,i=oc(i,t,r,0),i!==n.check)?kd:(o=cp(e,t,r,r),o?(n.mode=16210,Fd):(n.havedict=1,Dd)))},inflateInfo:"pako inflate (from Nodeca project)"};var pp=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1};const fp=Object.prototype.toString,{Z_NO_FLUSH:hp,Z_FINISH:gp,Z_OK:_p,Z_STREAM_END:bp,Z_NEED_DICT:Ep,Z_STREAM_ERROR:vp,Z_DATA_ERROR:yp,Z_MEM_ERROR:mp}=lc;function Ip(e){this.options=ud.assign({chunkSize:65536,windowBits:15,to:""},e||{});const t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits&&(t.windowBits=-15)),!(t.windowBits>=0&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&(15&t.windowBits||(t.windowBits|=15)),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new pd,this.strm.avail_out=0;let r=dp.inflateInit2(this.strm,t.windowBits);if(r!==_p)throw new Error(uc[r]);if(this.header=new pp,dp.inflateGetHeader(this.strm,this.header),t.dictionary&&("string"==typeof t.dictionary?t.dictionary=dd.string2buf(t.dictionary):"[object ArrayBuffer]"===fp.call(t.dictionary)&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(r=dp.inflateSetDictionary(this.strm,t.dictionary),r!==_p)))throw new Error(uc[r])}function Tp(e,t){const r=new Ip(t);if(r.push(e),r.err)throw r.msg||uc[r.err];return r.result}Ip.prototype.push=function(e,t){const r=this.strm,n=this.options.chunkSize,i=this.options.dictionary;let o,s,a;if(this.ended)return!1;for(s=t===~~t?t:!0===t?gp:hp,"[object ArrayBuffer]"===fp.call(e)?r.input=new Uint8Array(e):r.input=e,r.next_in=0,r.avail_in=r.input.length;;){for(0===r.avail_out&&(r.output=new Uint8Array(n),r.next_out=0,r.avail_out=n),o=dp.inflate(r,s),o===Ep&&i&&(o=dp.inflateSetDictionary(r,i),o===_p?o=dp.inflate(r,s):o===yp&&(o=Ep));r.avail_in>0&&o===bp&&r.state.wrap>0&&0!==e[r.next_in];)dp.inflateReset(r),o=dp.inflate(r,s);switch(o){case vp:case yp:case Ep:case mp:return this.onEnd(o),this.ended=!0,!1}if(a=r.avail_out,r.next_out&&(0===r.avail_out||o===bp))if("string"===this.options.to){let e=dd.utf8border(r.output,r.next_out),t=r.next_out-e,i=dd.buf2string(r.output,e);r.next_out=t,r.avail_out=n-t,t&&r.output.set(r.output.subarray(e,e+t),0),this.onData(i)}else this.onData(r.output.length===r.next_out?r.output:r.output.subarray(0,r.next_out));if(o!==_p||0!==a){if(o===bp)return o=dp.inflateEnd(this.strm),this.onEnd(o),this.ended=!0,!0;if(0===r.avail_in)break}}return!0},Ip.prototype.onData=function(e){this.chunks.push(e)},Ip.prototype.onEnd=function(e){e===_p&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=ud.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};var Rp={Inflate:Ip,inflate:Tp,inflateRaw:function(e,t){return(t=t||{}).raw=!0,Tp(e,t)},ungzip:Tp,constants:lc};const{Inflate:Cp,inflate:Op,inflateRaw:Sp,ungzip:Ap}=Rp;var Pp,Np,wp,Mp,Lp=Ap,Up=((Pp={})[Wn]=exports.ErrorCode.RC_DISCONN_KICK,Pp[Jn]=exports.ErrorCode.RC_DISCONN_EXCEPTION,Pp[Zn]=exports.ErrorCode.RC_DISCONN_EXCEPTION,Pp[Xn]=exports.ErrorCode.RC_CONN_REDIRECTED,Pp[$n]=exports.ErrorCode.RC_CONN_TOKEN_EXPIRED,Pp[ei]=exports.ErrorCode.RC_CONN_PROTO_VERSION_ERROR,Pp[ti]=exports.ErrorCode.RC_ACCOUNT_CANCELLATION,Pp),Dp=((Np={})[Sn]=exports.ErrorCode.SUCCESS,Np[An]=exports.ErrorCode.RC_CONN_PROTO_VERSION_ERROR,Np[Pn]=exports.ErrorCode.RC_CONN_IDENTIFIER_REJECTED,Np[Nn]=exports.ErrorCode.RC_CONN_SERVER_UNAVAILABLE,Np[wn]=exports.ErrorCode.RC_CONN_TOKEN_INCORRECT,Np[Mn]=exports.ErrorCode.RC_CONN_NOT_AUTHRORIZED,Np[Ln]=exports.ErrorCode.RC_CONN_REDIRECTED,Np[Un]=exports.ErrorCode.RC_CONN_PACKAGE_NAME_INVALID,Np[Dn]=exports.ErrorCode.RC_CONN_APP_BLOCKED_OR_DELETED,Np[xn]=exports.ErrorCode.RC_CONN_USER_BLOCKED,Np[jn]=exports.ErrorCode.RC_CONN_TOKEN_EXPIRED,Np[Vn]=exports.ErrorCode.RC_CONN_DEVICE_ERROR,Np[Gn]=exports.ErrorCode.RC_CONN_HOSTNAME_ERROR,Np[kn]=exports.ErrorCode.RC_DISCONN_SAME_CLIENT_ON_LINE,Np[Fn]=exports.ErrorCode.RC_LISCENSE_COUNT_OUT_OF_LIMIT,Np[Bn]=exports.ErrorCode.RC_CONN_WRONG_CLUSTER,Np[Hn]=exports.ErrorCode.RC_APP_AUTH_NOT_PASS,Np[qn]=exports.ErrorCode.RC_OTP_USED,Np[Yn]=exports.ErrorCode.RC_PLATFORM_ERROR,Np[Kn]=exports.ErrorCode.RC_ACCOUNT_CANCELLATION,Np[Qn]=exports.ErrorCode.RC_LICENSE_EXPIRED,Np),xp=function(e){return[Zr.ppMsgS,Zr.pgMsgS,Zr.chatMsgS,Zr.prMsgS].includes(e)},jp=function(e,t){var r=0;return e.isAutoDelete&&(r|=1),e.isOverwrite&&(r|=2),2===t&&(r|=4),r},Vp={1:"ChannelsUserInfos",2:"ChannelsInviteStatusInfos",3:"ChannelsJoinedInfos",11:"FriendUserInfos",12:"FriendInviteInfos"},Gp=((wp={})[M.GROUP_OPERATION]=function(e){return"ChannelEventData"},wp[M.GROUP_PROFILE_CHANGE]=function(e){return"ChannelEventData"},wp[v.FRIEND_APPLICATION]=function(e){return{0:"FriendApplyEvent",1:"FriendApplyEvent",2:"FriendUserInfo",3:"FriendsInput",5:"FriendTypeChangeEvent",6:"FriendUpdateEvent"}[e]},wp),kp=function(){function e(e){Object.defineProperty(this,"logger",{enumerable:!0,configurable:!0,writable:!0,value:e})}return Object.defineProperty(e.prototype,"decodeByPBName",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n,i=this,o=e,s=((n={})[Fo]=i._formatHistoryMessages,n[Lo]=i._formatConversationList,n[Go]=i._formatChatRoomInfos,n[es]=i._formatChatRoomKVList,n[ms]=i._formatGrpReadReceiptQryResp,n[qs]=i._formatQueryReceiptResp,n[xs]=i._formatUltraOperateStatusNotifyList,n[Us]=i._formatUltraMsgList,n[Do]=i._formatUltraGroupUnreadMentionedList,n[Po]=i._formatChrmKVVersion,n[ba]=i._formateChannelsListResult,n)[t];try{o=e.length>0&&Za.decode(t,e),Nt(s)&&(o=s.call(this,o,r))}catch(e){this.logger.error(H.L_PB_DECODE_E,t)}return o}}),Object.defineProperty(e.prototype,"_formatJSONContent",{enumerable:!1,configurable:!0,writable:!0,value:function(e){try{return JSON.parse(e)}catch(t){return this.logger.error(H.L_PARSE_JSON_E,e),e}}}),Object.defineProperty(e.prototype,"_getUtfContent",{enumerable:!1,configurable:!0,writable:!0,value:function(e){if(e.user){var t=e.user,r=t.portrait,n=t.portraitUri,i=r||n;i&&(e.user.portrait=e.user.portraitUri=i)}return e}}),Object.defineProperty(e.prototype,"_setExpansion",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t;return e&&(t=function(e){var t={},r=JSON.parse(e);return ou(r,(function(e,r){t[r]=e.v})),t}(e)),t}}),Object.defineProperty(e.prototype,"_formatReceivedMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){if(!e)return e;var r=this,n=t||{},i=n.currentUserId,o=n.connectedTime,s=n.afterDecode,a=e.content,u=e.fromUserId,l=e.type,c=e.groupId,d=e.status,p=e.dataTime,f=e.extraContent,h=e.extStatus,g=e.clientUniqueId,_=e.busChannel,b=e.msgId,E=e.classname,v=e.toUserIds,y=e.optionBits,m=e.direction||exports.MessageDirection.RECEIVE,I=function(e){var t=exports.ReceivedStatus.READ;return{isPersited:!!(16&e),isCounted:!!(32&e),isMentioned:!!(64&e),disableNotification:!!(512&e),receivedStatus:t=2&e?exports.ReceivedStatus.RETRIEVED:t,canIncludeExpansion:!!(1024&e)}}(d),T=I.isPersited,R=I.isCounted,C=I.isMentioned,O=I.disableNotification,S=I.receivedStatus,A=I.canIncludeExpansion,P=!!(2&(h||0)),N=!!(4&(h||0)),w=!!(64&(h||0)),M=!!(8&(h||0))?exports.UltraGroupChannelType.PRIVATE:exports.UltraGroupChannelType.PUBLIC,L=[exports.ConversationType.GROUP,exports.ConversationType.CHATROOM,exports.ConversationType.RTC_ROOM,exports.ConversationType.ULTRA_GROUP].indexOf(l)>-1?c:u,U=u,D=exports.MessageDirection.RECEIVE;m===exports.MessageDirection.SEND&&(U=i,D=exports.MessageDirection.SEND);var x=kt(p),j=x<o,V=l===exports.ConversationType.CHATROOM,G=r._setExpansion(f),k=r._formatJSONContent(a);k=r._getUtfContent(k);var F=or(e.configFlag,e.pushContent,e.pushExt);V&&u===i&&(D=exports.MessageDirection.SEND);var B={conversationType:l,targetId:L,senderUserId:U,messageType:E,messageUId:b,isPersited:T,isCounted:R,isMentioned:C,sentTime:x,messageDirection:D,receivedTime:Date.now(),disableNotification:O,receivedStatus:S,receivedStatusInfo:Bt(S),canIncludeExpansion:A,content:k,expansion:G,pushConfig:F,channelId:_||"",isInterrupt:P,isModifyMessage:N,messageId:kt(g)||0,sentStatus:exports.SentStatus.SENT,isOffLineMessage:j,channelType:M,isStatusMessage:w,readReceiptInfo:void 0,directedUserIds:v,disableUpdateLastMessage:!!(1&(y||0)),needReceipt:!!(2&(y||0)),sendReceipt:!!(4&(y||0))||void 0};return(null==s?void 0:s(B))||B}}),Object.defineProperty(e.prototype,"_formatHistoryMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this,n=e.list,i=e.hasMsg,o=e.compressedData;if(e.compressioEnabled){var s=Lp(o),a=Za.decode(Fo,s);return this._formatHistoryMessages(a,t)}var u=t.conversation||{},l=u.targetId,c=kt(e.syncTime),d=[];return ou(n,(function(e){var n=r._formatReceivedMessage(e,t);u.conversationType===exports.ConversationType.ULTRA_GROUP?n.targetId=e.groupId||u.targetId:n.targetId=l,d.push(n)}),{isReverse:!0}),{syncTime:c,list:d,hasMore:!!i}}}),Object.defineProperty(e.prototype,"formatEventChangeList",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;return e.map((function(e){var r,n=e.businessId,i=e.time,o=e.changeType,s=e.originalId,a=e.originalTime,u=e.secondaryId,l=e.isAdmin,c=e.additionalMark,d=e.operatorId,p=e.subChangeType,f=e.secondaryType,h=e.remindType,g=e.isRemindMe,_=e.extIds,b=e.eventData;return b&&(r=t._formatEventData(b,o,p)),{businessId:n,changeType:o,originalId:s,time:kt(i),originalTime:kt(a),secondaryId:u||"",isAdmin:l,additionalMark:c,operatorId:d,subChangeType:p,userGroupIds:_,secondaryType:f,remindType:h,isRemindMe:g,eventData:r}}))}}),Object.defineProperty(e.prototype,"_formatEventData",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n={};return e&&Gp[t]&&Gp[t](r)&&(n=Za.decode(Gp[t](r),e)||{}),n}}),Object.defineProperty(e.prototype,"_formatUltraOperateStatusNotifyList",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.type,r=e.notifyType,n=e.info,i=e.summary,o=[],s=[],a=!(2&~r),u=!(1&~r);return u&&Array.isArray(n)&&n.forEach((function(e){var t=e.targetId,r=e.busChannel,n=e.userId,i=e.opType,s=e.optime,a=kt(s);o.push({targetId:t,channelId:r,userId:n,operationType:i,operationTime:a})})),a&&Array.isArray(i)&&i.forEach((function(e){var t=e.targetId,r=e.busChannel,n=e.count,i=e.opType;s.push({targetId:t,channelId:r,count:n,operationType:i})})),{conversationType:t,info:o,summary:s,hasInfo:u,hasSummary:a}}}),Object.defineProperty(e.prototype,"_formatUltraMsgList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this,n=e.list;return{list:n&&n.map((function(e){return r._formatReceivedMessage(e,t)}))}}}),Object.defineProperty(e.prototype,"_formatUltraGroupUnreadMentionedList",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.msgInfo;return(void 0===t?[]:t).map((function(e){return{messageUId:e.msgId,sentTime:kt(e.msgTime),mentionedType:e.remindType,messageType:e.className||""}}))}}),Object.defineProperty(e.prototype,"_getUltraGroupConversationInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=t.versionTime,n=t.unreadCount,i=t.remindCount,o=t.busChannelType,s=t.msgInfo,a=t.remindMeCount;return e.versionTime=kt(r)||0,e.unreadMessageCount=this._getUnreadCount(kt(n)||0),e.unreadMentionedCount=this._getUnreadCount(kt(i)||0),e.unreadMentionedMeCount=this._getUnreadCount(kt(a)||0),e.channelType=o||exports.UltraGroupChannelType.PUBLIC,e.lastReadTime=0,s&&(e.firstUnreadMessage={sentTime:kt(s.msgTime)},e.lastReadTime=kt(s.msgTime)-1),e}}),Object.defineProperty(e.prototype,"_getUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return e>999?999:e}}),Object.defineProperty(e.prototype,"_formatConversationList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this,n=this,i=e.info,o=e.compressedData;if(e.compressioEnabled){var s=Lp(o),a=Za.decode(Lo,s);return this._formatConversationList(a,t)}var u=t.afterDecode,l={list:(i=su(i,(function(e){var i=e.msg,o=e.userId,s=e.type,a=e.unreadCount,l=e.busChannel,c=e.versionTime,d=null;i&&((d=n._formatReceivedMessage(i,t)).targetId=o);var p={targetId:o,conversationType:s,unreadMessageCount:kt(a)||0,latestMessage:d,channelId:l||"",operationTime:kt(c)||0};return s===exports.ConversationType.ULTRA_GROUP&&(p=r._getUltraGroupConversationInfo(p,e)),(null==u?void 0:u(p))||p})))||[]};return((null==t?void 0:t.conversationType)||exports.ConversationType.NONE)===exports.ConversationType.ULTRA_GROUP&&(l.isFinished=e.isFinished),l}}),Object.defineProperty(e.prototype,"_formatChatRoomInfos",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.userTotalNums,r=e.userInfos;return{userCount:t,userInfos:su(r,(function(e){var t=e.id,r=e.time;return{id:t,time:kt(r)}}))}}}),Object.defineProperty(e.prototype,"_formatChatRoomKVList",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.entries,r=e.bFullUpdate,n=e.syncTime,i=e.compressedData;if(e.compressioEnabled){var o=Lp(i),s=Za.decode(es,o);return this._formatChatRoomKVList(s)}return t=su(t=t||[],(function(e){var t=e.key,r=e.value,n=e.status,i=e.timestamp,o=e.uid,s=e.version,a=function(e){return{isAutoDelete:!!(1&e),isOverwrite:!!(2&e),type:4&e?exports.ChatroomEntryType.DELETE:exports.ChatroomEntryType.UPDATE}}(n);return{key:t,value:r,isAutoDelete:a.isAutoDelete,isOverwrite:a.isOverwrite,type:a.type,userId:o,timestamp:kt(i),version:kt(s)}})),{kvEntries:t,isFullUpdate:r,syncTime:n}}}),Object.defineProperty(e.prototype,"_formatGrpReadReceiptQryResp",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.totalMemberNum,r=e.list;return r.forEach((function(e){e.readTime=kt(e.readTime)})),{totalMemberCount:t,list:r}}}),Object.defineProperty(e.prototype,"_formatQueryReceiptResp",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.list,r=void 0===t?[]:t,n=e.num,i=e.readCnt;return{list:r.map((function(e){return{readTime:kt(e.receiptTime),userId:e.userId}})),totalCount:n,readCount:i}}}),Object.defineProperty(e.prototype,"_formatChrmKVVersion",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.joinTime,r=e.createTime,n=e.memberCount,i=e.chatroomBanState;return{joinTime:t,createTime:r||0,memberCount:n||0,isAllChatroomBanned:!!(1&i),isCurrentUserBanned:!!(2&i),isCurrentChatroomBanned:!!(4&i),isCurrentChatroomInWhitelist:!!(1&e.whiteListState)}}}),Object.defineProperty(e.prototype,"_formateChannelsListResult",{enumerable:!1,configurable:!0,writable:!0,value:function(e){if(!e)return{result:{list:[]}};var t=e.listType,r=e.result,n=e.page;return r?{listType:t,result:Za.decode(Vp[t],r)||[],page:n}:{listType:t,result:{list:[]},page:n}}}),Object.defineProperty(e.prototype,"_calculateFlag",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.isFilerWhiteBlacklist,r=e.isVoipPush,n=e.pushConfig||{},i=0;return i|=r?1:0,i|=t?2:0,i|=n.disablePushTitle?4:0,i|=n.forceShowDetailContent?8:0}}),Object.defineProperty(e.prototype,"_getPushExtraModule",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.pushTitle,r=e.iOSConfig,n=e.androidConfig,i=e.templateId,o=void 0===i?"":i,s=e.harmonyOSConfig,a=Za.getModule(yo);if(t&&a.setTitle(t),r||n||s){var u=function(e,t,r){void 0===e&&(e={}),void 0===t&&(t={}),void 0===r&&(r={});var n=t.channelIdMi,i=t.channelIdHW,o=t.channelIdOPPO,s=t.typeVivo,a=t.importanceHW,u=t.categoryHW,l=t.imageUrlHW,c=t.categoryVivo,d=t.importanceHonor,p=t.imageUrlHonor,f=function(e,t){void 0===e&&(e={}),void 0===t&&(t={});var r=e.threadId,n=e.apnsCollapseId,i=e.category,o=e.richMediaUri,s=e.interruptionLevel,a=t.googleConfig,u={};u["thread-id"]=r||"",u["apns-collapse-id"]=n||"",u.category=i||"",u.richMediaUri=o||"",u["interruption-level"]=s||"active";var l={};l.collapse_key=null==a?void 0:a.collapseKey,l.imageUrl=null==a?void 0:a.imageUrl;var c=null==a?void 0:a.priority;return c&&!["high","normal"].includes(c)&&(c="normal"),l.priority=c,{APNS:u,FCM:l}}(e,t),h=[{HW:{channelId:i||"",importance:a||"NORMAL",image:l||"",category:u||""}},{MI:{channelId:n||""}},{OPPO:{channelId:o||""}},{VIVO:{classification:s||"",category:c||""}},{APNS:f.APNS},{FCM:f.FCM},{HONOR:{importance:d||exports.PushImportanceHonor.NORMAL,image:p||""}},{OHOS:{category:r.category||null,image:r.image||""}}];return JSON.stringify(h)}(r,n,s);a.setPushConfigs(u)}return(null==n?void 0:n.notificationId)&&a.setPushId(null==n?void 0:n.notificationId),a.setTemplateId(o),a}}),Object.defineProperty(e.prototype,"_getUpMsgModule",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=t.messageType,n=t.content,i=t.directionalUserIdList,o=t.canIncludeExpansion,s=t.expansion,a=t.pushConfig,u=t.channelId,l=t.pushData,c=void 0===l?"":l,d=t.pushContent,p=void 0===d?"":d,f=t.messageId,h=void 0===f?0:f,g=t.disableUpdateLastMessage,_=void 0!==g&&g,b=t.isPersited,E=t.needReceipt,v=e.conversationType,y=e.targetId,m=Za.getModule(vo),I=function(e){var t=e.isStatusMessage,r=e.isPersited,n=e.isCounted;t&&(r=n=!1);var i=0;return r&&(i|=1),n&&(i|=2),e.isMentioned&&(i|=4),e.disableNotification&&(i|=32),e.canIncludeExpansion&&(i|=64),i}(t),T=a||{},R=T.pushContent,C=void 0===R?p:R,O=T.pushData,S=void 0===O?c:O;m.setSessionId(I),C&&m.setPushText(C),S&&m.setAppData(S),i&&m.setToUserIds(i);var A=this._calculateFlag(t);if(m.setConfigFlag(A),m.setClassname(r),n.user&&n.user.portraitUri&&(n.user.portrait=n.user.portraitUri),m.setContent(JSON.stringify(n)),o&&s){var P={};ou(s,(function(e,t){P[t]={v:e}})),m.setExtraContent(JSON.stringify(P))}if(a){var N=this._getPushExtraModule(a);m.setPushExt(N)}m.setClientUniqueId(h),m.setIsResend(h>0),wt(u)||m.setBusChannel(u),v===exports.ConversationType.SYSTEM&&m.setSystemId(y);var w=0;return b&&_&&(w|=1),E&&(w|=2),m.setOptionBits(w),m}}),Object.defineProperty(e.prototype,"encodeUpMsg",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return this._getUpMsgModule(e,t).toArrayBuffer()}}),Object.defineProperty(e.prototype,"encodeGetHistoryMsg",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=t.count,n=t.order,i=t.timestamp,o=t.channelId,s=Za.getModule(ko);return s.setTargetId(e),s.setTime(i),s.setCount(r),s.setOrder(n),s.setBusChannel(o||""),s.setCompressioEnabled(Zu.enable()),s.toArrayBuffer()}}),Object.defineProperty(e.prototype,"encodeOldConversationList",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=(e=e||{}).count,r=e.type,n=e.startTime,i=e.order;t=t||0,n=n||0,i=i||0;var o=Za.getModule(wo);return o.setType(r),o.setCount(t),o.setStartTime(n),o.setOrder(i),o.setCompressioEnabled(Zu.enable()),o.toArrayBuffer()}}),Object.defineProperty(e.prototype,"encodeBatchDeleteConversation",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=Za.getModule(Jo),r=[];return e.forEach((function(e){var t=e.conversationType,n=e.targetId,i=e.channelId,o=Za.getModule(zo);o.setConversationType(t),o.setConversationId(n),o.setBusChannel(i||""),r.push(o)})),t.setRelation(r),t.toArrayBuffer()}}),Object.defineProperty(e.prototype,"_encodeSessions",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return e.map((function(e){var t=e.conversationType,r=e.targetId,n=Za.getModule(Ko);return n.setType(t),n.setChannelId(r),n}))}}),Object.defineProperty(e.prototype,"encodeRemoveConversationList",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=Za.getModule(Yo);return t.setSessions(this._encodeSessions(e)),t.toArrayBuffer()}}),Object.defineProperty(e.prototype,"encodeBatchClearRemoteMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=Za.getModule(jo),r=e.map((function(e){var t=Za.getModule(xo);return t.setTargetId(e.targetId),t.setConversationType(e.conversationType),t.setBusChannel(e.channelId),t.setDataTime(e.timestamp),t}));return t.setInput(r),t.toArrayBuffer()}}),Object.defineProperty(e.prototype,"encodeExpandUltraMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=e.targetId,n=e.conversationType,i=e.channelId,o=e.messageUId,s=e.sendTime,a=e.keys,u={mid:o,put:e.expansion,del:a,clear:e.removeAll?1:0},l=Za.getModule(Ps);return l.setFromUserId(t),l.setTargetId(r),l.setType(n),l.setBusChannel(i||""),l.setMsgUID(o),l.setMsgTime(s),l.setContent(JSON.stringify(u)),l.toArrayBuffer()}}),Object.defineProperty(e.prototype,"encodemodifyMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=e.targetId,n=e.conversationType,i=e.channelId,o=e.messageUId,s=e.sendTime,a=e.content,u=Za.getModule(Ps);return u.setFromUserId(t),u.setTargetId(r),u.setType(n),u.setBusChannel(i||""),u.setMsgUID(o),u.setMsgTime(s),u.setContent(JSON.stringify(a)),u.toArrayBuffer()}}),Object.defineProperty(e.prototype,"encodeQueryMsgChange",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=Za.getModule(Ns);return t.setSyncTime(e),t.toArrayBuffer()}}),Object.defineProperty(e.prototype,"encodeMsgQuery",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.targetId,r=e.conversationType,n=e.messages,i=Za.getModule(Ls),o=n.map((function(e){return{msgTime:e.sendTime,msgUID:e.messageUId,busChannel:e.channelId}}));return i.setTargetId(t),i.setType(r),i.setQuery(o),i.toArrayBuffer()}}),Object.defineProperty(e.prototype,"encodeUnreadMentionedMsgQuery",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.targetId,r=e.channelId,n=e.sentTime,i=e.count,o=Za.getModule(Uo);return o.setGroupId(t),o.setBusChannel(r),o.setMsgTime(n),o.setSize(i),o.toArrayBuffer()}}),Object.defineProperty(e.prototype,"encodeOperateStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){var i=Za.getModule(Ds);return i.setTargetId(e),i.setType(t),i.setBusChannel(r),i.setOpType(n),i.toArrayBuffer()}}),Object.defineProperty(e.prototype,"encodeSetUltraGroupDefaultNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=Za.getModule(ps);return r.setUnpushLevel(e),r.setBusChannel(t),r.toArrayBuffer()}}),Object.defineProperty(e.prototype,"encodeGetUltraGroupDefaultNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=Za.getModule(ds);return t.setBusChannel(e),t.toArrayBuffer()}}),Object.defineProperty(e.prototype,"encodeModifyChatRoomKV",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n=Za.getModule(Xo),i=t.key,o=t.value,s=t.notificationExtra,a=t.isSendNotification,u=t.type,l=t.timestamp,c=u||exports.ChatroomEntryType.UPDATE,d=jp(t,c),p={key:i,value:o||"",uid:r,version:l};if(wt(d)||(p.status=d),n.setEntry(p),a){var f={conversationType:exports.ConversationType.CHATROOM,targetId:e},h={key:i,value:o,extra:s,type:c},g=this._getUpMsgModule(f,{messageType:exports.MessageType.CHRM_KV_NOTIFY,content:h,isPersited:!1,isCounted:!1});n.setNotification(g),n.setBNotify(!0),n.setType(exports.ConversationType.CHATROOM)}return n.toArrayBuffer()}}),Object.defineProperty(e.prototype,"encodeModifyChatRoomKVS",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n=Za.getModule($o),i=t.entries,o=t.type||exports.ChatroomEntryType.UPDATE,s=jp(t,o),a=[];return i.forEach((function(e){var t={key:e.key,value:e.value||"",uid:r,version:e.timestamp};wt(s)||(t.status=s),a.push(t)})),n.setEntry(a),n.toArrayBuffer()}}),Object.defineProperty(e.prototype,"encodePullChatRoomKV",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return Za.encode(rs,{timestamp:e,compressioEnabled:Zu.enable()})}}),Object.defineProperty(e.prototype,"encodeReadReceipt",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=Za.getModule(bs);return r.setMsgId(e),t&&r.setChannelId(t),r.toArrayBuffer()}}),Object.defineProperty(e.prototype,"encodeCreateTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=Za.getModule(Is),n=[];return e.forEach((function(e){var t=Za.getModule(Ts);t.setTagId(e.tagId),t.setName(e.tagName),n.push(t)})),r.setTags(n),r.setVersion(t),r.toArrayBuffer()}}),Object.defineProperty(e.prototype,"encodeMessageReader",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=Za.getModule(bs);return r.setMsgId(e),t&&r.setChannelId(t),r.toArrayBuffer()}}),Object.defineProperty(e.prototype,"encodeReadReceiptMsg",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n=Za.getModule(Bs),i=e.conversationType,o=e.targetId,s=e.channelId,a=void 0===s?"":s;return n.setType(i),n.setTargetId(o),n.setBusChannel(a),n.setStartMsgId(t),n.setEndMsgId(r),n.toArrayBuffer()}}),Object.defineProperty(e.prototype,"encodeReceiptQryReq",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=Za.getModule(Hs),n=e.targetId,i=e.channelId,o=void 0===i?"":i;return r.setTargetId(n),r.setBusChannel(o),r.setMsgId(t),r.toArrayBuffer()}}),Object.defineProperty(e.prototype,"encodeReceiptCntQryReq",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=Za.getModule(Ys),n=e.targetId,i=e.conversationType,o=e.channelId,s=void 0===o?"":o;return r.setChannelId(n),r.setBusChannel(s),r.setType(i),r.setMsgId(t),r.toArrayBuffer()}}),Object.defineProperty(e.prototype,"encodeRemoveTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=Za.getModule(Rs),n=[];return e.forEach((function(e){var t=Za.getModule(Ts);t.setTagId(e),n.push(t)})),r.setTags(n),r.setVersion(t),r.toArrayBuffer()}}),Object.defineProperty(e.prototype,"encodeUpdateConversationTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n=Za.getModule(cs),i=[];return t.forEach((function(t){var r=Za.getModule(us),n=Za.getModule(ls),o=[];e.forEach((function(e){var t=Za.getModule(Ts);t.setTagId(e.tagId),wt(e.isTop)||t.setIsTop(e.isTop),o.push(t)})),n.setSessionStateType(3),n.setValue(JSON.stringify(o)),n.setTags(o),r.setType(t.conversationType),r.setChannelId(t.targetId),r.setTime(Date.now()),r.setStateItem([n]),i.push(r)})),n.setState(i),n.setVersion(r),n.toArrayBuffer()}}),Object.defineProperty(e.prototype,"encodeUpdateUserSubReq",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){var i=Za.getModule(Qs);i.setSubType(e),i.setOpType(r),i.setExpiry(n);var o=[];return t.forEach((function(e){var t=Za.getModule(Ws);t.setSubUserId(e),o.push(t)})),i.setSubUsers(o),i.toArrayBuffer()}}),Object.defineProperty(e.prototype,"encodePullUserSubReq",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.version,r=e.pageToken,n=Za.getModule(zs);return n.setVersion(t),n.setPageToken(r),n.toArrayBuffer()}}),Object.defineProperty(e.prototype,"encodePullSubDataReq",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.version,r=e.needAllData,n=e.pageToken,i=Za.getModule(Xs);return i.setVersionTime(t),i.setNeedAllData(r),i.setPageToken(n),i.toArrayBuffer()}}),Object.defineProperty(e.prototype,"encodeQrySubDataReq",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=Za.getModule(ta);r.setSubType(e);var n=[];return t.forEach((function(e){var t=Za.getModule(Ws);t.setSubUserId(e),n.push(t)})),r.setSubUsers(n),r.toArrayBuffer()}}),Object.defineProperty(e.prototype,"encodePullUserProfileReq",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=Za.getModule(oa);return t.setUserId(e),t.toArrayBuffer()}}),Object.defineProperty(e.prototype,"encodeUserProfileInput",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=Za.getModule(aa);return e.setNothing(1),e.toArrayBuffer()}}),Object.defineProperty(e.prototype,"encodeUserProfilePermission",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=Za.getModule(ua);return t.setPermission(e),t.toArrayBuffer()}}),Object.defineProperty(e.prototype,"encodeSearchUserProfile",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=Za.getModule(la);return t.setUniqueId(e),t.toArrayBuffer()}}),Object.defineProperty(e.prototype,"encodeUserProfile",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=Za.getModule(ra),r=[],n=[];return Object.keys(e).forEach((function(t){if("extraProfile"!==t){var i=e[t],o=Za.getModule(na);o.setKey(t),o.setValue((null==i?void 0:i.toString())||""),r.push(o)}else if(e.extraProfile){var s=e.extraProfile;Object.keys(s).forEach((function(e){var t=s[e],r=Za.getModule(na);r.setKey(e),r.setValue(t.toString()||""),n.push(r)}))}})),t.setUserProfile(r),t.setUserExtProfile(n),t.toArrayBuffer()}}),Object.defineProperty(e.prototype,"encodeMultiChannels",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=Za.getModule(pa),r=[];return e.forEach((function(e){var t=Za.getModule(ca);t.setTargetId(e),r.push(t)})),t.setType(exports.ConversationType.GROUP),t.setList(r),t.toArrayBuffer()}}),Object.defineProperty(e.prototype,"encodeQuitGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){void 0===r&&(r=[]),void 0===n&&(n=!0);var o=Za.getModule(fa);if(o.setTargetId(t),o.setType(exports.ConversationType.GROUP),"dismiss"!==e&&i){var s=this.encodeQuitChannelsSetting(i,n);o.setSettingInfo(s)}return"quit"!==e&&"dismiss"!==e&&o.setUsers(r),o.toArrayBuffer()}}),Object.defineProperty(e.prototype,"encodeQuitChannelsSetting",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=Za.getModule(ha);return r.setIsQuit(t),r.setIsDelBan(!!(null==e?void 0:e.removeMuteStatus)),r.setIsDelWhite(!!(null==e?void 0:e.removeWhiteList)),r.setIsDelAttention(!!(null==e?void 0:e.removeFollow)),r}}),Object.defineProperty(e.prototype,"encodeModifyChannelsInput",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n=Za.getModule(fa);return n.setTargetId(t),n.setType(exports.ConversationType.GROUP),n.setUsers(r),n.setOperateType(e),n.toArrayBuffer()}}),Object.defineProperty(e.prototype,"encodeChannelsQueryInput",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.type,r=e.groupId,n=e.option,i=e.ids,o=Za.getModule(ga);if(r&&o.setTargetId(r),o.setType(exports.ConversationType.GROUP),["getGroupMembersByRole","getGroupApplications","getJoinedGroupsByRole"].includes(t)&&n){var s=this.encodePagingQuery(n);o.setPage(s)}return["getGroupMembers","getJoinedGroups"].includes(t)&&o.setIds(null!=i?i:[]),e.roleType&&o.setRoleType(e.roleType),o.toArrayBuffer()}}),Object.defineProperty(e.prototype,"encodePagingQuery",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=Za.getModule(_a),r=e.count,n=e.order,i=e.pageToken;return t.setSize(r),t.setOrder(n?0:1),t.setPageToken(i),t}}),Object.defineProperty(e.prototype,"encodeJoinGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){void 0===r&&(r=[]);var n=Za.getModule(Ta);return n.setTargetId(t),n.setType(exports.ConversationType.GROUP),"invite"===e&&n.setUserIds(r),n.toArrayBuffer()}}),Object.defineProperty(e.prototype,"encodeMemberResponseInput",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.groupId,r=e.inviterId,n=e.optType,i=e.optResult,o=e.joinUserId,s=e.reason,a=Za.getModule(Ia);return a.setTargetId(t),a.setType(exports.ConversationType.GROUP),a.setOptType(n),a.setOptResult(i),a.setInviterId(r),n===exports.GroupOperationRole.MANAGER&&a.setJoinUserId(o),i||a.setDetail(null!=s?s:""),a.toArrayBuffer()}}),Object.defineProperty(e.prototype,"encodeSetGroupRemark",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=Za.getModule(ma),n=exports.GroupOperationType.ADD;return r.setTargetId(e),r.setType(exports.ConversationType.GROUP),t||(n=exports.GroupOperationType.REMOVE),r.setOperateType(n),r.setChannelNickName(t),r.toArrayBuffer()}}),Object.defineProperty(e.prototype,"encodeSetGroupFollows",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n=Za.getModule(fa);return n.setTargetId(t),n.setType(exports.ConversationType.GROUP),n.setUsers(r),n.setOperateType(e),n.toArrayBuffer()}}),Object.defineProperty(e.prototype,"encodeFriendInput",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=Za.getModule(Ra);return t.setTargetId(e.targetId),e.type&&t.setType(e.type),e.info&&t.setInfo(e.info),t.toArrayBuffer()}}),Object.defineProperty(e.prototype,"encodeFriendsInput",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return Za.encode(Ca,{targetId:e,type:t})}}),Object.defineProperty(e.prototype,"encodeFriendQueryInput",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n=null!=t?t:{},i=n.count,o=void 0===i?200:i,s=n.pageToken,a=void 0===s?"":s,u=n.order,l=void 0!==u&&u,c=Za.getModule(Pa);c.setQueryType(e),11===e&&c.setFriendType(r);var d=Za.getModule(_a);return d.setSize(o),d.setOrder(l?0:1),d.setPageToken(a),c.setPage(d),c.toArrayBuffer()}}),Object.defineProperty(e.prototype,"encodeQuerySessionsInput",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=Za.getModule(Qo);return t.setSessions(this._encodeSessions(e)),t.toArrayBuffer()}}),e}(),Fp=function(e){function r(t,r,n){var i=e.call(this,t,r,n)||this;return Object.defineProperty(i,"_socket",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(i,"_connectedTime",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(i,"_socketIndex",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(i,"_serverSessionId",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(i,"_localConnectedTime",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(i,"codec",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(i,"_idCount",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(i,"_generateMessageId",{enumerable:!0,configurable:!0,writable:!0,value:function(){return i._idCount>=65535&&(i._idCount=0),++i._idCount}}),Object.defineProperty(i,"_pingResolve",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(i,"_messageIds",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(i,"_syncMessageIds",{enumerable:!0,configurable:!0,writable:!0,value:{}}),i.codec=new kp(i.logger),i}return t(r,e),Object.defineProperty(r.prototype,"getConnectedTime",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._connectedTime}}),Object.defineProperty(r.prototype,"getLocalConnectedTime",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._localConnectedTime}}),Object.defineProperty(r.prototype,"getCrtServerTime",{enumerable:!1,configurable:!0,writable:!0,value:function(){return Date.now()-this._localConnectedTime+this._connectedTime}}),Object.defineProperty(r.prototype,"getDelayTime",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._localConnectedTime-this._connectedTime}}),Object.defineProperty(r.prototype,"_connectWithToken",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return o(this,void 0,void 0,(function(){var r,i,o,a,u,l,c,d,p,f;return s(this,(function(h){switch(h.label){case 0:if(r=t.openAnti,i=t.type,o=t.baggageEnabled,a=this.getCmpList(t),this.logger.debug(H.L_NAVI_CMP_R,JSON.stringify(a),n),0===(u=a.filter((function(e,t){return a.findIndex((function(t){return t.addr===e.addr}))===t})).sort((function(e,t){return e.weight>t.weight?-1:1}))).length)return this.logger.error(H.L_NAVI_CONF_E,"no service available",n),[2,gt(exports.ErrorCode.SERVER_UNAVAILABLE)];l=1===r?tn.V4:tn.V3,c=function(t){var r,a,c,p,f,h,g,_,b,E,v;return s(this,(function(s){switch(s.label){case 0:return r=u[t],a=r.protocol,c=r.addr,p=r.weight,f=function(e,t,r,n,i,o,s,a){var u,l=s?"&protocolVer=".concat(s):"",c=Fu(),d=Hu();return"".concat(e,"://").concat(t,"/websocket?appId=").concat(r,"&token=").concat(encodeURIComponent(n),"&sdkVer=").concat(je,"&pid=").concat(o,"&deviceId=").concat(encodeURIComponent(c)).concat(1===a?"&baggage=".concat(encodeURIComponent("cid=".concat(i))):"","&apiVer=").concat(encodeURIComponent((null===(u=lo.getApiVer)||void 0===u?void 0:u.call(lo))||"||")).concat(lo.connectPlatform?"&platform=".concat(lo.connectPlatform):"").concat(l).concat(lo.isFromUniapp?"&appIdentifier=".concat(encodeURIComponent(d)):"")}(a===q.WS?"ws":"wss",c,d.appkey,e,d.cid,"",l,o),h=Date.now(),[4,d.connectWebSocket(f,l,n)];case 1:return g=s.sent(),_=g.code,b=g.data,E=d.cmpWeightCache.findIndex((function(e){return e.addr===c})),v={bid:cr(),ptc:Re.WS,cod:_,net:d.getNetwork().type,dur:Date.now()-h,spr:1,pr:i||0,hos:c,idx:E,rct:d.retryCount?Se.RECONNECT:Se.CONNECT,cid:d.cid,v:Oe.CURRENT,rsn:d._doConnectReason,count:d.retryCount,weight:p,ssid:d._serverSessionId},d.logger.record(pe.IM_WEBSOCKET,JSON.stringify(v),n),_===exports.ErrorCode.RC_SOCKET_DISCONNECTED||_===exports.ErrorCode.TIMEOUT?[2,"continue"]:_!==exports.ErrorCode.SUCCESS?[2,{value:gt(_)}]:(d._localConnectedTime=Math.floor((Date.now()+h)/2),d._socket=b.socket,d.updateCmpWeight(u[t].addr,!0),d.curCmpUrl=u[t].addr,[2,{value:ht(b.userId)}])}}))},d=this,p=0,h.label=1;case 1:return p<u.length?[5,c(p)]:[3,4];case 2:if("object"==typeof(f=h.sent()))return[2,f.value];h.label=3;case 3:return p+=1,[3,1];case 4:return[2,gt(exports.ErrorCode.SERVER_UNAVAILABLE)]}}))}))}}),Object.defineProperty(r.prototype,"connectWebSocket",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n,i,o,a,u,l,c=this;return s(this,(function(s){return this.logger.info(H.L_CONNECT_O,"connect start: ".concat(e),r),n=It(),i=n.resolve,o=n.promise,a=lo.createWebSocket(e),this._socketIndex=a.id,u=exports.ErrorCode.SUCCESS,l=setTimeout((function(){c.logger.warn(H.L_CONNECT_S,"timeout",r),u=exports.ErrorCode.TIMEOUT,a.close()}),5e3),a.onOpen((function(){c.logger.info(H.L_CONNECT_S,"socket opened",r),clearTimeout(l)})),a.onError((function(e){c.logger.info(H.L_CONNECT_S,"socket error",r),clearTimeout(l);var t=exports.ErrorCode.RC_SOCKET_DISCONNECTED;i(gt(t)),c.onSocketEnd(a,t)})),a.onClose((function(){c.logger.info(H.L_CONNECT_S,"socket close",r);var e=u===exports.ErrorCode.SUCCESS?exports.ErrorCode.RC_SOCKET_DISCONNECTED:u;i(gt(e)),c.onSocketEnd(a,e)})),a.onMessage((function(e){if(c._socketIndex===a.id){if("[object ArrayBuffer]"===Object.prototype.toString.call(e)){var n=Ti(e,t);if(n){if(n instanceof ui){var o=n.status;if(o!==Sn)return c.logger.warn(H.L_CONNECT_O,"connect failed: ".concat(o),r),u=Dp[o],a.close(),void i(gt(u));c.logger.info(H.L_CONNECT_O,"connect success",r);var s=n.timestamp,l=n.userId,d=n.messageId,p=n.sessionId;return c._serverSessionId=p,c._connectedTime=s,c._idCount=d,void i(ht({userId:l,socket:a}))}if(n instanceof ci){var f=n.status;return c.logger.info(H.T,"recv disconnect signal -> status: ".concat(f)),void c.onRecvDisconnect(f,a)}c._onReceiveSignal(n)}}}else c.logger.warn(H.L_WS_DISACCORD_E,JSON.stringify({socketIndex:c._socketIndex,curSocketId:a.id}))})),[2,o]}))}))}}),Object.defineProperty(r.prototype,"_qosNeedAck",{enumerable:!1,configurable:!0,writable:!0,value:function(e){if(e.header.qos!==$r.AT_MOST_ONCE)return e instanceof gi&&!e.syncMsg?(this.logger.debug(H.O,"send pubAck -> ".concat(e.messageId," ").concat(e.topic)),void this.sendOnly(new yi(e.messageId))):void(e instanceof Ii&&this._messageIds[e.messageId]&&(this.logger.debug(H.O,"send queryCon -> ".concat(e.messageId)),this.sendOnly(new mi(e.messageId))))}}),Object.defineProperty(r.prototype,"_publishReader",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,o=this;return s(this,(function(s){switch(s.label){case 0:return t=e.syncMsg,r=e.topic,n=e.messageId,this.logger.debug(H.O,"recv PublishReader -> messageId: ".concat(n," ").concat(r)),r===pn?[2]:!t||xp(rn(r))?(this.emit("signal",e),[2]):[4,new Promise((function(e){o._syncMessageIds[n]=e}))];case 1:return i=s.sent(),delete this._syncMessageIds[n],this.emit("signal",e,i),[2]}}))}))}}),Object.defineProperty(r.prototype,"_onReceiveSignal",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n;return s(this,(function(i){switch(i.label){case 0:return e instanceof pi&&this._pingResolve?(this._pingResolve(exports.ErrorCode.SUCCESS),this._pingResolve=void 0,[2]):(this._qosNeedAck(e),(e instanceof vi||e instanceof Ii)&&(t=e.messageId,this.logger.debug(H.O,"recv ack -> messageId: ".concat(t)),(r=this._messageIds[t])&&(r(e),delete this._messageIds[t]),(n=this._syncMessageIds[t])&&(delete this._syncMessageIds[t],n(e))),e instanceof gi?[4,this._publishReader(e)]:[3,2]);case 1:i.sent(),i.label=2;case 2:return[2]}}))}))}}),Object.defineProperty(r.prototype,"onRecvDisconnect",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._socket&&this._socket===t&&(this._socket=null,this.clearResolves(),this.onDisconnectByServer(function(e){return Up[e]}(e)))}}),Object.defineProperty(r.prototype,"onSocketEnd",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._socket&&this._socket===e&&(this._socket=null,this.clearResolves(),this.onDisconenctUnusual(t),this._pingResolve&&(this._pingResolve(t),this._pingResolve=void 0))}}),Object.defineProperty(r.prototype,"clearResolves",{enumerable:!1,configurable:!0,writable:!0,value:function(){for(var e in this._messageIds){var t=this._messageIds[e];delete this._messageIds[e],t(exports.ErrorCode.RC_SOCKET_DISCONNECTED)}}}),Object.defineProperty(r.prototype,"sendPing",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;return new Promise((function(r){t._pingResolve=r,setTimeout((function(){return r(exports.ErrorCode.TIMEOUT)}),e),t.sendOnly(new di)}))}}),Object.defineProperty(r.prototype,"sendOnly",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._socket&&((e instanceof Ei||e instanceof bi)&&(e.messageId=this._generateMessageId()),this._socket.send(e.getArrayBuffer()))}}),Object.defineProperty(r.prototype,"_sendHandler",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i=this;return s(this,(function(o){switch(o.label){case 0:return this._socket?(t=this._generateMessageId(),e.messageId=t,this._socket.send(e.getArrayBuffer()),[4,new Promise((function(e){i._messageIds[t]=e,setTimeout((function(){i._messageIds[t]&&delete i._messageIds[t],e(exports.ErrorCode.TIMEOUT)}),3e4)}))]):[2,gt(exports.ErrorCode.RC_NET_CHANNEL_INVALID)];case 1:return r=o.sent(),(n="number"==typeof r?r:r.status)!==exports.ErrorCode.SUCCESS&&this.logger.warn(H.O,"send rmtp fail -> messageId: ".concat(t,", code: ").concat(n,", topic: ").concat(e.topic)),"number"==typeof r?[2,gt(r)]:[2,n===exports.ErrorCode.SUCCESS?ht(r):gt(n,"",r)]}}))}))}}),Object.defineProperty(r.prototype,"query",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){return o(this,void 0,void 0,(function(){var o,a,u,l;return s(this,(function(s){switch(s.label){case 0:return o=this.logger.createTraceId(),nn(e),this.logger.debug(H.L_QUERY_CMP_T,JSON.stringify({topic:e,targetId:t}),o),a=new bi(e,r,t),i&&a.setHeaderQos(i),[4,this._sendHandler(a)];case 1:return u=s.sent(),this.logger.summary(H.L_QUERY_CMP_T,u,o,{topic:e,targetId:t}),l=u.data,u.isOk&&void 0!==n?[2,ht(Za.decode(n,l.pbData))]:[2,u]}}))}))}}),Object.defineProperty(r.prototype,"send",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n,i,o,a;return s(this,(function(s){switch(s.label){case 0:return[4,this._sendHandler(e)];case 1:return(n=s.sent()).data?n.data instanceof vi?[2,n]:(i=n.data,o=t&&i.pbData&&[exports.ErrorCode.SUCCESS,exports.ErrorCode.CHATROOM_KV_STORE_NOT_ALL_SUCCESS,exports.ErrorCode.RC_BESUBSCRIBED_USERIDS_COUNT_EXCEED_LIMIT,exports.ErrorCode.RC_USER_PROFILE_KEY_NOT_EXIST,exports.ErrorCode.RC_USER_PROFILE_EXT_KEY_NOT_EXIST,exports.ErrorCode.RC_USER_PROFILE_VALUE_CAN_ONLY_BE_NUMBERS,exports.ErrorCode.RC_USER_PROFILE_VALUE_EXCEED_RANGE,exports.ErrorCode.RC_GROUP_PARAMETER_FORMAT_ERROR].indexOf(i.status)>=0,a=o?this.codec.decodeByPBName(i.pbData,t,r):i,0!==i.status?(this.logger.warn(H.O,"send failed -> messageId: ".concat(i.messageId,", respPBName: ").concat(t,", status: ").concat(i.status)),[2,gt(i.status,void 0,t&&i.pbData?a:null)]):[2,ht(a)]):[2,n.wipe()]}}))}))}}),Object.defineProperty(r.prototype,"close",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return r?[4,this.sendOnly(new li(zn))]:[3,2];case 1:e.sent(),e.label=2;case 2:return this._socket&&(this._socket.close(),this._socket=null),this.clearResolves(),[2]}}))}))}}),r}(Ur),Bp=function(e){function r(t,r,n){var i=e.call(this,r,t,n)||this;Object.defineProperty(i,"deviceId",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(i,"model",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(i,"_mrtr",{enumerable:!0,configurable:!0,writable:!0,value:{chatroom:0,group:0,private:0,ultraGroup:0,temporary:!1}});var o=lo.runtimeInfo,s=o.type,a=o.version;return i.deviceId=Fu(),i.model="Web|".concat(s,"|").concat(a),i.init(),i}return t(r,e),Object.defineProperty(r.prototype,"httpRequest",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return o(this,void 0,void 0,(function(){var i,o,a,u,l,c,d,p;return s(this,(function(s){switch(s.label){case 0:return(i=n).deviceId=this.deviceId,i.model=this.model,o={url:e,method:t,headers:r,body:JSON.stringify(i)},this.logger.info(H.L_REQUEST_T,JSON.stringify(o)),[4,lo.httpReq(o)];case 1:a=s.sent(),u=a.status,l=a.data,c=void 0===l?"":l,this.logger.info(H.L_REQUEST_R,JSON.stringify({status:u,data:c}));try{return d=JSON.parse(c),p=d.data,[2,{code:parseInt(d.code,10),data:p}]}catch(e){return this.logger.warn(H.L_CLOUD_CONFIG_DATA_E,JSON.stringify({status:u,data:c,error:e})),[2,{code:u,msg:e}]}return[2]}}))}))}}),Object.defineProperty(r.prototype,"setCloudControllerCache",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=ze(this.appkey);lo.localStorage.setItem(t,JSON.stringify(e)),this.logger.info(H.L_CLOUD_SET_CACHE_O,JSON.stringify(e))}}),Object.defineProperty(r.prototype,"getLocalCloudControllerCache",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=ze(this.appkey),t=lo.localStorage.getItem(e);return this.logger.info(H.L_CLOUD_SET_CACHE_O,JSON.stringify({appkey:this.appkey,key:e,data:t})),t}}),Object.defineProperty(r.prototype,"setMRTRConfig",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this.logger.info(H.L_CLOUD_SET_MRTR_O,JSON.stringify(e)),this._mrtr=e}}),Object.defineProperty(r.prototype,"getMRTRConfig",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._mrtr}}),r}(Mr),Hp=null,qp="RC_LOGS",Yp="RC_STATISTICS",Kp="RC_CONF",Qp=((Mp={})[qp]=["level","time"],Mp[Kp]=["key"],Mp[Yp]=["level","time"],Mp),Wp=function(e,t,r){return new Promise((function(n){var i=e.transaction(t,"readwrite").objectStore(t).index("time"),o=IDBKeyRange.upperBound(Date.now()-r),s=i.openCursor(o);s.onsuccess=function(e){var t=e.target.result;t?(t.delete(),t.continue()):n()},s.onerror=function(){n()}}))},Jp=null,zp=function(e){return o(void 0,void 0,void 0,(function(){var t,r;return s(this,(function(n){switch(n.label){case 0:return[4,Hp];case 1:return(t=n.sent())?(r=t.db,[4,Wp(r,qp,e)]):[2];case 2:return n.sent(),[4,Wp(r,Yp,e)];case 3:return n.sent(),Jp=setTimeout((function(){return zp(e)}),6e5),[2]}}))}))},Zp=function(e,t,r){void 0===r&&(r=168),Hp||("undefined"!=typeof window&&window&&window.indexedDB&&"IE"!==lo.runtimeInfo.type?Hp=new Promise((function(n){var i=window.indexedDB;!function(e){var t=window.indexedDB;t.databases&&t.databases().then((function(r){r.forEach((function(r){r.name&&e.includes(r.name)&&t.deleteDatabase(r.name)}))}))}(["RC_ENGINE_DB","RC_STATISTIC_".concat(e)]);var o="RC_LOGS_".concat(e),s=i.open(o,2);s.onerror=function(e){t.error(H.L_LOGDB_OPEN_FAILED_E,e.target.error),n(null)},s.onsuccess=function(i){var o=i.target.result;o?(o.onclose=function(e){Hp=null,t.warn(H.L_LOGDB_CLOSED_S)},o.onerror=function(e){Hp=null,t.error(H.L_LOGDB_ERROR_E,e.target.error)},o.onabort=function(e){t.info(H.L_LOGDB_ABORT_S,e.target.error)},zp(3600*Math.max(24,Math.min(168,r))*1e3),n({appkey:e,db:o})):n(null)},s.onupgradeneeded=function(e){var t=e.target.result;Object.keys(Qp).forEach((function(e){t.objectStoreNames.contains(e)&&t.deleteObjectStore(e);var r=e===Kp?{keyPath:"key"}:{autoIncrement:!0},n=t.createObjectStore(e,r);Qp[e].forEach((function(e){return n.createIndex(e,e,{unique:!1})}))}))}})):t.warn(H.L_UNSUPPORT_INDEXDB_O))},Xp=[],$p=function(e,t,r){return new Promise((function(n){var i=e.transaction(t,"readwrite");i.oncomplete=n,i.onabort=n;var o=i.objectStore(t);r.forEach((function(e){try{o.add(e)}catch(t){null===console||void 0===console||console.error("write failed ->",e,t)}}))}))},ef=[],tf=!1,rf=function(e){return o(void 0,void 0,void 0,(function(){var t,r;return s(this,(function(n){switch(n.label){case 0:return tf||0===ef.length?[2]:(tf=!0,t=ef.filter((function(e){return e.level<exports.LogL.FATAL})),r=ef.filter((function(e){return e.level>=exports.LogL.FATAL})),ef.length=0,[4,$p(e,qp,r)]);case 1:return n.sent(),[4,$p(e,Yp,t)];case 2:return n.sent(),tf=!1,0===ef.length&&Xp.length>0&&(Xp.forEach((function(e){return e.close()})),Xp.length=0),setTimeout((function(){return rf(e)})),[2]}}))}))};function nf(e){return o(this,void 0,void 0,(function(){var t;return s(this,(function(r){switch(r.label){case 0:return[4,Hp];case 1:return(t=r.sent())?[2,new Promise((function(r){var n=t.db.transaction(Kp,"readonly").objectStore(Kp).get(e);n.onsuccess=function(e){var t;r({value:null===(t=n.result)||void 0===t?void 0:t.value,success:!0})},n.onerror=function(e){r({success:!1})}}))]:[2,{success:!1}]}}))}))}var of=ot,sf=function(){return{setTimestamp4RealtimeLog:function(e){of=e},getTimestamp4RealtimeLog:function(){return of},getLogs:function(e,t,r,n,i){return void 0===i&&(i=qp),o(this,void 0,void 0,(function(){var o;return s(this,(function(s){switch(s.label){case 0:return[4,Hp];case 1:return(o=s.sent())?[2,new Promise((function(s){var a=o.db.transaction(i,"readonly").objectStore(i),u=[],l=IDBKeyRange.bound(e,t),c=a.index("time").openCursor(l);c.onsuccess=function(e){var t=e.target.result;if(t){var i=t.value;i.level<=r&&(n?i.sessionId===it:i.level>=0)&&u.push(i),t.continue()}else s({dbReady:!0,logs:u})},c.onerror=function(e){s({dbReady:!1,logs:[]})}}))]:[2,{dbReady:!1,logs:[]}]}}))}))}}},af="REPORT_SESSION",uf=function(e,t){return o(void 0,void 0,void 0,(function(){var r,n,i,a;return s(this,(function(u){switch(u.label){case 0:return r="".concat(af,"_").concat(e),[4,nf("".concat(af,"_").concat(e))];case 1:return n=u.sent(),i=n.success,a=n.value,i?(t===(null==a?void 0:a.sessionId)||function(e,t){o(this,void 0,void 0,(function(){var r,n;return s(this,(function(i){switch(i.label){case 0:return[4,Hp];case 1:return(r=i.sent())?(n=r.db,n.transaction(Kp,"readwrite").objectStore(Kp).put({key:e,value:t}),[2,!0]):[2,!1]}}))}))}(r,{sessionId:t}),[2]):[2]}}))}))},lf=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return t(r,e),Object.defineProperty(r.prototype,"_handleWrite",{enumerable:!1,configurable:!0,writable:!0,value:function(e){!function(e){o(void 0,void 0,void 0,(function(){var t;return s(this,(function(r){switch(r.label){case 0:return[4,Hp];case 1:if(!(t=r.sent()))return[2];if(e.content&&Tt(e.content))try{e.content=JSON.parse(e.content)}catch(e){}return ef.push(e),rf(t.db),[2]}}))}))}(e)}}),r}(Tr),cf=144e5;if("undefined"!=typeof window){window.__rongcloud_devtools__={logger:{get:function(e,t,r){return void 0===t&&(t=Date.now()-cf),void 0===r&&(r=Date.now()),o(this,void 0,void 0,(function(){var n,i;return s(this,(function(o){switch(o.label){case 0:return t=t<0?Date.now()+t:t,(r=r<=0?Date.now():r)-t>cf&&(t=r-cf),(n=new lf(e,"RC-IM","IM")).debug(H.T,"get logs: startTime ".concat(t," endTime ").concat(r)),Zp(e,n),[4,sf().getLogs(t,r,exports.LogL.DEBUG,!1)];case 1:return i=o.sent().logs,n.debug(H.T,"get logs ".concat(i.length)),function(e,t){var r=t.map((function(e){var t=e.sessionId,r=e.time,n=e.type,i=e.level,o=e.tag,s=e.traceId,a=e.loggerId,u=e.content;return"".concat(t,",").concat(r,",").concat(n,",").concat(i,",").concat(o,",").concat(s,",").concat(a,',"').concat(u,'"\n')})),n=new Blob(r,{type:"text/csv"}),i=URL.createObjectURL(n),o=document.createElement("a");o.href=i,o.download="".concat(e,".csv"),document.body.appendChild(o),o.click(),document.body.removeChild(o),URL.revokeObjectURL(i)}("".concat(e,"-").concat(t,"-").concat(r),i),[2]}}))}))}}}}var df,pf,ff,hf=function(e){function r(t,r,n){var i,o=Fu(),s=lo.runtimeInfo,a=s.type,u=s.version,l="".concat(a,"|").concat(u,"|").concat(r.getSessionId());return i=e.call(this,t,o,l,sf(),r)||this,Object.defineProperty(i,"tableName",{enumerable:!0,configurable:!0,writable:!0,value:n}),i}return t(r,e),Object.defineProperty(r.prototype,"send",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return lo.httpReq(e)}}),Object.defineProperty(r.prototype,"checkStart",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return o(this,void 0,void 0,(function(){return s(this,(function(r){switch(r.label){case 0:return[4,uf(t.userId,this.logger.getSessionId())];case 1:return r.sent(),[2,e.prototype.checkStart.call(this,t,this.tableName)]}}))}))}}),Object.defineProperty(r.prototype,"compressLogs",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){return s(this,(function(t){return[2,{success:!0,data:nl(e.map(Cr).join(""))}]}))}))}}),Object.defineProperty(r.prototype,"realtimeReport",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r,n){return o(this,void 0,void 0,(function(){return s(this,(function(i){return[2,e.prototype.realtimeReport.call(this,t,r,n,this.tableName)]}))}))}}),r}(Rr),gf=function(e){function r(t,r){return e.call(this,t,r,qp)||this}return t(r,e),Object.defineProperty(r.prototype,"isReporter",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,(t=this.userId,r=this.logger.getSessionId(),o(void 0,void 0,void 0,(function(){var e,n,i;return s(this,(function(o){switch(o.label){case 0:return[4,nf("".concat(af,"_").concat(t))];case 1:return e=o.sent(),n=e.success,i=e.value,[2,n&&(null==i?void 0:i.sessionId)===r]}}))})))];case 1:return[2,e.sent()]}var t,r}))}))}}),Object.defineProperty(r.prototype,"report",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r,n,i,a,u,l){return void 0===l&&(l=!1),o(this,void 0,void 0,(function(){var o;return s(this,(function(s){switch(s.label){case 0:return[4,this.isReporter()];case 1:return o=s.sent(),this.userId&&!o?[2]:[2,e.prototype.report.call(this,t,r,n,i,a,u,l)]}}))}))}}),r}(hf),_f=function(e){function r(t,r){return e.call(this,t,r,Yp)||this}return t(r,e),r}(hf),bf=function(e){function r(t,r){var n=e.call(this)||this;return df.add(n),Object.defineProperty(n,"_ctx",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(n,"_storage",{enumerable:!0,configurable:!0,writable:!0,value:r}),n._ctx.on("sCmd",c(n,df,"m",pf),n),n}return t(r,e),Object.defineProperty(r.prototype,"_handleSyncData",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,c(this,df,"m",ff).call(this,e)];case 1:return[2,t.sent().trans((function(t){return{version:t.version||e+1}}))]}}))}))}}),Object.defineProperty(r.prototype,"syncDataFromServer",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e;return s(this,(function(t){switch(t.label){case 0:return e=this._storage.get("conversationStatusVersion"),[4,c(this,df,"m",ff).call(this,e)];case 1:return t.sent(),[2,this._storage.get("conversationStatusVersion")]}}))}))}}),Object.defineProperty(r.prototype,"pushTask",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return o(this,void 0,void 0,(function(){var r=this;return s(this,(function(n){return[2,e.prototype.pushTask.call(this,(function(e){return o(r,void 0,void 0,(function(){var r;return s(this,(function(n){switch(n.label){case 0:return[4,t(e)];case 1:return(r=n.sent()).isOk?(this._storage.set("conversationStatusVersion",r.data.version),[2,r]):[2,r.wipe()]}}))}))}),(function(e,t){return e.code===exports.ErrorCode.USER_SETTING_SYNCED_ERROR&&t<5}))]}))}))}}),r}(bt);df=new WeakSet,pf=function(e,t){var r=t.type,n=t.time;if(3===r)this.push(n),e.stopPropagation()},ff=function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,o;return s(this,(function(s){switch(s.label){case 0:return t=this._ctx.logger,r=t.createTraceId(),t.info(H.L_PULL_CONVERSATION_SETTINGS_T,JSON.stringify({version:e}),r),n=Za.encode(ss,{time:e}),[4,this._ctx.query(Zr.pullSeAtts,this._ctx.currentUserId,n,as)];case 1:return i=s.sent(),t.summary(H.L_PULL_CONVERSATION_SETTINGS_R,i,r,{version:e},(function(t){return{syncTime:t.version,version:e}})),i.isOk?((o=this._storage.updateBySessionStates(i.data)).length&&this._ctx.emit("conversationStatusChanged",o),[2,i]):[2,i.wipe()]}}))}))};var Ef,vf,yf,mf,If=function(){function e(){Object.defineProperty(this,"_memData",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}return Object.defineProperty(e.prototype,"syncDataFromLocalStorage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._memData=this._syncDataHandler(e)}}),Object.defineProperty(e.prototype,"get",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._memData[e].value}}),Object.defineProperty(e.prototype,"set",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this._memData[e],n=r.key,i=r.stringify;r.value=t;var o=i?JSON.stringify(t):t;lo.localStorage.setItem(n,o)}}),e}(),Tf=function(e,t,r){return"".concat(null!=r?r:"","_").concat(e,"_").concat(t)},Rf=function(e){var t=u(e.split("_")),r=t[0],n=t[1],i=t.slice(2);return{channelId:r,conversationType:parseInt(n,10),targetId:i.join("_")}};function Cf(e){if(e){if(Array.isArray(e))return e;var t=Object.entries(e).map((function(e){var t=u(e,2);return{tagId:t[0],isTop:t[1].isTop}}));return t}}var Of=function(){return{latestMessage:null,lastReadTime:0,firstUnreadMessageType:"",firstUnreadMessageUId:"",firstUnreadTime:0,unreadCount:0,unreadMentionedCount:0,unreadMentionedMeCount:0,hasMentioned:!1,mentionedInfo:void 0,isTop:!1,notificationLevel:exports.NotificationLevel.NOT_SET,tags:[],channelType:exports.UltraGroupChannelType.PUBLIC,operationTime:0,draft:"",hidden:!1}},Sf=function(){function e(e){Ef.set(this,void 0),vf.set(this,void 0),yf.set(this,void 0),mf.set(this,Of()),d(this,Ef,e.conversationType,"f"),d(this,vf,e.targetId,"f"),d(this,yf,e.channelId||"","f")}return Object.defineProperty(e.prototype,"conversationType",{get:function(){return c(this,Ef,"f")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"targetId",{get:function(){return c(this,vf,"f")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"channelId",{get:function(){return c(this,yf,"f")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"channelType",{get:function(){return c(this,mf,"f").channelType},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"hidden",{get:function(){return!!c(this,mf,"f").hidden},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isTop",{get:function(){return!!c(this,mf,"f").isTop},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"notificationLevel",{get:function(){return c(this,mf,"f").notificationLevel||exports.NotificationLevel.NOT_SET},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"tags",{get:function(){return(c(this,mf,"f").tags||[]).map((function(e){return{tagId:e.tagId,isTop:e.isTop}}))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"unreadCount",{get:function(){return c(this,mf,"f").unreadCount||0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"unreadMentionedCount",{get:function(){return c(this,mf,"f").unreadMentionedCount||0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"unreadMentionedMeCount",{get:function(){return c(this,mf,"f").unreadMentionedMeCount||0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"hasMentioned",{get:function(){return!!c(this,mf,"f").hasMentioned},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"mentionedInfo",{get:function(){return c(this,mf,"f").mentionedInfo},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"lastReadTime",{get:function(){return c(this,mf,"f").lastReadTime||0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"firstUnreadTime",{get:function(){return c(this,mf,"f").firstUnreadTime||0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"firstUnreadMessageUId",{get:function(){return c(this,mf,"f").firstUnreadMessageUId||""},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"firstUnreadMessageType",{get:function(){return c(this,mf,"f").firstUnreadMessageType||""},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"latestMessage",{get:function(){return c(this,mf,"f").latestMessage||null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"operationTime",{get:function(){return c(this,mf,"f").operationTime||0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"draft",{get:function(){return c(this,mf,"f").draft||""},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"firstUnreadMessage",{get:function(){return this.firstUnreadTime?{sentTime:this.firstUnreadTime,messageType:this.firstUnreadMessageType,messageUId:this.firstUnreadMessageUId}:null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"id",{get:function(){return{conversationType:c(this,Ef,"f"),targetId:c(this,vf,"f"),channelId:c(this,yf,"f")}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"key",{get:function(){return Tf(c(this,Ef,"f"),c(this,vf,"f"),c(this,yf,"f"))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"toIReceivedConversation",{enumerable:!1,configurable:!0,writable:!0,value:function(){return n(n({},this.id),{latestMessage:this.latestMessage,unreadMessageCount:this.unreadCount,unreadMentionedCount:this.unreadMentionedCount,unreadMentionedMeCount:this.unreadMentionedMeCount,hasMentioned:this.hasMentioned,mentionedInfo:this.mentionedInfo,lastUnreadTime:0,notificationLevel:this.notificationLevel,notificationStatus:Le(this.notificationLevel),isTop:this.isTop,operationTime:this.operationTime,firstUnreadMessage:this.firstUnreadMessage,versionTime:0,draft:this.draft})}}),Object.defineProperty(e.prototype,"toStoragItem",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e={};return this.isTop&&(e.to=!0),this.notificationLevel!==exports.NotificationLevel.NOT_SET&&(e.nl=this.notificationLevel),this.tags.length>0&&(e.tg=this.tags),this.hidden&&(e.h=!0),e}}),Object.defineProperty(e.prototype,"remove",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.updateAttrs(n(n({},Of()),{tags:this.tags,isTop:this.isTop,notificationLevel:this.notificationLevel,hidden:!0}))}}),Object.defineProperty(e.prototype,"updateAttrs",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this;void 0===t&&(t=0);var n={},i={latestMessage:"latestMessage",unreadCount:"unreadMessageCount",hasMentioned:"hasMentioned",mentionedInfo:"mentionedInfo",notificationLevel:"notificationLevel",tags:"tags",isTop:"isTop",lastReadTime:void 0,firstUnreadMessageType:void 0,firstUnreadMessageUId:void 0,firstUnreadTime:void 0,unreadMentionedCount:void 0,unreadMentionedMeCount:void 0,channelType:void 0,operationTime:void 0,draft:void 0,hidden:void 0};return Object.entries(i).forEach((function(i){var o=u(i,2),s=o[0],a=o[1],l=s;if(Object.prototype.hasOwnProperty.call(e,l)){var d=e[l];c(r,mf,"f")[l]!==d&&(c(r,mf,"f")[l]=d,a&&(n[a]={time:t,val:d}))}})),Object.keys(n).length>0?n:null}}),e}();Ef=new WeakMap,vf=new WeakMap,yf=new WeakMap,mf=new WeakMap;var Af,Pf,Nf,wf=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return t(r,e),Object.defineProperty(r.prototype,"toStoragItem",{enumerable:!1,configurable:!0,writable:!0,value:function(){var t=e.prototype.toStoragItem.call(this);return this.unreadCount>0&&(t.c=this.unreadCount),this.unreadMentionedCount>0&&(t.mc=this.unreadMentionedCount),this.unreadMentionedMeCount>0&&(t.mmc=this.unreadMentionedMeCount),this.hasMentioned&&(t.hm=!0),this.mentionedInfo&&(t.m=this.mentionedInfo),this.firstUnreadMessageUId&&(t.fuid=this.firstUnreadMessageUId),this.firstUnreadMessageType&&(t.fumt=this.firstUnreadMessageType),this.firstUnreadTime&&(t.fut=this.firstUnreadTime),this.lastReadTime&&(t.rt=this.lastReadTime),t}}),r}(Sf),Mf=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return t(r,e),Object.defineProperty(r.prototype,"toIReceivedConversation",{enumerable:!1,configurable:!0,writable:!0,value:function(){var t=e.prototype.toIReceivedConversation.call(this);return t.channelType=this.channelType,t}}),Object.defineProperty(r.prototype,"isDefaultChannel",{enumerable:!1,configurable:!0,writable:!0,value:function(){return!this.channelId||"RCDefault"===this.channelId}}),r}(Sf),Lf=function(e){function r(t){var r=e.call(this)||this;return Af.add(r),Object.defineProperty(r,"_ctx",{enumerable:!0,configurable:!0,writable:!0,value:t}),Pf.set(r,new Map),r}return t(r,e),Object.defineProperty(r.prototype,"_syncDataHandler",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=lo.localStorage,r=e.appkey,n=e.currentUserId,i=e.isDisableEmptyUGChannelId,o=Ye(r,n),s=qe(r,n),a=Ke(r,n),u=Be(r,n),l=Fe(r,n),c=He(r,n),d=t.getItem(o)||"0",p=t.getItem(s)||"0",f=t.getItem(a)||"1",h=t.getItem(u)||"{}",g=t.getItem(l)||"0",_=t.getItem(c)||"{}",b=JSON.parse(h);Object.keys(b).forEach((function(e){var t=Rf(e);me(t.conversationType,ge)||delete b[e]}));var E=JSON.parse(_);return Object.keys(E).forEach((function(e){var t=Rf(e);(t.conversationType!==exports.ConversationType.ULTRA_GROUP||i&&!t.channelId)&&delete E[e]})),{inboxTime:{value:parseInt(d,10)||0,key:o},outboxTime:{value:parseInt(p,10)||0,key:s},broadcastTime:{value:parseInt(f,10)||0,key:a},conversationStatus:{value:b,key:u,stringify:!0},ultraGroupStatus:{value:E,key:c,stringify:!0},conversationStatusVersion:{value:parseInt(g,10)||0,key:l}}}}),Object.defineProperty(r.prototype,"syncDataFromLocalStorage",{enumerable:!1,configurable:!0,writable:!0,value:function(t){e.prototype.syncDataFromLocalStorage.call(this,t),c(this,Pf,"f").clear(),c(this,Af,"m",Nf).call(this)}}),Object.defineProperty(r.prototype,"getOrCreateModel",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=Tf(e.conversationType,e.targetId,e.channelId),n=c(this,Pf,"f").get(r);return n||(n=e.conversationType===exports.ConversationType.ULTRA_GROUP?new Mf(e):new wf(e),t&&c(this,Pf,"f").set(r,n)),n}}),Object.defineProperty(r.prototype,"getUGFistUnreadMessageInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=Tf(exports.ConversationType.ULTRA_GROUP,e,t),n=c(this,Pf,"f").get(r);return(null==n?void 0:n.firstUnreadMessage)||null}}),Object.defineProperty(r.prototype,"updateConversationStorage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this.get("ultraGroupStatus"),r=this.get("conversationStatus");e.forEach((function(e){var n=e.conversationType,i=e.key,o=e.toStoragItem(),s=Object.keys(o),a=0===s.length||1===s.length&&"h"===s[0],u=n===exports.ConversationType.ULTRA_GROUP?t:r;a?delete u[i]:u[i]=o})),this.set("conversationStatus",r),this.set("ultraGroupStatus",t)}}),Object.defineProperty(r.prototype,"updateBySessionStates",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this,r=e.version,i=e.state;if(r&&this.set("conversationStatusVersion",r),!(null==i?void 0:i.length))return[];var o=new Map,s=new Set;return i.forEach((function(e){var n=e.channelId,i=e.busChannel,a=e.type,u=e.stateItem;if(e.time,n){var l=Tf(a,n,i),d=Rf(l),p=c(t,Pf,"f").get(l);p||(p=a===exports.ConversationType.ULTRA_GROUP?new Mf(d):new wf(d),c(t,Pf,"f").set(l,p)),s.add(p);var f={};null==u||u.forEach((function(e){var t=e.tags,r=e.sessionStateType,n=e.value;switch(r){case _o.IsSilent:f.notificationLevel=parseInt(n,10);break;case _o.IsTop:f.isTop="1"===n;break;case _o.Tags:f.tags=t}}));var h=p.updateAttrs(f,r);if(h)if(o.has(p)){var g=o.get(p);Object.assign(g,h)}else o.set(p,h)}})),this.updateConversationStorage(Array.from(s)),Array.from(o.entries()).map((function(e){var t=u(e,2),r=t[0],i=t[1];return n(n({},r.toIReceivedConversation()),{updatedItems:i})}))}}),Object.defineProperty(r.prototype,"addRelations",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n=this;e.forEach((function(e){var i=e.userId,o=e.type,s=e.busChannel,a=Tf(o,i,s),u=Rf(a),l=n.getOrCreateModel(u,!0),c=function(e,t,r){var n,i,o,s=e.msg;return{latestMessage:s?Wu(s,t,r,e.userId):void 0,lastReadTime:e.readMsgTime,unreadCount:e.unreadCount,operationTime:e.versionTime,unreadMentionedCount:e.remindCount,unreadMentionedMeCount:e.remindMeCount,firstUnreadMessageType:null===(n=e.msgInfo)||void 0===n?void 0:n.className,firstUnreadMessageUId:null===(i=e.msgInfo)||void 0===i?void 0:i.msgId,firstUnreadTime:null===(o=e.msgInfo)||void 0===o?void 0:o.msgTime}}(e,t,r);o===exports.ConversationType.ULTRA_GROUP?l.updateAttrs(c,e.versionTime||0):l.updateAttrs({latestMessage:c.latestMessage,operationTime:c.operationTime,hidden:!1},e.versionTime||0)}))}}),Object.defineProperty(r.prototype,"getDrafts",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r=Tf(e.conversationType,e.targetId,e.channelId);return(null===(t=c(this,Pf,"f").get(r))||void 0===t?void 0:t.draft)||""}}),Object.defineProperty(r.prototype,"setDrafts",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this.getOrCreateModel(e,!0).updateAttrs({draft:t})}}),Object.defineProperty(r.prototype,"deleteDrafts",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=Tf(e.conversationType,e.targetId,e.channelId),r=c(this,Pf,"f").get(t);r&&r.updateAttrs({draft:""})}}),Object.defineProperty(r.prototype,"getCachedUGConversation",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=Tf(exports.ConversationType.ULTRA_GROUP,e,t),n=c(this,Pf,"f").get(r);return(null==n?void 0:n.toIReceivedConversation())||null}}),Object.defineProperty(r.prototype,"getAllUGModels",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=c(this,Pf,"f").values();return Array.from(e).filter((function(e){return e.conversationType===exports.ConversationType.ULTRA_GROUP&&e.targetId})).map((function(e){return e}))}}),Object.defineProperty(r.prototype,"getAllSGModels",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=c(this,Pf,"f").values();return Array.from(e).filter((function(e){return e.conversationType!==exports.ConversationType.ULTRA_GROUP&&e.targetId})).map((function(e){return e}))}}),Object.defineProperty(r.prototype,"getAllModels",{enumerable:!1,configurable:!0,writable:!0,value:function(){return Array.from(c(this,Pf,"f").values()).filter((function(e){return e.targetId}))}}),Object.defineProperty(r.prototype,"getModel",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=Tf(e.conversationType,e.targetId,e.channelId);return c(this,Pf,"f").get(t)||null}}),Object.defineProperty(r.prototype,"removeConversation",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.conversationType,r=e.targetId,n=e.channelId,i=Tf(t,r,n),o=c(this,Pf,"f").get(i);o&&(o.remove(),this.updateConversationStorage([o]))}}),Object.defineProperty(r.prototype,"updateConversationCache",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this.getOrCreateModel(e,!0);r.updateAttrs(t,0),this.updateConversationStorage([r])}}),Object.defineProperty(r.prototype,"getUnreadCountByTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=0;return this.getAllSGModels().forEach((function(n){var i;if(n.tags.some((function(t){return t.tagId===e}))){if(n.notificationLevel>exports.NotificationLevel.NOT_SET&&!t)return;r+=null!==(i=n.unreadCount)&&void 0!==i?i:0}})),r}}),Object.defineProperty(r.prototype,"getAllUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=0;return this.getAllSGModels().forEach((function(n){var i,o=n.conversationType;e.includes(o)&&(n.notificationLevel>exports.NotificationLevel.NOT_SET&&!t||(r+=null!==(i=n.unreadCount)&&void 0!==i?i:0))})),r}}),Object.defineProperty(r.prototype,"getAllUnreadMentionedCount",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=0;return this.getAllSGModels().forEach((function(t){var r;e+=null!==(r=t.unreadMentionedCount)&&void 0!==r?r:0})),e}}),Object.defineProperty(r.prototype,"getTagConversationCountMap",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=new Map;return this.getAllModels().forEach((function(t){var r=t.tags;r.length>0&&r.forEach((function(r){e.set(r.tagId,(e.get(r.tagId)||[]).concat(t.id))}))})),e}}),Object.defineProperty(r.prototype,"getTotalUnreadCountByLevels",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n=0;return this.getAllModels().forEach((function(i){if(e.includes(i.conversationType)){var o=i.notificationLevel,s=i.unreadCount,a=i.unreadMentionedCount;(0===t.length||t.includes(o))&&(n+=r?a:s)}})),n}}),Object.defineProperty(r.prototype,"clearConversationUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,i){var o=Tf(e,t,r),s=c(this,Pf,"f").get(o);if(!s)return null;var a=s.updateAttrs({unreadCount:0,unreadMentionedCount:0,unreadMentionedMeCount:0,hasMentioned:!1,mentionedInfo:void 0,lastReadTime:i,firstUnreadTime:0,firstUnreadMessageType:void 0,firstUnreadMessageUId:void 0});return this.updateConversationStorage([s]),a?n(n({},s.toIReceivedConversation()),{updatedItems:a}):null}}),r}(If);function Uf(e){return Object.keys(e).map((function(t){var r=e[t];return"string"!=typeof r&&(r="".concat(r)),{key:t,value:r}}))}function Df(e,t,r,n){return Za.encode(ca,{targetId:e,type:exports.ConversationType.GROUP,users:n,extProfile:r?Uf(r):void 0,settingProfile:Uf(t)})}Pf=new WeakMap,Af=new WeakSet,Nf=function(){var e=this,t=Object.entries(this.get("conversationStatus")),r=Object.entries(this.get("ultraGroupStatus"));l(l([],u(t),!1),u(r),!1).forEach((function(t){var r,n,i,o,s,a,l,c,d,p,f,h,g,_,b=u(t,2),E=b[0],v=b[1],y=Rf(E);me(y.conversationType,be)&&e.getOrCreateModel(y,!0).updateAttrs((n=(r=v).c,i=r.mc,o=r.mmc,s=r.hm,a=r.m,l=r.fut,c=r.fuid,d=r.fumt,p=r.nl,f=r.to,h=r.tg,g=r.rt,_=r.h,{isTop:f,notificationLevel:p,tags:Cf(h),unreadCount:n,unreadMentionedCount:i,unreadMentionedMeCount:o,hasMentioned:s,mentionedInfo:a,firstUnreadTime:l,firstUnreadMessageUId:c,firstUnreadMessageType:d,lastReadTime:g,hidden:_}),0)}))};var xf,jf,Vf,Gf,kf,Ff,Bf,Hf,qf,Yf,Kf=function(e,t){return Za.encode(qo,{type:e.conversationType,msgTime:t,channelId:e.targetId,busChannel:e.channelId||""})},Qf=function(e,t,r){return Za.encode(wo,{startTime:e,order:t,count:r,compressioEnabled:Zu.enable()})},Wf=function(e){var t=Za.decode(Lo,e),r=t.compressioEnabled,n=t.compressedData,i=t.info,o=t.pullTime,s=t.isFinished;if(r){var a=Lp(n);return Wf(a)}return{info:i,pullTime:o,isFinished:s}},Jf=function(e){var t=Za.decode(mo,e);if(t.compressioEnabled){var r=Lp(t.compressedData);return Jf(r)}return t},zf=function(e){var t=Za.decode(Io,e);if(t.compressioEnabled){var r=Lp(t.compressedData);return zf(r)}return{syncTime:t.syncTime,list:t.list.map((function(e){return Za.decode(To,new Uint8Array(e))}))}},Zf=function(e){return Za.encode(vs,n(n({},e),{compress:Zu.enable()}))},Xf=function(e){var t=Za.decode(ys,e);if(t.compress){var r=Lp(t.compressData);return Xf(r)}return t},$f=function(e){function r(t,r){var n=e.call(this)||this;return xf.add(n),Object.defineProperty(n,"_ctx",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(n,"_storage",{enumerable:!0,configurable:!0,writable:!0,value:r}),n._ctx.on("sNtf",c(n,xf,"m",kf),n),n._ctx.on("signal",c(n,xf,"m",jf),n),n._ctx.on("syncMsg",c(n,xf,"m",Vf),n),n}return t(r,e),Object.defineProperty(r.prototype,"_handleSyncData",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var e,t,r,n,i,o,a,u,l,c,d,p,f,h,g,_,b,E,v;return s(this,(function(s){switch(s.label){case 0:return e=this._ctx,t=e.logger,r=e.currentUserId,n=e.connectedTime,i=this._storage.get("inboxTime"),o=this._storage.get("outboxTime"),a=this._storage.get("broadcastTime"),u=t.createTraceId(),t.info(H.L_PULL_MSG_T,JSON.stringify({inboxTime:i,outboxTime:o,broadcastTime:a}),u),l=Za.encode(Eo,{ispolling:!1,isPullSend:!0,syncTime:i,sendBoxSyncTime:o,broadcastSyncTime:a,compressioEnabled:Zu.enable()}),[4,this._ctx.query(Zr.pullMsg,this._ctx.currentUserId,l)];case 1:return c=s.sent(),t.summary(H.L_PULL_MSG_R,c,u),c.isOk?(d=Jf(c.data.pbData),f=(p=d).list,h=p.finished,g=p.syncTime,_=p.broadcastSyncTime,b=o,E=f.map((function(e){var t=Wu(e,r,n);return t.messageDirection===exports.MessageDirection.SEND&&(b=Math.max(b,t.sentTime)),t})),this._storage.set("inboxTime",g),this._storage.set("broadcastTime",_||1),this._storage.set("outboxTime",b),this._ctx.emit("messagesFromSG",E,!!h),v=Math.max(g,_||1,b),[2,ht({version:v,hasNext:!h})]):[2,c.wipe()]}}))}))}}),r}(bt);xf=new WeakSet,jf=function(e,t){rn(t.topic)===Zr.s_msg&&(e.stopPropagation(),c(this,xf,"m",Gf).call(this,t))},Vf=function(e,t,r){var n=t.conversationType,i=t.sentTime;n!==exports.ConversationType.ULTRA_GROUP&&n!==exports.ConversationType.CHATROOM&&(n===exports.ConversationType.RTC_ROOM||xp(r)||(e.stopPropagation(),this.push(i)))},Gf=function(e){var t=this._ctx,r=t.currentUserId,n=t.connectedTime,i=Za.decode(To,e.pbData),o=Wu(i,r,n),s=o.conversationType,a=o.sentTime,u=o.isStatusMessage;s===exports.ConversationType.RTC_ROOM||u?this._ctx.emit("smsgFromSignalGroup",o):this.push(a)},kf=function(e,t){1===t.type&&(e.stopPropagation(),this.push(t.time))};var eh,th,rh=function(e){function r(t){var r=e.call(this)||this;return Ff.add(r),Object.defineProperty(r,"_ctx",{enumerable:!0,configurable:!0,writable:!0,value:t}),r._ctx.on("syncMsg",c(r,Ff,"m",Hf),r),r._ctx.on("sCmd",c(r,Ff,"m",Bf),r),r}return t(r,e),Object.defineProperty(r.prototype,"markOnline",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t,r,n,i,o;return s(this,(function(s){switch(s.label){case 0:return[4,c(this,Ff,"m",Yf).call(this,0)];case 1:return(e=s.sent()).isOk?(this._ctx.logger.info(H.L_NOTIFY_ULTRA_ONLINE_S,"success"),t=e.data.syncTime,[4,c(this,Ff,"m",qf).call(this,0,[])]):(this._ctx.logger.warn(H.L_NOTIFY_ULTRA_ONLINE_S,"fail to pull ug msg, code: ".concat(e.code)),[2,e.wipe()]);case 2:return(r=s.sent()).isOk?(n=r.data,i=n.length>0?n[n.length-1].versionTime:0,o=Math.max(t,i),[2,ht({relations:n,msgVersion:o})]):[2,r.wipe()]}}))}))}}),Object.defineProperty(r.prototype,"_handleSyncData",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t=this;return s(this,(function(r){switch(r.label){case 0:return[4,c(this,Ff,"m",Yf).call(this,e)];case 1:return[2,r.sent().trans((function(e){var r=e,n=r.syncTime,i=r.finished,o=r.list;if(null==o?void 0:o.length){var s=t._ctx,a=s.currentUserId,u=s.connectedTime,l=o.map((function(e){return Wu(e,a,u)}));t._ctx.emit("messagesFromUG",l,n)}return{version:n,hasNext:!i}}))]}}))}))}}),r}(bt);Ff=new WeakSet,Bf=function(e,t){if(6===t.type)this.push(t.time),e.stopPropagation()},Hf=function(e,t){t.conversationType===exports.ConversationType.ULTRA_GROUP&&(this.push(t.sentTime),e.stopPropagation())},qf=function e(t,r){return o(this,void 0,void 0,(function(){var n,i,o,a,d,p,f,h,g;return s(this,(function(s){switch(s.label){case 0:return n=this._ctx,i=n.logger,o=i.createTraceId(),i.info(H.L_PULL_UG_RELATIONS_T,JSON.stringify({ver:t}),o),a=Za.encode(Ss,{syncTime:t,isEraseMsgContent:!1}),[4,this._ctx.query(Zr.pullUgSes,this._ctx.currentUserId,a,Lo)];case 1:return d=s.sent(),i.summary(H.L_PULL_UG_RELATIONS_R,d,o,{ver:t},(function(e){return{isFinished:e.isFinished}})),d.isOk?(p=d.data,f=p.info,h=p.isFinished,r.push.apply(r,l([],u(f),!1)),h?[2,ht(r)]:(g=f[f.length-1].versionTime,[2,c(this,Ff,"m",e).call(this,g,r)])):[2,d.wipe()]}}))}))},Yf=function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,o,a,u;return s(this,(function(s){switch(s.label){case 0:return t=this._ctx,r=t.currentUserId,n=t.logger,i=n.createTraceId(),n.info(H.L_PULL_ULTRA_MSG_T,JSON.stringify({version:e}),i),l=e,o=Za.encode(As,{syncTime:l,compressioEnabled:Zu.enable()}),[4,this._ctx.query(Zr.pullUgMsg,r,o)];case 1:return a=s.sent(),n.summary(H.L_PULL_ULTRA_MSG_R,a,i,{version:e}),a.isOk?(u=a.data,[2,ht(Jf(u.pbData))]):[2,a.wipe()]}var l}))}))};var nh=13,ih=36,oh=function(e){function r(t,r){var n=e.call(this)||this;return eh.add(n),Object.defineProperty(n,"_con",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(n,"_logger",{enumerable:!0,configurable:!0,writable:!0,value:r}),n}return t(r,e),Object.defineProperty(r.prototype,"_handleSyncData",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,o,a,l,d=this;return s(this,(function(s){switch(s.label){case 0:return t=this._logger.createTraceId(),this._logger.info(H.L_PULL_EVENT_CHANGE_T,JSON.stringify({version:e}),t),[4,c(this,eh,"m",th).call(this,e)];case 1:return r=s.sent(),this._logger.summary(H.L_PULL_EVENT_CHANGE_R,r,t,{version:e}),r.isOk?(n=r.data,i=n.list,o=n.syncTime,a=n.hasNext,i.length&&(l=new Map,i.forEach((function(e){var t=e.changeType;l.has(t)?l.get(t).push(e):l.set(t,[e])})),Array.from(l.entries()).forEach((function(e){var t=u(e,2),r=t[0],n=t[1];d.emit("serverEvent",r,n)}))),[2,ht({version:o,hasNext:a})]):[2,r.wipe()]}}))}))}}),Object.defineProperty(r.prototype,"noticeOnline",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t;return s(this,(function(r){switch(r.label){case 0:return e=this._logger.createTraceId(),this._logger.info(H.L_SERVER_EVENT_NOTIFY_ONLINE_T,JSON.stringify({version:0}),e),[4,c(this,eh,"m",th).call(this,0)];case 1:return t=r.sent(),this._logger.summary(H.L_SERVER_EVENT_NOTIFY_ONLINE_R,t,e,{version:0}),[2,t]}}))}))}}),r}(bt);eh=new WeakSet,th=function(e){var t=Za.encode(Ns,{syncTime:e});return this._con.query(Zr.pullEventChange,this._con.getCurrentUserId(),t,ws)};var sh,ah,uh,lh,ch,dh,ph,fh,hh,gh,_h,bh,Eh,vh,yh,mh,Ih,Th,Rh,Ch,Oh=function(e){function r(t){var r=e.call(this)||this;return Object.defineProperty(r,"_ctx",{enumerable:!0,configurable:!0,writable:!0,value:t}),r}return t(r,e),Object.defineProperty(r.prototype,"_handleSyncData",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,o,a;return s(this,(function(s){switch(s.label){case 0:return t=Za.encode(Ns,{syncTime:e}),[4,this._ctx.query(Zr.qryMsgChange,this._ctx.currentUserId,t,Ms)];case 1:return(r=s.sent()).isOk?(n=r.data,i=n.list,o=n.syncTime,a=n.hasNext,i&&i.length&&this._ctx.emit("ugChanged",i),[2,ht({version:o,hasNext:a})]):[2,r.wipe()]}}))}))}}),r}(bt),Sh=function(){return o(void 0,void 0,void 0,(function(){return s(this,(function(e){return[2,exports.ErrorCode.NOT_SUPPORT]}))}))},Ah=function(){return o(void 0,void 0,void 0,(function(){return s(this,(function(e){return[2,gt(exports.ErrorCode.NOT_SUPPORT,"Not support")]}))}))},Ph=18e4,Nh=function(){function e(e){ah.add(this),Object.defineProperty(this,"_ctx",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"storage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"settings",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),uh.set(this,void 0),lh.set(this,void 0),ch.set(this,void 0),gh.set(this,1),Object.defineProperty(this,"searchConversationByContent",{enumerable:!0,configurable:!0,writable:!0,value:Ah}),this.storage=new Lf(e),this.settings=new bf(this._ctx,this.storage),d(this,uh,new rh(this._ctx),"f"),d(this,lh,new $f(this._ctx,this.storage),"f"),d(this,ch,new Oh(this._ctx),"f"),this._ctx.on("onConnected",c(this,ah,"m",hh),this),this._ctx.on("onDisconnected",c(this,ah,"m",Eh),this),this._ctx.on("onSuspend",c(this,ah,"m",Eh),this),this._ctx.on("sCmd",c(this,ah,"m",vh),this),this._ctx.on("signal",c(this,ah,"m",yh),this),this._ctx.on("serverEvent",c(this,ah,"m",dh),this)}return Object.defineProperty(e.prototype,"getConversationListByFilter",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){return s(this,(function(t){switch(e.type){case Hr.TIMESTAMP:return[2,c(this,ah,"m",mh).call(this,e.params)];case Hr.BLOCKED:return[2,c(this,ah,"m",Th).call(this)];case Hr.TOP:return[2,c(this,ah,"m",Ih).call(this,e.params)];case Hr.UNREAD:return[2,c(this,ah,"m",Rh).call(this,e.params)];default:return[2,gt(exports.ErrorCode.NOT_SUPPORT)]}}))}))}}),Object.defineProperty(e.prototype,"getTotalUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n,i,o;return s(this,(function(s){return n=this._ctx.includeUg,i=0,o=t&&t.length?t:ye(n?be:ge),this.storage.getAllModels().forEach((function(t){t.unreadCount>0&&o.includes(t.conversationType)&&(t.conversationType!==exports.ConversationType.ULTRA_GROUP&&t.channelId===e||t.conversationType===exports.ConversationType.ULTRA_GROUP&&(""===t.channelId||"RCDefault"===t.channelId))&&(r||t.notificationLevel<=exports.NotificationLevel.NOT_SET)&&(i+=t.unreadCount)})),[2,ht(i)]}))}))}}),Object.defineProperty(e.prototype,"getConversation",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n;return s(this,(function(i){return n=this.storage.getOrCreateModel({conversationType:e,targetId:t,channelId:r},!1),[2,ht(n.toIReceivedConversation())]}))}))}}),Object.defineProperty(e.prototype,"batchSetConversationToTop",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return o(this,void 0,void 0,(function(){var r=this;return s(this,(function(i){return[2,this.settings.pushTask((function(i){return o(r,void 0,void 0,(function(){var r,o,a,u=this;return s(this,(function(s){switch(s.label){case 0:return[4,c(this,ah,"m",Ch).call(this,e,i,t)];case 1:return(r=s.sent()).isOk?(o=r.data.version,a=e.map((function(e){var r=u.storage.getOrCreateModel(e,!0);return r.updateAttrs({isTop:t,hidden:!n&&r.hidden,operationTime:r.hidden&&n?Date.now():r.operationTime}),r})),this.storage.updateConversationStorage(a),[2,ht({version:o})]):[2,r.wipe()]}}))}))}))]}))}))}}),Object.defineProperty(e.prototype,"batchSetConversationNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r=this;return s(this,(function(n){return[2,this.settings.pushTask((function(n){return o(r,void 0,void 0,(function(){var r,i,o,a=this;return s(this,(function(s){switch(s.label){case 0:return[4,c(this,ah,"m",Ch).call(this,e,n,void 0,t)];case 1:return(r=s.sent()).isOk?(i=r.data.version,o=e.map((function(e){var r=a.storage.getOrCreateModel(e,!0);return r.updateAttrs({notificationLevel:t}),r})),this.storage.updateConversationStorage(o),[2,ht({version:i})]):[2,r.wipe()]}}))}))}))]}))}))}}),Object.defineProperty(e.prototype,"getConversationNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t;return s(this,(function(r){return t=this.storage.getOrCreateModel(e,!1),[2,ht(t.notificationLevel)]}))}))}}),Object.defineProperty(e.prototype,"getConversationTypeNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t;return s(this,(function(r){return t=this.storage.getOrCreateModel({conversationType:e,targetId:""},!1),[2,ht(t.notificationLevel)]}))}))}}),Object.defineProperty(e.prototype,"setConversationTypeNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r=this;return s(this,(function(n){return[2,this.settings.pushTask((function(n){return o(r,void 0,void 0,(function(){var r,i,o;return s(this,(function(s){switch(s.label){case 0:return[4,this._ctx.query(Zr.setTypeUnpush,this._ctx.currentUserId,Za.encode(gs,{type:e,unpushLevel:t,version:n}),_s)];case 1:return(r=s.sent()).isOk?(i=r.data.version,(o=this.storage.getOrCreateModel({conversationType:e,targetId:""},!0)).updateAttrs({notificationLevel:t}),this.storage.updateConversationStorage([o]),[2,ht({version:i})]):[2,r.wipe()]}}))}))}))]}))}))}}),Object.defineProperty(e.prototype,"clearAllUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t;return s(this,(function(r){return e=this._ctx.includeUg,t=this.storage.getAllSGModels(),e&&t.push.apply(t,l([],u(this.storage.getAllUGModels().filter((function(e){return e.isDefaultChannel()}))),!1)),t.forEach((function(e){e.updateAttrs({unreadCount:0,unreadMentionedCount:0,unreadMentionedMeCount:0,hasMentioned:!1,mentionedInfo:void 0,lastReadTime:0,firstUnreadMessageType:void 0,firstUnreadMessageUId:void 0,firstUnreadTime:void 0})})),this.storage.updateConversationStorage(t),[2,ht()]}))}))}}),Object.defineProperty(e.prototype,"deleteRemoteMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i,o,a,u;return s(this,(function(s){switch(s.label){case 0:return r=t.map((function(e){return{msgDataTime:e.sentTime,msgId:e.messageUId,direct:e.messageDirection}})),n=Za.encode(Zo,{type:e.conversationType,busChannel:e.channelId,conversationId:e.targetId,msgs:r}),i=e.conversationType===exports.ConversationType.ULTRA_GROUP?Zr.delUgMsg:Zr.delMsg,[4,this._ctx.query(i,this._ctx.currentUserId,n)];case 1:return(o=s.sent()).isOk?this._ctx.includeUg?((a=this.storage.getModel(e))&&(u=a.latestMessage)&&t.some((function(e){return e.messageUId===u.messageUId}))&&a.updateAttrs({latestMessage:null}),[2,ht()]):[2,ht()]:[2,o.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"deleteRemoteMessageByTimestamp",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i,o,a;return s(this,(function(s){switch(s.label){case 0:return r=Za.encode(xo,{conversationType:e.conversationType,targetId:e.targetId,busChannel:e.channelId,dataTime:t}),n=xh[e.conversationType],[4,this._ctx.query(n,this._ctx.currentUserId,r)];case 1:return(i=s.sent()).isOk?this._ctx.includeUg?((o=this.storage.getModel(e))&&(a=o.latestMessage)&&(0===t||a.sentTime<=t)&&o.updateAttrs({latestMessage:null}),[2,ht()]):[2,ht()]:[2,i.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"batchClearRemoteHistoryMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var t,r,n=this;return s(this,(function(i){switch(i.label){case 0:return t=Za.encode(jo,{input:e.map((function(e){return{conversationType:e.conversationType,targetId:e.targetId,busChannel:e.channelId,dataTime:e.timestamp||0}}))}),[4,this._ctx.query(Zr.cleanMsgBatch,this._ctx.currentUserId,t)];case 1:return(r=i.sent()).isOk?(e.forEach((function(e){var t=n.storage.getModel(e);if(t){var r=t.latestMessage;r&&(!e.timestamp||r.sentTime<=e.timestamp)&&t.updateAttrs({latestMessage:null})}})),[2,ht()]):[2,r.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"sendReadReceiptResponseV5",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n;return s(this,(function(i){switch(i.label){case 0:return r=Za.encode(Es,{targetId:e.targetId,type:e.conversationType,channelId:e.channelId,readType:0,msgIds:t}),n=t[0],[4,this._ctx.query(Zr.readReceipt,n,r)];case 1:return[2,i.sent().wipe()]}}))}))}}),Object.defineProperty(e.prototype,"getMessageReadReceiptInfoV5",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i,o,a;return s(this,(function(s){switch(s.label){case 0:return r=Zf({targetId:e.targetId,type:e.conversationType,busChannel:e.channelId,msgIds:t,qryType:0}),[4,this._ctx.query(Zr.qryReceipt,t[0],r)];case 1:return(n=s.sent()).isOk?(i=n.data,o=Xf(i.pbData).resp,a=o.map((function(e){return{messageUId:e.msgId,unreadCount:e.unreadCnt,readCount:e.readCnt,totalCount:e.totalCnt}})),[2,ht(a)]):[2,n.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"getMessagesReadReceiptUsersByPageV5",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n,i,o,a,u,l,c,d;return s(this,(function(s){switch(s.label){case 0:return n=0===r.readStatus?1:2,i=Zf({targetId:e.targetId,type:e.conversationType,busChannel:e.channelId,msgIds:[t],qryType:1,pageType:1,pageToken:r.pageToken,pageSize:r.pageCount,readType:n,order:r.order?0:1}),[4,this._ctx.query(Zr.qryReceipt,t,i)];case 1:return(o=s.sent()).isOk?(a=o.data,u=Xf(a.pbData),l=u.resp,c=u.pageToken,d=l[0],[2,ht({pageToken:c||"",totalCount:1===n?d.readCnt:d.unreadCnt,users:(1===n?d.readUser:d.unreadUser).map((function(e){var t=e.userId,r=e.mentioned;return{userId:t,timestamp:e.receiptTime||0,isMentioned:!!r}}))})]):[2,o.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"getMessagesReadReceiptByUsersV5",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n,i,o,a,c;return s(this,(function(s){switch(s.label){case 0:return n=Zf({targetId:e.targetId,type:e.conversationType,busChannel:e.channelId,msgIds:[t],qryType:2,users:r}),[4,this._ctx.query(Zr.qryReceipt,t,n)];case 1:return(i=s.sent()).isOk?(o=i.data,a=Xf(o.pbData).resp,c=a[0],[2,ht({pageToken:"",totalCount:0,users:l(l([],u(c.readUser),!1),u(c.unreadUser),!1).map((function(e){var t=e.userId,r=e.mentioned;return{userId:t,timestamp:e.receiptTime||0,isMentioned:!!r}}))})]):[2,i.wipe()]}}))}))}}),e}();uh=new WeakMap,lh=new WeakMap,ch=new WeakMap,gh=new WeakMap,ah=new WeakSet,dh=function(e,t,r){if(t===ih){e.stopPropagation();var n=[];r.forEach((function(e){if(0===e.subChangeType){var t=Za.decode(ka,new Uint8Array(e.eventData)),r=t.msgId,i=t.unreadCnt,o=t.readCnt,s=t.readList,a=t.totalCnt;n.push({identifier:{conversationType:e.channelType,targetId:e.businessId,channelId:e.secondaryId},messageUId:r,users:s.map((function(e){return{userId:e.userId,timestamp:e.receiptTime,isMentioned:!!e.mentioned}})),readCount:o,unreadCount:i,totalCount:a})}})),this._ctx.emit("readReceiptResponseV5",n)}},ph=function(e){e||(c(this,lh,"f").setInitVersion(0),this._ctx.includeUg&&c(this,ah,"m",_h).call(this)),c(this,lh,"f").startInterval(Ph,!0)},fh=function(e){return o(this,void 0,void 0,(function(){var t;return s(this,(function(r){switch(r.label){case 0:return e?[3,2]:[4,this.settings.syncDataFromServer()];case 1:t=r.sent(),this.settings.setInitVersion(t),r.label=2;case 2:return this._ctx.isConnected&&this.settings.startInterval(Ph,!0),[2]}}))}))},hh=function(e,t){t||this.storage.syncDataFromLocalStorage(this._ctx),c(this,ah,"m",fh).call(this,t),c(this,ah,"m",ph).call(this,t),this._ctx.ugEnabel&&c(this,ah,"m",bh).call(this,t)},_h=function e(){return o(this,void 0,void 0,(function(){var t,r,n,i,o,a,u,l,p,f,h=this;return s(this,(function(s){switch(s.label){case 0:return this._ctx.isConnected?(t=this._ctx.logger,r=t.createTraceId(),n=c(this,gh,"f"),t.info(H.L_PULL_SG_RELATIONS_T,JSON.stringify({startTime:n}),r),i=Qf(n,1,1e3),[4,this._ctx.query(Zr.qryRelationR,this._ctx.currentUserId,i)]):[2];case 1:return(o=s.sent()).isOk?(a=o.data,u=Wf(a.pbData),l=u.info,p=u.isFinished,f=u.pullTime,d(this,gh,f,"f"),t.info(H.L_PULL_SG_RELATIONS_R,JSON.stringify({startTime:n,isFinished:p,pullTime:f}),r),this.storage.addRelations(l,this._ctx.currentUserId,this._ctx.connectedTime),p?(this._ctx.emit("sgRelationsSynced"),[2]):[2,c(this,ah,"m",e).call(this)]):(t.warn(H.L_PULL_SG_RELATIONS_R,o.errmsg(),r),setTimeout((function(){return c(h,ah,"m",e).call(h)}),1e3),[2])}}))}))},bh=function(e){return o(this,void 0,void 0,(function(){var e,t,r,n;return s(this,(function(i){switch(i.label){case 0:return[4,c(this,uh,"f").markOnline()];case 1:return(e=i.sent()).isOk?(t=e.data,r=t.relations,n=t.msgVersion,this.storage.addRelations(r,this._ctx.currentUserId,this._ctx.connectedTime),this._ctx.emit("ultraGroupEnable"),c(this,uh,"f").setInitVersion(n),c(this,uh,"f").startInterval(Ph,!0),c(this,ch,"f").setInitVersion(n),c(this,ch,"f").startInterval(Ph,!0),[2]):[2]}}))}))},Eh=function(){this.settings.stopInterval(),c(this,uh,"f").reset(),c(this,lh,"f").reset(),c(this,ch,"f").reset()},vh=function(e,t){if(3===t.type)return e.stopPropagation(),void this.settings.push(t.time);7===t.type&&(e.stopPropagation(),c(this,ch,"f").push(t.time))},yh=function(e,t,r){var n=t.syncMsg,i=rn(t.topic);if(n&&i===Zr.updUgRTime){e.stopPropagation();var o=Za.decode(qo,t.pbData),s=o.channelId,a=o.busChannel,u=o.msgTime,l=this.storage.clearConversationUnreadCount(exports.ConversationType.ULTRA_GROUP,s,a||"",u);l&&this._ctx.emit("conversationStatusChanged",[l])}},mh=function(e){return o(this,void 0,void 0,(function(){var t,r,i,o,a,u,l,c,d,p,f,h,g,_,b,E,v,y=this;return s(this,(function(s){switch(s.label){case 0:return t=e.count,r=e.startTime,i=e.order,o=this._ctx,a=o.currentUserId,u=o.connectedTime,this._ctx.includeUg?[3,2]:(l=Qf(r,i||0,t),[4,this._ctx.query(Zr.qryRelationR,this._ctx.currentUserId,l)]);case 1:return(c=s.sent()).isOk?(d=Wf(c.data.pbData),p=d.info,f=d.isFinished,h=p.map((function(e){var t=e.userId,r=e.type,i=e.busChannel,o=y.storage.getOrCreateModel({conversationType:r,targetId:t,channelId:i},!1);return n(n({},o.toIReceivedConversation()),{operationTime:e.versionTime,latestMessage:e.msg?Wu(e.msg,a,u,t):null})})),[2,ht({list:h,hasNext:"boolean"==typeof f?!f:void 0})]):[2,c.wipe()];case 2:return g=0!==r||i?r:Number.MAX_SAFE_INTEGER,_=this.storage.getAllModels().filter((function(e){return!e.hidden&&(e.conversationType!==exports.ConversationType.ULTRA_GROUP||!e.channelId||"RCDefault"===e.channelId)&&(i?e.operationTime>g:e.operationTime<g)})).sort((function(e,t){return e.operationTime-t.operationTime})),b=_.length>t,E=Math.min(_.length,t),v=i?_.slice(0,E):_.slice(_.length-E),i||v.reverse(),[2,ht({hasNext:b,list:v.map((function(e){return e.toIReceivedConversation()}))})]}}))}))},Ih=function(e){var t;return o(this,void 0,void 0,(function(){var r,n,i,o;return s(this,(function(s){return r=this._ctx.includeUg,n=null==e?void 0:e.channelId,i=((null===(t=null==e?void 0:e.conversationTypes)||void 0===t?void 0:t.length)||0)>0?e.conversationTypes:ye(r?be:ge),o=this.storage.getAllModels().filter((function(e){return e.isTop&&!e.hidden&&(e.conversationType!==exports.ConversationType.ULTRA_GROUP&&(!n||e.channelId===n)||r&&(!e.channelId||""===e.channelId||"RCDefault"===e.channelId))&&i.includes(e.conversationType)})).sort((function(e,t){return e.operationTime-t.operationTime})).map((function(e){return e.toIReceivedConversation()})),[2,ht({list:o,hasNext:!1})]}))}))},Th=function(){return o(this,void 0,void 0,(function(){var e,t;return s(this,(function(r){return e=this._ctx.includeUg,t=this.storage.getAllModels().filter((function(t){return!t.hidden&&t.notificationLevel>exports.NotificationLevel.NOT_SET&&(t.conversationType!==exports.ConversationType.ULTRA_GROUP||e&&(!t.channelId||""===t.channelId||"RCDefault"===t.channelId))})).sort((function(e,t){return e.operationTime-t.operationTime})).map((function(e){return e.toIReceivedConversation()})),[2,ht({list:t,hasNext:!1})]}))}))},Rh=function(e){var t;return o(this,void 0,void 0,(function(){var r,n,i;return s(this,(function(o){return r=this._ctx.includeUg,n=((null===(t=null==e?void 0:e.conversationTypes)||void 0===t?void 0:t.length)||0)>0?e.conversationTypes:ye(r?be:ge),i=this.storage.getAllModels().filter((function(e){return e.unreadCount>0&&(e.conversationType!==exports.ConversationType.ULTRA_GROUP||r&&(!e.channelId||""===e.channelId||"RCDefault"===e.channelId))&&n.includes(e.conversationType)})).sort((function(e,t){return e.operationTime-t.operationTime})).map((function(e){return e.toIReceivedConversation()})),[2,ht({list:i,hasNext:!1})]}))}))},Ch=function(e,t,r,n){return o(this,void 0,void 0,(function(){var i,o;return s(this,(function(s){return i=[],void 0!==r&&i.push({sessionStateType:_o.IsTop,value:r?"1":"0"}),void 0!==n&&i.push({sessionStateType:_o.IsSilent,value:n.toString()}),o=Za.encode(cs,{version:t,state:e.map((function(e){return{type:e.conversationType,channelId:e.targetId,busChannel:e.channelId,stateItem:i}}))}),[2,this._ctx.query(Zr.setSeAtt,this._ctx.currentUserId,o,hs)]}))}))};var wh,Mh,Lh,Uh,Dh,xh=((sh={})[exports.ConversationType.PRIVATE]=Zr.cleanPMsg,sh[exports.ConversationType.GROUP]=Zr.cleanGMsg,sh[exports.ConversationType.CUSTOMER_SERVICE]=Zr.cleanCMsg,sh[exports.ConversationType.SYSTEM]=Zr.cleanSMsg,sh[exports.ConversationType.APP_PUBLIC_SERVICE]=Zr.cleanMCMsg,sh[exports.ConversationType.PUBLIC_SERVICE]=Zr.cleanMPMsg,sh[exports.ConversationType.ULTRA_GROUP]=Zr.cleanGMsg,sh),jh=function(){Object.defineProperty(this,"recallMsgMap",{enumerable:!0,configurable:!0,writable:!0,value:new Set})};function Vh(e){var t=!(1&~(e.ugMsg||0)),r=!(1&~(e.sessionCfg||0));return t&&r}var Gh,kh=[Zr.chatMsg,Zr.ugMsg,Zr.recallMsg,Zr.ppMsgS,Zr.pgMsgS,Zr.ppMsgP,Zr.pgMsgP,Zr.pcMsgP,Zr.prMsgS,Zr.pbMsgP,Zr.chatMsgS],Fh=function(e){function r(t,r,n,i){var o=e.call(this)||this;return wh.add(o),Object.defineProperty(o,"appkey",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(o,"_connMgr",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(o,"_navi",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(o,"logger",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(o,"send",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(o,"query",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(o,"userStorage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Mh.set(o,void 0),o.userStorage=new jh,d(o,Mh,new oh(r,i),"f"),c(o,Mh,"f").pipe(o),o.on("onConnected",c(o,wh,"m",Lh),o,100),o.on("onDisconnected",c(o,wh,"m",Uh),o,100),o.on("onSuspend",c(o,wh,"m",Uh),o,100),o.send=o._connMgr.send.bind(o._connMgr),o.query=o._connMgr.query.bind(o._connMgr),o.on("signal",c(o,wh,"m",Dh),o),o}return t(r,e),Object.defineProperty(r.prototype,"isConnected",{get:function(){return this._connMgr.isConnected},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"currentUserId",{get:function(){return this._connMgr.getCurrentUserId()},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"currentToken",{get:function(){return this._connMgr.getToken()},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"serverTime",{get:function(){return this._connMgr.getCrtServerTime()},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"connectedTime",{get:function(){return this._connMgr.getConnectedTime()},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"ugEnabel",{get:function(){return!(1&~(this.getNaviInfoFromCache().ugMsg||0))},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"isDisableEmptyUGChannelId",{get:function(){return!(2&~(this.getNaviInfoFromCache().ugDriven||0))},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"includeUg",{get:function(){return Vh(this.getNaviInfoFromCache())},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"getNaviInfoFromCache",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._navi.getNaviInfoFromCache(this.currentToken)}}),r}(pt);Mh=new WeakMap,wh=new WeakSet,Lh=function(e,t){return o(this,void 0,void 0,(function(){var e,t,r,n,i,o,a;return s(this,(function(s){switch(s.label){case 0:return e=this.getNaviInfoFromCache(),t=e.eventDriven||0,r=e.grpRRVer||0,(3&t)>0||4===r?[4,c(this,Mh,"f").noticeOnline()]:[3,2];case 1:if(!(n=s.sent()).isOk)return[2];i=n.data,o=i.syncTime,a=i.hasNext,c(this,Mh,"f").setInitVersion(o),c(this,Mh,"f").startInterval(18e4,!!a),s.label=2;case 2:return[2]}}))}))},Uh=function(e){c(this,Mh,"f").reset()},Dh=function(e,t,r){var n=t.topic,i=t.syncMsg,o=rn(n);if(o||(this.logger.warn(H.L_RECV_RMTP_E,"unknown topic: ".concat(n)),e.stopPropagation()),this.logger.debug(H.L_RECV_RMTP_O,n),i&&kh.includes(o)){e.stopPropagation();var s=r||{},a=s.timestamp,u=void 0===a?this.serverTime:a,l=s.messageUId,d=void 0===l?"":l,p=Qu(t,this.currentUserId,u,d),f=Wu(p,this.currentUserId,this.connectedTime,t.targetId);this.emit("syncMsg",f,o)}else{if(o===Zr.s_ntf){e.stopPropagation();var h=(b=Za.decode(bo,t.pbData)).type,g=b.chrmId,_=b.time;return this.logger.info(H.L_RECV_S_NTF_O,"type: ".concat(h,", chrmId: ").concat(g,", time: ").concat(_)),void this.emit("sNtf",b)}if(o===Zr.s_cmd){e.stopPropagation();var b;h=(b=Za.decode(bo,t.pbData)).type,g=b.chrmId,_=b.time;if(this.logger.info(H.L_RECV_S_CMD_O,"type: ".concat(h,", chrmId: ").concat(g,", time: ").concat(_)),11===h)return void c(this,Mh,"f").push(_);this.emit("sCmd",b)}}};var Bh=((Gh={})[exports.ConversationType.PRIVATE]=Zr.qryPMsg,Gh[exports.ConversationType.GROUP]=Zr.qryGMsg,Gh[exports.ConversationType.CHATROOM]=Zr.qryCHMsg,Gh[exports.ConversationType.CUSTOMER_SERVICE]=Zr.qryCMsg,Gh[exports.ConversationType.SYSTEM]=Zr.qrySMsg,Gh[exports.ConversationType.APP_PUBLIC_SERVICE]=Zr.qryMCMsg,Gh[exports.ConversationType.PUBLIC_SERVICE]=Zr.qryMPMsg,Gh),Hh=function(e,t,r,n,i,o,s){return{conversationType:e,targetId:t,senderUserId:o,messageDirection:exports.MessageDirection.SEND,isCounted:!!r.isCounted,isMentioned:!!r.isMentioned,content:r.content,messageType:r.messageType,isOffLineMessage:!1,isPersited:!!r.isPersited,messageUId:n,sentTime:i,receivedTime:0,disableNotification:!!r.disableNotification,isStatusMessage:!!r.isStatusMessage,canIncludeExpansion:!!r.canIncludeExpansion,expansion:r.canIncludeExpansion?r.expansion:null,receivedStatus:exports.ReceivedStatus.UNREAD,receivedStatusInfo:Bt(exports.ReceivedStatus.UNREAD),pushConfig:r.pushConfig,channelId:r.channelId,isInterrupt:r.isInterrupt,messageId:s||0,sentStatus:exports.SentStatus.SENT,directedUserIds:r.directionalUserIdList,disableUpdateLastMessage:r.disableUpdateLastMessage,needReceipt:r.needReceipt}},qh=[M.GROUP_OPERATION,M.GROUP_PROFILE_CHANGE,M.GROUP_APPLICATION_INVITATION,M.GROUP_FOLLOW_USER_CHANGE],Yh=[v.FRIEND_APPLICATION];function Kh(){return function(e,t,r){var n=r.value;return r.value=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return o(this,void 0,void 0,(function(){return s(this,(function(t){return this._isConnected?[2,n.apply(this,e)]:[2,Promise.resolve({code:exports.ErrorCode.RC_NET_UNAVAILABLE})]}))}))},r}}function Qh(){return function(e,t,r){var n=r.value;return r.value=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return o(this,void 0,void 0,(function(){return s(this,(function(t){return this._isConnected?[2,n.apply(this,e)]:[2,Promise.resolve(gt(exports.ErrorCode.RC_NET_UNAVAILABLE))]}))}))},r}}function Wh(e){return e?e.map((function(e){var t;return{userId:e.userId,name:e.name,portraitUri:e.portraitUrl,remark:null!==(t=e.remarkName)&&void 0!==t?t:"",directionType:e.friendType,extProfile:e.extProfile,addTime:kt(e.relationTime),inBlackList:!!e.flag}})):[]}function Jh(e){return e&&e.list?e.list.map((function(e){return{userId:e.userId,name:e.name||"",portraitUri:e.portraitUrl||"",applicationType:e.type,applicationStatus:e.status,operationTime:kt(e.operateTime),extra:e.info||"",friendType:e.friendType}})):[]}var zh=function(e){function r(t,r,n){var i=e.call(this,t,r,n,new lf(n.appkey,"IMLib","IM"))||this;d.add(i),Object.defineProperty(i,"_connMgr",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(i,"_ctx",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(i,"_sendMessageStore",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(i,"_chrmEntryHandler",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(i,"_joinedChrmManager",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(i,"_userSettingManager",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(i,"_readReceiptManager",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(i,"_subscribeManager",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(i,"_reconnectTimer",{enumerable:!0,configurable:!0,writable:!0,value:-1}),Object.defineProperty(i,"_pullOfflineFinished",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(i,"reporter",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(i,"reporterStatistic",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(i,"navi",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(i,"_openCallPlus",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(i,"cloudController",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(i,"cloudControllerUri",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(i,"_environment",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(i,"_enableReadReceiptStorage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(i,"_chat",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(i,"_chrmsQueue",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(i,"_latestPullKVMsgTimestamp",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(i,"getFirstUnreadMessage",{enumerable:!0,configurable:!0,writable:!0,value:Ah}),Object.defineProperty(i,"_intervalTimerForChrmPull",{enumerable:!0,configurable:!0,writable:!0,value:-1}),Object.defineProperty(i,"_handleInnerMsgOptions",{enumerable:!0,configurable:!0,writable:!0,value:function(e,t,r){var n,o=r.messageType;if(o===exports.MessageType.SYNC_READ_STATUS&&function(e){return[exports.ConversationType.GROUP,exports.ConversationType.DISCUSSION,exports.ConversationType.ULTRA_GROUP,exports.ConversationType.PUBLIC_SERVICE,exports.ConversationType.APP_PUBLIC_SERVICE].includes(e)}(e)&&Object.assign(r,{directionalUserIdList:[i.currentUserId]}),o===exports.MessageType.READ_RECEIPT_RESPONSE){if(!r.content.receiptMessageDic||0===Object.keys(r.content.receiptMessageDic).length){var s=null===(n=i._readReceiptManager)||void 0===n?void 0:n.getReceiptMessageDic({conversationType:e,targetId:t,channelId:r.channelId});r.content.receiptMessageDic=s||{}}for(var a in r.directionalUserIdList=[],r.content.receiptMessageDic)r.directionalUserIdList.push(a)}return r}}),Object.defineProperty(i,"_isUltraGroupListExist",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(i,"_ultraMsgMap",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(i,"getContinuousMessages",{enumerable:!0,configurable:!0,writable:!0,value:Ah}),Object.defineProperty(i,"getHistoryMessagesByObjectNames",{enumerable:!0,configurable:!0,writable:!0,value:Ah}),Object.defineProperty(i,"clearConversations",{enumerable:!0,configurable:!0,writable:!0,value:Sh}),Object.defineProperty(i,"setUserStatusListener",{enumerable:!0,configurable:!0,writable:!0,value:Sh}),Object.defineProperty(i,"setUserStatus",{enumerable:!0,configurable:!0,writable:!0,value:Sh}),Object.defineProperty(i,"subscribeUserStatus",{enumerable:!0,configurable:!0,writable:!0,value:Sh}),Object.defineProperty(i,"getUserStatus",{enumerable:!0,configurable:!0,writable:!0,value:Ah}),Object.defineProperty(i,"addToBlacklist",{enumerable:!0,configurable:!0,writable:!0,value:Sh}),Object.defineProperty(i,"removeFromBlacklist",{enumerable:!0,configurable:!0,writable:!0,value:Sh}),Object.defineProperty(i,"getBlacklist",{enumerable:!0,configurable:!0,writable:!0,value:Ah}),Object.defineProperty(i,"getBlacklistStatus",{enumerable:!0,configurable:!0,writable:!0,value:Ah}),Object.defineProperty(i,"insertMessage",{enumerable:!0,configurable:!0,writable:!0,value:Ah}),Object.defineProperty(i,"batchInsertMessage",{enumerable:!0,configurable:!0,writable:!0,value:Ah}),Object.defineProperty(i,"getMessageCount",{enumerable:!0,configurable:!0,writable:!0,value:Ah}),Object.defineProperty(i,"deleteMessages",{enumerable:!0,configurable:!0,writable:!0,value:Sh}),Object.defineProperty(i,"deleteMessagesByTimestamp",{enumerable:!0,configurable:!0,writable:!0,value:Sh}),Object.defineProperty(i,"batchClearMessagesByTimestamp",{enumerable:!0,configurable:!0,writable:!0,value:Sh}),Object.defineProperty(i,"clearMessages",{enumerable:!0,configurable:!0,writable:!0,value:Sh}),Object.defineProperty(i,"getMessage",{enumerable:!0,configurable:!0,writable:!0,value:Ah}),Object.defineProperty(i,"setMessageContent",{enumerable:!0,configurable:!0,writable:!0,value:Sh}),Object.defineProperty(i,"setMessageSearchField",{enumerable:!0,configurable:!0,writable:!0,value:Sh}),Object.defineProperty(i,"searchConversationByContentWithAllChannel",{enumerable:!0,configurable:!0,writable:!0,value:Ah}),Object.defineProperty(i,"searchMessagesWithParams",{enumerable:!0,configurable:!0,writable:!0,value:Ah}),Object.defineProperty(i,"getMessagesByTimestamp",{enumerable:!0,configurable:!0,writable:!0,value:Ah}),Object.defineProperty(i,"setMessageSentStatus",{enumerable:!0,configurable:!0,writable:!0,value:Sh}),Object.defineProperty(i,"updateMessageReceiptStatus",{enumerable:!0,configurable:!0,writable:!0,value:Ah}),Object.defineProperty(i,"setMessageReceivedStatus",{enumerable:!0,configurable:!0,writable:!0,value:Sh}),Object.defineProperty(i,"clearLocalData",{enumerable:!0,configurable:!0,writable:!0,value:Ah}),Object.defineProperty(i,"clearUnreadCountByTimestamp",{enumerable:!0,configurable:!0,writable:!0,value:Sh}),Object.defineProperty(i,"setCheckDuplicateMessage",{enumerable:!0,configurable:!0,writable:!0,value:Ah}),Object.defineProperty(i,"setCheckChatRoomDuplicateMessage",{enumerable:!0,configurable:!0,writable:!0,value:Ah}),Object.defineProperty(i,"getConversations",{enumerable:!0,configurable:!0,writable:!0,value:Ah});var o=n.appkey,s=n.logOutputLevel,a=n.logExpireTime,u=n.navigators,l=n.areaCode,h=n.logServerUrl,g=n.miniCMPProxy,_=n.environment,b=n.useNaviV2,E=void 0!==b&&b,v=n.enableReadReceiptStorage;i._environment=_||"default",i._enableReadReceiptStorage=v,i.logger.setOutputLevel(s),yr.init({areaCode:l,navigators:u,logServerUrl:h,miniCMPProxy:g}),Zp(o,i.logger,a),i.reporter=new gf(o,i.logger),i.navi=new hl(o,i.logger,new yl(o,i.logger),i._environment,E),i.reporterStatistic=new _f(o,i.logger),i._sendMessageStore=new gl(o),i._chrmEntryHandler=new ul(i);var y=i._connMgr=new Fp(o,i.navi,i.logger),m=i._ctx=new Fh(i._appkey,y,i.navi,i.logger);return i._connMgr.pipe(m),i._chat=new Nh(m),m.on("conversationStatusChanged",i._conversationStatusChanged,i),m.on("sCmd",i._handleSCmdNotify,i),m.on("sNtf",i._handleMsgNotify,i),m.on("signal",i._handleSignal,i),m.on("onConnected",i.onConnected,i),m.on("onDisconnected",i.onDisconnected,i),m.on("onConnecting",i.onConnecting,i),m.on("onSuspend",i.onSuspend,i),m.on("ultraGroupEnable",i._handleUltraGroupEnable,i),m.on("messagesFromUG",i._handleMessagesFromUltraGroup,i),m.on("messagesFromSG",i._handleMessagesFromSignalGroup,i),m.on("smsgFromSignalGroup",i._handleSmsgFromSignalGroup,i),m.on("syncMsg",i._handleSyncMsg,i),m.on("sgRelationsSynced",i._handleSGRelationsSynced,i),m.on("serverEvent",c(i,d,"m",f),i),m.on("readReceiptResponseV5",c(i,d,"m",p),i),m.on("ugChanged",i._handleUGChangeList,i),i}var d,p,f,h;return t(r,e),Object.defineProperty(r.prototype,"chat",{get:function(){return this._chat},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"_initCloudController",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e;e=u(yr.getCloudControllerUrl(),1),this.cloudControllerUri=e[0],this.cloudController=new Bp(this._appkey,this.logger,this.reporter),this.cloudControllerUri&&this.cloudController.request(this.cloudControllerUri,Ir.init)}}),Object.defineProperty(r.prototype,"onConnected",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this.navi.getNaviInfoFromCache(this._connMgr.getToken());this._pullOfflineFinished=!1,this._joinedChrmManager||(this._joinedChrmManager=new ll(r.joinMChrm)),this._userSettingManager||(this._userSettingManager=new dl(this,this._appkey,this.currentUserId,this._watcher.tag)),this._readReceiptManager||(this._readReceiptManager=new vl(this._appkey,this.currentUserId,this._connMgr.getDelayTime())),this._initSubscribeManager(r),this._userSettingManager.pullUserSettings(0),this._sendMessageStore.init(this.currentUserId),this._rejoinChrm(),this._openCallPlus&&this._syncCallPullKVMsg(),this._watcher.onConnected(),this.reporter.checkStart(r),this.reporterStatistic.checkStart(r)}}),Object.defineProperty(r.prototype,"onDisconnected",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r;this._resetMemoryState(),null===(r=this._userSettingManager)||void 0===r||r.stopAllTask(),this._watcher.onDisconnected(t)}}),Object.defineProperty(r.prototype,"onSuspend",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r;null===(r=this._userSettingManager)||void 0===r||r.stopAllTask(),this._watcher.onSuspend(t)}}),Object.defineProperty(r.prototype,"onConnecting",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._watcher.onConnecting()}}),Object.defineProperty(r.prototype,"_conversationStatusChanged",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._watcher.conversation(t);var r=t.some((function(e){var t;return void 0!==(null===(t=e.updatedItems)||void 0===t?void 0:t.tags)}));r&&this._watcher.conversationTag()}}),Object.defineProperty(r.prototype,"_initSubscribeManager",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;(e.subDriven||e.userProfile)&&(this._subscribeManager||(this._subscribeManager=new El(this._connMgr,{syncSubscribeUserStatusFinished:function(e){var r,n;null===(n=(r=t._watcher).syncSubscribedUserStatusFinished)||void 0===n||n.call(r,e)},subscribeUserStatusChanged:function(e){var r,n;null===(n=(r=t._watcher).subscribedUserStatusChange)||void 0===n||n.call(r,e)},subscribeRelationChanged:function(e){var r,n;null===(n=(r=t._watcher).subscribedRelationChange)||void 0===n||n.call(r,e)},ownUserProfileChanged:function(e){var r,n;null===(n=(r=t._watcher).ownUserProfileChanged)||void 0===n||n.call(r,e)}},this.currentUserId,this._connMgr.getDelayTime(),this.logger,!!e.userProfile,e.subDriven||0)),this._subscribeManager.syncData())}}),Object.defineProperty(r.prototype,"createLogger",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return new lf(this._appkey,e,t)}}),Object.defineProperty(r.prototype,"refetchNaviInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.navi.request(this._connMgr.getToken(),!0,!0,this.logger.createTraceId())}}),Object.defineProperty(r.prototype,"getNaviInfoFromCache",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.navi.getNaviInfoFromCache(this._connMgr.getToken())}}),Object.defineProperty(r.prototype,"getConnectedTime",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._connMgr.getConnectedTime()}}),Object.defineProperty(r.prototype,"getConnectionStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._connMgr.getConnectionStatus()}}),Object.defineProperty(r.prototype,"connect",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return o(this,void 0,void 0,(function(){return s(this,(function(i){return this._openCallPlus=r,[2,this._connMgr.connect(e,t,r,n)]}))}))}}),Object.defineProperty(r.prototype,"_handleUltraGroupEnable",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._isUltraGroupListExist=!0,this._watcher.ultraGroupEnable()}}),Object.defineProperty(r.prototype,"_handleSGRelationsSynced",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._watcher.sgRelationsSynced()}}),Object.defineProperty(r.prototype,"_handleMessagesFromUltraGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var i=this,o=new Map,s=[];t.forEach((function(e){var t,r,n,a=e.targetId,u=e.content,l=e.messageUId,c=e.channelId,d=e.isMentioned,p=e.isCounted,f=e.senderUserId,h=e.messageType,g=e.sentTime,_=e.channelType,b=e.isPersited;if(i._ultraMsgMap[l])delete i._ultraMsgMap[l];else{var E={conversationType:exports.ConversationType.ULTRA_GROUP,targetId:a,channelId:c||""},v=i._chat.storage.getOrCreateModel(E,!0),y=o.get(v)||{channelType:_};o.set(v,y),b&&(y.hidden=!1,y.latestMessage=e,y.operationTime=g),p&&f!==i.currentUserId&&h!==exports.MessageType.RECALL_NOTIFICATION_MESSAGE&&(y.unreadCount=v.unreadCount+1,d&&((null===(t=null==u?void 0:u.mentionedInfo)||void 0===t?void 0:t.type)===exports.MentionedType.ALL||(null===(n=null===(r=null==u?void 0:u.mentionedInfo)||void 0===r?void 0:r.userIdList)||void 0===n?void 0:n.includes(i.currentUserId)))&&(y.unreadMentionedCount=v.unreadMentionedCount+1,y.hasMentioned=!0,y.mentionedInfo=null==u?void 0:u.mentionedInfo),v.firstUnreadMessage||(y.firstUnreadMessageType=h,y.firstUnreadMessageUId=l,y.firstUnreadTime=g)),s.push(e)}}));var a=[],l=[];Array.from(o.entries()).forEach((function(e){var t=u(e,2),r=t[0],i=t[1];a.push(r);var o=r.updateAttrs(i);o&&l.push(n(n({},r.toIReceivedConversation()),{updatedItems:o}))})),this._chat.storage.updateConversationStorage(a),l.length>0&&this._watcher.conversation(l),this._batchMessage(s)}}),Object.defineProperty(r.prototype,"_handleMessagesFromSignalGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n=this,i=this._messageProcessor(t),o=i.newOutboxTime;i.messageUIds;var s=i.messages,a=i.messageExpansionList,u=i.RSMsgList,l=i.msgUIds2Statistic;l.length>0&&this.logger.record(pe.IM_MSG_RECEIVE,JSON.stringify({client_ts:Date.now(),server_deltatime:Date.now()-this._connMgr.getCrtServerTime(),msg_ids:l.join(",")})),this._batchMessage(s),a.forEach((function(e){n._receiveMessageExpansion(e)})),u.forEach((function(e){n._processRSMsg(e)})),this._sendMessageStore.removeByTimestamp(o),r&&!this._pullOfflineFinished&&(this._pullOfflineFinished=!0,this.logger.info(H.L_PULL_OFFLINE_MESSAGE_FINISHED_S),this._watcher.pullFinished())}}),Object.defineProperty(r.prototype,"_handleSignal",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n,i=t.syncMsg,o=t.topic;if(i)this._receiveSyncMsg(t,r);else switch(rn(o)){case Zr.s_us:this._receiveSettingNotify(t);break;case Zr.rtc_ntf:this._receiveRtcKv(t.pbData);break;case Zr.s_opNtf:this._pullOperateStatusNotify(t);break;case Zr.s_pubCall:this._pubCallInfo(t);break;case Zr.s_stat:null===(n=this._subscribeManager)||void 0===n||n.updateUserStatus(t)}}}),Object.defineProperty(r.prototype,"_handleSCmdNotify",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r,n,i,o=t.time,s=t.type,a=t.chrmId;switch(s){case 2:if(!this._chrmsQueue[a])return;this._chrmEntryHandler.pullEntry(a,o);break;case 4:this._chrmEntryHandler.reset(a),this._watcher.chatroom({chatroomDestroyed:a});break;case 8:null===(r=this._subscribeManager)||void 0===r||r.startsyncSubscribeUserStatus(o);break;case 9:null===(n=this._subscribeManager)||void 0===n||n.startSyncSubscribeRelationship(o);break;case 10:null===(i=this._subscribeManager)||void 0===i||i.syncOwnProfile(!0)}}}),Object.defineProperty(r.prototype,"_receiveSettingNotify",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=Za.decode(Cs,e.pbData).version;this._userSettingManager.pullUserSettings(t)}}),Object.defineProperty(r.prototype,"_receiveMessageExpansion",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.content,r=e.channelId,n=void 0===r?"":r,i=e.conversationType,o=e.targetId,s=t.put,a=t.del,u=t.mid;s&&this._watcher.expansion({updatedExpansion:{messageUId:u,expansion:s,channelId:n,conversationType:i,targetId:o}}),a&&this._watcher.expansion({deletedExpansion:{messageUId:u,deletedKeys:a,channelId:n,conversationType:i,targetId:o}})}}),Object.defineProperty(r.prototype,"_clearConversationUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){var o=this._chat.storage.clearConversationUnreadCount(e,t,r,i);n&&o&&this._watcher.conversation([o])}}),Object.defineProperty(r.prototype,"_setConversationCacheByMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.conversationType,r=e.isPersited,i=e.targetId,o=e.channelId,s=e.sentTime,a=e.disableUpdateLastMessage;e.messageDirection;var u=e.senderUserId,l=e.messageType,c=e.isCounted,d=e.messageUId,p=e.content,f=e.isMentioned;if(me(t,ge)){var h=this.getNaviInfoFromCache(),g=this._chat.storage.getOrCreateModel({conversationType:t,targetId:i,channelId:o},!0),_={},b=u===this.currentUserId,E=l===exports.MessageType.RECALL,v=g.lastReadTime>s;if(c&&!zu(h).isOk&&!E&&!b&&!v&&(0===g.unreadCount&&(_.firstUnreadMessageUId=d,_.firstUnreadTime=s,_.firstUnreadMessageType=l),_.unreadCount=g.unreadCount+1,f&&Pt(p)&&p.mentionedInfo)){_.hasMentioned=!0,_.mentionedInfo=p.mentionedInfo;var y=p.mentionedInfo,m=y.type,I=y.userIdList;(m===exports.MentionedType.ALL||(I||[]).includes(this.currentUserId))&&(_.unreadMentionedCount=g.unreadMentionedCount+1)}if(E&&Pt(p)&&!b){var T=p,R=T.sentTime,C=T.messageUId;!this._ctx.userStorage.recallMsgMap.has(C)&&g.unreadCount>0&&R>g.lastReadTime&&(this._ctx.userStorage.recallMsgMap.add(C),_.unreadCount=g.unreadCount-1,0===g.unreadCount&&(_.firstUnreadMessageUId="",_.firstUnreadTime=0,_.firstUnreadMessageType=""))}r&&(_.hidden=!1,_.operationTime=s,a||g.latestMessage&&!(g.latestMessage.sentTime<s)||(_.latestMessage=e));var O=g.updateAttrs(_);this._chat.storage.updateConversationStorage([g]),O&&r&&!a&&this._watcher.conversation([n(n({},g.toIReceivedConversation()),{updatedItems:O})])}}}),Object.defineProperty(r.prototype,"_receiveSyncMsg",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r;switch(rn(e.topic)){case Zr.updRTime:this._receivesyncReadStatus(e);break;case Zr.updUserSub:null===(r=this._subscribeManager)||void 0===r||r.startSyncSubscribeRelationship(t.timestamp)}}}),Object.defineProperty(r.prototype,"_batchMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){for(var t=this,r=[],n=[],i=[],o=e.length-1;o>=0;o-=1){var s=e[o];s.messageType===exports.MessageType.LOG_COMMAND&&s.senderUserId===Ve?n.unshift(s):s.messageType===exports.MessageType.CLOUD_CONTROL&&s.senderUserId===Ve?i.push(s):r.unshift(s)}this._watcher.batchMessage(r),n.forEach((function(e){var r=e.content,n=r.startTime,i=r.endTime,o=r.platform,s=r.logId,a=r.uri;t.reporter.report(parseInt(n,10),parseInt(i,10),o,a,s,e.messageUId)})),i.length>0&&this._ccMsgHandler(i)}}),Object.defineProperty(r.prototype,"_ccMsgHandler",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t;return o(this,void 0,void 0,(function(){var r,n,i;return s(this,(function(o){switch(o.label){case 0:return e.shift()?(r=this._connMgr.getToken(),[4,null===(t=this.cloudController)||void 0===t?void 0:t.request(this.cloudControllerUri,Ir.other,r)]):[3,2];case 1:n=o.sent()||0,(i=e.filter((function(e){return e.sentTime>n}))).length>0&&this._ccMsgHandler(i),o.label=2;case 2:return[2]}}))}))}}),Object.defineProperty(r.prototype,"_pubCallInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=Za.decode(Gs,e.pbData),r=t.key,n=t.dataContent,i=t.maxTime;this._latestPullKVMsgTimestamp=i,this._watcher.callInfo(JSON.stringify({list:[{key:r,value:n}]}))}}),Object.defineProperty(r.prototype,"_handleMsgNotify",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=t.type,n=t.chrmId,i=t.time;if(2===r){var o=this._chrmsQueue[n];o&&(o.queue.push(i),this._pullChrmMsg(n))}}}),Object.defineProperty(r.prototype,"_receivesyncReadStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=Za.decode(qo,e.pbData),r=t.type,n=t.channelId,i=t.msgTime,o=t.busChannel;this._clearConversationUnreadCount(r,n,o||"",!0,i),this._watcher.syncReadStatus({conversationType:r,targetId:n,channelId:o,timestamp:i})}}),Object.defineProperty(r.prototype,"_syncCallPullKVMsg",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t,r,n;return s(this,(function(i){switch(i.label){case 0:return this._isConnected?(e=Za.encode(ks,{syncTime:this._latestPullKVMsgTimestamp}),[4,this._connMgr.query(Zr.pullKvMsg,this.currentUserId,e,Fs)]):[2];case 1:return t=i.sent(),r=t.isOk,n=t.data,r&&n?(this._latestPullKVMsgTimestamp=n.maxTime,this._watcher.callInfo(JSON.stringify({list:n.info})),[2]):[2]}}))}))}}),Object.defineProperty(r.prototype,"_isConnected",{get:function(){return this._connMgr.getConnectionStatus()===exports.RCConnectionStatus.CONNECTED},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"_filterMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.messageType;return t===exports.MessageType.DELIVERED||t===exports.MessageType.DELIVERED_MSG||t===exports.MessageType.SYNC_READ_STATUS&&!this._processSRSMsg(e)}}),Object.defineProperty(r.prototype,"_messageProcessor",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this,r=0,n=[],i=[],o=[],s=[],a=[];return e.forEach((function(e){var u=e.conversationType,l=e.targetId,c=e.channelId,d=e.messageDirection,p=e.messageUId,f=e.messageType,h=e.sentTime,g=e.senderUserId,_=e.content;if(n.push(p),d===exports.MessageDirection.SEND){r=Math.max(h,r);var b=t._sendMessageStore.getSendMessageMap(),E=f===exports.MessageType.RECALL?"Cmd:".concat(_.messageUId):p;if(b[E])return void t._sendMessageStore.removeByUID(E)}if(!t._filterMessage(e)){switch(h>=t._connMgr.getConnectedTime()&&t._writeMessagesLog(u,p)&&a.push(p),f){case exports.MessageType.EXPANSION_NOTIFY:return void o.push(e);case exports.MessageType.READ_RECEIPT:g===t.currentUserId&&t._clearConversationUnreadCount(u,l,c,!0,h);break;case exports.MessageType.READ_STATE:return void s.push(e);case exports.MessageType.READ_RECEIPT_REQUEST:t._enableReadReceiptStorage&&t._processRRReqMsg(e);break;case exports.MessageType.READ_RECEIPT_RESPONSE:t._enableReadReceiptStorage&&t._processRRRspMsg(e)}var v=t._handleMsgProperties(e);t._setConversationCacheByMessage(v),i.push(v)}})),{newOutboxTime:r,messageUIds:n,messages:i,messageExpansionList:o,RSMsgList:s,msgUIds2Statistic:a}}}),Object.defineProperty(r.prototype,"_processSRSMsg",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.conversationType,r=e.targetId,n=e.channelId,i=e.content,o=e.senderUserId,s=e.sentTime;if(o!==this.currentUserId)return!1;var a=this.getNaviInfoFromCache();return this._clearConversationUnreadCount(t,r,n,!0,s),1!==a.sesDriven||(s>this.getConnectedTime()||this._watcher.syncReadStatus({conversationType:t,targetId:r,channelId:n,timestamp:i.lastMessageSendTime}),!1)}}),Object.defineProperty(r.prototype,"_processRSMsg",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.conversationType,r=e.targetId,i=e.channelId,o=e.content,s={conversationType:t,targetId:r,channelId:i};this._watcher.messageReadReceipt(t===exports.ConversationType.PRIVATE?{privateReadReceipt:n(n({},s),{endMsgTime:o.endMsgTime})}:{groupReadReceipt:n(n({},s),{totalCount:o.tmn,readedCount:o.rrn,messageUId:o.msgId})})}}),Object.defineProperty(r.prototype,"_processRRReqMsg",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r=e.conversationType,n=e.channelId,i=e.targetId,o=e.content,s=e.sentTime,a=e.messageDirection,u=e.senderUserId;null===(t=this._readReceiptManager)||void 0===t||t.insert({conversationType:r,channelId:n,targetId:i},o.messageUId,a,s,u)}}),Object.defineProperty(r.prototype,"_processRRRspMsg",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r,n,i=this,o=e.conversationType,s=e.channelId,u=e.targetId,l=e.content,c=e.senderUserId,d=l.receiptMessageDic,p=void 0===d?{}:d;if(c===this.currentUserId)for(var f in p){var h=p[f];try{for(var g=(t=void 0,a(h)),_=g.next();!_.done;_=g.next()){var b=_.value;null===(n=this._readReceiptManager)||void 0===n||n.remove({conversationType:o,channelId:s,targetId:u},b)}}catch(e){t={error:e}}finally{try{_&&!_.done&&(r=g.return)&&r.call(g)}finally{if(t)throw t.error}}}else(p[this.currentUserId]||[]).forEach((function(e){var t;null===(t=i._readReceiptManager)||void 0===t||t.addReadedUser({conversationType:o,channelId:s,targetId:u},e,c)}))}}),Object.defineProperty(r.prototype,"_handleSmsgFromSignalGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=t.conversationType;t.messageType;var n=t.senderUserId,i=t.messageUId,o=t.sentTime;t.isStatusMessage,this._writeMessagesLog(r,i)&&this.logger.record(pe.IM_MSG_RECEIVE,JSON.stringify({client_ts:Date.now(),server_deltatime:Date.now()-this._connMgr.getCrtServerTime(),msg_ids:i})),n!==this.currentUserId||t.isStatusMessage||this._sendMessageStore.setMessage(i,o),this._handleNotNotifyMsg(t)||(this._handleReadReceiptStorage(t),this._setConversationCacheByMessage(t),this._batchMessage([t]))}}),Object.defineProperty(r.prototype,"_handleReadReceiptStorage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){if(this._enableReadReceiptStorage){var t=e.messageType;t===exports.MessageType.READ_RECEIPT_REQUEST&&this._processRRReqMsg(e),t===exports.MessageType.READ_RECEIPT_RESPONSE&&this._processRRRspMsg(e)}}}),Object.defineProperty(r.prototype,"_handleSyncMsg",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){(t.conversationType!==exports.ConversationType.CHATROOM||this._chrmsQueue[t.targetId])&&(this._sendMessageStore.setMessage(t.messageUId,t.sentTime),this.logger.info(H.L_RECV_MULTI_SYNC_MSG_O,JSON.stringify({messageUId:t.messageUId,messgeId:t.messageId,sentTime:t.sentTime})),t.messageType!==exports.MessageType.EXPANSION_NOTIFY?((t.messageType===exports.MessageType.SYNC_READ_STATUS||t.messageType===exports.MessageType.READ_RECEIPT&&t.senderUserId===this.currentUserId)&&this._clearConversationUnreadCount(t.conversationType,t.targetId,t.channelId,!0,t.sentTime),t.messageType===exports.MessageType.READ_RECEIPT_REQUEST&&this._processRRReqMsg(t),t.messageType===exports.MessageType.READ_RECEIPT_RESPONSE&&this._processRRRspMsg(t),this._setConversationCacheByMessage(t),this._batchMessage([t])):this._receiveMessageExpansion(t))}}),Object.defineProperty(r.prototype,"_handleNotNotifyMsg",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.messageType,r=e.senderUserId;return t===exports.MessageType.DELIVERED||(t===exports.MessageType.DELIVERED_MSG||(t===exports.MessageType.EXPANSION_NOTIFY?(this._receiveMessageExpansion(e),!0):t===exports.MessageType.SYNC_READ_STATUS&&r!==this.currentUserId||t===exports.MessageType.READ_STATE&&(this._processRSMsg(e),!0)))}}),Object.defineProperty(r.prototype,"_handleMsgProperties",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){void 0===t&&(t=!1);var r,n=e.messageType,i=e.isStatusMessage,o=e.isCounted,s=void 0!==o&&o,a=e.isPersited,u=void 0!==a&&a;if(r=Gr(n)?Vr(n):{isCounted:s,isPersited:u,isStatusMessage:!1},Object.assign(e,r),t&&!wt(i)&&(e.isStatusMessage=i),!t){var l=e.content.user;if(l){var c=l.portrait,d=l.portraitUri,p=c||d;p&&(l.portrait=l.portraitUri=p)}}return e}}),Object.defineProperty(r.prototype,"_fixDownstreamData",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return e&&2===t.list.length&&(t.hasMore=!0,0===r?t.list.shift():t.list.pop()),t}}),Object.defineProperty(r.prototype,"getHistoryMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i,a,u,l){var c;return void 0===a&&(a=""),o(this,void 0,void 0,(function(){var o,u,d,p,f,h,g,_,b,E,v,y=this;return s(this,(function(s){switch(s.label){case 0:return u=(o=this).currentUserId,d=o._connMgr,p=Bh[e]||Zr.qryPMsg,f=1===n&&0===r,d?(h=d.codec.encodeGetHistoryMsg(t,{timestamp:r,count:f?2:n,order:i,channelId:a}),this.logger.info(H.L_GET_HISTORY_MSG_T,JSON.stringify({targetId:t,conversationType:e,channelId:a,timestamp:r,count:n,order:i}),l),[4,d.send(new bi(p,h,u),Fo,{currentUserId:u,connectedTime:d.getConnectedTime(),conversation:{targetId:t},afterDecode:function(r){var n,i=null===(n=y._readReceiptManager)||void 0===n?void 0:n.getReadReceiptInfo({conversationType:e,channelId:a,targetId:t},r.messageUId);if(i){var o=i.users;r.readReceiptInfo={isReceiptRequestMessage:!0,readerList:o}}return r}})]):[3,2];case 1:return g=s.sent(),_=g.code,b=g.data,_===exports.ErrorCode.SUCCESS&&b?(E=this._fixDownstreamData(f,b,i),v=[],null===(c=E.list)||void 0===c||c.forEach((function(e){e&&v.push(e.messageUId)})),this.logger.info(H.L_GET_HISTORY_MSG_R,JSON.stringify({code:_,messageUIds:v.join(",")}),l),[2,{code:_,data:{list:E.list,hasMore:E.hasMore}}]):(this.logger.warn(H.L_GET_HISTORY_MSG_R,JSON.stringify({code:_,messageUIds:""}),l),[2,{code:_}]);case 2:return[2,{code:exports.ErrorCode.RC_NET_CHANNEL_INVALID}]}}))}))}}),Object.defineProperty(r.prototype,"getMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i,o,s){return this.getHistoryMessage(e,t,r,n,i,o,s)}}),Object.defineProperty(r.prototype,"reportSDKInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,o,a,u,l;return s(this,(function(s){switch(s.label){case 0:return this._isConnected?(r=(t=this).currentUserId,n=t._connMgr,i=this.logger.createTraceId(),o=JSON.stringify(e),this.logger.debug(H.L_VER_REPORT_T,o,i),a=Za.encode(Os,{sdkInfo:o}),u=new bi(Zr.reportsdk,a,r),[4,n.send(u)]):[2];case 1:return(l=s.sent().code)!==exports.ErrorCode.SUCCESS&&this.logger.warn(H.L_VER_REPORT_R,l,i),[2]}}))}))}}),Object.defineProperty(r.prototype,"removeConversation",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,o;return s(this,(function(s){switch(s.label){case 0:return t=e.conversationType,r=e.targetId,n=e.channelId,e.conversationType!==exports.ConversationType.ULTRA_GROUP?[3,2]:(o=Za.encode(Ga,{targetId:r,type:t,busChannel:[n],cleanMsg:!1}),[4,this._connMgr.query(Zr.delUgSe,this.currentUserId,o)]);case 1:return i=s.sent(),[3,4];case 2:return o=Za.encode(Mo,{type:t,busChannel:n?[n]:[]}),[4,this._connMgr.query(Zr.delRelation,r,o)];case 3:i=s.sent(),s.label=4;case 4:return i.isOk&&this._chat.storage.removeConversation(e),[2,i.wipe()]}}))}))}}),Object.defineProperty(r.prototype,"batchRemoveConversation",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n;return s(this,(function(i){switch(i.label){case 0:return this._isConnected?(t=this._connMgr,r=t.codec.encodeBatchDeleteConversation(e),n=new bi(Zr.delRelationBatch,r,this.getCurrentUserId()),[4,t.send(n)]):[2,exports.ErrorCode.RC_NET_UNAVAILABLE];case 1:return[2,i.sent().code]}}))}))}}),Object.defineProperty(r.prototype,"getTotalUnreadCountByLevels",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return void 0===r&&(r=!1),o(this,void 0,void 0,(function(){var n;return s(this,(function(i){return n=0,e.includes(exports.ConversationType.ULTRA_GROUP)&&!this._isUltraGroupListExist?[2,gt(exports.ErrorCode.METHOD_NOT_AVAILABLE)]:(n+=this._chat.storage.getTotalUnreadCountByLevels(e,t,r),[2,ht(n)])}))}))}}),Object.defineProperty(r.prototype,"getConversationUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n;return s(this,(function(i){return n=this._chat.storage.getOrCreateModel({conversationType:e,targetId:t,channelId:r},!1),[2,ht(n.unreadCount)]}))}))}}),Object.defineProperty(r.prototype,"clearConversationUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return this._clearConversationUnreadCount(e,t,r,!1,this.getServerTime()),Promise.resolve(exports.ErrorCode.SUCCESS)}}),Object.defineProperty(r.prototype,"getFirstUnreadMessageInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n,i;return s(this,(function(o){return(n=this._chat.storage.getModel({conversationType:e,targetId:t,channelId:r}))?(i=n.firstUnreadMessage,[2,ht(i?{messageUId:i.messageUId||"",sentTime:i.sentTime}:null)]):[2,ht(null)]}))}))}}),Object.defineProperty(r.prototype,"saveConversationMessageDraft",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return this._chat.storage.setDrafts({conversationType:e,targetId:t,channelId:n},r),Promise.resolve(exports.ErrorCode.SUCCESS)}}),Object.defineProperty(r.prototype,"getConversationMessageDraft",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n=this._chat.storage.getDrafts({conversationType:e,targetId:t,channelId:r});return Promise.resolve({code:exports.ErrorCode.SUCCESS,data:n})}}),Object.defineProperty(r.prototype,"clearConversationMessageDraft",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return this._chat.storage.deleteDrafts({conversationType:e,targetId:t,channelId:r}),Promise.resolve(exports.ErrorCode.SUCCESS)}}),Object.defineProperty(r.prototype,"_joinChrm",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){return o(this,void 0,void 0,(function(){var o,a,u,l,c,d,p,f,h,g,_,b,E,v,y,m;return s(this,(function(s){switch(s.label){case 0:return this._isConnected?(o=this._connMgr,a=Za.encode(Ao,{nothing:1,extra:n}),u=r?Zr.joinChrmR:Zr.joinChrm,l=new bi(u,a,e),this.logger.info(H.L_JOIN_CHATROOM_T,JSON.stringify({chatroomId:e,count:t,topic:Zr[u]}),i),[4,o.send(l,Po)]):[2,{code:exports.ErrorCode.RC_NET_UNAVAILABLE}];case 1:return c=s.sent(),d=c.code,p=c.data,f=d===exports.ErrorCode.SUCCESS?"info":"warn",this.logger[f](H.L_JOIN_CHATROOM_R,JSON.stringify({code:d,timestamp:(new Date).getTime()}),i),d===exports.ErrorCode.SUCCESS?(g=(h=p).joinTime,_=h.createTime,b=h.memberCount,E=h.isAllChatroomBanned,v=h.isCurrentUserBanned,y=h.isCurrentChatroomBanned,m=h.isCurrentChatroomInWhitelist,this._chrmsQueue[e]||(this._chrmsQueue[e]={pulling:!1,queue:[],timestamp:0}),this._pullChrmMsg(e,t,g),this.getNaviInfoFromCache().kvStorage&&this._chrmEntryHandler.pullEntry(e,0),this._joinedChrmManager.set(e,t,n),this._startSyncIntervalForChrmPull(),[2,{code:d,data:{joinTime:g,createTime:_,memberCount:b,isAllChatroomBanned:E,isCurrentUserBanned:v,isCurrentChatroomBanned:y,isCurrentChatroomInWhitelist:m}}]):[2,{code:d}]}}))}))}}),Object.defineProperty(r.prototype,"_rejoinChrm",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t,r,i,o,a,u,l,c,d,p,f,h,g;return s(this,(function(s){switch(s.label){case 0:for(r in e=this._joinedChrmManager.get(),t=[],e)t.push(r);i=0,s.label=1;case 1:return i<t.length?(o=t[i],a=e[o],u=a.count,l=void 0===u?10:u,c=a.extra,this.logger.info(H.L_REJOIN_CHATROOM_T,JSON.stringify({chatroomId:o,count:l,extra:c})),d=this.logger.createTraceId(),[4,this._joinChrm(o,l,!0,c,d)]):[3,4];case 2:if(p=s.sent(),f=p.code,h=p.data,g=f===exports.ErrorCode.SUCCESS?"info":"warn",this.logger[g](H.L_REJOIN_CHATROOM_R,JSON.stringify({code:f,timestamp:(new Date).getTime()}),d),f===exports.ErrorCode.SUCCESS)return this._watcher.chatroom({rejoinedRoom:n({chatroomId:o,count:l},h)}),[2];f===exports.ErrorCode.RC_CHATROOM_USER_KICKED&&(this._joinedChrmManager.remove(o),delete this._chrmsQueue[o]),this._watcher.chatroom({rejoinedRoom:{chatroomId:o,errorCode:f}}),s.label=3;case 3:return i++,[3,1];case 4:return[2]}}))}))}}),Object.defineProperty(r.prototype,"_pullChrmMsg",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return void 0===t&&(t=10),void 0===r&&(r=0),o(this,void 0,void 0,(function(){var n,i,o,a,u,l,c,d,p,f,h,g,_,b,E,v,y,m=this;return s(this,(function(s){switch(s.label){case 0:return this._isConnected?(n=this._chrmsQueue[e],i=n.pulling,o=n.timestamp,i?[2]:(n.pulling=!0,a=r?0:o,u=Za.encode(No,{count:t,syncTime:a,compressioEnabled:Zu.enable()}),l=this.logger.createTraceId(),this.logger.info(H.L_PULL_CHATROOM_MSG_T,JSON.stringify({chatroomId:e,syncTime:a})),[4,this._connMgr.query(Zr.chrmPull,e,u)])):[2];case 1:return c=s.sent(),this.logger.summary(H.L_PULL_CHATROOM_MSG_R,c,l,{chatroomId:e,syncTime:a,count:t}),n.pulling=!1,c.isOk?(d=zf(c.data.pbData),p=d.list,f=d.syncTime,n.timestamp=r?Math.max(f,r):f,n.queue=n.queue.filter((function(e){return e>f})),h=[],g=[],b=(_=this).currentUserId,E=_._connMgr,v=p.map((function(t){return Wu(t,b,E.getConnectedTime(),e)})),y=[],v.forEach((function(e){e.sentTime<o||(e.sentTime>=m._connMgr.getConnectedTime()&&m._writeMessagesLog(exports.ConversationType.CHATROOM,e.messageUId)&&g.push(e.messageUId),h.push(e.messageUId),y.push(e))})),this._batchMessage(y),g.length>0&&this.logger.record(pe.IM_MSG_RECEIVE,JSON.stringify({client_ts:Date.now(),server_deltatime:Date.now()-this._connMgr.getCrtServerTime(),msg_ids:g.join(",")})),n.queue.length>0&&(n.queue.length=0,this._pullChrmMsg(e)),[2]):[2]}}))}))}}),Object.defineProperty(r.prototype,"joinChatroom",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return o(this,void 0,void 0,(function(){return s(this,(function(i){switch(i.label){case 0:return[4,this._joinChrm(e,t,!1,r,n)];case 1:return[2,i.sent().code]}}))}))}}),Object.defineProperty(r.prototype,"joinExistChatroom",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return o(this,void 0,void 0,(function(){return s(this,(function(i){return[2,this._joinChrm(e,t,!0,r,n)]}))}))}}),Object.defineProperty(r.prototype,"quitChatroom",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r;return s(this,(function(n){switch(n.label){case 0:return this._isConnected?(t=this._connMgr,delete this._chrmsQueue[e],this._chrmEntryHandler.reset(e),this._joinedChrmManager.remove(e),r=Za.encode(Ao,{nothing:1}),[4,t.query(Zr.exitChrm,e,r)]):[2,exports.ErrorCode.RC_NET_UNAVAILABLE];case 1:return[2,n.sent().code]}}))}))}}),Object.defineProperty(r.prototype,"getChatroomInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n,i,o;return s(this,(function(s){switch(s.label){case 0:return this._isConnected?(n=this._connMgr,i=Za.encode(Vo,{count:t,order:r}),o=new bi(Zr.queryChrmI,i,e),[4,n.send(o,Go)]):[2,gt(exports.ErrorCode.RC_NET_UNAVAILABLE)];case 1:return[2,s.sent().trans((function(e){return e}))]}}))}))}}),Object.defineProperty(r.prototype,"getChatroomHistoryMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return o(this,void 0,void 0,(function(){var i,o,a,u,l,c;return s(this,(function(s){switch(s.label){case 0:return this._isConnected?(i=this._connMgr,o=i.codec.encodeGetHistoryMsg(e,{timestamp:t,count:r,order:n}),a=new bi(Zr.qryCHMsg,o,e),[4,i.send(a,Fo,{conversation:{targetId:e}})]):[2,{code:exports.ErrorCode.RC_NET_UNAVAILABLE}];case 1:return u=s.sent(),l=u.code,c=u.data,l!==exports.ErrorCode.SUCCESS?[2,{code:l}]:[2,{code:l,data:{list:c.list,hasMore:c.hasMore}}]}}))}))}}),Object.defineProperty(r.prototype,"_modifyChatroomKV",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i,o,a,u,l,c,d;return s(this,(function(s){switch(s.label){case 0:return this._isConnected?(n=(r=this)._connMgr,i=r.currentUserId,o=this._chrmEntryHandler.getVersion(e,t.key),t.version=null==o?this.getServerTime():o,a=n.codec.encodeModifyChatRoomKV(e,t,i),u=t.type===exports.ChatroomEntryType.UPDATE?Zr.setKV:Zr.delKV,l=new bi(u,a,e),[4,n.send(l,Po)]):[2,exports.ErrorCode.RC_NET_UNAVAILABLE];case 1:return c=s.sent(),(d=c.code)===exports.ErrorCode.SUCCESS?(this._chrmEntryHandler.setLocal(e,{kvEntries:[t],syncTime:this.getServerTime()},i),[2,d]):[2,d]}}))}))}}),Object.defineProperty(r.prototype,"_chatroomKVStoreNotAllSuccess",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=t.data,n=e;return r&&Array.isArray(r.errorKeys)&&r.errorKeys.forEach((function(e){var t=n.findIndex((function(t){return e.key===t.key}));-1!==t&&n.splice(t,1)})),n}}),Object.defineProperty(r.prototype,"_modifyChatroomKVS",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,i,o,a,u,l,c,d,p,f,h,g,_=this;return s(this,(function(s){switch(s.label){case 0:return this._isConnected?(i=(r=this)._connMgr,o=r.currentUserId,t.entries.forEach((function(t){var r=_._chrmEntryHandler.getVersion(e,t.key);t.version=null==r?_.getServerTime():r})),a=i.codec.encodeModifyChatRoomKVS(e,t,o),u=t.type===exports.ChatroomEntryType.UPDATE?Zr.setKVS:Zr.delKVS,l=new bi(u,a,e),[4,i.send(l,ts)]):[2,{code:exports.ErrorCode.RC_NET_UNAVAILABLE}];case 1:return c=s.sent(),d=c.code,-1!==[exports.ErrorCode.SUCCESS,exports.ErrorCode.CHATROOM_KV_STORE_NOT_ALL_SUCCESS].indexOf(d)&&(f=[],delete(h=n({},t)).entries,t.entries.forEach((function(e){f.push(n(n({},e),h))})),d===exports.ErrorCode.CHATROOM_KV_STORE_NOT_ALL_SUCCESS&&(g=c.data,p=g.errorKeys,f=this._chatroomKVStoreNotAllSuccess(f,c)),this._chrmEntryHandler.setLocal(e,{kvEntries:f,syncTime:(new Date).getTime()},o)),[2,{code:d,data:p}]}}))}))}}),Object.defineProperty(r.prototype,"setChatroomEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){return s(this,(function(r){return t.type=exports.ChatroomEntryType.UPDATE,t.userId=t.userId||this.currentUserId,[2,this._modifyChatroomKV(e,t)]}))}))}}),Object.defineProperty(r.prototype,"setChatroomEntries",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){return s(this,(function(r){return t.type=exports.ChatroomEntryType.UPDATE,t.userId=t.userId||this.currentUserId,[2,this._modifyChatroomKVS(e,t)]}))}))}}),Object.defineProperty(r.prototype,"forceSetChatroomEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){return s(this,(function(r){return t.type=exports.ChatroomEntryType.UPDATE,t.isOverwrite=!0,t.userId=t.userId||this.currentUserId,[2,this._modifyChatroomKV(e,t)]}))}))}}),Object.defineProperty(r.prototype,"removeChatroomEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){return s(this,(function(r){return t.type=exports.ChatroomEntryType.DELETE,t.userId=t.userId||this.currentUserId,[2,this._modifyChatroomKV(e,t)]}))}))}}),Object.defineProperty(r.prototype,"removeChatroomEntries",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){return s(this,(function(r){return t.type=exports.ChatroomEntryType.DELETE,t.userId=t.userId||this.currentUserId,[2,this._modifyChatroomKVS(e,t)]}))}))}}),Object.defineProperty(r.prototype,"forceRemoveChatroomEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){return s(this,(function(r){return t.type=exports.ChatroomEntryType.DELETE,t.isOverwrite=!0,t.userId=t.userId||this.currentUserId,[2,this._modifyChatroomKV(e,t)]}))}))}}),Object.defineProperty(r.prototype,"getChatroomEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i,o,a,u,l;return s(this,(function(s){switch(s.label){case 0:return(r=this._chrmEntryHandler.getValue(e,t))?[2,{code:exports.ErrorCode.SUCCESS,data:r}]:this._isConnected?(n=this._connMgr,i=n.codec.encodePullChatRoomKV(0),o=new bi(Zr[Zr.pullKV],i,e),[4,n.send(o,es)]):[2,{code:exports.ErrorCode.RC_NET_UNAVAILABLE}];case 1:return a=s.sent(),(u=a.data)&&u.kvEntries&&u.kvEntries.length&&(l=u.kvEntries.find((function(e){return e.key===t})),void 0!==l)?[2,{code:exports.ErrorCode.SUCCESS,data:null==l?void 0:l.value}]:[2,{code:exports.ErrorCode.CHATROOM_KEY_NOT_EXIST}]}}))}))}}),Object.defineProperty(r.prototype,"getAllChatroomEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,o,a;return s(this,(function(s){switch(s.label){case 0:return(t=this._chrmEntryHandler.getAll(e))&&Object.keys(t).length?[2,{code:exports.ErrorCode.SUCCESS,data:t}]:this._isConnected?(r=this._connMgr,t={},n=r.codec.encodePullChatRoomKV(0),i=new bi(Zr[Zr.pullKV],n,e),[4,r.send(i,es)]):[2,{code:exports.ErrorCode.RC_NET_UNAVAILABLE}];case 1:return o=s.sent(),(a=o.data)&&a.kvEntries&&a.kvEntries.length&&a.kvEntries.forEach((function(e){e.key&&(t[e.key]=e.value||"")})),[2,{code:exports.ErrorCode.SUCCESS,data:t}]}}))}))}}),Object.defineProperty(r.prototype,"pullChatroomEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i,o,a,u,l,c,d,p,f,h=this;return s(this,(function(s){switch(s.label){case 0:return this._isConnected?(n=(r=this)._connMgr,i=r.currentUserId,this._chrmsQueue[e]?(o=n.codec.encodePullChatRoomKV(t),a=new bi(Zr[Zr.pullKV],o,e),this.logger.info(H.L_PULL_CHATROOM_KV_T,JSON.stringify({chatroomId:e,timestamp:t})),[4,n.send(a,es)]):[2,{code:exports.ErrorCode.RC_CHATROOM_NOT_EXIST}]):[2,{code:exports.ErrorCode.RC_NET_UNAVAILABLE}];case 1:return u=s.sent(),l=u.code,c=u.data,this._chrmsQueue[e]?(d=l===exports.ErrorCode.SUCCESS?"info":"warn",this.logger[d](H.L_PULL_CHATROOM_KV_R,JSON.stringify({code:l,timestamp:t})),l===exports.ErrorCode.SUCCESS&&c?(p=c.kvEntries,f=[],p.length>0&&(p.forEach((function(t){var r=t.key,n=t.value,i=t.type,o=t.timestamp,s=t.userId;h._chrmEntryHandler.getValue(e,r)===n&&s===h.getCurrentUserId()||f.push({key:r,value:n,type:i,timestamp:o,chatroomId:e})})),this._chrmEntryHandler.setLocal(e,c,i),f.length>0&&this._watcher.chatroom({updatedEntries:f})),[2,{code:l,data:c}]):[2,{code:l}]):[2,{code:exports.ErrorCode.RC_CHATROOM_NOT_EXIST}]}}))}))}}),Object.defineProperty(r.prototype,"_startSyncIntervalForChrmPull",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this;this._stopSyncIntervalForChrmPull(),this._intervalTimerForChrmPull=setInterval((function(){var t=Object.keys(e._chrmsQueue);0!==t.length&&e._isConnected?t.forEach((function(t){e._pullChrmMsg(t),e.getNaviInfoFromCache().kvStorage&&e._chrmEntryHandler.pullEntry(t,0)})):e._stopSyncIntervalForChrmPull()}),18e4)}}),Object.defineProperty(r.prototype,"_stopSyncIntervalForChrmPull",{enumerable:!1,configurable:!0,writable:!0,value:function(){"number"!=typeof this._intervalTimerForChrmPull&&(clearInterval(this._intervalTimerForChrmPull),this._intervalTimerForChrmPull=-1)}}),Object.defineProperty(r.prototype,"removeChatroomFromCatch",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t;null===(t=this._joinedChrmManager)||void 0===t||t.remove(e)}}),Object.defineProperty(r.prototype,"_writeMessagesLog",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r,n=null===(r=this.cloudController)||void 0===r?void 0:r.getMRTRConfig();if(!n)return!1;var i=function(e){if(!e)return Math.floor(4294967296*Math.random());var t=0;if(0===e.length)return t;for(var r=0;r<e.length;r++)t=(t<<5)-t+e.charCodeAt(r),t|=0;return Math.abs(t)}(t),o=0;switch(e){case exports.ConversationType.PRIVATE:o=n.private;break;case exports.ConversationType.GROUP:o=n.group;break;case exports.ConversationType.CHATROOM:o=n.chatroom;break;case exports.ConversationType.ULTRA_GROUP:o=n.ultraGroup}return!!o&&i%(1/o)==0}}),Object.defineProperty(r.prototype,"sendMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,i,a){return o(this,void 0,void 0,(function(){var o,u,l,c,d,p,f,h,g,_,b,E,v,y;return s(this,(function(s){switch(s.label){case 0:return r=this._handleInnerMsgOptions(e,t,r),r=this._handleMsgProperties(r,!0),o=!1,[exports.ConversationType.PRIVATE,exports.ConversationType.GROUP].includes(e)&&(r.isStatusMessage||Vr(r.messageType).isStatusMessage)&&(o=!0),u=o?function(e){var t;return(t={},t[exports.ConversationType.PRIVATE]=Zr.ppMsgS,t[exports.ConversationType.GROUP]=Zr.pgMsgS,t)[e]}(e):function(e){var t;return(t={},t[exports.ConversationType.PRIVATE]=Zr.ppMsgP,t[exports.ConversationType.GROUP]=Zr.pgMsgP,t[exports.ConversationType.CHATROOM]=Zr.chatMsg,t[exports.ConversationType.CUSTOMER_SERVICE]=Zr.pcMsgP,t[exports.ConversationType.RTC_ROOM]=Zr.prMsgS,t[exports.ConversationType.SYSTEM]=Zr.pbMsgP,t)[e]}(e)||Zr.ppMsgP,o&&(r.isPersited=!1,r.isCounted=!1),l=r.messageId?r.messageId:lr(),r.messageId=l,c=this._connMgr.codec.encodeUpMsg({conversationType:e,targetId:t},r),(d=new Ei(Zr[u],c,e===exports.ConversationType.SYSTEM?this.currentUserId:t)).setHeaderQos($r.AT_LEAST_ONCE),o?(this._connMgr.sendOnly(d),[2,ht(Hh(e,t,n({},r),"",0,this.currentUserId,l))]):(p=this._connMgr.getCrtServerTime(),f=Hh(e,t,n(n({},r),{isStatusMessage:o}),"",p,this.currentUserId,l),null==i||i(l),this.logger.info(H.L_SEND_MSG_T,JSON.stringify({messageType:r.messageType,conversationType:e,targetId:t,channelId:r.channelId}),a),h=Date.now(),[4,this._connMgr.send(d)]);case 1:return g=s.sent(),_=g.code,b=g.isOk,E=g.msg,v=g.data,b?(this.logger.info(H.L_SEND_MSG_R,JSON.stringify({code:_,messageUId:null==v?void 0:v.messageUId,messageId:null==v?void 0:v.messageId}),a),y=v,this._sendMessageSuccessHandle(f,y),this._writeMessagesLog(e,y.messageUId)&&this.logger.record(pe.IM_MSG_SEND,JSON.stringify({msg_id:y.messageUId,channel:e,start_ts:h,client_ts:Date.now(),server_deltatime:Date.now()-this._connMgr.getCrtServerTime(),cod:_})),[2,ht(f)]):(this.logger.warn(H.L_SEND_MSG_R,JSON.stringify({code:_,messageUId:f.messageUId,messageId:f.messageId}),a),this._writeMessagesLog(e)&&this.logger.record(pe.IM_MSG_SEND,JSON.stringify({channel:e,start_ts:h,client_ts:Date.now(),server_deltatime:Date.now()-this._connMgr.getCrtServerTime(),cod:_})),f.sentStatus=exports.SentStatus.FAILED,[2,gt(_,E,f)])}}))}))}}),Object.defineProperty(r.prototype,"_sendMessageSuccessHandle",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r,n=this;this._sendMessageStore.setMessage(t.messageUId,t.timestamp),e.sentTime=t.timestamp,e.messageUId=t.messageUId,this._setConversationCacheByMessage(e);var i=e.messageType,o=e.conversationType,s=e.targetId,a=e.channelId,u=e.sentTime,l=e.content,c=e.messageDirection;if(this._enableReadReceiptStorage){if(i===exports.MessageType.READ_RECEIPT_REQUEST){var d=l.messageUId;null===(r=this._readReceiptManager)||void 0===r||r.insert({conversationType:o,targetId:s,channelId:a},d,c,u)}if(i===exports.MessageType.READ_RECEIPT_RESPONSE){var p=l.receiptMessageDic;if(!p)return;for(var f in p)p[f].forEach((function(e){var t;null===(t=n._readReceiptManager)||void 0===t||t.remove({conversationType:o,targetId:s,channelId:a},e)}))}}}}),Object.defineProperty(r.prototype,"recallMsg",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r;return o(this,void 0,void 0,(function(){var i,o,a,u,l,c,d,p,f,h,g,_,b,E,v,y,m,I;return s(this,(function(s){switch(s.label){case 0:return i=e.targetId,o=e.conversationType,a=e.channelId||"",u=t.user,l=t.extra,c=t.isDelete,d=t.directionalUserIdList,p=t.disableUpdateLastMessage,f=t.messageUId,h=t.sentTime,g={conversationType:o,targetId:i,messageUId:f,sentTime:h,channelId:a,isDelete:c||!1,isAdmin:t.isAdmin},u&&(g.user=u),l&&(g.extra=l),_={content:g,messageType:"RC:RcCmd",disableNotification:null==t?void 0:t.disableNotification,pushConfig:null==t?void 0:t.pushConfig,pushContent:(null===(r=t.pushConfig)||void 0===r?void 0:r.pushContent)||t.pushContent||"",channelId:a,disableUpdateLastMessage:p},[exports.ConversationType.GROUP,exports.ConversationType.ULTRA_GROUP].includes(o)&&d&&(_.directionalUserIdList=d),b=this._connMgr.codec.encodeUpMsg({conversationType:o,targetId:i},_),(E=new Ei(Zr.recallMsg,b,this.currentUserId)).setHeaderQos($r.AT_LEAST_ONCE),[4,this._connMgr.send(E)];case 1:return(v=s.sent()).isOk?(y=v.data,o!==exports.ConversationType.ULTRA_GROUP&&(m="Cmd:".concat(f),y.messageUId=m),I=Hh(o,i,n(n({},_),{isPersited:!0}),y.messageUId,y.timestamp,this.currentUserId),o===exports.ConversationType.ULTRA_GROUP?(this._ultraMsgMap[y.messageUId]=y.timestamp,this._updateUltraGroupWhenRecallMsg(i,a,f)):(this._sendMessageStore.setMessage(y.messageUId,y.timestamp),this._setConversationCacheByMessage(I)),[2,ht(I)]):[2,v.wipe()]}}))}))}}),Object.defineProperty(r.prototype,"sendReadReceiptMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n,i;return s(this,(function(o){return this._isConnected?(n=this._connMgr.codec.encodeReadReceipt(t,r),i=new bi(Zr[Zr.rrMsg],n,e),[2,this._connMgr.send(i)]):[2,{code:exports.ErrorCode.RC_NET_UNAVAILABLE}]}))}))}}),Object.defineProperty(r.prototype,"getMessageReader",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n,i;return s(this,(function(o){return this._isConnected?(n=this._connMgr.codec.encodeMessageReader(t,r),i=new bi(Zr[Zr.rrList],n,e),[2,this._connMgr.send(i,ms)]):[2,{code:exports.ErrorCode.RC_NET_UNAVAILABLE}]}))}))}}),Object.defineProperty(r.prototype,"sendReadReceiptMessageV4",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n,i;return s(this,(function(o){return n=this._connMgr.codec.encodeReadReceiptMsg(e,t,r),i=new Ei(Zr[Zr.sendMsgRead],n,e.targetId),[2,this._connMgr.send(i)]}))}))}}),Object.defineProperty(r.prototype,"getMessageReadReceiptV4",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n;return s(this,(function(i){return r=this._connMgr.codec.encodeReceiptQryReq(e,t),n=new bi(Zr[Zr.qryMsgRead],r,e.targetId),[2,this._connMgr.send(n,qs)]}))}))}}),Object.defineProperty(r.prototype,"batchGetMessageReadReceiptInfoV4",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,i,o,a,u,l;return s(this,(function(s){switch(s.label){case 0:return r=this._connMgr.codec.encodeReceiptCntQryReq(e,t),i=new bi(Zr[Zr.qryMsgReadCntBatch],r,e.targetId),[4,this._connMgr.send(i,Ks)];case 1:return o=s.sent(),a=o.code,u=o.data,l=(u||{result:[]}).result,a===exports.ErrorCode.SUCCESS&&l?[2,{code:a,data:l.map((function(t){return n({messageUId:t.msgId,readedCount:t.cnt,totalCount:t.tmn},e)}))}]:[2,{code:a}]}}))}))}}),Object.defineProperty(r.prototype,"updateConversationReadTime",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n;return s(this,(function(i){switch(i.label){case 0:return r=Kf(e,t),n=new Ei(Zr.updRTime,r,this.currentUserId),[4,this._connMgr.send(n)];case 1:return[2,i.sent().wipe()]}}))}))}}),Object.defineProperty(r.prototype,"pullUserSettings",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,o,a,c,d,p=this;return s(this,(function(s){switch(s.label){case 0:return this._isConnected?(t=this.getNaviInfoFromCache(),r=Za.encode(is,{version:e,ipType:t.ipType||0}),[4,this._connMgr.query(Zr.pullUS,this.currentUserId,r,os)]):[2,gt(exports.ErrorCode.RC_NET_UNAVAILABLE)];case 1:return(n=s.sent()).isOk?(i=n.data,o=i.version,a=i.items,c=[],d=!1,null==a||a.forEach((function(e){var t=e.key,r=e.value;"Tag"===t?(d=!0,c.push.apply(c,l([],u(e.tags||[]),!1))):"VoipInfo"===t&&p._naviChangeHandler(ri.readUTF(new Uint8Array(r)))})),[2,ht({version:o,changed:d,tags:c})]):[2,n.wipe()]}}))}))}}),Object.defineProperty(r.prototype,"_naviChangeHandler",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this._connMgr.getToken();this.navi.updateVoipCallInfo(t,e);var r=this.navi.getNaviInfoFromCache(t);this._watcher.onNaviDataChange(n({},r))}}),Object.defineProperty(r.prototype,"getFileToken",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,i,a,u){return o(this,void 0,void 0,(function(){var o,l,c,d,p;return s(this,(function(s){switch(s.label){case 0:return this._isConnected?(o=i&&"uploads"!==i?t||"":ir(e,t),l=this.getNaviInfoFromCache(),c=_r(l,this.logger),d="",c||(d=JSON.stringify({uploadDomain:c})),p=Za.encode(Ro,{type:e,key:o,httpMethod:r||"",queryString:i||"",url:a||"",ext:d,size:u?Math.ceil(u):0,ipType:l.ipType||0}),[4,this._connMgr.query(Zr.qnTkn,this.currentUserId,p,Oo)]):[2,{code:exports.ErrorCode.RC_NET_UNAVAILABLE}];case 1:return[2,s.sent().trans((function(e){return n(n({},e),{fileName:o,downloadAuthInfo:e.downloadAuthInfo?JSON.parse(e.downloadAuthInfo):null})}))]}}))}))}}),Object.defineProperty(r.prototype,"getFileUrl",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return o(this,void 0,void 0,(function(){var i,o,a,u,l;return s(this,(function(s){switch(s.label){case 0:return i=this.getNaviInfoFromCache(),a="",u="",t===exports.UploadMethod.QINIU?o=Zr.qnUrl:t===exports.UploadMethod.AWS?o=Zr.s3Url:t===exports.UploadMethod.STC?o=Zr.stcUrl:t===exports.UploadMethod.MINIO?(o=Zr.minioUrl,a=_r(i,this.logger),u=JSON.stringify({url:a})):o=Zr.aliUrl,l=Za.encode(Co,{type:e,key:r,fileName:n,ext:u,size:-1,ipType:i.ipType||0}),[4,this._connMgr.query(o,this.currentUserId,l,So)];case 1:return[2,s.sent().trans((function(e){return{downloadUrl:e.downloadUrl}}))]}}))}))}}),Object.defineProperty(r.prototype,"disconnect",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){return s(this,(function(r){switch(r.label){case 0:return this.reporter.stop(),this.reporterStatistic.stop(),[4,this._connMgr.disconnect(e,t)];case 1:return r.sent(),this._resetMemoryState(),[2]}}))}))}}),Object.defineProperty(r.prototype,"_resetMemoryState",{enumerable:!1,configurable:!0,writable:!0,value:function(){-1!==this._reconnectTimer&&(clearTimeout(this._reconnectTimer),this._reconnectTimer=-1),this._isUltraGroupListExist=!1,this._joinedChrmManager&&(this._joinedChrmManager.clear(),delete this._joinedChrmManager),this._userSettingManager&&delete this._userSettingManager,this._readReceiptManager&&delete this._readReceiptManager,this._subscribeManager&&delete this._subscribeManager,this._chrmsQueue={}}}),Object.defineProperty(r.prototype,"registerMessageType",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){}}),Object.defineProperty(r.prototype,"getServerTime",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._connMgr.getCrtServerTime()}}),Object.defineProperty(r.prototype,"getCurrentUserId",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._connMgr.getCurrentUserId()}}),Object.defineProperty(r.prototype,"currentUserId",{get:function(){return this._connMgr.getCurrentUserId()},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"createTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t=this;return s(this,(function(r){return this._isConnected?[2,this._userSettingManager.pushTask((function(r){return o(t,void 0,void 0,(function(){var t,i,o,a,u,l;return s(this,(function(s){switch(s.label){case 0:return t=this._connMgr.codec.encodeCreateTag([e],r),i=new bi(Zr[Zr.addSeTag],t,this.currentUserId),[4,this._connMgr.send(i,ns)];case 1:return o=s.sent(),a=o.code,u=o.data,a===exports.ErrorCode.SUCCESS&&u&&(l=u.version,this._userSettingManager.addTag([n(n({},e),{createdTime:l})],l)),[2,{code:a}]}}))}))}))]:[2,{code:exports.ErrorCode.RC_NET_UNAVAILABLE}]}))}))}}),Object.defineProperty(r.prototype,"removeTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t=this;return s(this,(function(r){return this._isConnected?[2,this._userSettingManager.pushTask((function(r){return o(t,void 0,void 0,(function(){var t,n,i,o,a,u;return s(this,(function(s){switch(s.label){case 0:return t=this._connMgr.codec.encodeRemoveTag([e],r),n=new bi(Zr[Zr.delSeTag],t,this.currentUserId),[4,this._connMgr.send(n,ns)];case 1:return i=s.sent(),o=i.code,a=i.data,o===exports.ErrorCode.SUCCESS&&a&&(u=a.version,this._userSettingManager.deleteTag([e],u)),[2,{code:o}]}}))}))}))]:[2,{code:exports.ErrorCode.RC_NET_UNAVAILABLE}]}))}))}}),Object.defineProperty(r.prototype,"updateTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t=this;return s(this,(function(r){return this._isConnected?[2,this._userSettingManager.pushTask((function(r){return o(t,void 0,void 0,(function(){var t,n,i,o,a,u;return s(this,(function(s){switch(s.label){case 0:return t=this._connMgr.codec.encodeCreateTag([e],r),n=new bi(Zr[Zr.addSeTag],t,this.currentUserId),[4,this._connMgr.send(n,ns)];case 1:return i=s.sent(),o=i.code,a=i.data,o===exports.ErrorCode.SUCCESS&&(u=a.version,this._userSettingManager.addTag([e],u)),[2,{code:o}]}}))}))}))]:[2,{code:exports.ErrorCode.RC_NET_UNAVAILABLE}]}))}))}}),Object.defineProperty(r.prototype,"getTagList",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t;return s(this,(function(r){return e=this._userSettingManager.getTags(),t=this._chat.storage.getTagConversationCountMap(),e.forEach((function(e){var r;e.conversationCount=(null===(r=t.get(e.tagId))||void 0===r?void 0:r.length)||0})),[2,ht(e)]}))}))}}),Object.defineProperty(r.prototype,"addTagForConversations",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r=this;return s(this,(function(i){return this._isConnected?[2,this._chat.settings.pushTask((function(i){return o(r,void 0,void 0,(function(){var r,o,a,l,c,d,p=this;return s(this,(function(s){switch(s.label){case 0:return this._userSettingManager.getTagById(e)?(r=this._connMgr.codec.encodeUpdateConversationTag([{tagId:e}],t,i),[4,this._connMgr.query(Zr.addTag,this.currentUserId,r,hs)]):[2,gt(exports.ErrorCode.TAG_NOT_EXIST)];case 1:return(o=s.sent()).isOk?(a=o.data.version,l=new Map,t.forEach((function(t){var r=p._chat.storage.getOrCreateModel(t,!0),n={},i=r.tags;i.find((function(t){return t.tagId===e}))||(n.tags=i.concat({tagId:e}),l.set(r,n))})),c=[],d=[],Array.from(l.entries()).forEach((function(e){var t=u(e,2),r=t[0],i=t[1];d.push(r);var o=r.updateAttrs(i,a);o&&c.push(n(n({},r.toIReceivedConversation()),{updatedItems:o}))})),this._chat.storage.updateConversationStorage(d),c.length>0&&this._watcher.conversation(c),[2,ht({version:a})]):[2,o.wipe()]}}))}))}))]:[2,{code:exports.ErrorCode.RC_NET_UNAVAILABLE}]}))}))}}),Object.defineProperty(r.prototype,"removeTagForConversations",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r=this;return s(this,(function(n){return this._isConnected?[2,this._chat.settings.pushTask((function(n){return o(r,void 0,void 0,(function(){var r,i,o,a,u=this;return s(this,(function(s){switch(s.label){case 0:return r=this._connMgr.codec.encodeUpdateConversationTag([{tagId:e}],t,n),[4,this._connMgr.query(Zr.delTag,this.currentUserId,r,hs)];case 1:return(i=s.sent()).isOk?(o=i.data.version,a=t.map((function(t){var r=u._chat.storage.getOrCreateModel(t,!0),n={tags:r.tags.filter((function(t){return t.tagId!==e}))};return r.updateAttrs(n,o),r})),this._chat.storage.updateConversationStorage(a),[2,ht({version:o})]):[2,i.wipe()]}}))}))}))]:[2,gt(exports.ErrorCode.RC_NET_UNAVAILABLE)]}))}))}}),Object.defineProperty(r.prototype,"removeTagsForConversation",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r=this;return s(this,(function(n){return this._isConnected?[2,this._chat.settings.pushTask((function(n){return o(r,void 0,void 0,(function(){var r,i,o,a,u,l,c;return s(this,(function(s){switch(s.label){case 0:return r=t.map((function(e){return{tagId:e}})),i=this._connMgr.codec.encodeUpdateConversationTag(r,[e],n),[4,this._connMgr.query(Zr.delTag,this.currentUserId,i,hs)];case 1:return(o=s.sent()).isOk?(a=o.data.version,u=this._chat.storage.getOrCreateModel(e,!0),l=u.tags,c={tags:l.filter((function(e){return!t.includes(e.tagId)}))},u.updateAttrs(c,a),this._chat.storage.updateConversationStorage([u]),[2,ht({version:a})]):[2,o.wipe()]}}))}))}))]:[2,gt(exports.ErrorCode.RC_NET_UNAVAILABLE)]}))}))}}),Object.defineProperty(r.prototype,"getConversationListByTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n,i,o,a,u,l,c;return s(this,(function(s){switch(s.label){case 0:return this._isConnected?(i=(n=this).currentUserId,o=n._connMgr,a=o.codec.encodeOldConversationList({count:r,type:exports.ConversationType.PRIVATE,startTime:t}),u=new bi(Zr.qryRelationR,a,i),[4,o.send(u,Lo,{currentUserId:i,connectedTime:o.getConnectedTime()})]):[2,gt(exports.ErrorCode.RC_NET_UNAVAILABLE)];case 1:return(l=s.sent()).isOk?(c=this._conversationHasTagFilter(e,l.data.list),[2,ht(c)]):[2,l.wipe()]}}))}))}}),Object.defineProperty(r.prototype,"_conversationHasTagFilter",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this,i=[],o=[];function s(e,t){return e.latestMessage&&t.latestMessage?e.latestMessage.sentTime-t.latestMessage.sentTime:0}return t.forEach((function(t){var s=r._chat.storage.getOrCreateModel(t,!0),a=s.tags,u=a&&a.find((function(t){return t.tagId===e}));if(u){var l=n(n({},s.toIReceivedConversation()),{isTopInTag:u.isTop||!1,latestMessage:t.latestMessage,operationTime:t.operationTime});u.isTop?i.push(n(n({},l),{isTopInTag:!0})):o.push(n(n({},l),{isTopInTag:!1}))}})),i.sort(s),o.sort(s),l(l([],u(i),!1),u(o),!1)}}),Object.defineProperty(r.prototype,"getUnreadCountByTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r;return s(this,(function(n){return this._isConnected?(r=this._chat.storage.getUnreadCountByTag(e,t),[2,ht(r)]):[2,gt(exports.ErrorCode.RC_NET_UNAVAILABLE)]}))}))}}),Object.defineProperty(r.prototype,"setConversationStatusInTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n=this;return s(this,(function(i){return this._isConnected?[2,this._chat.settings.pushTask((function(i){return o(n,void 0,void 0,(function(){var n,o,a,u,l,c,d;return s(this,(function(s){switch(s.label){case 0:return n=r.isTop,o=[{tagId:e,isTop:n}],a=this._chat.storage.getOrCreateModel(t,!1),(u=a.tags).find((function(t){return t.tagId===e}))?(l=this._connMgr.codec.encodeUpdateConversationTag(o,[t],i),[4,this._connMgr.query(Zr.addTag,this.currentUserId,l,hs)]):[2,gt(exports.ErrorCode.NO_TAG_IN_CONVER)];case 1:return(c=s.sent()).isOk?(d=c.data.version,u.find((function(t){return t.tagId===e})).isTop=n,this._chat.storage.updateConversationCache(t,{tags:u}),this._watcher.conversationTag(),[2,ht({version:d})]):[2,c.wipe()]}}))}))}))]:[2,gt(exports.ErrorCode.RC_NET_UNAVAILABLE)]}))}))}}),Object.defineProperty(r.prototype,"getTagsForConversation",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n;return s(this,(function(i){return this._isConnected?(t=this._chat.storage.getOrCreateModel(e,!1),r=this._userSettingManager.getTagsInfo(),n=t.tags.map((function(e){var t;return{tagId:e.tagId,tagName:null===(t=r[e.tagId])||void 0===t?void 0:t.tagName}})),[2,ht(n)]):[2,gt(exports.ErrorCode.RC_NET_UNAVAILABLE)]}))}))}}),Object.defineProperty(r.prototype,"getUnreadMentionedCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r;return s(this,(function(n){return t=this._chat.storage.getOrCreateModel(e,!1),r=this._getUnreadCount(t.unreadMentionedCount),[2,ht(r)]}))}))}}),Object.defineProperty(r.prototype,"getAllUnreadMentionedCount",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e;return s(this,(function(t){return e=this._chat.storage.getAllUnreadMentionedCount(),[2,ht(e)]}))}))}}),Object.defineProperty(r.prototype,"getRemoteHistoryMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i,o){return this.getHistoryMessage(e,t,r,n,i,o)}}),Object.defineProperty(r.prototype,"getUltraGroupList",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i=this;return s(this,(function(o){return t=e.targetId,r=e.channelType,this._isUltraGroupListExist?(n=this._chat.storage.getAllUGModels().filter((function(e){return!(void 0!==t&&t!==e.targetId||void 0!==r&&r!==e.channelType)})).map((function(e){var t=e.toIReceivedConversation();return t.unreadMentionedCount=i._getUnreadCount(t.unreadMentionedCount||0),t.unreadMessageCount=i._getUnreadCount(t.unreadMessageCount||0),t.unreadMentionedMeCount=i._getUnreadCount(t.unreadMentionedMeCount||0),t})),(s=n).sort((function(e,t){var r,n,i=(null===(r=e.latestMessage)||void 0===r?void 0:r.sentTime)||0;return((null===(n=t.latestMessage)||void 0===n?void 0:n.sentTime)||0)-i})),[2,ht(s)]):[2,gt(exports.ErrorCode.METHOD_NOT_AVAILABLE)];var s}))}))}}),Object.defineProperty(r.prototype,"_getUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return e>999?999:e}}),Object.defineProperty(r.prototype,"getBlockUltraGroupList",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e;return s(this,(function(t){return this._isUltraGroupListExist?(e=this._chat.storage.getAllUGModels().filter((function(e){return e.notificationLevel>exports.NotificationLevel.NOT_SET})).map((function(e){return{conversationType:exports.ConversationType.ULTRA_GROUP,targetId:e.targetId,channelId:e.channelId}})),[2,ht(e)]):[2,gt(exports.ErrorCode.METHOD_NOT_AVAILABLE)]}))}))}}),Object.defineProperty(r.prototype,"getUltraGroupUnreadMentionedCountByTargetId",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i;return s(this,(function(o){return this._isUltraGroupListExist?(r=this._chat.storage.getAllUGModels(),n=r.reduce((function(r,n){if(n.targetId!==e||!n.unreadMentionedCount)return r;var i=n.notificationLevel||exports.NotificationLevel.NOT_SET;return!t||t.includes(i)?r+n.unreadMentionedCount:r}),0),i=this._getUnreadCount(n),[2,ht(i)]):[2,gt(exports.ErrorCode.METHOD_NOT_AVAILABLE)]}))}))}}),Object.defineProperty(r.prototype,"getUltraGroupUnreadCountByTargetId",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i;return s(this,(function(o){return r=this._chat.storage.getAllUGModels(),n=r.reduce((function(r,n){if(n.targetId!==e||!n.unreadCount)return r;var i=n.notificationLevel||exports.NotificationLevel.NOT_SET;return!t||t.includes(i)?r+n.unreadCount:r}),0),i=this._getUnreadCount(n),[2,ht(i)]}))}))}}),Object.defineProperty(r.prototype,"getUltraGroupUnreadInfoList",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r=this;return s(this,(function(n){return this._isUltraGroupListExist?(t=this._chat.storage.getAllUGModels().filter((function(t){return e.includes(t.targetId)})).map((function(e){return{conversationType:e.conversationType,type:e.conversationType,targetId:e.targetId,channelId:e.channelId||"",unreadMessageCount:r._getUnreadCount(e.unreadCount||0),mentionedCount:r._getUnreadCount(e.unreadMentionedCount||0),mentionedMeCount:r._getUnreadCount(e.unreadMentionedMeCount||0),notificationLevel:e.notificationLevel||exports.NotificationLevel.NOT_SET}})),[2,ht(t)]):[2,gt(exports.ErrorCode.METHOD_NOT_AVAILABLE)]}))}))}}),Object.defineProperty(r.prototype,"getAllUltraGroupUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return void 0===e&&(e=!1),o(this,void 0,void 0,(function(){var t,r;return s(this,(function(n){return this._isUltraGroupListExist?(t=this._chat.storage.getAllUGModels().reduce((function(t,r){return e?t+(r.unreadMentionedCount||0):t+(r.unreadCount||0)}),0),r=this._getUnreadCount(t),[2,ht(r)]):[2,gt(exports.ErrorCode.METHOD_NOT_AVAILABLE)]}))}))}}),Object.defineProperty(r.prototype,"clearUltraUnreadcount",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return void 0===t&&(t=""),o(this,void 0,void 0,(function(){var r,n,i,o,a;return s(this,(function(s){switch(s.label){case 0:return this._isUltraGroupListExist?this._isConnected?(r=this.getServerTime(),n=Kf({conversationType:exports.ConversationType.ULTRA_GROUP,targetId:e,channelId:t},r),(i=new Ei(Zr[Zr.updUgRTime],n,this.currentUserId)).setHeaderQos($r.AT_LEAST_ONCE),[4,this._connMgr.send(i)]):[2,exports.ErrorCode.RC_NET_UNAVAILABLE]:[2,Promise.resolve(exports.ErrorCode.METHOD_NOT_AVAILABLE)];case 1:return o=s.sent(),a=o.code,o.isOk&&this._clearConversationUnreadCount(exports.ConversationType.ULTRA_GROUP,e,t,!1,r),[2,a]}}))}))}}),Object.defineProperty(r.prototype,"sendUltraMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,i){return o(this,void 0,void 0,(function(){var o,a,u,l,c,d,p,f,h,g,_,b,E;return s(this,(function(s){switch(s.label){case 0:return this._isConnected?(t=this._handleMsgProperties(t,!0),o=t.messageId?t.messageId:lr(),t.messageId=o,a=this._connMgr.codec.encodeUpMsg({conversationType:exports.ConversationType.ULTRA_GROUP,targetId:e},t),(u=new Ei(Zr[Zr.ugMsg],a,e)).setHeaderQos($r.AT_LEAST_ONCE),l=this._connMgr.getCrtServerTime(),c=Hh(exports.ConversationType.ULTRA_GROUP,e,n({},t),"",l,this.currentUserId,o),r&&r(o),this.logger.info(H.L_SEND_MSG_T,JSON.stringify({messageType:t.messageType,conversationType:exports.ConversationType.ULTRA_GROUP,targetId:e,channelId:t.channelId}),i),d=Date.now(),[4,this._connMgr.send(u)]):[2,{code:exports.ErrorCode.RC_NET_UNAVAILABLE}];case 1:return p=s.sent(),f=p.code,h=p.data,f!==exports.ErrorCode.SUCCESS?(this.logger.warn(H.L_SEND_MSG_R,JSON.stringify({code:f,messageUId:c.messageUId,messageId:c.messageId}),i),this._writeMessagesLog(exports.ConversationType.ULTRA_GROUP)&&this.logger.record(pe.IM_MSG_SEND,JSON.stringify({channel:exports.ConversationType.ULTRA_GROUP,start_ts:d,client_ts:Date.now(),server_deltatime:Date.now()-this._connMgr.getCrtServerTime(),cod:f})),c.sentStatus=exports.SentStatus.FAILED,[2,{code:f,data:c}]):(this.logger.info(H.L_SEND_MSG_R,JSON.stringify({code:f,messageUId:null==h?void 0:h.messageUId,messageId:null==h?void 0:h.messageId}),i),g=h,this._writeMessagesLog(exports.ConversationType.ULTRA_GROUP,g.messageUId)&&this.logger.record(pe.IM_MSG_SEND,JSON.stringify({msg_id:g.messageUId,channel:exports.ConversationType.ULTRA_GROUP,start_ts:d,client_ts:Date.now(),server_deltatime:Date.now()-this._connMgr.getCrtServerTime(),cod:f})),c.sentTime=g.timestamp,c.messageUId=g.messageUId,this._ultraMsgMap[g.messageUId]=g.timestamp,_=t.channelId||"",b=this._chat.storage.getOrCreateModel({conversationType:exports.ConversationType.ULTRA_GROUP,targetId:e,channelId:_},!0),(E=b.updateAttrs({operationTime:g.timestamp,latestMessage:n({},c)}))&&this._watcher.conversation([n(n({},b.toIReceivedConversation()),{updatedItems:E})]),[2,{code:f,data:c}])}}))}))}}),Object.defineProperty(r.prototype,"sendUltraGroupTypingStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i,o,a,u;return s(this,(function(s){switch(s.label){case 0:return this._isConnected?(r=e.conversationType,n=e.channelId,i=e.targetId,o=this._connMgr.codec.encodeOperateStatus(i,r,n||"",t||0),(a=new Ei(Zr.operate,o,i)).setHeaderQos($r.AT_LEAST_ONCE),[4,this._connMgr.send(a)]):[2,{code:exports.ErrorCode.RC_NET_UNAVAILABLE}];case 1:return(u=s.sent().code)!==exports.ErrorCode.SUCCESS?[2,{code:u,msg:exports.ErrorCode[u]}]:[2,{code:u}]}}))}))}}),Object.defineProperty(r.prototype,"getUltraGroupMessageListByMessageUId",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,o,a,u;return s(this,(function(s){switch(s.label){case 0:return this._isConnected?e.messages&&e.messages.length<1||e.messages&&e.messages.length>20?[2,{code:exports.ErrorCode.MSG_LIMIT_ERROR}]:(t={},e.messages.forEach((function(e){t[e.messageUId]=void 0})),r=this._connMgr.codec.encodeMsgQuery(e),(n=new bi(Zr[Zr.qryMsg],r,this.currentUserId)).setHeaderQos($r.AT_LEAST_ONCE),[4,this._connMgr.send(n,Us,{connectedTime:this._connMgr.getConnectedTime(),currentUserId:this.currentUserId})]):[2,{code:exports.ErrorCode.RC_NET_UNAVAILABLE}];case 1:return i=s.sent(),o=i.code,a=i.data,o!==exports.ErrorCode.SUCCESS?[2,{code:o,msg:exports.ErrorCode[o]}]:(u=(a||{}).list,Array.isArray(u)&&u.forEach((function(e){var r=e.messageUId;t[r]=e})),[2,{code:0,data:t}])}}))}))}}),Object.defineProperty(r.prototype,"_pullOperateStatusNotify",{enumerable:!1,configurable:!0,writable:!0,value:function(e){if(this._isConnected){var t=this._connMgr.codec.decodeByPBName(e.pbData,xs),r=t.conversationType,n=t.info,i=t.summary;this.logger.debug(H.O,"s_opNtf -> type: ".concat(r,", info: ").concat(n,", summary: ").concat(i)),this._watcher.operateStatus(t)}}}),Object.defineProperty(r.prototype,"expandUltraMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n;return s(this,(function(i){switch(i.label){case 0:return this._isConnected?(t=this._connMgr.codec.encodeExpandUltraMessage(e,this.currentUserId),(r=new bi(Zr[Zr.upMsgEx],t,e.targetId)).setHeaderQos($r.AT_LEAST_ONCE),[4,this._connMgr.send(r)]):[2,{code:exports.ErrorCode.RC_NET_UNAVAILABLE}];case 1:return(n=i.sent().code)!==exports.ErrorCode.SUCCESS?[2,{code:n,msg:exports.ErrorCode[n]}]:[2,{code:n}]}}))}))}}),Object.defineProperty(r.prototype,"modifyMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,o,a;return s(this,(function(s){switch(s.label){case 0:return this._isConnected?(t=this._connMgr.codec.encodemodifyMessage(e,this.currentUserId),(r=new bi(Zr[Zr.modifyMsg],t,e.targetId)).setHeaderQos($r.AT_LEAST_ONCE),[4,this._connMgr.send(r)]):[2,{code:exports.ErrorCode.RC_NET_UNAVAILABLE}];case 1:return n=s.sent(),i=n.code,o=n.data,i!==exports.ErrorCode.SUCCESS?[2,{code:i,msg:exports.ErrorCode[i]}]:(a=o,this._ultraMsgMap[a.messageUId]=a.timestamp,[2,{code:i}])}}))}))}}),Object.defineProperty(r.prototype,"_handleEventChangeList",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t={Group:{map:{},types:qh},Friend:{map:{},types:Yh}},r=function(e,t,r){e[t]||(e[t]=[]),e[t].push(r)};e.forEach((function(e){var n=e.changeType;for(var i in t)if(t[i].types.includes(n)){r(t[i].map,n,e);break}}));var n={Group:this._processChangeMapGroup.bind(this),Friend:this._processChangeMapFriend.bind(this)};for(var i in t)Object.keys(t[i].map).length>0&&n[i](t[i].map)}}),Object.defineProperty(r.prototype,"_handleUGChangeList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r={};t.forEach((function(e){var t=e.changeType;r[t]||(r[t]=[]),r[t].push(e)}));var n=z.CHANNEL_CHANGE,i=z.MSG_RECALL,o=z.MSG_EXPANSION,s=z.MSG_MODIFY,a=z.USER_GROUP_CHANGE;r[n]&&this._handleUltraChannelChange(r[n]),r[i]&&this._handleMsgRecall(r[i]),r[o]&&this._handleMsgUpdate(r[o]),r[s]&&this._handleMsgUpdate(r[s]),r[a]&&this._handleUserGroupStatus(r[a])}}),Object.defineProperty(r.prototype,"_processChangeMapGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=M.GROUP_OPERATION,r=M.GROUP_PROFILE_CHANGE,n=M.GROUP_FOLLOW_USER_CHANGE;e[t]&&this._handleGroupOperation(e[t]),e[r]&&this._handleGroupProfileChange(e[r]),e[n]&&this._handleFollowUserChange(e[n])}}),Object.defineProperty(r.prototype,"_processChangeMapFriend",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;(e[v.FRIEND_APPLICATION]||[]).forEach((function(e){var r,n,i,o,s,a,u,l,c,d,p=e.subChangeType,f=e.businessId,h=e.time,g=e.eventData,_=y.FRIEND_APPLY,b=y.FRIEND_REFUSE,E=y.FRIEND_USER_INFO,v=y.FRIENDS_INPUT,m=y.FRIEND_CLEAR,I=y.FRIEND_INFO_CHANGE,T=y.FRIEND_INFO_CHANGE_SYNC;switch(p){case _:case b:var R=p===_?exports.FriendApplicationStatus.UNHANDLED:exports.FriendApplicationStatus.REFUSED;null===(n=(r=t._watcher).friendApplicationStatusChanged)||void 0===n||n.call(r,{userId:f,applicationType:g.applyType,applicationStatus:R,directionType:g.friendType,operationTime:h,extra:g.info||""});break;case E:null===(o=(i=t._watcher).friendAdd)||void 0===o||o.call(i,{userId:f,name:g.name,portraitUri:g.portraitUrl,directionType:g.friendType,operationTime:h});break;case v:null===(a=(s=t._watcher).friendDelete)||void 0===a||a.call(s,{userIds:g.targetId,directionType:g.type,operationTime:h});break;case m:null===(l=(u=t._watcher).friendCleared)||void 0===l||l.call(u,h);break;case I:break;case T:null===(d=(c=t._watcher).friendInfoChangedSync)||void 0===d||d.call(c,{userId:f,remark:g.remarkname,extProfile:g.extProfile,operationTime:h})}}))}}),Object.defineProperty(r.prototype,"_handleGroupOperation",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;e.forEach((function(e){var r,n,i,o,s=e.subChangeType,a=e.businessId,l=e.time,c=e.eventData,d=c.optUserInfo,p=c.channelInfo,f=c.userInfos,h={groupId:a,operation:s,operationTime:l};d&&(r=u(Zt([d]),1),h.operatorInfo=r[0]),s===exports.GroupOperation.CREATE&&(n=u(Qt([p]),1),h.groupInfo=n[0]),[exports.GroupOperation.CREATE,exports.GroupOperation.DISMISS].includes(s)||(h.memberInfos=Zt(f)),null===(o=(i=t._watcher).groupOperation)||void 0===o||o.call(i,h)}))}}),Object.defineProperty(r.prototype,"_handleGroupProfileChange",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;e.forEach((function(e){var r,n,i,o,s,a,l=e.businessId,c=e.time,d=e.eventData,p=e.subChangeType,f=e.secondaryId;switch(p){case S.GROUP_INFO_CHANGE:var h=u(Zt([d.optUserInfo]),1)[0],g=u(Wt([d.channelInfo]),1)[0],_=u(d.channelFullInfo?Wt([d.channelFullInfo]):[void 0],1)[0];null===(n=(r=t._watcher).groupInfoChanged)||void 0===n||n.call(r,{operatorInfo:h,groupInfo:g,changedGroupInfo:g,operationTime:c,fullGroupInfo:_});break;case S.MEMBER_PROFILE_CHANGE:h=u(Zt([d.optUserInfo]),1)[0];var b=Zt(d.userInfos)[0];null===(o=(i=t._watcher).groupMemberInfoChanged)||void 0===o||o.call(i,{groupId:l,operatorInfo:h,memberInfo:b,operationTime:c});break;case S.GROUP_REMARK_DELETE:case S.GROUP_REMARK_SET:var E=p===S.GROUP_REMARK_SET?exports.GroupOperationType.ADD:exports.GroupOperationType.REMOVE;null===(a=(s=t._watcher).groupRemarkChangedSync)||void 0===a||a.call(s,{groupId:l,operationType:E,operationTime:c,groupRemark:f})}}))}}),Object.defineProperty(r.prototype,"_handleFollowUserChange",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;e.forEach((function(e){var r,n,i=e.subChangeType,o=e.businessId,s=e.time,a=e.userGroupIds,u=1===i?exports.GroupOperationType.ADD:exports.GroupOperationType.REMOVE;null===(n=(r=t._watcher).groupFollowsChangedSync)||void 0===n||n.call(r,{groupId:o,operationType:u,operationTime:s,userIds:a})}))}}),Object.defineProperty(r.prototype,"_handleUltraChannelChange",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this,r=[],n=[],i=[];e.forEach((function(e){var o=e.subChangeType,s=e.targetId,a=e.msgTime,u=e.operatorId,l=e.busChannel||"",c=t._chat.storage.getCachedUGConversation(s,l);if(c){var d=Z.PUBLIC_TO_PRIVATE,p=Z.PRIVATE_TO_PUBLIC,f=Z.PUBLIC_TO_PRIVATE_USER_NOT_IN,h=Z.CHANNEL_DELETE,g=Z.CHANNEL_USER_KICKED;switch(o){case p:t._chat.storage.updateConversationCache(c,{channelType:exports.UltraGroupChannelType.PUBLIC}),r.push({targetId:s,channelId:l,changeType:exports.UltraGroupChannelChangeType.PRIVATE_TO_PUBLIC,channelType:exports.UltraGroupChannelType.PUBLIC});break;case d:t._chat.storage.updateConversationCache(c,{channelType:exports.UltraGroupChannelType.PRIVATE}),r.push({targetId:s,channelId:l,changeType:exports.UltraGroupChannelChangeType.PUBLIC_TO_PRIVATE,channelType:exports.UltraGroupChannelType.PRIVATE});break;case f:t._chat.storage.removeConversation(c),r.push({targetId:s,channelId:l,changeType:exports.UltraGroupChannelChangeType.PUBLIC_TO_PRIVATE_USER_NOT_IN,channelType:c.channelType});break;case h:t._chat.storage.removeConversation(c),n.push({targetId:s,channelId:l,channelType:c.channelType,deleteTime:a});break;case g:i.push({targetId:s,channelId:l,userId:u,channelType:exports.UltraGroupChannelType.PRIVATE}),u===t.currentUserId&&t._chat.storage.removeConversation(c)}}})),r.length>0&&this._watcher.ultraGroupChannelChangeType(r),n.length>0&&this._watcher.ultraGroupChannelDelete(n),i.length>0&&this._watcher.ultraGroupChannelUserKicked(i)}}),Object.defineProperty(r.prototype,"_handleMsgRecall",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this,r=[];e.forEach((function(e){var n=e.targetId,i=e.busChannel,o=e.msgUID,s=e.msgTime,a=e.type,u=e.operatorId,l=e.remindType;t._updateUltraGroupWhenRecallMsg(n,i||"",o,s,l),r.push({targetId:n,conversationType:a,sentTime:s,messageUId:o,senderUserId:u,channelId:i||"",content:{conversationType:a,targetId:n,messageUId:o,channelId:i||""},messageDirection:1,messageType:exports.MessageType.RECALL,isOffLineMessage:!1,receivedTime:Date.now(),isPersited:!1,isCounted:!1,isMentioned:!1,disableNotification:!1,isStatusMessage:!1,canIncludeExpansion:!1,expansion:null,receivedStatus:exports.ReceivedStatus.UNREAD,receivedStatusInfo:Bt(exports.ReceivedStatus.UNREAD)})})),this._watcher.ultraGroupMessageRecalled(r)}}),Object.defineProperty(r.prototype,"_handleMsgUpdate",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t={};for(var r in e.forEach((function(e){var r=e.targetId,n=e.type,i=e.msgTime,o=e.msgUID,s=e.busChannel,a="".concat(n,"_").concat(r);t[a]||(t[a]=[]),t[a].push({messageUId:o,channelId:s||"",sendTime:i})})),t){var n=r.split("_"),i=n.shift(),o=n.join("_");this._pullUltraMessageList(e[0].changeType,{targetId:o,conversationType:Number(i),messages:l([],u(t[r]),!1)})}}}),Object.defineProperty(r.prototype,"_pullUltraMessageList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i,o,a,u,l,c=this;return s(this,(function(s){switch(s.label){case 0:return this._isConnected?(r=this._connMgr.codec.encodeMsgQuery(t),(n=new bi(Zr.qryMsg,r,this.currentUserId)).setHeaderQos($r.AT_LEAST_ONCE),[4,this._connMgr.send(n,Us,{connectedTime:this._connMgr.getConnectedTime(),currentUserId:this.currentUserId})]):[2,{code:exports.ErrorCode.RC_NET_UNAVAILABLE}];case 1:return i=s.sent(),o=i.code,a=i.data,o!==exports.ErrorCode.SUCCESS?[2,{code:o,msg:exports.ErrorCode[o]}]:(u=(a||{}).list,l=[],Array.isArray(u)&&u.forEach((function(e){var t,r=e.targetId,n=e.channelId,i=e.messageUId,o=c._chat.storage.getCachedUGConversation(r,n||"");o&&(null===(t=o.latestMessage)||void 0===t?void 0:t.messageUId)===i&&c._chat.storage.updateConversationCache(o,{latestMessage:e}),l.push(e)})),e===z.MSG_EXPANSION&&this._watcher.ultraGroupMessageExpansionUpdated(l),e===z.MSG_MODIFY&&this._watcher.ultraGroupMessageModified(l),[2])}}))}))}}),Object.defineProperty(r.prototype,"_handleUserGroupStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,o,a,u,l,c,d,p;return s(this,(function(s){return t=X.REMOVE_USER_GROUP,r=X.JOIN_USER_GROUP,n=X.EXIT_USER_GROUP,i=X.CHANNEL_BIND_USER_GROUP,o=X.CHANNEL_UNBIND_USER_GROUP,a=[],u=[],l=[],c=[],d=[],e.forEach((function(e){var s=e.type,p=e.targetId,f=e.busChannelType,h=e.busChannel,g=e.userGroupIds;switch(e.subChangeType){case t:a.push({conversation:{conversationType:s,targetId:p},userGroupIds:g});break;case r:u.push({conversation:{conversationType:s,targetId:p},userGroupIds:g});break;case n:l.push({conversation:{conversationType:s,targetId:p},userGroupIds:g});break;case i:c.push({conversation:{conversationType:s,targetId:p,channelId:h},channelType:f,userGroupIds:g});break;case o:d.push({conversation:{conversationType:s,targetId:p,channelId:h},channelType:f,userGroupIds:g})}})),p={},a.length>0&&(p.userGroupDisband=a),u.length>0&&(p.userAdded=u),l.length>0&&(p.userRemoved=l),c.length>0&&(p.userGroupBindChannel=c),d.length>0&&(p.userGroupUnBindChannel=d),this._watcher.userGroupStatus(p),[2]}))}))}}),Object.defineProperty(r.prototype,"getUltraHistoryMsg",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n;return o(this,void 0,void 0,(function(){var i,o,a,u,l,c;return s(this,(function(s){switch(s.label){case 0:return this._isConnected?(i=this._connMgr.codec.encodeGetHistoryMsg(e,t),o=new bi(Zr[Zr.qryUgMsg],i,this.currentUserId),this.logger.info(H.L_GET_HISTORY_MSG_T,JSON.stringify({targetId:e,conversationType:exports.ConversationType.ULTRA_GROUP,channelId:t.channelId,timestamp:null==t?void 0:t.timestamp,count:null==t?void 0:t.count}),r),[4,this._connMgr.send(o,Fo,{currentUserId:this.currentUserId,conversation:{conversationType:exports.ConversationType.ULTRA_GROUP,targetId:e}})]):[2,{code:exports.ErrorCode.RC_NET_UNAVAILABLE}];case 1:return a=s.sent(),u=a.code,l=a.data,u===exports.ErrorCode.SUCCESS&&l?(c=[],null===(n=l.list)||void 0===n||n.forEach((function(e){e&&c.push(e.messageUId)})),this.logger.info(H.L_GET_HISTORY_MSG_R,JSON.stringify({code:u,messageUIds:c.join(",")}),r),[2,{code:u,data:l}]):(this.logger.warn(H.L_GET_HISTORY_MSG_R,JSON.stringify({code:u,messageUIds:""}),r),[2,{code:u}])}}))}))}}),Object.defineProperty(r.prototype,"setUltraGroupDefaultNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n,i,o,a;return s(this,(function(s){switch(s.label){case 0:return this._isUltraGroupListExist?this._isConnected?(n=this._connMgr.codec.encodeSetUltraGroupDefaultNotificationLevel(t,r),i=new bi(Zr.ugUnpushSet,n,e),[4,this._connMgr.send(i)]):[2,{code:exports.ErrorCode.RC_NET_UNAVAILABLE}]:[2,Promise.resolve({code:exports.ErrorCode.METHOD_NOT_AVAILABLE})];case 1:return o=s.sent(),a=o.code,exports.ErrorCode.SUCCESS,[2,{code:a}]}}))}))}}),Object.defineProperty(r.prototype,"getUltraGroupDefaultNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i,o,a,u,l;return s(this,(function(s){switch(s.label){case 0:return this._isUltraGroupListExist?this._isConnected?(r=this._connMgr,n=r.codec.encodeGetUltraGroupDefaultNotificationLevel(t),i=new bi(Zr[Zr.ugUnpushQuery],n,e),[4,r.send(i,fs)]):[2,{code:exports.ErrorCode.RC_NET_UNAVAILABLE}]:[2,Promise.resolve({code:exports.ErrorCode.METHOD_NOT_AVAILABLE})];case 1:return o=s.sent(),a=o.code,u=o.data,a===exports.ErrorCode.SUCCESS&&u?(l=u.unpushLevel,[2,{code:a,data:l}]):[2,{code:a}]}}))}))}}),Object.defineProperty(r.prototype,"_updateUltraGroupWhenRecallMsg",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,i,o){var s=this._chat.storage.getModel({conversationType:exports.ConversationType.ULTRA_GROUP,targetId:e,channelId:t});if(s){var a={},u=s.latestMessage;u&&u.messageUId===r&&(a.latestMessage=null),i&&s.lastReadTime<i&&s.unreadCount&&(a.unreadCount=s.unreadCount-1,o!==$.ALL&&o!==$.ME||!s.unreadMentionedCount||(a.unreadMentionedCount=s.unreadMentionedCount-1),o===$.ME&&s.unreadMentionedCount&&(a.unreadMentionedMeCount=s.unreadMentionedMeCount-1));var l=s.updateAttrs(a,i);this._chat.storage.updateConversationStorage([s]),l&&this._watcher.conversation([n(n({},s.toIReceivedConversation()),{updatedItems:l})])}}}),Object.defineProperty(r.prototype,"getUltraGroupUnreadMentionedMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,o;return s(this,(function(s){switch(s.label){case 0:return this._isConnected?this._isUltraGroupListExist?(t=this._connMgr.codec.encodeUnreadMentionedMsgQuery(e),r=new bi(Zr[Zr.qryUgUal],t,this.currentUserId),[4,this._connMgr.send(r,Do)]):[2,Promise.resolve({code:exports.ErrorCode.METHOD_NOT_AVAILABLE})]:[2,{code:exports.ErrorCode.RC_NET_UNAVAILABLE}];case 1:return n=s.sent(),i=n.code,o=n.data,i===exports.ErrorCode.SUCCESS&&o?[2,{code:i,data:o}]:[2,{code:i}]}}))}))}}),Object.defineProperty(r.prototype,"getUltraGroupFirstUnreadMessageTimestamp",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t;return s(this,(function(r){return this._isConnected?this._isUltraGroupListExist?(t=this._chat.storage.getUGFistUnreadMessageInfo(e.targetId,e.channelId||""))?[2,ht(t)]:[2,gt(exports.ErrorCode.RC_DB_DATA_NOT_FOUND)]:[2,gt(exports.ErrorCode.METHOD_NOT_AVAILABLE)]:[2,gt(exports.ErrorCode.RC_NET_UNAVAILABLE)]}))}))}}),Object.defineProperty(r.prototype,"subscribeUser",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){return s(this,(function(n){return this._isConnected?[2,this._subscribeManager.updateSubscribeRelation(e,t,exports.SubscribeOperationType.SUBSCRIBE,r)]:[2,{code:exports.ErrorCode.RC_NET_UNAVAILABLE}]}))}))}}),Object.defineProperty(r.prototype,"unSubscribeUser",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){return s(this,(function(r){switch(r.label){case 0:return this._isConnected?[4,this._subscribeManager.updateSubscribeRelation(e,t,exports.SubscribeOperationType.UNSUBSCRIBE)]:[2,{code:exports.ErrorCode.RC_NET_UNAVAILABLE}];case 1:return[2,{code:r.sent().code}]}}))}))}}),Object.defineProperty(r.prototype,"getSubscribeUserList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n;return o(this,void 0,void 0,(function(){var i;return s(this,(function(o){return this._isConnected?(i=null===(n=this._subscribeManager)||void 0===n?void 0:n.getSubscribeUserList(e,t,r),[2,Promise.resolve({code:exports.ErrorCode.SUCCESS,data:i})]):[2,{code:exports.ErrorCode.RC_NET_UNAVAILABLE}]}))}))}}),Object.defineProperty(r.prototype,"getSubscribeUserStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r;return o(this,void 0,void 0,(function(){var n;return s(this,(function(i){return this._isConnected?(n=null===(r=this._subscribeManager)||void 0===r?void 0:r.getSubscribeUserStatus(e,t),[2,Promise.resolve({code:exports.ErrorCode.SUCCESS,data:n})]):[2,{code:exports.ErrorCode.RC_NET_UNAVAILABLE}]}))}))}}),Object.defineProperty(r.prototype,"updateMyUserProfile",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t;return o(this,void 0,void 0,(function(){var r,n,i,o,a;return s(this,(function(s){switch(s.label){case 0:return this._isConnected?(r=Za.encode(ra,c(this,d,"m",h).call(this,e)),[4,this._connMgr.query(Zr.updUserProfile,this.currentUserId,r,void 0)]):[2,{code:exports.ErrorCode.RC_NET_UNAVAILABLE}];case 1:return(n=s.sent()).data?(i=Za.decode(ia,n.data.pbData),n.isOk?(o=i.version,null===(t=this._subscribeManager)||void 0===t||t.updateOwnProfile(e,o),[2,n.wipe()]):(a=i.censorFailedFields,[2,gt(n.code,"",a&&0!==a.length?{errorKeys:a,errorKey:a[0]}:void 0)])):[2,n.wipe()]}}))}))}}),Object.defineProperty(r.prototype,"getMyUserProfile",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._isConnected?this._subscribeManager.getOwnProfile():Promise.resolve({code:exports.ErrorCode.RC_NET_UNAVAILABLE})}}),Object.defineProperty(r.prototype,"getUserProfiles",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){return s(this,(function(t){return this._isConnected?[2,this._subscribeManager.getUserProfiles(e)]:[2,{code:exports.ErrorCode.RC_NET_UNAVAILABLE}]}))}))}}),Object.defineProperty(r.prototype,"updateMyUserProfileVisibility",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r;return s(this,(function(n){switch(n.label){case 0:return this._isConnected?(t=this._connMgr.codec.encodeUserProfilePermission(e),r=new bi(Zr[Zr.updProfilePermiss],t,this.currentUserId),[4,this._connMgr.send(r)]):[2,{code:exports.ErrorCode.RC_NET_UNAVAILABLE}];case 1:return[2,{code:n.sent().code}]}}))}))}}),Object.defineProperty(r.prototype,"getMyUserProfileVisibility",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t,r,n,i;return s(this,(function(o){switch(o.label){case 0:return this._isConnected?(e=this._connMgr.codec.encodeUserProfileInput(),t=new bi(Zr[Zr.qProfilePermiss],e,this.currentUserId),[4,this._connMgr.send(t,ua)]):[2,{code:exports.ErrorCode.RC_NET_UNAVAILABLE}];case 1:return r=o.sent(),n=r.code,i=r.data,n!==exports.ErrorCode.SUCCESS?[2,{code:n}]:[2,{code:n,data:null==i?void 0:i.permission}]}}))}))}}),Object.defineProperty(r.prototype,"searchUserProfileByUniqueId",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,o,a;return s(this,(function(s){switch(s.label){case 0:return this._isConnected?(t=this._connMgr.codec.encodeSearchUserProfile(e),r=new bi(Zr[Zr.searchUserProfile],t,this.currentUserId),[4,this._connMgr.send(r,ra)]):[2,{code:exports.ErrorCode.RC_NET_UNAVAILABLE}];case 1:return n=s.sent(),i=n.code,o=n.data,i===exports.ErrorCode.SUCCESS&&o?(a=qt(o.userId,o.userProfile,o.userExtProfile),[2,{code:i,data:a}]):[2,{code:i}]}}))}))}}),Object.defineProperty(r.prototype,"bindRTCRoomForChatroom",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i;return s(this,(function(o){switch(o.label){case 0:return this._isConnected?(t=e.chatRoomId,r=Za.encode(js,{rtcRoomId:t}),n=new bi(Zr.setRtcRoomId,r,t),[4,this._connMgr.send(n)]):[2,exports.ErrorCode.RC_NET_UNAVAILABLE];case 1:return i=o.sent(),[2,i.code]}}))}))}}),Object.defineProperty(r.prototype,"rtcSignaling",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return o(this,void 0,void 0,(function(){var i,o,a,u;return s(this,(function(s){switch(s.label){case 0:return this._isConnected?(i=r?new bi(t,n,e):new Ei(t,n,e),[4,this._connMgr.send(i)]):[2,{code:exports.ErrorCode.RC_NET_UNAVAILABLE}];case 1:return o=s.sent(),a=o.code,u=o.data,[2,{code:a,buffer:u instanceof vi||null==u?void 0:u.pbData}]}}))}))}}),Object.defineProperty(r.prototype,"rtcPing",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n,i,o,a,u;return s(this,(function(s){switch(s.label){case 0:return n=mu(this.rtcCodec,t,r),[4,this.rtcSignaling(e,Zr[Zr.rtcPing],!0,n)];case 1:return i=s.sent(),o=i.code,a=i.buffer,o!==exports.ErrorCode.SUCCESS?[2,{code:o}]:((u=this.rtcCodec.decode(tu.RtcOutput,a)).version=kt(u.version),[2,{code:o,data:u}])}}))}))}}),Object.defineProperty(r.prototype,"getDeviceId",{enumerable:!1,configurable:!0,writable:!0,value:function(){return Fu()}}),Object.defineProperty(r.prototype,"setPushConfig",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;(t=e.deviceId)&&(ku=t),r=e.packageName,Bu=r}}),Object.defineProperty(r.prototype,"getOSInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){return s(this,(function(e){return[2,{code:exports.ErrorCode.NOT_SUPPORT}]}))}))}}),Object.defineProperty(r.prototype,"getProcessInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){return s(this,(function(e){return[2,{code:exports.ErrorCode.NOT_SUPPORT}]}))}))}}),Object.defineProperty(r.prototype,"getMainProcessInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){return s(this,(function(e){return[2,{code:exports.ErrorCode.NOT_SUPPORT}]}))}))}}),Object.defineProperty(r.prototype,"destroy",{enumerable:!1,configurable:!0,writable:!0,value:function(){o(void 0,void 0,void 0,(function(){var e,t;return s(this,(function(r){switch(r.label){case 0:return Hp?(Jp&&(clearTimeout(Jp),Jp=null),[4,Hp]):[2];case 1:return(e=r.sent())&&(t=e.db,Xp.push(t)),Hp=null,[2]}}))}))}}),Object.defineProperty(r.prototype,"setProxy",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return Promise.resolve({code:exports.ErrorCode.NOT_SUPPORT})}}),Object.defineProperty(r.prototype,"getProxy",{enumerable:!1,configurable:!0,writable:!0,value:function(){return Promise.resolve({code:exports.ErrorCode.NOT_SUPPORT})}}),Object.defineProperty(r.prototype,"testProxy",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return Promise.resolve({status:exports.ErrorCode.NOT_SUPPORT})}}),Object.defineProperty(r.prototype,"setNetwork",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._connMgr.setNetwork(e,t),e.status}}),Object.defineProperty(r.prototype,"createGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return o(this,void 0,void 0,(function(){var i,o,a,u;return s(this,(function(s){switch(s.label){case 0:return i=Df(e,t,r,n),[4,this._connMgr.query(Zr.channelCreate,e,i,void 0)];case 1:return(o=s.sent()).isOk||!o.data?[2,ht()]:(a=Za.decode(da,o.data.pbData),u={errorKeys:a.censorFailedFields,processCode:a.processCode||0},[2,gt(o.code,o.msg,u)])}}))}))}}),Object.defineProperty(r.prototype,"updateGroupInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n,i,o;return s(this,(function(s){switch(s.label){case 0:return n=Df(e,t,r),[4,this._connMgr.query(Zr.upChannelInfo,e,n,void 0)];case 1:return(i=s.sent()).isOk||!i.data?[2,ht()]:(o=Za.decode(da,i.data.pbData),[2,gt(i.code,i.msg,{errorKeys:o.censorFailedFields})])}}))}))}}),Object.defineProperty(r.prototype,"getGroupsInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,o,a,u;return s(this,(function(s){switch(s.label){case 0:return t=this._connMgr.codec.encodeMultiChannels(e),r=new bi(Zr[Zr.qChannelInfo],t,e[0]),[4,this._connMgr.send(r,ba)];case 1:return n=s.sent(),i=n.code,o=n.data,i===exports.ErrorCode.SUCCESS&&o?(a=o.result.list,u=Qt(void 0===a?[]:a),[2,{code:i,data:u}]):[2,{code:i}]}}))}))}}),Object.defineProperty(r.prototype,"kickGroupMembers",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n;return o(this,void 0,void 0,(function(){var i,o,a,u,l;return s(this,(function(s){switch(s.label){case 0:return i=this._connMgr.codec.encodeQuitGroup("kick",e,t,!0,r),o=new bi(Zr[Zr.channelMemKick],i,e),[4,this._connMgr.send(o,da)];case 1:return a=s.sent(),u=a.code,l=a.data,u!==exports.ErrorCode.SUCCESS?[2,{code:u,msg:null!==(n=null==l?void 0:l.msg)&&void 0!==n?n:""}]:[2,{code:u}]}}))}))}}),Object.defineProperty(r.prototype,"quitGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r;return o(this,void 0,void 0,(function(){var n,i,o,a,u;return s(this,(function(s){switch(s.label){case 0:return n=this._connMgr.codec.encodeQuitGroup("quit",e,[],!0,t),i=new bi(Zr[Zr.channelMemQuit],n,e),[4,this._connMgr.send(i,da)];case 1:return o=s.sent(),a=o.code,u=o.data,a!==exports.ErrorCode.SUCCESS?[2,{code:a,msg:null!==(r=null==u?void 0:u.msg)&&void 0!==r?r:""}]:[2,{code:a}]}}))}))}}),Object.defineProperty(r.prototype,"dismissGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t;return o(this,void 0,void 0,(function(){var r,n,i,o,a;return s(this,(function(s){switch(s.label){case 0:return r=this._connMgr.codec.encodeQuitGroup("dismiss",e),n=new bi(Zr[Zr.channelDismiss],r,e),[4,this._connMgr.send(n,da)];case 1:return i=s.sent(),o=i.code,a=i.data,o!==exports.ErrorCode.SUCCESS?[2,{code:o,msg:null!==(t=null==a?void 0:a.msg)&&void 0!==t?t:""}]:[2,{code:o}]}}))}))}}),Object.defineProperty(r.prototype,"transferGroupOwner",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){var i;return o(this,void 0,void 0,(function(){var o,a,u,l,c;return s(this,(function(s){switch(s.label){case 0:return o=this._connMgr.codec.encodeQuitGroup("transfer",e,[t],r,n),a=new bi(Zr[Zr.channelTransfer],o,e),[4,this._connMgr.send(a,da)];case 1:return u=s.sent(),l=u.code,c=u.data,l!==exports.ErrorCode.SUCCESS?[2,{code:l,msg:null!==(i=null==c?void 0:c.msg)&&void 0!==i?i:""}]:[2,{code:l}]}}))}))}}),Object.defineProperty(r.prototype,"setGroupManagers",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n;return o(this,void 0,void 0,(function(){var i,o,a,u,l;return s(this,(function(s){switch(s.label){case 0:return i=this._connMgr.codec.encodeModifyChannelsInput(e,t,r),o=new bi(Zr[Zr.upChannelManager],i,t),[4,this._connMgr.send(o,da)];case 1:return a=s.sent(),u=a.code,l=a.data,u!==exports.ErrorCode.SUCCESS?[2,{code:u,msg:null!==(n=null==l?void 0:l.msg)&&void 0!==n?n:""}]:[2,{code:u}]}}))}))}}),Object.defineProperty(r.prototype,"getGroupMembersByRole",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n,i,o,a,u,l,c,d,p,f,h;return s(this,(function(s){switch(s.label){case 0:return n=this._connMgr.codec.encodeChannelsQueryInput({type:"getGroupMembersByRole",groupId:e,option:r,roleType:t}),i=new bi(Zr[Zr.qChannelMem],n,e),[4,this._connMgr.send(i,ba)];case 1:return o=s.sent(),a=o.code,u=o.data,a===exports.ErrorCode.SUCCESS&&u?(l=u.result,c=u.page,p=(d=c||{}).pageToken,f=d.hasNext,[],h=Zt(l.list),[2,{code:a,data:{data:h,pageToken:f&&p?p:""}}]):[2,{code:a}]}}))}))}}),Object.defineProperty(r.prototype,"getGroupMembers",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i,o,a,u,l;return s(this,(function(s){switch(s.label){case 0:return r=this._connMgr.codec.encodeChannelsQueryInput({type:"getGroupMembers",groupId:e,ids:t}),n=new bi(Zr[Zr.qChannelSpeMem],r,e),[4,this._connMgr.send(n,ba)];case 1:return i=s.sent(),o=i.code,a=i.data,o!==exports.ErrorCode.SUCCESS?[2,{code:o}]:a?(u=a.result,[],l=Zt(u.list),[2,{code:o,data:l}]):[2,{code:o,data:[]}]}}))}))}}),Object.defineProperty(r.prototype,"setGroupMemberInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return o(this,void 0,void 0,(function(){var i,o,a;return s(this,(function(s){switch(s.label){case 0:return i=Za.encode(ma,{targetId:e,type:exports.ConversationType.GROUP,userId:t,channelNickName:r,additional:n}),[4,this._connMgr.query(Zr.upChannelMem,e,i,void 0)];case 1:return(o=s.sent()).isOk||!o.data?[2,ht()]:(a=Za.decode(da,o.data.pbData),[2,gt(o.code,o.msg,{errorKeys:a.censorFailedFields})])}}))}))}}),Object.defineProperty(r.prototype,"searchGroupMembers",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return Promise.resolve({code:exports.ErrorCode.NOT_SUPPORT})}}),Object.defineProperty(r.prototype,"joinGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t;return o(this,void 0,void 0,(function(){var r,n,i,o,a;return s(this,(function(s){switch(s.label){case 0:return r=this._connMgr.codec.encodeJoinGroup("join",e),n=new bi(Zr[Zr.channelMemJoin],r,e),[4,this._connMgr.send(n,da)];case 1:return i=s.sent(),o=i.code,a=i.data,[2,{code:o,data:{processCode:null!==(t=null==a?void 0:a.processCode)&&void 0!==t?t:0}}]}}))}))}}),Object.defineProperty(r.prototype,"inviteUsersToGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r,n;return o(this,void 0,void 0,(function(){var i,o,a,u,l;return s(this,(function(s){switch(s.label){case 0:return i=this._connMgr.codec.encodeJoinGroup("invite",e,t),o=new bi(Zr[Zr.channelMemInvite],i,e),[4,this._connMgr.send(o,da)];case 1:return a=s.sent(),u=a.code,l=a.data,u!==exports.ErrorCode.SUCCESS?[2,{code:u,msg:null!==(r=null==l?void 0:l.msg)&&void 0!==r?r:""}]:[2,{code:u,data:{processCode:null!==(n=null==l?void 0:l.processCode)&&void 0!==n?n:0}}]}}))}))}}),Object.defineProperty(r.prototype,"memberInviteResponse",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;return o(this,void 0,void 0,(function(){var n,i,o,a,u;return s(this,(function(s){switch(s.label){case 0:return n=this._connMgr.codec.encodeMemberResponseInput(e),i=new bi(Zr[Zr.channelApplyResp],n,e.groupId),[4,this._connMgr.send(i,da)];case 1:return o=s.sent(),a=o.code,u=o.data,a!==exports.ErrorCode.SUCCESS?[2,{code:a,msg:null!==(t=null==u?void 0:u.msg)&&void 0!==t?t:""}]:[2,{code:a,data:{processCode:null!==(r=null==u?void 0:u.processCode)&&void 0!==r?r:0}}]}}))}))}}),Object.defineProperty(r.prototype,"getGroupApplications",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var t,r,i,o,a,u,l;return s(this,(function(s){switch(s.label){case 0:return t=Za.encode(ga,{type:exports.ConversationType.GROUP,page:{size:e.count,pageToken:e.pageToken,order:e.order?0:1}}),[4,this._connMgr.query(Zr.qChannelApplyList,this.currentUserId,t,ba)];case 1:return(r=s.sent()).isOk?(i=function(e){var t=e.listType,r=e.result,i=e.page,o=new Uint8Array(r),s=[];switch(t){case 1:s=Za.decode(va,o).list;break;case 2:s=Za.decode(Ea,o).list;break;case 3:s=Za.decode(ya,o).list;break;case 11:s=Za.decode(Ma,o).list;break;case 13:s=Za.decode(La,o).list}return n(n({},i),{list:s})}(r.data),o=i.pageToken,a=i.hasNext,u=i.list,l=u.map(er),[2,ht({data:l,pageToken:a&&o?o:""})]):[2,r.wipe()]}}))}))}}),Object.defineProperty(r.prototype,"getJoinedGroupsByRole",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i,o,a,u,l,c,d,p,f;return s(this,(function(s){switch(s.label){case 0:return r=this._connMgr.codec.encodeChannelsQueryInput({type:"getJoinedGroupsByRole",option:t,roleType:e}),n=new bi(Zr[Zr.qChannelMemJoin],r,this.currentUserId),[4,this._connMgr.send(n,ba)];case 1:return i=s.sent(),o=i.code,a=i.data,o===exports.ErrorCode.SUCCESS&&a?(u=a.result,l=a.page,d=(c=l||{}).pageToken,p=c.hasNext,f=Qt(u.list),[2,{code:o,data:{data:f,pageToken:p&&d?d:""}}]):[2,{code:o}]}}))}))}}),Object.defineProperty(r.prototype,"searchJoinedGroups",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return Promise.resolve({code:exports.ErrorCode.NOT_SUPPORT})}}),Object.defineProperty(r.prototype,"getJoinedGroups",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,o,a,u;return s(this,(function(s){switch(s.label){case 0:return t=this._connMgr.codec.encodeChannelsQueryInput({type:"getJoinedGroups",ids:e}),r=new bi(Zr[Zr.qChannelMemSpeJoin],t,this.currentUserId),[4,this._connMgr.send(r,ba)];case 1:return n=s.sent(),i=n.code,o=n.data,i===exports.ErrorCode.SUCCESS&&o?(a=o.result.list,u=Qt(a),[2,{code:i,data:u}]):[2,{code:i}]}}))}))}}),Object.defineProperty(r.prototype,"setGroupRemark",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n;return s(this,(function(i){switch(i.label){case 0:return r=this._connMgr.codec.encodeSetGroupRemark(e,t),n=new bi(Zr[Zr.upChannelRemark],r,e),[4,this._connMgr.send(n)];case 1:return[2,{code:i.sent().code}]}}))}))}}),Object.defineProperty(r.prototype,"setGroupFollows",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n,i;return s(this,(function(o){switch(o.label){case 0:return n=this._connMgr.codec.encodeSetGroupFollows(e,t,r),i=new bi(Zr[Zr.upChannelFollow],n,t),[4,this._connMgr.send(i)];case 1:return[2,{code:o.sent().code}]}}))}))}}),Object.defineProperty(r.prototype,"getGroupFollows",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,o,a,u;return s(this,(function(s){switch(s.label){case 0:return t=this._connMgr.codec.encodeChannelsQueryInput({type:"getGroupFollows",groupId:e}),r=new bi(Zr[Zr.qChannelFollow],t,this.currentUserId),[4,this._connMgr.send(r,ba)];case 1:return n=s.sent(),i=n.code,o=n.data,i===exports.ErrorCode.SUCCESS&&o?(a=o.result,l=a.list,u=l.map((function(e){var t=e.userId,r=e.opTime;return{userId:t,time:kt(r)}})),[2,{code:i,data:u}]):[2,{code:i}]}var l}))}))}}),Object.defineProperty(r.prototype,"addFriend",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n;return o(this,void 0,void 0,(function(){var i,o,a,u,l;return s(this,(function(s){switch(s.label){case 0:return i=this._connMgr.codec.encodeFriendInput({targetId:e,type:t,info:r}),o=new bi(Zr[Zr.friendAdd],i,this.currentUserId),[4,this._connMgr.send(o,da)];case 1:return a=s.sent(),u=a.code,l=a.data,u===exports.ErrorCode.SUCCESS&&l?[2,{code:u,data:{processCode:null!==(n=null==l?void 0:l.processCode)&&void 0!==n?n:0}}]:[2,{code:u}]}}))}))}}),Object.defineProperty(r.prototype,"deleteFriends",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n;return s(this,(function(i){switch(i.label){case 0:return r=this._connMgr.codec.encodeFriendsInput(e,t),n=new bi(Zr[Zr.friendDel],r,this.currentUserId),[4,this._connMgr.send(n)];case 1:return[2,{code:i.sent().code}]}}))}))}}),Object.defineProperty(r.prototype,"acceptFriendApplication",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r;return s(this,(function(n){switch(n.label){case 0:return t=this._connMgr.codec.encodeFriendInput({targetId:e,type:1}),r=new bi(Zr[Zr.friendHandle],t,this.currentUserId),[4,this._connMgr.send(r)];case 1:return[2,{code:n.sent().code}]}}))}))}}),Object.defineProperty(r.prototype,"refuseFriendApplication",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n;return s(this,(function(i){switch(i.label){case 0:return r=this._connMgr.codec.encodeFriendInput({targetId:e,type:2,info:t}),n=new bi(Zr[Zr.friendHandle],r,this.currentUserId),[4,this._connMgr.send(n)];case 1:return[2,{code:i.sent().code}]}}))}))}}),Object.defineProperty(r.prototype,"setFriendInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n,i,o;return s(this,(function(s){switch(s.label){case 0:return n=Za.encode(Sa,{targetId:e,remarkName:t,extProfile:Uf(r)}),[4,this._connMgr.query(Zr.friendSetPf,this.currentUserId,n,void 0)];case 1:return(i=s.sent()).isOk||!i.data?[2,i.wipe()]:(o=Za.decode(Aa,i.data.pbData),[2,gt(i.code,"",{errorKeys:o.censorFailedFields})])}}))}))}}),Object.defineProperty(r.prototype,"checkFriends",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i,o,a,u;return s(this,(function(s){switch(s.label){case 0:return r=this._connMgr.codec.encodeFriendsInput(e,t),n=new bi(Zr[Zr.friendCheck],r,this.currentUserId),[4,this._connMgr.send(n,Oa)];case 1:return i=s.sent(),o=i.code,a=i.data,o!==exports.ErrorCode.SUCCESS?[2,{code:o}]:a?(u=a.list.map((function(e){return{userId:e.targetId,relationType:e.status}})),[2,{code:o,data:u}]):[2,{code:o,data:[]}]}}))}))}}),Object.defineProperty(r.prototype,"getFriends",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i,o,a,u,l,c,d,p;return s(this,(function(s){switch(s.label){case 0:return r=this._connMgr.codec.encodeFriendQueryInput(11,t,e),n=new bi(Zr[Zr.friendsQuery],r,this.currentUserId),[4,this._connMgr.send(n,ba)];case 1:return i=s.sent(),o=i.code,a=i.data,o===exports.ErrorCode.SUCCESS&&a?(u=a.result,l=a.page,d=(c=l||{}).pageToken,p=c.hasNext,u&&u.list?[2,{code:o,data:{data:Wh(u.list),pageToken:p&&d?d:""}}]:[2,{code:o,data:{data:[],pageToken:p&&d?d:""}}]):[2,{code:o}]}}))}))}}),Object.defineProperty(r.prototype,"getFriendApplications",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var t,r,n,i,o,a,u,l,c,d;return s(this,(function(s){switch(s.label){case 0:return t=this._connMgr.codec.encodeFriendQueryInput(12,e),r=new bi(Zr[Zr.friendsQuery],t,this.currentUserId),[4,this._connMgr.send(r,ba)];case 1:return n=s.sent(),i=n.code,o=n.data,i!==exports.ErrorCode.SUCCESS?[2,{code:i}]:o?(a=o.result,u=o.page,c=(l=u||{}).pageToken,d=l.hasNext,[2,{code:i,data:{data:Jh(a),pageToken:d&&c?c:""}}]):[2,{code:i,data:{data:[],pageToken:""}}]}}))}))}}),Object.defineProperty(r.prototype,"deleteFriendApplication",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){return s(this,(function(e){return[2,{code:exports.ErrorCode.NOT_SUPPORT}]}))}))}}),Object.defineProperty(r.prototype,"getFriendsInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,o;return s(this,(function(s){switch(s.label){case 0:return t=Za.encode(Na,{targetId:e}),r=new bi(Zr[Zr.friendsInfoQry],t,this.currentUserId),[4,this._connMgr.send(r,Ma)];case 1:return n=s.sent(),i=n.code,o=n.data,i!==exports.ErrorCode.SUCCESS?[2,{code:i}]:o?[2,{code:i,data:Wh(o.list)}]:[2,{code:i,data:[]}]}}))}))}}),Object.defineProperty(r.prototype,"searchFriendsInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){return s(this,(function(e){return[2,Promise.resolve({code:exports.ErrorCode.NOT_SUPPORT})]}))}))}}),Object.defineProperty(r.prototype,"setFriendAddPermission",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r;return s(this,(function(n){switch(n.label){case 0:return t=Za.encode(wa,{level:e}),r=new bi(Zr.friendAuthSet,t,this.currentUserId),[4,this._connMgr.send(r)];case 1:return[2,n.sent().wipe()]}}))}))}}),Object.defineProperty(r.prototype,"getFriendAddPermission",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t,r,n,i;return s(this,(function(o){switch(o.label){case 0:return e=this._connMgr.codec.encodeFriendInput({targetId:this.currentUserId}),t=new bi(Zr.friendAuthGet,e,this.currentUserId),[4,this._connMgr.send(t,wa)];case 1:return r=o.sent(),n=r.code,i=r.data,n===exports.ErrorCode.SUCCESS&&i?[2,{code:n,data:i}]:[2,{code:n}]}}))}))}}),Object.defineProperty(r.prototype,"getUnreadMentionedMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){throw new Error("Method not implemented.")}}),Object.defineProperty(r.prototype,"setCallInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n,i,o,a,u;return s(this,(function(s){switch(s.label){case 0:return(n=this._connMgr)?(i=Za.encode(Vs,{key:t,dataContent:r}),[4,n.send(new bi(Zr.reqCall,i,e),Vs)]):[3,2];case 1:return o=s.sent(),a=o.code,u=o.data,a===exports.ErrorCode.SUCCESS&&u?[2,Promise.resolve({code:a,data:{key:u.key,value:u.dataContent}})]:[2,Promise.resolve({code:a})];case 2:return[2,Promise.resolve({code:exports.ErrorCode.RC_NET_CHANNEL_INVALID})]}}))}))}}),Object.defineProperty(r.prototype,"getRealtimeConversations",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n,i,o,a,u,l,c,d,p,f=this;return s(this,(function(s){switch(s.label){case 0:return i=(n=this).currentUserId,o=n._connMgr,a=exports.ConversationType.PRIVATE,u=o.codec.encodeOldConversationList({count:e,type:a,startTime:t,order:r}),l=new bi(Zr.qrySessions,u,i),[4,o.send(l,Lo,{currentUserId:i,connectedTime:o.getConnectedTime(),afterDecode:function(e){var t=e.conversationType,r=e.targetId,n=e.channelId,i=e.unreadMessageCount,o=f._chat.storage.getOrCreateModel({conversationType:t,targetId:r,channelId:n},!1).toIReceivedConversation();return Object.assign(e,o,{unreadMessageCount:i}),e}})];case 1:return c=s.sent(),d=c.code,p=c.data,d!==exports.ErrorCode.SUCCESS?[2,{code:d}]:[2,{code:d,data:null==p?void 0:p.list.sort((function(e,t){var n,i,o=(null===(n=e.latestMessage)||void 0===n?void 0:n.sentTime)||0,s=(null===(i=t.latestMessage)||void 0===i?void 0:i.sentTime)||0;return 0===r?s-o:o-s}))}]}}))}))}}),Object.defineProperty(r.prototype,"getRealtimeConTotalUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e;return s(this,(function(t){switch(t.label){case 0:return e=Za.encode(Bo,{nothing:1}),[4,this._connMgr.query(Zr.qrySessionsAtt,this.currentUserId,e,Ho)];case 1:return[2,t.sent().trans((function(e){return e.totalUnreadCount}))]}}))}))}}),Object.defineProperty(r.prototype,"clearRealtimeConUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,o;return s(this,(function(s){switch(s.label){case 0:return t=e.conversationType,r=e.targetId,n=this.getServerTime(),this._clearConversationUnreadCount(t,r,"",!1,n),i=Kf(e,n),o=new Ei(Zr.updRRTime,i,this.currentUserId),[4,this._connMgr.send(o)];case 1:return[2,s.sent().wipe()]}}))}))}}),Object.defineProperty(r.prototype,"removeRealtimeConversations",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r;return s(this,(function(n){switch(n.label){case 0:return t=this._connMgr,r=new bi(Zr.delSessions,t.codec.encodeRemoveConversationList(e),this.getCurrentUserId()),[4,t.send(r)];case 1:return[2,{code:n.sent().code}]}}))}))}}),Object.defineProperty(r.prototype,"getRealtimeConUnreadCounts",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;return o(this,void 0,void 0,(function(){var n,i,o;return s(this,(function(s){switch(s.label){case 0:return n=this._connMgr.codec.encodeQuerySessionsInput(e),i=new bi(Zr[Zr.qrySessionsUnread],n,this.currentUserId),[4,this._connMgr.send(i,Wo)];case 1:return(o=s.sent()).code===exports.ErrorCode.SUCCESS&&o.data?[2,{code:o.code,data:null===(r=null===(t=o.data)||void 0===t?void 0:t.sessions)||void 0===r?void 0:r.map((function(e){return{conversationType:e.type,targetId:e.channelId,channelId:e.busChannel||"",unreadCount:kt(e.unreadCount)}}))}]:[2,{code:o.code}]}}))}))}}),Object.defineProperty(r.prototype,"setNotificationQuietHoursWithSetting",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t;return s(this,(function(r){switch(r.label){case 0:return t=Za.encode(Da,e),[4,this._connMgr.query(Zr.addUnpush,this.currentUserId,t)];case 1:return[2,r.sent().wipe()]}}))}))}}),Object.defineProperty(r.prototype,"removeNotificationQuietHoursSetting",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e;return s(this,(function(t){switch(t.label){case 0:return e=Za.encode(xa,{nothing:0}),[4,this._connMgr.query(Zr.delUnpush,this.currentUserId,e)];case 1:return[2,t.sent().wipe()]}}))}))}}),Object.defineProperty(r.prototype,"getNotificationQuietHoursSetting",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e;return s(this,(function(t){switch(t.label){case 0:return e=Za.encode(ja,{nothing:0}),[4,this._connMgr.query(Zr.qryUnpush,this.currentUserId,e,Va)];case 1:return[2,t.sent().trans((function(e){var t=e.isUnpush,r=e.spanMinutes,n=e.startTime,i=e.level,o=e.timezone;return t?{spanMinutes:r,startTime:n,level:i,timezone:o}:{spanMinutes:0,startTime:"",level:exports.PushNotificationQuietHoursLevel.PUSH_NOTIFICATION_QUIET_HOURS_LEVEL_DEFAULT}}))]}}))}))}}),Object.defineProperty(r.prototype,"getStatsUrlList",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){return s(this,(function(e){return[2,ht(yr.getStatsUrlList(this.getNaviInfoFromCache()))]}))}))}}),d=new WeakSet,p=function(e,t){var r,n;null===(n=(r=this._watcher).readReceiptResponseV5)||void 0===n||n.call(r,t)},f=function(e,t,r){var n=this;t!==nh?this._handleEventChangeList(this._connMgr.codec.formatEventChangeList(r)):r.forEach((function(e){Za.decode(Ua,new Uint8Array(e.eventData)).statusInfo.forEach((function(e){var t,r,i=er(e);null===(r=(t=n._watcher).groupApplicationEvent)||void 0===r||r.call(t,i)}))}))},h=function(e){var t={},r=e.extraProfile;return r&&(delete e.extraProfile,t.userExtProfile=Uf(r)),t.userProfile=Uf(e),t},i([Kh()],r.prototype,"createGroup",null),i([Kh()],r.prototype,"updateGroupInfo",null),i([Kh()],r.prototype,"getGroupsInfo",null),i([Kh()],r.prototype,"kickGroupMembers",null),i([Kh()],r.prototype,"quitGroup",null),i([Kh()],r.prototype,"dismissGroup",null),i([Kh()],r.prototype,"transferGroupOwner",null),i([Kh()],r.prototype,"setGroupManagers",null),i([Kh()],r.prototype,"getGroupMembersByRole",null),i([Kh()],r.prototype,"getGroupMembers",null),i([Kh()],r.prototype,"setGroupMemberInfo",null),i([Kh()],r.prototype,"joinGroup",null),i([Kh()],r.prototype,"inviteUsersToGroup",null),i([Kh()],r.prototype,"memberInviteResponse",null),i([Kh()],r.prototype,"getGroupApplications",null),i([Kh()],r.prototype,"getJoinedGroupsByRole",null),i([Kh()],r.prototype,"getJoinedGroups",null),i([Kh()],r.prototype,"setGroupRemark",null),i([Kh()],r.prototype,"setGroupFollows",null),i([Kh()],r.prototype,"getGroupFollows",null),i([Kh()],r.prototype,"addFriend",null),i([Kh()],r.prototype,"deleteFriends",null),i([Kh()],r.prototype,"acceptFriendApplication",null),i([Kh()],r.prototype,"refuseFriendApplication",null),i([Kh()],r.prototype,"setFriendInfo",null),i([Kh()],r.prototype,"checkFriends",null),i([Kh()],r.prototype,"getFriends",null),i([Kh()],r.prototype,"getFriendApplications",null),i([Kh()],r.prototype,"deleteFriendApplication",null),i([Kh()],r.prototype,"getFriendsInfo",null),i([Kh()],r.prototype,"searchFriendsInfo",null),i([Kh()],r.prototype,"setFriendAddPermission",null),i([Kh()],r.prototype,"getFriendAddPermission",null),i([Kh()],r.prototype,"getRealtimeConversations",null),i([Kh()],r.prototype,"getRealtimeConTotalUnreadCount",null),i([Kh()],r.prototype,"clearRealtimeConUnreadCount",null),i([Kh()],r.prototype,"removeRealtimeConversations",null),i([Kh()],r.prototype,"getRealtimeConUnreadCounts",null),i([Qh()],r.prototype,"setNotificationQuietHoursWithSetting",null),i([Qh()],r.prototype,"removeNotificationQuietHoursSetting",null),i([Qh()],r.prototype,"getNotificationQuietHoursSetting",null),r}(Ru);function Zh(e){return n({},e)}function Xh(e,t,r){var n=r.value;r.value=function(){for(var e,t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return 1!==(null===(e=this.getNaviInfoFromCache())||void 0===e?void 0:e.userProfile)?Promise.resolve({code:exports.ErrorCode.RC_USER_PROFILE_SERVICE_UNAVAILABLE}):n.call.apply(n,l([this],u(t),!1))}}function $h(e,t,r){var n=r.value;r.value=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return zu(this.getNaviInfoFromCache()).isOk?n.call.apply(n,l([this],u(e),!1)):Promise.resolve({code:exports.ErrorCode.RC_REAL_TIME_CONVERSATION_UNAVAILABLE})}}var eg=function(){function e(e){var r,i,o=this;t.add(this),Object.defineProperty(this,"_token",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(this,"_pluginContextQueue",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_pluginInstanseMap",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_engine",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"appkey",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_options",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"sse",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_versionInfo",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_typingInfo",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"rtcCodec",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"logger",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_compatibleMessageProccessor",{enumerable:!0,configurable:!0,writable:!0,value:(r={},r[exports.MessageType.CHATROOM_MERGE_CHANGE]=this._processChrmMemChangeMessage.bind(this),r[exports.MessageType.TYPING_STATUS]=this._processTypingStatusMessage.bind(this),r[exports.MessageType.INTERCEPT]=this._processInterceptMessage.bind(this),r[exports.MessageType.CHATROOM_SYNC_MSG]=this._processChrmSyncMessage.bind(this),r[exports.MessageType.CHATROOM_MERGE_BLOCK]=this._processChrmMemBlockMessage.bind(this),r[exports.MessageType.CHATROOM_MERGE_BAN]=this._processChrmMemBanMessage.bind(this),r)}),Object.defineProperty(this,"_messageProccessor",{enumerable:!0,configurable:!0,writable:!0,value:(i={},i[exports.MessageType.READ_RECEIPT]=this._processReadReceiptMessage.bind(this),i[exports.MessageType.READ_RECEIPT_REQUEST]=this._processReadReceiptRequestMessage.bind(this),i[exports.MessageType.READ_RECEIPT_RESPONSE]=this._processReadReceiptResponseMessage.bind(this),i)}),Object.defineProperty(this,"_watcher",{enumerable:!0,configurable:!0,writable:!0,value:{message:void 0,batchMessage:void 0,conversationState:void 0,chatroomState:void 0,connection:void 0,expansion:void 0,tag:void 0,conversationTagChanged:void 0,pullFinished:void 0,readReceiptReceived:void 0,messageReceiptRequest:void 0,messageReceiptResponse:void 0,typingState:void 0,messageBlocked:void 0,ultraGroupEnable:void 0,sgRelationsSynced:void 0,operateStatus:void 0,ultraGroupMessageExpansionUpdated:void 0,ultraGroupMessageModified:void 0,ultraGroupMessageRecalled:void 0,ultraGroupChannelChangeType:void 0,ultraGroupChannelUserKicked:void 0,ultraGroupChannelDelete:void 0,userGroupStatus:void 0,messageReadReceipt:void 0,syncReadStatus:void 0,subscribedUserStatusChange:void 0,subscribedRelationChange:void 0,syncSubscribedUserStatusFinished:void 0,ownUserProfileChanged:void 0,groupOperation:void 0,groupInfoChanged:void 0,groupMemberInfoChanged:void 0,groupApplicationEvent:void 0,groupRemarkChangedSync:void 0,groupFollowsChangedSync:void 0,friendAdd:void 0,friendDelete:void 0,friendApplicationStatusChanged:void 0,friendCleared:void 0,friendInfoChangedSync:void 0,databaseUpgradeWillStart:void 0,databaseUpgrading:void 0,databaseUpgradeDidComplete:void 0,readReceiptResponseV5:void 0}}),Object.defineProperty(this,"_typingInternalTimer",{enumerable:!0,configurable:!0,writable:!0,value:-1}),Object.defineProperty(this,"_typingExpireTime",{enumerable:!0,configurable:!0,writable:!0,value:2e3}),Object.defineProperty(this,"_typingChangedList",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"getChatRoomHistoryMessages",{enumerable:!0,configurable:!0,writable:!0,value:this.getChatroomHistoryMessages}),this._options=n({},e),this.appkey=this._options.appkey,this._options.typingExpireTime&&(this._options.typingExpireTime<2e3?this._typingExpireTime=2e3:this._options.typingExpireTime>6e3?this._typingExpireTime=6e3:this._typingExpireTime=this._options.typingExpireTime),this._options.navigators=this._options.navigators.map((function(e){return e.replace(/\/$/g,"")}));var s={onConnected:function(){return o._onConnectionStatusChange(exports.RCConnectionStatus.CONNECTED)},onConnecting:this._onConnectionStatusChange.bind(this,exports.RCConnectionStatus.CONNECTING),onSuspend:this._onConnectionStatusChange.bind(this,exports.RCConnectionStatus.SUSPENDED),onDisconnected:this._onConnectionStatusChange.bind(this,exports.RCConnectionStatus.DISCONNECTED),batchMessage:this._batchMessageReceiver.bind(this),chatroom:this._chatroomInfoListener.bind(this),conversation:this._conversationInfoListener.bind(this),conversationTag:this._conversationTagListener.bind(this),expansion:this._expansionInfoListener.bind(this),tag:this._tagListener.bind(this),onRTCDataChange:this._rtcDataChange.bind(this),pullFinished:this._pullFinishedListener.bind(this),ultraGroupEnable:this._ultraGroupEnableListener.bind(this),sgRelationsSynced:this._sgRelationsSyncedListener.bind(this),operateStatus:this._operateStatusListener.bind(this),ultraGroupMessageExpansionUpdated:this._ultraGroupMessageExpansionUpdatedListener.bind(this),ultraGroupMessageModified:this._ultraGroupMessageModifiedListener.bind(this),ultraGroupMessageRecalled:this._ultraGroupMessageRecalledListener.bind(this),callInfo:this._callInfoListener.bind(this),ultraGroupChannelChangeType:this._ultraGroupChannelChangeTypeListener.bind(this),ultraGroupChannelUserKicked:this._ultraGroupChannelUserKickedListener.bind(this),ultraGroupChannelDelete:this._ultraGroupChannelDeleteListener.bind(this),onNaviDataChange:this._naviDataChange.bind(this),userGroupStatus:this._userGroupStatusListener.bind(this),messageReadReceipt:this._messageReadReceipt.bind(this),syncReadStatus:this._syncReadStatus.bind(this),subscribedUserStatusChange:this._subscribedUserStatusChange.bind(this),subscribedRelationChange:this._subscribedRelationChange.bind(this),syncSubscribedUserStatusFinished:this._syncSubscribedUserStatusFinished.bind(this),ownUserProfileChanged:this._ownUserProfileChanged.bind(this),groupOperation:this._groupOperation.bind(this),groupInfoChanged:this._groupInfoChanged.bind(this),groupMemberInfoChanged:this._groupMemberInfoChanged.bind(this),groupApplicationEvent:this._groupApplicationEvent.bind(this),groupRemarkChangedSync:this._groupRemarkChangedSync.bind(this),groupFollowsChangedSync:this._groupFollowsChangedSync.bind(this),friendAdd:this._friendAdd.bind(this),friendDelete:this._friendDelete.bind(this),friendApplicationStatusChanged:this._friendApplicationStatusChanged.bind(this),friendCleared:this._friendCleared.bind(this),friendInfoChangedSync:this._friendInfoChangedSync.bind(this),databaseUpgradeWillStart:this._databaseUpgradeWillStart.bind(this),databaseUpgrading:this._databaseUpgrading.bind(this),databaseUpgradeDidComplete:this._databaseUpgradeDidComplete.bind(this),readReceiptResponseV5:this._readReceiptResponseV5.bind(this)};this.rtcCodec=new au(vu,yu);var a=Ft();this._engine=a?new RCCppEngine(this.rtcCodec,s,this._options):new zh(this.rtcCodec,s,this._options),this.logger=this._engine.getInnerLogger(),this._options.eventLoopBlockingCheck&&Or.start(this.logger),this.sse=new Cu(this,a)}var t,r,a;return Object.defineProperty(e,"init",{enumerable:!1,configurable:!0,writable:!0,value:function(t){if(this._context)return this._context.logger.warn(H.A_INIT_REPEAT_O),this._context;this._context=new e(t),this._context.logger.info(H.L_INIT_O,JSON.stringify({appkey:t.appkey,navigators:t.navigators,typingExpireTime:t.typingExpireTime})),this._context.logger.warn(H.L_IMSDK_VER_O,JSON.stringify({commitId:"79ec0f08dba08186185e3b0ad35a6952067191a0",version:"5.20.2-enterprise.10"}));var r=this._context._engine;return lo.setNetworkStatusListener(r.setNetwork.bind(r)),this._context}}),Object.defineProperty(e,"getContext",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._context}}),Object.defineProperty(e.prototype,"getOptions",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._options}}),Object.defineProperty(e,"destroy",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return this._context?(this._context.logger.info(H.A_DESTROY_O),[4,this._context._destroy()]):[2];case 1:return e.sent(),this._context=void 0,[2]}}))}))}}),Object.defineProperty(e.prototype,"install",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this.logger.createTraceId();if(this.logger.info(H.L_INSTALL_PLUGIN_T,JSON.stringify({tag:e.tag}),r),this._pluginInstanseMap[e.tag])return this.logger.warn(H.L_INSTALL_PLUGIN_R,"repeat install",r),this._pluginInstanseMap[e.tag];var n="RCRTC"===e.tag?new Pu(this):new Au(this),i=null;try{if(!e.verify(lo))return null;i=e.setup(n,lo,t)}catch(e){this.logger.error(H.L_INSTALL_PLUGIN_R,null==e?void 0:e.stack,r)}return["RCRTC","RCCall"].includes(e.tag)&&e.version&&e.name&&(this._versionInfo[e.name]=e.version),i&&(this._pluginContextQueue.push(n),this._pluginInstanseMap[e.tag]=i),i}}),Object.defineProperty(e.prototype,"_onConnectionStatusChange",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r,n;this.logger.warn(H.A_CONNECT_S,"status: ".concat(e,", code: ").concat(t)),null===(n=(r=this._watcher).connection)||void 0===n||n.call(r,e,t),this._pluginContextQueue.forEach((function(r){var n;null===(n=r.onconnectionstatechange)||void 0===n||n.call(r,e,t)}))}}),Object.defineProperty(e.prototype,"_processChrmMemChangeMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){if("function"==typeof this._watcher.chatroomState){var t={},r=[],n=e.content.memberCount,i=void 0===n?0:n;Array.isArray(e.content.userList)&&e.content.userList.forEach((function(e){t[e.userId]=e.status,r.push({userId:e.userId,action:e.status,extra:e.extra})})),this._watcher.chatroomState({userChange:{users:t,chatroomId:e.targetId,memberCount:i,userList:r}})}return!0}}),Object.defineProperty(e.prototype,"_processTypingStatusMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){if(this._addTypingInfo(Zh(e)),this._watcher.typingState)return!0}}),Object.defineProperty(e.prototype,"_processInterceptMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t={conversationType:e.conversationType,targetId:e.targetId,channelId:e.channelId||"",blockType:e.content.interceptType,blockedMessageUId:e.content.msgUId,extra:e.content.extra};if(e.conversationType===exports.ConversationType.ULTRA_GROUP){var r=e.content.sourceType;if(t.sourceType=r,(r===exports.MessageBlockSourceType.MSG_EXPANSION||r===exports.MessageBlockSourceType.MSG_MODIFY)&&e.content.sourceContent)try{t.sourceContent=JSON.parse(e.content.sourceContent)}catch(e){this.logger.warn(H.L_CALLBACK_E,JSON.stringify({source:"message.content.sourceContent",msg:e.message}))}}return this._MessageBlockedListener(t),!0}}),Object.defineProperty(e.prototype,"_processChrmSyncMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return"function"==typeof this._watcher.chatroomState&&this._watcher.chatroomState({chatroomNotifyMultiLoginSync:{chatroomId:e.content.chatroomId,status:e.content.status,reason:e.content.reason,time:e.content.time,extra:e.content.extra||null}}),!0}}),Object.defineProperty(e.prototype,"_processChrmMemBlockMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r=e.content;return r.operateType===exports.ChrmMemOperateType.Blocked&&(null===(t=r.userList)||void 0===t?void 0:t.includes(this.getCurrentUserId()))&&this._engine.removeChatroomFromCatch(r.chatroomId),"function"==typeof this._watcher.chatroomState&&this._watcher.chatroomState({chatroomNotifyBlock:{chatroomId:r.chatroomId,operateType:r.operateType,durationTime:r.durationTime,operateTime:r.operateTime,userIdList:r.userList,extra:r.extra||null}}),!0}}),Object.defineProperty(e.prototype,"_processChrmMemBanMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return"function"==typeof this._watcher.chatroomState&&this._watcher.chatroomState({chatroomNotifyBan:{chatroomId:e.content.chatroomId,banType:e.content.operateType,durationTime:e.content.durationTime,operateTime:e.content.operateTime,userIdList:e.content.userList,extra:e.content.extra||null}}),!0}}),Object.defineProperty(e.prototype,"_processReadReceiptMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){"function"==typeof this._watcher.readReceiptReceived&&this._watcher.readReceiptReceived({conversationType:e.conversationType,targetId:e.targetId,channelId:e.channelId},e.content.messageUId,e.content.lastMessageSendTime,e.senderUserId)}}),Object.defineProperty(e.prototype,"_processReadReceiptRequestMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){"function"==typeof this._watcher.messageReceiptRequest&&this._watcher.messageReceiptRequest({conversationType:e.conversationType,targetId:e.targetId,channelId:e.channelId},e.content.messageUId,e.senderUserId)}}),Object.defineProperty(e.prototype,"_processReadReceiptResponseMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r=null===(t=e.content)||void 0===t?void 0:t.receiptMessageDic,n=this._engine.getCurrentUserId();r&&Array.isArray(r[n])&&"function"==typeof this._watcher.messageReceiptResponse&&this._watcher.messageReceiptResponse({conversationType:e.conversationType,targetId:e.targetId,channelId:e.channelId},e.senderUserId,r[n])}}),Object.defineProperty(e.prototype,"_messageReceiver",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n,i,o,s,a=this;if(!(null===(i=(n=this._compatibleMessageProccessor)[e.messageType])||void 0===i?void 0:i.call(n,e))&&!this._pluginContextQueue.some((function(t){if(!t.onmessage)return!1;try{return t.onmessage(Zh(e))}catch(e){return a.logger.error(H.A_MSG_LISTENER_E,null==e?void 0:e.stack),!1}})))return null===(s=(o=this._watcher).message)||void 0===s||s.call(o,Zh(e),t,r),e}}),Object.defineProperty(e.prototype,"_batchMessageReceiver",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n=this,i=[],o=[],s=[exports.MessageType.READ_RECEIPT,exports.MessageType.READ_RECEIPT_REQUEST,exports.MessageType.READ_RECEIPT_RESPONSE];e.forEach((function(e){var a=n._messageReceiver(e,t,r);a&&s.includes(a.messageType)?o.push(a):a&&i.push(a)})),i.length&&this._watcher.batchMessage&&(this.logger.debug(H.L_BATCH_MESSAGE_O,i.map((function(e){return e.messageUId})).join(",")),this._watcher.batchMessage(i)),o.length&&o.forEach((function(e){n._messageProccessor[e.messageType]&&n._messageProccessor[e.messageType](e)}))}}),Object.defineProperty(e.prototype,"_chatroomInfoListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).chatroomState)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_conversationInfoListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).conversationState)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_expansionInfoListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).expansion)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_tagListener",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e,t;null===(t=(e=this._watcher).tag)||void 0===t||t.call(e)}}),Object.defineProperty(e.prototype,"_conversationTagListener",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e,t;null===(t=(e=this._watcher).conversationTagChanged)||void 0===t||t.call(e)}}),Object.defineProperty(e.prototype,"_typingStatusListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).typingState)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_pullFinishedListener",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e,t;null===(t=(e=this._watcher).pullFinished)||void 0===t||t.call(e)}}),Object.defineProperty(e.prototype,"_MessageBlockedListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).messageBlocked)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_callInfoListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;this._pluginContextQueue.forEach((function(r){try{r.onCallInfo&&r.onCallInfo(e)}catch(e){t.logger.warn(H.L_CALLBACK_E,null==e?void 0:e.stack)}}))}}),Object.defineProperty(e.prototype,"_ultraGroupEnableListener",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e,t;null===(t=(e=this._watcher).ultraGroupEnable)||void 0===t||t.call(e)}}),Object.defineProperty(e.prototype,"_sgRelationsSyncedListener",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e,t;null===(t=(e=this._watcher).sgRelationsSynced)||void 0===t||t.call(e)}}),Object.defineProperty(e.prototype,"_operateStatusListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).operateStatus)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_ultraGroupMessageExpansionUpdatedListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).ultraGroupMessageExpansionUpdated)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_ultraGroupMessageModifiedListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).ultraGroupMessageModified)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_ultraGroupMessageRecalledListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).ultraGroupMessageRecalled)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_ultraGroupChannelChangeTypeListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).ultraGroupChannelChangeType)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_ultraGroupChannelUserKickedListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).ultraGroupChannelUserKicked)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_ultraGroupChannelDeleteListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).ultraGroupChannelDelete)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_userGroupStatusListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).userGroupStatus)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_messageReadReceipt",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).messageReadReceipt)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_syncReadStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).syncReadStatus)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_subscribedUserStatusChange",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).subscribedUserStatusChange)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_subscribedRelationChange",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).subscribedRelationChange)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_syncSubscribedUserStatusFinished",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;this.logger.info(H.L_SYNC_SUBSCRIBED_USER_STATUS_FINISHED_S),null===(r=(t=this._watcher).syncSubscribedUserStatusFinished)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_ownUserProfileChanged",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;this.logger.info(H.L_OWN_USER_PROFILE_CHANGED_S),null===(r=(t=this._watcher).ownUserProfileChanged)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_groupOperation",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).groupOperation)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_groupInfoChanged",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).groupInfoChanged)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_groupMemberInfoChanged",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).groupMemberInfoChanged)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_groupApplicationEvent",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).groupApplicationEvent)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_groupRemarkChangedSync",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).groupRemarkChangedSync)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_groupFollowsChangedSync",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).groupFollowsChangedSync)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_friendAdd",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).friendAdd)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_friendDelete",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).friendDelete)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_friendApplicationStatusChanged",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).friendApplicationStatusChanged)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_friendCleared",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).friendCleared)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_friendInfoChangedSync",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).friendInfoChangedSync)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_rtcDataChange",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._pluginContextQueue.forEach((function(r){var n;null===(n=r.onrtcdatachange)||void 0===n||n.call(r,e,t)}))}}),Object.defineProperty(e.prototype,"_naviDataChange",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._pluginContextQueue.forEach((function(t){var r;null===(r=t.onnavidatachange)||void 0===r||r.call(t,e)}))}}),Object.defineProperty(e.prototype,"_databaseUpgradeWillStart",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e,t;this.logger.info(H.L_DB_UPGRATE_START_S),null===(t=(e=this._watcher).databaseUpgradeWillStart)||void 0===t||t.call(e)}}),Object.defineProperty(e.prototype,"_databaseUpgrading",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;this.logger.info(H.L_DB_UPGRATING_S,e),null===(r=(t=this._watcher).databaseUpgrading)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_databaseUpgradeDidComplete",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;this.logger.info(H.L_DB_UPGRATE_COMPLETE_S),null===(r=(t=this._watcher).databaseUpgradeDidComplete)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_readReceiptResponseV5",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).readReceiptResponseV5)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"assignWatcher",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;Object.keys(this._watcher).forEach((function(r){if(Object.prototype.hasOwnProperty.call(e,r)){var n=e[r];t._watcher[r]=Nt(n)||Pt(n)?n:void 0}}))}}),Object.defineProperty(e.prototype,"_resetWatcher",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this;Object.keys(this._watcher).forEach((function(t){e._watcher[t]=void 0}))}}),Object.defineProperty(e.prototype,"_addTypingInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.senderUserId,r=e.conversationType,n=e.targetId,i=e.content,o=e.channelId,s=i.typingContentType,a=o||"",u="".concat(r,"#").concat(n,"#").concat(a);this._typingInfo[u]||(this._typingInfo[u]=[]);var l=this._typingInfo[u].findIndex((function(e){return e.userId===t}));l>=0&&this._typingInfo[u][l].messageType===s?this._typingInfo[u][l].timestamp=Date.now():(l>=0&&this._typingInfo[u].splice(l,1),this._typingInfo[u].push({userId:t,messageType:s,timestamp:Date.now()}),this._typingChangedList.includes(u)||this._typingChangedList.push(u),this._startCheckTypingInfo())}}),Object.defineProperty(e.prototype,"_startCheckTypingInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this;-1===this._typingInternalTimer&&0!==Object.keys(this._typingInfo).length&&(this._typingInternalTimer=setInterval((function(){for(var t in e._typingInfo){var r=e._typingInfo[t].length;e._typingInfo[t]=e._typingInfo[t].filter((function(t){return Date.now()-t.timestamp<e._typingExpireTime})),e._typingInfo[t].length===r||e._typingChangedList.includes(t)||e._typingChangedList.push(t),0===e._typingInfo[t].length&&delete e._typingInfo[t]}e._notifyTypingChanged()}),500))}}),Object.defineProperty(e.prototype,"_notifyTypingChanged",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this;if(this._typingChangedList.length>0){var t=this._typingChangedList.map((function(t){return{conversationType:Number(t.split("#")[0]),targetId:t.split("#")[1],channelId:t.split("#")[2],list:e._typingInfo[t]||[]}}));this._typingStatusListener(t),this._typingChangedList=[]}0===Object.keys(this._typingInfo).length&&(clearInterval(this._typingInternalTimer),this._typingInternalTimer=-1)}}),Object.defineProperty(e.prototype,"getConnectedTime",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._engine.getConnectedTime()}}),Object.defineProperty(e.prototype,"getServerTime",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._engine.getServerTime()}}),Object.defineProperty(e.prototype,"getDeviceId",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._engine.getDeviceId()}}),Object.defineProperty(e.prototype,"setPushConfig",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._engine.setPushConfig(e)}}),Object.defineProperty(e.prototype,"getCurrentUserId",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._engine.getCurrentUserId()}}),Object.defineProperty(e.prototype,"getConnectionStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._engine.getConnectionStatus()}}),Object.defineProperty(e.prototype,"validateConnected",{get:function(){var e=this;return function(){return e._engine.getConnectionStatus()===exports.RCConnectionStatus.CONNECTED?ht(e._engine.getNaviInfoFromCache()):gt(exports.ErrorCode.RC_NET_UNAVAILABLE)}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"validateLogin",{get:function(){var e=this;return function(){return e._engine.getCurrentUserId()?ht(e._engine.getNaviInfoFromCache()):gt(exports.ErrorCode.RC_NET_UNAVAILABLE)}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"token",{get:function(){return this._token},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"refetchNaviInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){return s(this,(function(e){return[2,this._engine.refetchNaviInfo()]}))}))}}),Object.defineProperty(e.prototype,"connect",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n,i;return o(this,void 0,void 0,(function(){var o,a,u,l,c,d;return s(this,(function(s){switch(s.label){case 0:return this._token=e,[4,lo.getNetworkType()];case 1:return o=s.sent(),this._engine.setNetwork({status:!0,type:o},!0),a=!!this._pluginInstanseMap.RCCallPlus,[4,this._engine.connect(e,t,a,r)];case 2:return u=s.sent(),l=u.code,c=u.data,l!==exports.ErrorCode.SUCCESS?[2,{code:l}]:(1!==this._engine.getNaviInfoFromCache().type&&(d=et.getInfo(),null===(i=(n=this._engine).reportSDKInfo)||void 0===i||i.call(n,d)),[2,{code:l,userId:c}])}}))}))}}),Object.defineProperty(e.prototype,"disconnect",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r=this;return s(this,(function(n){switch(n.label){case 0:return clearInterval(this._typingInternalTimer),this._typingInternalTimer=-1,this._typingInfo={},[4,this._engine.disconnect(e,t)];case 1:return n.sent(),this._pluginContextQueue.forEach((function(e){if(e.ondisconnect)try{e.ondisconnect()}catch(e){r.logger.error(H.L_CALLBACK_E,null==e?void 0:e.stack)}})),[2,Promise.resolve()]}}))}))}}),Object.defineProperty(e.prototype,"reconnect",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this.connect(this.token,!!e,this.logger.createTraceId())}}),Object.defineProperty(e.prototype,"_channelIdConvert",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){if(e!==exports.ConversationType.ULTRA_GROUP)return t;var r=this.getNaviInfoFromCache();return!!(2&((null==r?void 0:r.ugDriven)||0))&&!t?"RCDefault":t}}),Object.defineProperty(e.prototype,"getNaviInfoFromCache",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._engine.getNaviInfoFromCache()}}),Object.defineProperty(e.prototype,"registerMessageType",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,i,o){void 0===i&&(i=[]),void 0===o&&(o=!1);var s,a,u,l={isPersited:t,isCounted:r,searchProps:i,isStatusMessage:o};s=e,a=l,(u=jr.get(s))&&!u.isCustom&&console.warn("Builtin message type '".concat(s,"' cannot be registered")),a.isStatusMessage&&(a.isCounted=a.isPersited=!1),jr.set(s,n(n({},a),{isCustom:!0})),this._engine.registerMessageType(e,l)}}),Object.defineProperty(e.prototype,"registerRTCSignalingListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._engine.registerRTCSignalingListener(e)}}),Object.defineProperty(e.prototype,"_handleExpansioResult",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){if(t){var r=jt(e),n=r.isIllgalEx,i=r.isExKeyOrValLengthExceedLimit;return r.isExceedLimit||i?exports.ErrorCode.EXPANSION_LIMIT_EXCEET:n?exports.ErrorCode.INVALID_PARAMETER_MESSAGE_EXPANSION:void 0}}}),Object.defineProperty(e.prototype,"sendMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){var o;if(r.needReceipt){if(4!==(null===(o=this.getNaviInfoFromCache())||void 0===o?void 0:o.grpRRVer))return Promise.resolve({code:exports.ErrorCode.READ_RECEIPT_ERROR});if(e!==exports.ConversationType.GROUP&&e!==exports.ConversationType.PRIVATE||r.isStatusMessage||!r.isPersited||e===exports.ConversationType.GROUP&&r.directionalUserIdList&&r.directionalUserIdList.length>0)return Promise.resolve({code:exports.ErrorCode.SEND_READ_RECEIPT_CONF_ERROR})}var s=xu(r.messageType,r.content),a=s.code,u=s.msg;if(a!==exports.ErrorCode.SUCCESS)return Promise.resolve({code:a,msg:u});if(e===exports.ConversationType.SYSTEM&&r.messageType!==exports.MessageType.SYNC_READ_STATUS)return Promise.resolve({code:exports.ErrorCode.SYS_CONVERSATION_NOT_SUPPORT_MESSAGE});if(r.messageType===exports.MessageType.STREAM_MESSAGE)return Promise.resolve({code:exports.ErrorCode.MESSAGE_NOT_SUPPORT_SENDING});var l=r.canIncludeExpansion,c=void 0!==l&&l,d=r.expansion,p=this._handleExpansioResult(d,c);if(p)return Promise.resolve({code:p});var f=r.isMentioned,h=r.mentionedUserIdList,g=r.mentionedType;f&&[exports.ConversationType.GROUP,exports.ConversationType.ULTRA_GROUP].includes(e)?r.content.mentionedInfo=function(e,t,r){var n,i,o;return{userIdList:(null===(n=e.mentionedInfo)||void 0===n?void 0:n.userIdList)||t,type:(null===(i=e.mentionedInfo)||void 0===i?void 0:i.type)||r||exports.MentionedType.ALL,mentionedContent:(null===(o=e.mentionedInfo)||void 0===o?void 0:o.mentionedContent)||""}}(r.content,h,g):delete r.content.mentionedInfo;var _=JSON.stringify(r.content);if(function(e){for(var t,r=0,n=0,i=e.length;n<i;n++)r+=(t=e.charCodeAt(n))<127?1:t<=2047?2:t<=65535?3:4;return r}(_)>xe)return Promise.resolve({code:exports.ErrorCode.RC_MSG_CONTENT_EXCEED_LIMIT});if(e===exports.ConversationType.ULTRA_GROUP)return r.channelId=this._channelIdConvert(e,r.channelId),this._engine.sendUltraMessage(t,r,n,i);var b=this.getNaviInfoFromCache();return(null==b?void 0:b.grpRRVer)&&r.messageType===exports.MessageType.READ_RECEIPT_RESPONSE?Promise.resolve({code:exports.ErrorCode.READ_RECEIPT_ERROR}):this._engine.sendMessage(e,t,r,n,i)}}),Object.defineProperty(e.prototype,"sendExpansionMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,o,a,u,l,c,d,p;return s(this,(function(s){switch(s.label){case 0:return t=e.channelId,r=e.conversationType,n=e.targetId,i=e.messageUId,o=e.keys,a=e.expansion,u=e.canIncludeExpansion,e.messageType===exports.MessageType.STREAM_MESSAGE&&((null==o?void 0:o.includes("RC_Ext_StreamMsgSummary"))||(null==a?void 0:a.RC_Ext_StreamMsgSummary))?[2,{code:exports.ErrorCode.STREAM_MESSAGE_EXPANSION_KEY_ERROR}]:u?(l=jt(a),c=l.isIllgalEx,d=l.isExKeyOrValLengthExceedLimit,l.isExceedLimit||d?[2,Promise.resolve({code:exports.ErrorCode.EXPANSION_LIMIT_EXCEET})]:c?[2,Promise.resolve({code:exports.ErrorCode.INVALID_PARAMETER_MESSAGE_EXPANSION})]:(p={mid:i},a&&(p.put=a),o&&(p.del=o),[4,this._engine.sendMessage(r,n,{content:p,messageType:exports.MessageType.EXPANSION_NOTIFY,channelId:t})])):[2,{code:exports.ErrorCode.MESSAGE_KV_NOT_SUPPORT}];case 1:return[2,{code:s.sent().code}]}}))}))}}),Object.defineProperty(e.prototype,"sendReadReceiptMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n;return s(this,(function(i){return n=this.getNaviInfoFromCache(),1!==((null==n?void 0:n.grpRRVer)||0)?[2,{code:exports.ErrorCode.READ_RECEIPT_ERROR,msg:"The read receipt switch is not on, please call the sendMessage method!"}]:[2,this._engine.sendReadReceiptMessage(e,t,r)]}))}))}}),Object.defineProperty(e.prototype,"getMessageReader",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n;return s(this,(function(i){return n=this.getNaviInfoFromCache(),1!==((null==n?void 0:n.grpRRVer)||0)?[2,{code:exports.ErrorCode.READ_RECEIPT_ERROR}]:[2,this._engine.getMessageReader(e,t,r||"")]}))}))}}),Object.defineProperty(e.prototype,"sendReadReceiptMessageV4",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){return s(this,(function(n){return[2,this._engine.sendReadReceiptMessageV4(e,t,r)]}))}))}}),Object.defineProperty(e.prototype,"getMessageReadReceiptV4",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){return s(this,(function(r){return[2,this._engine.getMessageReadReceiptV4(e,t)]}))}))}}),Object.defineProperty(e.prototype,"batchGetMessageReadReceiptInfoV4",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){return s(this,(function(r){return[2,this._engine.batchGetMessageReadReceiptInfoV4(e,t)]}))}))}}),Object.defineProperty(e.prototype,"updateConversationReadTime",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){return s(this,(function(r){return[2,this._engine.updateConversationReadTime(e,t)]}))}))}}),Object.defineProperty(e.prototype,"_destroy",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e=this;return s(this,(function(t){switch(t.label){case 0:return Or.stop(),this._resetWatcher(),this._engine.destroy(),lo.removeNetworkStatusListener(),[4,this.disconnect()];case 1:return t.sent(),this._pluginContextQueue.forEach((function(t){if(t.ondestroy)try{t.ondestroy()}catch(t){e.logger.error(H.L_CALLBACK_E,null==t?void 0:t.stack)}})),this._pluginContextQueue.length=0,this._pluginInstanseMap={},[2]}}))}))}}),Object.defineProperty(e.prototype,"getHistoryMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i,o,s,a){var u={timestamp:r||0,count:n||20,order:i||0,channelId:o||""};if(e===exports.ConversationType.ULTRA_GROUP){var l=this._channelIdConvert(e,u.channelId);return u.channelId=l,this._engine.getUltraHistoryMsg(t,u,a)}return this._engine.getHistoryMessage(e,t,u.timestamp,u.count,u.order,u.channelId,s||"",a)}}),Object.defineProperty(e.prototype,"getMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i,o,s){var a={timestamp:r||0,count:n||20,order:i||0,channelId:o||""};if(e===exports.ConversationType.ULTRA_GROUP){var u=this._channelIdConvert(e,a.channelId);return a.channelId=u,this._engine.getUltraHistoryMsg(t,a,s)}return this._engine.getMessages(e,t,a.timestamp,a.count,a.order,a.channelId,s)}}),Object.defineProperty(e.prototype,"getContinuousMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i,o){return void 0===r&&(r=0),void 0===n&&(n=20),void 0===i&&(i=0),void 0===o&&(o=""),this._engine.getContinuousMessages(e,t,r,n,i,o)}}),Object.defineProperty(e.prototype,"getHistoryMessagesByObjectNames",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i,o,s){return this._engine.getHistoryMessagesByObjectNames(e,t,r,n,i,o,s)}}),Object.defineProperty(e.prototype,"getConversationListByFilter",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i=this;return s(this,(function(o){switch(o.label){case 0:return(t=qr("getConversationListByFilter",e).tryTrans((function(){e.type;var t=i._engine.getNaviInfoFromCache();return Ft()||t&&Vh(t)?i.validateLogin():i.validateConnected()}))).isOk?(r=this.logger.createTraceId(),this.logger.info(H.A_GET_CONVERSATION_LIST_BY_FILTER_T,JSON.stringify(e),r),[4,this._engine.chat.getConversationListByFilter(e)]):[2,t.wipe()];case 1:return n=o.sent(),this.logger.summary(H.A_GET_CONVERSATION_LIST_BY_FILTER_R,n,r),[2,n.trans((function(e){return e.list}))]}}))}))}}),Object.defineProperty(e.prototype,"getConversation",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i;return s(this,(function(o){switch(o.label){case 0:return(t=Vt("getLocalConversation",e,Ee).result()).isOk?(r=this.logger.createTraceId(),this.logger.info(H.A_GET_CONVERSATION_T,JSON.stringify(e),r),n=this._channelIdConvert(e.conversationType,e.channelId)||"",[4,this._engine.chat.getConversation(e.conversationType,e.targetId,n)]):[2,t.wipe()];case 1:return i=o.sent(),this.logger.summary(H.A_GET_CONVERSATION_R,i,r,e),[2,i]}}))}))}}),Object.defineProperty(e.prototype,"removeConversation",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n;return s(this,(function(i){switch(i.label){case 0:return(t=Vt("removeConversation",e,be).result().tryTrans(this.validateConnected)).isOk?(e.channelId=this._channelIdConvert(e.conversationType,e.channelId)||"",r=this.logger.createTraceId(),this.logger.info(H.A_REMOVE_CONVERSATION_T,JSON.stringify(e),r),[4,this._engine.removeConversation(e)]):[2,t.wipe()];case 1:return n=i.sent(),this.logger.summary(H.A_REMOVE_CONVERSATION_R,n,r),[2,n]}}))}))}}),Object.defineProperty(e.prototype,"batchRemoveConversation",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._engine.batchRemoveConversation(e)}}),Object.defineProperty(e.prototype,"getUltraGroupList",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._engine.getUltraGroupList(e)}}),Object.defineProperty(e.prototype,"getBlockUltraGroupList",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._engine.getBlockUltraGroupList()}}),Object.defineProperty(e.prototype,"clearUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){if(e===exports.ConversationType.ULTRA_GROUP){var n=this._channelIdConvert(e,r);return this._engine.clearUltraUnreadcount(t,n||"")}return this._engine.clearConversationUnreadCount(e,t,r||"")}}),Object.defineProperty(e.prototype,"clearAllUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.logger.info(H.A_CLEAR_ALL_UNREAD_COUNT_O),this._engine.chat.clearAllUnreadCount()}}),Object.defineProperty(e.prototype,"getUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n=this._channelIdConvert(e,r);return this._engine.getConversationUnreadCount(e,t,n||"")}}),Object.defineProperty(e.prototype,"getTotalUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n;return s(this,(function(i){return(n=vt.create("getTotalUnreadCount").validate("channelId",e,Dt,!0).fail(exports.ErrorCode.INVALID_PARAMETER_CHANNEL_ID).isTypedArray("conversationTypes",t,Ut).fail(exports.ErrorCode.INVALID_PARAMETER_CONVERSATION_TYPE_LIST).result().tryTrans(this.validateConnected).tryTrans((function(e){var r=Vh(e);return!r&&t&&t.includes(exports.ConversationType.ULTRA_GROUP)?gt(exports.ErrorCode.METHOD_NOT_SUPPORT):ht(r)}))).isOk?[2,this._engine.chat.getTotalUnreadCount(e,t||[],!!r)]:[2,n.wipe()]}))}))}}),Object.defineProperty(e.prototype,"getTotalUnreadCountByLevels",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return this._engine.getTotalUnreadCountByLevels(e,t,r)}}),Object.defineProperty(e.prototype,"getFirstUnreadMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return this._engine.getFirstUnreadMessage(e,t,r||"")}}),Object.defineProperty(e.prototype,"getFirstUnreadMessageInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return this._engine.getFirstUnreadMessageInfo(e,t,r)}}),Object.defineProperty(e.prototype,"batchSetConversationNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e,n){return o(this,void 0,void 0,(function(){var i,o,a,u,l,d=this;return s(this,(function(s){switch(s.label){case 0:return i=vt.create("batchSetConversationNotificationLevel"),(o=i.isLimitedTypedArray("conversations",e,20,(function(e){return Vt("batchSetConversationNotificationLevel",e,be).result().isOk}),!0,1).fail(exports.ErrorCode.INVALID_PARAMETER_CONVERSATION_LIST).result().tryTrans(this.validateConnected)).isOk?(a=this.logger.createTraceId(),this.logger.info(H.A_BATCH_SET_CONVERSATION_NOTIFICATION_LEVEL_T,JSON.stringify({conversations:e,notificationLevel:n}),a),u=e.map((function(e){return c(d,t,"m",r).call(d,e)})),[4,this._engine.chat.batchSetConversationNotificationLevel(u,n)]):[2,o.wipe()];case 1:return l=s.sent(),this.logger.summary(H.A_BATCH_SET_CONVERSATION_NOTIFICATION_LEVEL_R,l,a),[2,l]}}))}))}}),Object.defineProperty(e.prototype,"batchSetConversationToTop",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,i){return o(this,void 0,void 0,(function(){var o,a,u,l,c,d=this;return s(this,(function(s){switch(s.label){case 0:return o=vt.create("batchSetConversationToTop"),(a=o.isLimitedTypedArray("conversations",e,20,(function(e){return Vt("batchSetConversationToTop",e,be).result().isOk}),!0,1).fail(exports.ErrorCode.INVALID_PARAMETER_CONVERSATION_LIST).result().tryTrans((function(){return e.every((function(e){return e.conversationType!==exports.ConversationType.ULTRA_GROUP||!e.channelId||"RCDefault"===e.channelId}))?ht():gt(exports.ErrorCode.ONLY_DEFAULT_CHANNEL_SUPPORTS_PINNING)})).tryTrans(this.validateConnected)).isOk?(u=this.logger.createTraceId(),this.logger.info(H.A_BATCH_SET_CONVERSATION_TO_TOP_T,JSON.stringify({conversations:e,isTop:t,isUpdateTime:r,isCreateConversation:i}),u),l=e.map((function(e){return n(n({},e),{channelId:d._channelIdConvert(e.conversationType,e.channelId)||""})})),[4,this._engine.chat.batchSetConversationToTop(l,t,r,i)]):[2,a.wipe()];case 1:return c=s.sent(),this.logger.summary(H.A_BATCH_SET_CONVERSATION_TO_TOP_R,c,u),[2,c]}}))}))}}),Object.defineProperty(e.prototype,"saveConversationMessageDraft",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){var i=this._channelIdConvert(e,n);return this._engine.saveConversationMessageDraft(e,t,r,i||"")}}),Object.defineProperty(e.prototype,"getConversationMessageDraft",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n=this._channelIdConvert(e,r);return this._engine.getConversationMessageDraft(e,t,n||"")}}),Object.defineProperty(e.prototype,"clearConversationMessageDraft",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n=this._channelIdConvert(e,r);return this._engine.clearConversationMessageDraft(e,t,n||"")}}),Object.defineProperty(e.prototype,"recallMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i,o,a,u;return s(this,(function(s){switch(s.label){case 0:return(r=Vt("recallMessage",e,Ee).isString("messageUId",t.messageUId,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_UID).isInteger("sentTime",t.sentTime,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TIMESTAMP).isBoolean("disableNotification",t.disableNotification).fail(exports.ErrorCode.INVALID_PARAMETER_DISABLE_NOTIFICATION).isObject("pushConfig",t.pushConfig).fail(exports.ErrorCode.INVALID_PARAMETER_PUSH_CONFIG).isBoolean("disableUpdateLastMessage",t.disableUpdateLastMessage).fail(exports.ErrorCode.INVALID_DISABLE_UPDATE_LAST_MESSAGE).isLimitedTypedArray("directionalUserIdList",t.directionalUserIdList,300,xt,!1,1).fail(exports.ErrorCode.INVALID_PARAMETER_USERIDLIST).result().tryTrans(this.validateConnected)).isOk?(n=t.messageUId,i=this.logger.createTraceId(),this.logger.info(H.A_RECALL_MESSAGE_T,JSON.stringify({messageUId:n}),i),o=e.conversationType,a=e.channelId,e.channelId=this._channelIdConvert(o,a)||"",[4,this._engine.recallMsg(e,t)]):(this.logger.warn(H.A_RECALL_MESSAGE_E,r.errmsg()),[2,r.wipe()]);case 1:return u=s.sent(),this.logger.summary(H.A_RECALL_MESSAGE_R,u,i,{messageUId:n}),[2,u]}}))}))}}),Object.defineProperty(e.prototype,"deleteRemoteMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,n){return o(this,void 0,void 0,(function(){var i,o,a,u,l,d;return s(this,(function(s){switch(s.label){case 0:return i=Vt("deleteRemoteMessage",e,be),(o=i.isLimitedTypedArray("messages",n,100,(function(e){if(!e||"object"!=typeof e)return!1;var t=e.messageUId,r=e.sentTime,n=e.messageDirection;return At(t)&&(n===exports.MessageDirection.SEND||n===exports.MessageDirection.RECEIVE)&&Ct({min:0})(r)}),!0).fail(exports.ErrorCode.MSG_LIMIT_ERROR).result().tryTrans(this.validateConnected).tryTrans((function(){return e.conversationType===exports.ConversationType.ULTRA_GROUP&&Ft()?gt(exports.ErrorCode.METHOD_NOT_SUPPORT):ht()}))).isOk?(a=c(this,t,"m",r).call(this,e),u=n.map((function(e){return e.messageUId})).join(","),l=this.logger.createTraceId(),this.logger.info(H.A_DELETE_REMOTE_MESSAGE_T,JSON.stringify({conversation:a,msgIds:u}),l),[4,this._engine.chat.deleteRemoteMessage(a,n)]):[2,o.wipe()];case 1:return d=s.sent(),this.logger.summary(H.A_DELETE_REMOTE_MESSAGE_R,d,l),[2,d]}}))}))}}),Object.defineProperty(e.prototype,"deleteRemoteMessageByTimestamp",{enumerable:!1,configurable:!0,writable:!0,value:function(e,i){return o(this,void 0,void 0,(function(){var o,a,u,l;return s(this,(function(s){switch(s.label){case 0:return(o=Vt("deleteRemoteMessageByTimestamp",e,Ee).isInteger("timestamp",i,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TIMESTAMP).result().tryTrans(this.validateConnected)).isOk?(a=c(this,t,"m",r).call(this,e),u=this.logger.createTraceId(),this.logger.info(H.A_DELETE_REMOTE_MESSAGE_BY_TIMESTAMP_T,JSON.stringify(n(n({},a),{timestamp:i})),u),[4,this._engine.chat.deleteRemoteMessageByTimestamp(a,i)]):[2,o.wipe()];case 1:return l=s.sent(),this.logger.summary(H.A_DELETE_REMOTE_MESSAGE_BY_TIMESTAMP_R,l,u),[2,l]}}))}))}}),Object.defineProperty(e.prototype,"joinChatroom",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return void 0===t&&(t=10),this._engine.joinChatroom(e,t,n,r)}}),Object.defineProperty(e.prototype,"joinExistChatroom",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return void 0===t&&(t=10),this._engine.joinExistChatroom(e,t,n,r)}}),Object.defineProperty(e.prototype,"quitChatroom",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._engine.quitChatroom(e)}}),Object.defineProperty(e.prototype,"getChatroomInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return this._engine.getChatroomInfo(e,t||0,r||0)}}),Object.defineProperty(e.prototype,"setChatroomEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=t.key,n=t.value;return ar(r)?ur(n)?this._engine.setChatroomEntry(e,t):Promise.resolve(exports.ErrorCode.INVALID_PARAMETER_VALUE):Promise.resolve(exports.ErrorCode.INVALID_PARAMETER_KEY)}}),Object.defineProperty(e.prototype,"setChatroomEntries",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){for(var r=0;r<t.entries.length;r++){var i=t.entries[r],o=i.key,s=i.value;if(!ar(o))return Promise.resolve({code:exports.ErrorCode.INVALID_PARAMETER_KEY});if(!ur(s))return Promise.resolve({code:exports.ErrorCode.INVALID_PARAMETER_VALUE})}var a=n(n({},t),{isOverwrite:t.isForce});return this._engine.setChatroomEntries(e,a)}}),Object.defineProperty(e.prototype,"forceSetChatroomEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=t.key,n=t.value;return ar(r)?ur(n)?this._engine.forceSetChatroomEntry(e,t):Promise.resolve(exports.ErrorCode.INVALID_PARAMETER_VALUE):Promise.resolve(exports.ErrorCode.INVALID_PARAMETER_KEY)}}),Object.defineProperty(e.prototype,"removeChatroomEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=t.key;return ar(r)?this._engine.removeChatroomEntry(e,t):Promise.resolve(exports.ErrorCode.INVALID_PARAMETER_KEY)}}),Object.defineProperty(e.prototype,"removeChatroomEntries",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){for(var r=0;r<t.entries.length;r++){var n=t.entries[r].key;if(!ar(n))return Promise.resolve({code:exports.ErrorCode.INVALID_PARAMETER_KEY})}return this._engine.removeChatroomEntries(e,t)}}),Object.defineProperty(e.prototype,"forceRemoveChatroomEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=t.key;return ar(r)?this._engine.forceRemoveChatroomEntry(e,t):Promise.resolve(exports.ErrorCode.INVALID_PARAMETER_KEY)}}),Object.defineProperty(e.prototype,"getChatroomEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return this._engine.getChatroomEntry(e,t)}}),Object.defineProperty(e.prototype,"getAllChatroomEntries",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._engine.getAllChatroomEntry(e)}}),Object.defineProperty(e.prototype,"getChatroomHistoryMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return this._engine.getChatroomHistoryMessages(e,n||0,t||20,r||0)}}),Object.defineProperty(e.prototype,"getFileToken",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i,a){return o(this,void 0,void 0,(function(){var o,u,l,c,d,p;return s(this,(function(s){switch(s.label){case 0:return o=this.getNaviInfoFromCache(),u=(null==o?void 0:o.uploadServer)||"",l=(null==o?void 0:o.ossConfig)||"",[4,this._engine.getFileToken(e,t,r,n,i,a)];case 1:return c=s.sent(),d=c.code,p=c.data,d===exports.ErrorCode.SUCCESS&&p?[2,Promise.resolve(Object.assign(p,{qiniu:u,ossConfig:p.ossConfig||l}))]:[2,Promise.reject(d)]}}))}))}}),Object.defineProperty(e.prototype,"getFileUrl",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return o(this,void 0,void 0,(function(){var i=this;return s(this,(function(o){return[2,this.validateConnected().next((function(){return i._engine.getFileUrl(e,r,t,n||"")}))]}))}))}}),Object.defineProperty(e.prototype,"createTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){return s(this,(function(t){return[2,this._engine.createTag(e)]}))}))}}),Object.defineProperty(e.prototype,"removeTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){return s(this,(function(t){return[2,this._engine.removeTag(e)]}))}))}}),Object.defineProperty(e.prototype,"updateTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){return s(this,(function(t){return[2,this._engine.updateTag(e)]}))}))}}),Object.defineProperty(e.prototype,"getTagList",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){return s(this,(function(e){return[2,this._engine.getTagList()]}))}))}}),Object.defineProperty(e.prototype,"addTagForConversations",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n=this;return s(this,(function(i){return t.length>1e3?[2,Promise.resolve({code:exports.ErrorCode.CONVER_OUT_LIMIT_ERROR})]:(r=t.map((function(e){var t=e.conversationType,r=e.targetId,i=e.channelId;return{conversationType:t,targetId:r,channelId:n._channelIdConvert(t,i)}})),[2,this._engine.addTagForConversations(e,r)])}))}))}}),Object.defineProperty(e.prototype,"removeTagForConversations",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n=this;return s(this,(function(i){return r=t.map((function(e){var t=e.conversationType,r=e.targetId,i=e.channelId;return{conversationType:t,targetId:r,channelId:n._channelIdConvert(t,i)}})),[2,this._engine.removeTagForConversations(e,r)]}))}))}}),Object.defineProperty(e.prototype,"removeTagsForConversation",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r;return s(this,(function(n){return r=this._channelIdConvert(e.conversationType,e.channelId),e.channelId=r,[2,this._engine.removeTagsForConversation(e,t)]}))}))}}),Object.defineProperty(e.prototype,"getConversationListByTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return o(this,void 0,void 0,(function(){return s(this,(function(i){return[2,this._engine.getConversationListByTag(e,t,r,n)]}))}))}}),Object.defineProperty(e.prototype,"getUnreadCountByTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){return s(this,(function(r){return[2,this._engine.getUnreadCountByTag(e,t)]}))}))}}),Object.defineProperty(e.prototype,"setConversationStatusInTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n;return s(this,(function(i){return n=this._channelIdConvert(t.conversationType,t.channelId),t.channelId=n,[2,this._engine.setConversationStatusInTag(e,t,r)]}))}))}}),Object.defineProperty(e.prototype,"getTagsForConversation",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t;return s(this,(function(r){return t=this._channelIdConvert(e.conversationType,e.channelId),e.channelId=t,[2,this._engine.getTagsForConversation(e)]}))}))}}),Object.defineProperty(e.prototype,"getUnreadMentionedCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this._channelIdConvert(e.conversationType,e.channelId);return e.channelId=t,this._engine.getUnreadMentionedCount(e)}}),Object.defineProperty(e.prototype,"getAllUnreadMentionedCount",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._engine.getAllUnreadMentionedCount()}}),Object.defineProperty(e.prototype,"sendUltraGroupTypingStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){if(e.conversationType!==exports.ConversationType.ULTRA_GROUP){var t=exports.ErrorCode.CONVERSATION_TYPE_NOT_SUPPORT;return Promise.resolve({code:t,msg:exports.ErrorCode[t]})}var r=this._channelIdConvert(e.conversationType,e.channelId);return e.channelId=r,this._engine.sendUltraGroupTypingStatus(e)}}),Object.defineProperty(e.prototype,"getUltraGroupMessageListByMessageUId",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this,r=e.messages.map((function(r){var n=r.sendTime,i=r.messageUId,o=r.channelId;return{sendTime:n,messageUId:i,channelId:t._channelIdConvert(e.conversationType,o)}}));return e.messages=r,this._engine.getUltraGroupMessageListByMessageUId(e)}}),Object.defineProperty(e.prototype,"expandUltraMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,o,a,u;return s(this,(function(s){switch(s.label){case 0:return t=e.conversationType,r=e.expansion,n=e.canIncludeExpansion,t!==exports.ConversationType.ULTRA_GROUP?[2,{code:i=exports.ErrorCode.CONVERSATION_TYPE_NOT_SUPPORT,msg:exports.ErrorCode[i]}]:n?(o=jt(r),a=o.isIllgalEx,u=o.isExKeyOrValLengthExceedLimit,o.isExceedLimit||u?[2,{code:exports.ErrorCode.EXPANSION_LIMIT_EXCEET}]:a?[2,{code:exports.ErrorCode.INVALID_PARAMETER_MESSAGE_EXPANSION}]:[4,this._engine.expandUltraMessage(e)]):[2,{code:exports.ErrorCode.MESSAGE_KV_NOT_SUPPORT}];case 1:return[2,{code:s.sent().code}]}}))}))}}),Object.defineProperty(e.prototype,"modifyMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t;return s(this,(function(r){switch(r.label){case 0:return e.conversationType!==exports.ConversationType.ULTRA_GROUP?[2,{code:t=exports.ErrorCode.CONVERSATION_TYPE_NOT_SUPPORT,msg:exports.ErrorCode[t]}]:[4,this._engine.modifyMessage(e)];case 1:return[2,{code:r.sent().code}]}}))}))}}),Object.defineProperty(e.prototype,"getUltraGroupUnreadMentionedCountByTargetId",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return this._engine.getUltraGroupUnreadMentionedCountByTargetId(e,t)}}),Object.defineProperty(e.prototype,"getUltraGroupUnreadCountByTargetId",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return this._engine.getUltraGroupUnreadCountByTargetId(e,t)}}),Object.defineProperty(e.prototype,"getAllUltraGroupUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return void 0===e&&(e=!1),this._engine.getAllUltraGroupUnreadCount(e)}}),Object.defineProperty(e.prototype,"getUltraGroupUnreadMentionedMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this._channelIdConvert(exports.ConversationType.ULTRA_GROUP,e.channelId);return e.channelId=t,this._engine.getUltraGroupUnreadMentionedMessages(e)}}),Object.defineProperty(e.prototype,"getUltraGroupFirstUnreadMessageTimestamp",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this._channelIdConvert(exports.ConversationType.ULTRA_GROUP,e.channelId);return e.channelId=t,this._engine.getUltraGroupFirstUnreadMessageTimestamp(e)}}),Object.defineProperty(e.prototype,"getUltraGroupUnreadInfoList",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._engine.getUltraGroupUnreadInfoList(e)}}),Object.defineProperty(e.prototype,"getOSInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._engine.getOSInfo()}}),Object.defineProperty(e.prototype,"getProcessInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._engine.getProcessInfo()}}),Object.defineProperty(e.prototype,"getMainProcessInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._engine.getMainProcessInfo()}}),Object.defineProperty(e.prototype,"setCallInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return this._engine.setCallInfo(e,t,r)}}),Object.defineProperty(e.prototype,"_isEnableSubDriven",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=(this.getNaviInfoFromCache()||{}).subDriven,r=void 0===t?0:t;switch(e){case exports.SubscribeType.ONLINE_STATUS:return 1&r;case exports.SubscribeType.USER_PROFILE:return 2&r;default:return!1}}}),Object.defineProperty(e.prototype,"subscribeUser",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return this._isEnableSubDriven(t)?this._engine.subscribeUser(e,t,r):Promise.resolve({code:exports.ErrorCode.RC_SUBSCRIBE_ONLINE_SERVICE_UNAVAILABLE})}}),Object.defineProperty(e.prototype,"unSubscribeUser",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return this._isEnableSubDriven(t)?this._engine.unSubscribeUser(e,t):Promise.resolve({code:exports.ErrorCode.RC_SUBSCRIBE_ONLINE_SERVICE_UNAVAILABLE})}}),Object.defineProperty(e.prototype,"getSubscribeUserList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return this._isEnableSubDriven(e)?this._engine.getSubscribeUserList(e,t,r):Promise.resolve({code:exports.ErrorCode.RC_SUBSCRIBE_ONLINE_SERVICE_UNAVAILABLE})}}),Object.defineProperty(e.prototype,"getSubscribeUserStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return this._isEnableSubDriven(e)?this._engine.getSubscribeUserStatus(e,t):Promise.resolve({code:exports.ErrorCode.RC_SUBSCRIBE_ONLINE_SERVICE_UNAVAILABLE})}}),Object.defineProperty(e.prototype,"updateMyUserProfile",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._engine.updateMyUserProfile(e)}}),Object.defineProperty(e.prototype,"getUserProfiles",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._engine.getUserProfiles(e)}}),Object.defineProperty(e.prototype,"getMyUserProfile",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._engine.getMyUserProfile()}}),Object.defineProperty(e.prototype,"updateMyUserProfileVisibility",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._engine.updateMyUserProfileVisibility(e)}}),Object.defineProperty(e.prototype,"getMyUserProfileVisibility",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._engine.getMyUserProfileVisibility()}}),Object.defineProperty(e.prototype,"searchUserProfileByUniqueId",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._engine.searchUserProfileByUniqueId(e)}}),Object.defineProperty(e.prototype,"clearConversations",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){return s(this,(function(r){return[2,this._engine.clearConversations(e,t)]}))}))}}),Object.defineProperty(e.prototype,"setUserStatusListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this;return this._engine.setUserStatusListener(e,(function(e){try{t(e)}catch(e){r.logger.error(H.L_CALLBACK_E,null==e?void 0:e.stack)}}))}}),Object.defineProperty(e.prototype,"addToBlacklist",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){return s(this,(function(t){return[2,this._engine.addToBlacklist(e)]}))}))}}),Object.defineProperty(e.prototype,"removeFromBlacklist",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){return s(this,(function(t){return[2,this._engine.removeFromBlacklist(e)]}))}))}}),Object.defineProperty(e.prototype,"getBlacklist",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){return s(this,(function(e){return[2,this._engine.getBlacklist()]}))}))}}),Object.defineProperty(e.prototype,"getBlacklistStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){return s(this,(function(t){return[2,this._engine.getBlacklistStatus(e)]}))}))}}),Object.defineProperty(e.prototype,"insertMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n,i,o;return s(this,(function(s){return n=xu(r.messageType,r.content),i=n.code,o=n.msg,i!==exports.ErrorCode.SUCCESS?[2,Promise.resolve({code:i,msg:o})]:[2,this._engine.insertMessage(e,t,r)]}))}))}}),Object.defineProperty(e.prototype,"batchInsertMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return this._engine.batchInsertMessage(e,t)}}),Object.defineProperty(e.prototype,"getMessageCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return void 0===r&&(r=""),o(this,void 0,void 0,(function(){return s(this,(function(n){return[2,this._engine.getMessageCount(e,t,r)]}))}))}}),Object.defineProperty(e.prototype,"deleteMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){return s(this,(function(t){return[2,this._engine.deleteMessages(e)]}))}))}}),Object.defineProperty(e.prototype,"deleteMessagesByTimestamp",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){return void 0===i&&(i=""),o(this,void 0,void 0,(function(){return s(this,(function(o){return[2,this._engine.deleteMessagesByTimestamp(e,t,r,!!n,i)]}))}))}}),Object.defineProperty(e.prototype,"batchClearMessagesByTimestamp",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){return s(this,(function(t){return[2,this._engine.batchClearMessagesByTimestamp(e)]}))}))}}),Object.defineProperty(e.prototype,"batchClearRemoteHistoryMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i;return s(this,(function(o){switch(o.label){case 0:return(r=vt.create("batchClearRemoteHistoryMessages").isTypedArray("options",e,(function(e){return Vt("",e,be).result().isOk&&Ct({min:0})(e.timestamp)}),!0).fail(exports.ErrorCode.MSG_LIMIT_ERROR).result().tryTrans(this.validateConnected)).isOk?(n=this.logger.createTraceId(),this.logger.info(H.A_BATCH_CLEAR_REMOTE_MSG_T,JSON.stringify({options:e,isDeleteLocal:t}),n),[4,this._engine.chat.batchClearRemoteHistoryMessages(e,t)]):[2,r.wipe()];case 1:return i=o.sent(),this.logger.summary(H.A_BATCH_CLEAR_REMOTE_MSG_R,r,n),[2,i]}}))}))}}),Object.defineProperty(e.prototype,"clearMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return void 0===r&&(r=""),o(this,void 0,void 0,(function(){return s(this,(function(n){return[2,this._engine.clearMessages(e,t,r)]}))}))}}),Object.defineProperty(e.prototype,"getLocalMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i=this;return s(this,(function(o){switch(o.label){case 0:return t=vt.create("getLocalMessage").validate("messageId",e,(function(){return Tt(e)||Rt(e)}),!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_ID).result(),r=this.logger.createTraceId(),this.logger.info(H.A_GET_LOCAL_MESSAGE_T,JSON.stringify({messageId:e}),r),[4,t.next((function(){return i._engine.getMessage(e)}))];case 1:return n=o.sent(),this.logger.summary(H.A_GET_LOCAL_MESSAGE_R,n,r,{messageId:e}),[2,n]}}))}))}}),Object.defineProperty(e.prototype,"setMessageContent",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){return s(this,(function(n){return[2,this._engine.setMessageContent(e,t,r)]}))}))}}),Object.defineProperty(e.prototype,"setMessageSearchField",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){return s(this,(function(n){return[2,this._engine.setMessageSearchField(e,t,r)]}))}))}}),Object.defineProperty(e.prototype,"setMessageSentStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){return s(this,(function(r){return[2,this._engine.setMessageSentStatus(e,t)]}))}))}}),Object.defineProperty(e.prototype,"setMessageReceivedStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){return s(this,(function(r){return[2,this._engine.setMessageReceivedStatus(e,t)]}))}))}}),Object.defineProperty(e.prototype,"setMessageStatusToRead",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i,o,a,u;return s(this,(function(s){switch(s.label){case 0:return(r=Vt("setMessageStatusToRead",e,ge).isNumber("timestamp",t,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TIMESTAMP).result().tryTrans(this.validateLogin)).isOk?(n=this.logger.createTraceId(),i=e.conversationType,o=e.targetId,a=e.channelId,this.logger.info(H.A_E_SET_MESSAGE_STATUS_TO_READ_T,JSON.stringify({conversation:e,timestamp:t}),n),[4,this._engine.updateMessageReceiptStatus(i,o,t,a)]):[2,r.wipe()];case 1:return u=s.sent(),this.logger.summary(H.A_E_SET_MESSAGE_STATUS_TO_READ_R,u,n),[2,u]}}))}))}}),Object.defineProperty(e.prototype,"setUserStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){return s(this,(function(t){return[2,this._engine.setUserStatus(e)]}))}))}}),Object.defineProperty(e.prototype,"subscribeUserStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){return s(this,(function(t){return[2,this._engine.subscribeUserStatus(e)]}))}))}}),Object.defineProperty(e.prototype,"getUserStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){return s(this,(function(t){return[2,this._engine.getUserStatus(e)]}))}))}}),Object.defineProperty(e.prototype,"searchConversationByContent",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return o(this,void 0,void 0,(function(){var i,o,a;return s(this,(function(s){switch(s.label){case 0:return(i=vt.create("searchConversationByContent").isNotEmptyString("keyword",e,!0).fail(exports.ErrorCode.INVALID_PARAMETER_KEYWORD).isTypedArray("messageTypes",t,(function(e){return At(e)})).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_TYPE).validate("channelId",r,Dt).fail(exports.ErrorCode.INVALID_PARAMETER_CHANNEL_ID).isTypedArray("conversationTypes",n,(function(e){return me(e,be)})).fail(exports.ErrorCode.INVALID_PARAMETER_CONVERSATION_TYPE_LIST).result().tryTrans(this.validateLogin)).isOk?(o=this.logger.createTraceId(),this.logger.info(H.A_E_SEARCH_CONVERSATION_BY_CONTENT_T,JSON.stringify({keyword:e,messageTypes:t,channelId:r,conversationTypes:n}),o),[4,this._engine.chat.searchConversationByContent(e,t&&0!==t.length?t:[exports.MessageType.TextMessage,exports.MessageType.FILE],r||"",n&&0!==n.length?n:ye(be))]):[2,i.wipe()];case 1:return a=s.sent(),this.logger.summary(H.A_E_SEARCH_CONVERSATION_BY_CONTENT_R,i,o),[2,a]}}))}))}}),Object.defineProperty(e.prototype,"searchConversationByContentWithAllChannel",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){return s(this,(function(n){return[2,this._engine.searchConversationByContentWithAllChannel(e,t&&0!==t.length?t:[exports.MessageType.TextMessage,exports.MessageType.FILE],r&&0!==r.length?r:ye(be))]}))}))}}),Object.defineProperty(e.prototype,"searchMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e,r){var i,u;return o(this,void 0,void 0,(function(){var o;return s(this,(function(s){switch(s.label){case 0:return(o=Vt("searchMessages",e,ge).isLimitedString("keyword",null==r?void 0:r.keyword,0,1e3,!0).fail(exports.ErrorCode.INVALID_PARAMETER_KEYWORD).isLimitedInteger("limit",null==r?void 0:r.limit,1,Xe,!0).fail(exports.ErrorCode.INVALID_PARAMETER_LIMIT).isLimitedInteger("offset",null==r?void 0:r.offset,0,Xe).fail(exports.ErrorCode.INVALID_PARAMETER_OFFSET).isLimitedInteger("order",null==r?void 0:r.order,0,1,!0).fail(exports.ErrorCode.INVALID_PARAMETER_ORDER).isObject("timeRange",r.timeRange).validate("timeRange",r.timeRange,(function(e){var t=e.startTime,r=e.endTime;return!t&&!r||!(t&&!Rt(t)||r&&!Rt(r))&&(t=null!=t?t:0,r=null!=r?r:Date.now(),t>=0&&t<=r)})).fail(exports.ErrorCode.INVALID_PARAMETER_TIMESTAMP).isTypedArray("objectNames",null===(i=null==r?void 0:r.messageFilter)||void 0===i?void 0:i.objectNames,(function(e){return"string"==typeof e&&e.length>0&&e.length<=128})).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_OBJECT_NAME_LIST).isTypedArray("senderIds",null===(u=null==r?void 0:r.messageFilter)||void 0===u?void 0:u.senderIds,xt).fail(exports.ErrorCode.INVALID_PARAMETER_USER_ID).result().tryTrans(this.validateLogin)).isOk?[4,c(this,t,"m",a).call(this,n(n({},r),{conversationFilter:{conversationTypes:[e.conversationType],targetIds:[e.targetId],channelIds:"string"==typeof e.channelId?[e.channelId]:[]}}))]:[2,o.wipe()];case 1:return[2,s.sent().orSync((function(){return ht({messages:[],totalMatched:0,conditionsMatched:0})}))]}}))}))}}),Object.defineProperty(e.prototype,"searchMessagesWithParams",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var r,n,i,u,l,d;return o(this,void 0,void 0,(function(){var o;return s(this,(function(s){return(o=vt.create("searchMessagesWithParams").isObject("params",e,!0).fail(exports.ErrorCode.BIZ_ERROR_INVALID_PARAMETER).isLimitedString("keyword",null==e?void 0:e.keyword,0,1e3).fail(exports.ErrorCode.INVALID_PARAMETER_KEYWORD).isLimitedInteger("limit",null==e?void 0:e.limit,1,Xe,!0).fail(exports.ErrorCode.INVALID_PARAMETER_LIMIT).isLimitedInteger("offset",null==e?void 0:e.offset,0,Xe).fail(exports.ErrorCode.INVALID_PARAMETER_OFFSET).isLimitedInteger("order",null==e?void 0:e.order,0,1,!0).fail(exports.ErrorCode.INVALID_PARAMETER_ORDER).isObject("timeRange",null==e?void 0:e.timeRange).validate("timeRange",null==e?void 0:e.timeRange,(function(e){var t=e.startTime,r=e.endTime;return!t&&!r||!(t&&!Rt(t)||r&&!Rt(r))&&(t=null!=t?t:0,r=null!=r?r:Date.now(),t>=0&&t<=r)})).fail(exports.ErrorCode.INVALID_PARAMETER_TIMESTAMP).isTypedArray("conversationTypes",null===(r=null==e?void 0:e.conversationFilter)||void 0===r?void 0:r.conversationTypes,(function(e){return me(e,be)})).fail(exports.ErrorCode.INVALID_PARAMETER_CONVERSATION_TYPE_LIST).isLimitedTypedArray("targetIds",null===(n=null==e?void 0:e.conversationFilter)||void 0===n?void 0:n.targetIds,20,xt,!1,0).fail(exports.ErrorCode.INVALID_PARAMETER_TARGETID_LIST).isLimitedTypedArray("channelIds",null===(i=null==e?void 0:e.conversationFilter)||void 0===i?void 0:i.channelIds,10,Dt,!1,0).fail(exports.ErrorCode.INVALID_PARAMETER_CHANNEL_ID).isLimitedTypedArray("senderIds",null===(u=null==e?void 0:e.messageFilter)||void 0===u?void 0:u.senderIds,20,xt,!1,0).fail(exports.ErrorCode.INVALID_PARAMETER_USERIDLIST).isTypedArray("objectNames",null===(l=null==e?void 0:e.messageFilter)||void 0===l?void 0:l.objectNames,(function(e){return"string"==typeof e&&e.length>0&&e.length<=128})).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_OBJECT_NAME_LIST).result().tryTrans(this.validateLogin)).isOk?(e.limit=Math.min(e.limit,100),(null===(d=e.messageFilter)||void 0===d?void 0:d.objectNames)&&e.messageFilter.objectNames.length>300&&(e.messageFilter.objectNames=e.messageFilter.objectNames.slice(0,300)),[2,c(this,t,"m",a).call(this,e)]):[2,o.wipe()]}))}))}}),Object.defineProperty(e.prototype,"getMessagesByTimestamp",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return o(this,void 0,void 0,(function(){return s(this,(function(i){return[2,this._engine.getMessagesByTimestamp(e,t,r,n)]}))}))}}),Object.defineProperty(e.prototype,"getUnreadMentionedMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return void 0===r&&(r=""),this._engine.getUnreadMentionedMessages(e,t,r)}}),Object.defineProperty(e.prototype,"clearUnreadCountByTimestamp",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return void 0===n&&(n=""),this._engine.clearUnreadCountByTimestamp(e,t,r,n)}}),Object.defineProperty(e.prototype,"getUltraGroupDefaultNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this._channelIdConvert(exports.ConversationType.ULTRA_GROUP,t);return this._engine.getUltraGroupDefaultNotificationLevel(e,r||"")}}),Object.defineProperty(e.prototype,"setUltraGroupDefaultNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n=this._channelIdConvert(exports.ConversationType.ULTRA_GROUP,r);return this._engine.setUltraGroupDefaultNotificationLevel(e,t,n||"")}}),Object.defineProperty(e.prototype,"getConversationNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var n;return s(this,(function(i){return(n=Vt("getConversationNotificationLevel",e,be).result()).isOk?[2,this._engine.chat.getConversationNotificationLevel(c(this,t,"m",r).call(this,e))]:[2,n.wipe()]}))}))}}),Object.defineProperty(e.prototype,"setConversationTypeNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r;return s(this,(function(n){return(r=vt.create("setConversationTypeNotificationLevel").validate("conversationType",e,(function(){return me(e,be)}),!0).fail(exports.ErrorCode.INVALID_PARAMETER_CONVERSATION_TYPE).isValueOf("level",t,exports.NotificationLevel,!0).fail(exports.ErrorCode.INVALID_PARAMETER_NOTIFICATION_LEVEL).result().tryTrans(this.validateConnected)).isOk?[2,this._engine.chat.setConversationTypeNotificationLevel(e,t)]:[2,r.wipe()]}))}))}}),Object.defineProperty(e.prototype,"getConversationTypeNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t;return s(this,(function(r){return(t=vt.create("getConversationTypeNotificationLevel").validate("conversationType",e,(function(){return me(e,be)}),!0).fail(exports.ErrorCode.INVALID_PARAMETER_CONVERSATION_TYPE).result().tryTrans(this.validateConnected)).isOk?[2,this._engine.chat.getConversationTypeNotificationLevel(e)]:[2,t.wipe()]}))}))}}),Object.defineProperty(e.prototype,"getRemoteHistoryMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i,o){return this._engine.getRemoteHistoryMessages(e,t,r,n,i,o)}}),Object.defineProperty(e.prototype,"clearLocalData",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.logger.info(H.A_CLEAR_LOCAL_CACHE_O),this._engine.clearLocalData()}}),Object.defineProperty(e.prototype,"createLogger",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return this._engine.createLogger(e,t)}}),Object.defineProperty(e.prototype,"getConversations",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._engine.getConversations(e)}}),Object.defineProperty(e.prototype,"setCheckDuplicateMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._engine.setCheckDuplicateMessage(e)}}),Object.defineProperty(e.prototype,"setCheckChatRoomDuplicateMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._engine.setCheckChatRoomDuplicateMessage(e)}}),Object.defineProperty(e.prototype,"rtcSignaling",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return this._engine.rtcSignaling(e,t,r,n)}}),Object.defineProperty(e.prototype,"rtcPing",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return this._engine.rtcPing(e,t,r)}}),Object.defineProperty(e.prototype,"bindRTCRoomForChatroom",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._engine.bindRTCRoomForChatroom(e)}}),Object.defineProperty(e.prototype,"setProxy",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._engine.setProxy(e)}}),Object.defineProperty(e.prototype,"getProxy",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._engine.getProxy()}}),Object.defineProperty(e.prototype,"testProxy",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return this._engine.testProxy(e,t)}}),Object.defineProperty(e.prototype,"createGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return void 0===n&&(n=[]),this._engine.createGroup(e,t,r,n)}}),Object.defineProperty(e.prototype,"updateGroupInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return this._engine.updateGroupInfo(e,t,r)}}),Object.defineProperty(e.prototype,"getGroupsInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._engine.getGroupsInfo(e)}}),Object.defineProperty(e.prototype,"kickGroupMembers",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return this._engine.kickGroupMembers(e,t,r)}}),Object.defineProperty(e.prototype,"quitGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return this._engine.quitGroup(e,t)}}),Object.defineProperty(e.prototype,"dismissGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._engine.dismissGroup(e)}}),Object.defineProperty(e.prototype,"transferGroupOwner",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return void 0===n&&(n=!1),this._engine.transferGroupOwner(e,t,n,r)}}),Object.defineProperty(e.prototype,"setGroupManagers",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return this._engine.setGroupManagers(e,t,r)}}),Object.defineProperty(e.prototype,"getGroupMembersByRole",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return this._engine.getGroupMembersByRole(e,t,r)}}),Object.defineProperty(e.prototype,"getGroupMembers",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return this._engine.getGroupMembers(e,t)}}),Object.defineProperty(e.prototype,"setGroupMemberInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return this._engine.setGroupMemberInfo(e,t,r,n)}}),Object.defineProperty(e.prototype,"searchGroupMembers",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return this._engine.searchGroupMembers(e,t,r)}}),Object.defineProperty(e.prototype,"joinGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._engine.joinGroup(e)}}),Object.defineProperty(e.prototype,"inviteUsersToGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return this._engine.inviteUsersToGroup(e,t)}}),Object.defineProperty(e.prototype,"acceptGroupInvite",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return this._engine.memberInviteResponse({groupId:e,inviterId:t,optType:0,optResult:exports.GroupOperationStatus.ACCEPT})}}),Object.defineProperty(e.prototype,"refuseGroupInvite",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return this._engine.memberInviteResponse({groupId:e,inviterId:t,optType:0,optResult:exports.GroupOperationStatus.REFUSE,reason:r})}}),Object.defineProperty(e.prototype,"acceptGroupApplication",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return this._engine.memberInviteResponse({groupId:e,joinUserId:t,inviterId:r,optType:1,optResult:exports.GroupOperationStatus.ACCEPT})}}),Object.defineProperty(e.prototype,"refuseGroupApplication",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return this._engine.memberInviteResponse({groupId:e,joinUserId:t,inviterId:r,optType:1,optResult:exports.GroupOperationStatus.REFUSE,reason:n})}}),Object.defineProperty(e.prototype,"getGroupApplications",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return this._engine.getGroupApplications(e,t,r)}}),Object.defineProperty(e.prototype,"getJoinedGroupsByRole",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return this._engine.getJoinedGroupsByRole(e,t)}}),Object.defineProperty(e.prototype,"searchJoinedGroups",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return this._engine.searchJoinedGroups(e,t)}}),Object.defineProperty(e.prototype,"getJoinedGroups",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._engine.getJoinedGroups(e)}}),Object.defineProperty(e.prototype,"setGroupRemark",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return this._engine.setGroupRemark(e,t)}}),Object.defineProperty(e.prototype,"addGroupFollows",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return this._engine.setGroupFollows(exports.GroupOperationType.ADD,e,t)}}),Object.defineProperty(e.prototype,"removeGroupFollows",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return this._engine.setGroupFollows(exports.GroupOperationType.REMOVE,e,t)}}),Object.defineProperty(e.prototype,"getGroupFollows",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._engine.getGroupFollows(e)}}),Object.defineProperty(e.prototype,"addFriend",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return this._engine.addFriend(e,t,r)}}),Object.defineProperty(e.prototype,"deleteFriends",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return this._engine.deleteFriends(e,t)}}),Object.defineProperty(e.prototype,"acceptFriendApplication",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._engine.acceptFriendApplication(e)}}),Object.defineProperty(e.prototype,"refuseFriendApplication",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return this._engine.refuseFriendApplication(e,t)}}),Object.defineProperty(e.prototype,"setFriendInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return this._engine.setFriendInfo(e,t,r)}}),Object.defineProperty(e.prototype,"checkFriends",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return this._engine.checkFriends(e,t)}}),Object.defineProperty(e.prototype,"getFriends",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return this._engine.getFriends(e,t)}}),Object.defineProperty(e.prototype,"getFriendApplications",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return this._engine.getFriendApplications(e,t,r)}}),Object.defineProperty(e.prototype,"getFriendsInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._engine.getFriendsInfo(e)}}),Object.defineProperty(e.prototype,"searchFriendsInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._engine.searchFriendsInfo(e)}}),Object.defineProperty(e.prototype,"setFriendAddPermission",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._engine.setFriendAddPermission(e)}}),Object.defineProperty(e.prototype,"getFriendAddPermission",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._engine.getFriendAddPermission()}}),Object.defineProperty(e.prototype,"getRealtimeConversations",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return this._engine.getRealtimeConversations(e,t,r)}}),Object.defineProperty(e.prototype,"getRealtimeConTotalUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._engine.getRealtimeConTotalUnreadCount()}}),Object.defineProperty(e.prototype,"clearRealtimeConUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._engine.clearRealtimeConUnreadCount(e)}}),Object.defineProperty(e.prototype,"removeRealtimeConversations",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._engine.removeRealtimeConversations(e)}}),Object.defineProperty(e.prototype,"getRealtimeConUnreadCounts",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._engine.getRealtimeConUnreadCounts(e)}}),Object.defineProperty(e.prototype,"setNotificationQuietHoursWithSetting",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;return vt.create("setNotificationQuietHoursWithSetting").isObject("opts",e,!0).isString("timezone",e.timezone).fail(exports.ErrorCode.BIZ_ERROR_INVALID_PARAMETER).validate("startTime",e.startTime,(function(e){return/^\d{2}(:\d{2}){2}$/.test(e)}),!0).fail(exports.ErrorCode.INVALID_PARAMETER_TIMESTRING).isLimitedNumber("spanMinutes",e.spanMinutes,1,1439,!0).fail(exports.ErrorCode.INVALID_PARAMETER_SPAN_MINUTES).isValueOf("level",e.level,exports.PushNotificationQuietHoursLevel,!0).fail(exports.ErrorCode.INVALID_PARAMETER_NOTIFICATION_LEVEL).result().next((function(){return t._engine.setNotificationQuietHoursWithSetting(e)}))}}),Object.defineProperty(e.prototype,"removeNotificationQuietHoursSetting",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._engine.removeNotificationQuietHoursSetting()}}),Object.defineProperty(e.prototype,"getNotificationQuietHoursSetting",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._engine.getNotificationQuietHoursSetting()}}),Object.defineProperty(e.prototype,"getStatsUrlList",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._engine.getStatsUrlList()}}),Object.defineProperty(e.prototype,"sendReadReceiptResponseV5",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r;return s(this,(function(n){return(r=Vt("sendReadReceiptResponseV5",e,_e).isTypedArray("messageUIdArray",t,(function(e){return xt(e)}),!0).fail(exports.ErrorCode.MSG_LIMIT_ERROR).isLimitedInteger("messageUIdArray",t.length,1,100,!0).fail(exports.ErrorCode.INVALID_PARAMETER_COUNT).result().tryTrans(this.validateConnected).tryTrans((function(e){return 4===e.grpRRVer?ht():gt(exports.ErrorCode.READ_RECEIPT_ERROR)}))).isOk?[2,this._engine.chat.sendReadReceiptResponseV5(e,t)]:[2,r.wipe()]}))}))}}),Object.defineProperty(e.prototype,"getMessageReadReceiptInfoV5",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r;return s(this,(function(n){return(r=Vt("getMessageReadReceiptInfoV5",e,_e).isTypedArray("messageUIdArray",t,(function(e){return xt(e)}),!0).fail(exports.ErrorCode.MSG_LIMIT_ERROR).isLimitedInteger("messageUIdArray",t.length,1,100,!0).fail(exports.ErrorCode.INVALID_PARAMETER_COUNT).result().tryTrans(this.validateConnected).tryTrans((function(e){return 4===e.grpRRVer?ht():gt(exports.ErrorCode.READ_RECEIPT_ERROR)}))).isOk?[2,this._engine.chat.getMessageReadReceiptInfoV5(e,t)]:[2,r.wipe()]}))}))}}),Object.defineProperty(e.prototype,"getMessagesReadReceiptUsersByPageV5",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n;return s(this,(function(i){return(n=Vt("getMessageReadReceiptInfoV5",e,_e).isNotEmptyString("messageUId",t,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_UID).isObject("option",r,!0).fail(exports.ErrorCode.BIZ_ERROR_INVALID_PARAMETER,"option type error").isString("pageToken",r.pageToken).fail(exports.ErrorCode.INVALID_PARAMETER_PAGING_QUERY_OPTION).isLimitedInteger("pageCount",r.pageCount,1,100,!0).fail(exports.ErrorCode.INVALID_PARAMETER_COUNT).result().tryTrans(this.validateConnected).tryTrans((function(e){return 4===e.grpRRVer?ht():gt(exports.ErrorCode.READ_RECEIPT_ERROR)}))).isOk?(r.order=1!==r.order?0:1,r.readStatus=1!==r.readStatus?0:1,[2,this._engine.chat.getMessagesReadReceiptUsersByPageV5(e,t,r)]):[2,n.wipe()]}))}))}}),Object.defineProperty(e.prototype,"getMessagesReadReceiptByUsersV5",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n;return s(this,(function(i){return(n=Vt("getMessagesReadReceiptByUsersV5",e,_e).isNotEmptyString("messageUId",t,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_UID).isTypedArray("userList",r,(function(e){return xt(e)}),!0).fail(exports.ErrorCode.INVALID_PARAMETER_USER_ID).isLimitedInteger("userList",r.length,1,100,!0).fail(exports.ErrorCode.INVALID_PARAMETER_COUNT).result().tryTrans(this.validateConnected).tryTrans((function(e){return 4===e.grpRRVer?ht():gt(exports.ErrorCode.READ_RECEIPT_ERROR)}))).isOk?[2,this._engine.chat.getMessagesReadReceiptByUsersV5(e,t,r)]:[2,n.wipe()]}))}))}}),t=new WeakSet,r=function(e){return{conversationType:e.conversationType,targetId:e.targetId,channelId:this._channelIdConvert(e.conversationType,e.channelId)}},a=function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,o,a;return s(this,(function(s){switch(s.label){case 0:return t=e.timeRange||{},r=t.startTime,n=t.endTime,i={startTime:null!=r?r:0,endTime:null!=n?n:Date.now()},e.timeRange=i,o=this.logger.createTraceId(),this.logger.info(H.A_SEARCH_MSGS_BY_PARAMS_T,JSON.stringify(e),o),[4,this._engine.searchMessagesWithParams(e)];case 1:return a=s.sent(),this.logger.summary(H.A_SEARCH_MSGS_BY_PARAMS_R,a,o),[2,a]}}))}))},i([Xh],e.prototype,"updateMyUserProfile",null),i([Xh],e.prototype,"getUserProfiles",null),i([Xh],e.prototype,"getMyUserProfile",null),i([Xh],e.prototype,"updateMyUserProfileVisibility",null),i([Xh],e.prototype,"getMyUserProfileVisibility",null),i([Xh],e.prototype,"searchUserProfileByUniqueId",null),i([Xh],e.prototype,"createGroup",null),i([Xh],e.prototype,"updateGroupInfo",null),i([Xh],e.prototype,"getGroupsInfo",null),i([Xh],e.prototype,"kickGroupMembers",null),i([Xh],e.prototype,"quitGroup",null),i([Xh],e.prototype,"dismissGroup",null),i([Xh],e.prototype,"transferGroupOwner",null),i([Xh],e.prototype,"setGroupManagers",null),i([Xh],e.prototype,"getGroupMembersByRole",null),i([Xh],e.prototype,"getGroupMembers",null),i([Xh],e.prototype,"setGroupMemberInfo",null),i([Xh],e.prototype,"searchGroupMembers",null),i([Xh],e.prototype,"joinGroup",null),i([Xh],e.prototype,"inviteUsersToGroup",null),i([Xh],e.prototype,"acceptGroupInvite",null),i([Xh],e.prototype,"refuseGroupInvite",null),i([Xh],e.prototype,"acceptGroupApplication",null),i([Xh],e.prototype,"refuseGroupApplication",null),i([Xh],e.prototype,"getGroupApplications",null),i([Xh],e.prototype,"getJoinedGroupsByRole",null),i([Xh],e.prototype,"searchJoinedGroups",null),i([Xh],e.prototype,"getJoinedGroups",null),i([Xh],e.prototype,"setGroupRemark",null),i([Xh],e.prototype,"addGroupFollows",null),i([Xh],e.prototype,"removeGroupFollows",null),i([Xh],e.prototype,"getGroupFollows",null),i([Xh],e.prototype,"addFriend",null),i([Xh],e.prototype,"deleteFriends",null),i([Xh],e.prototype,"acceptFriendApplication",null),i([Xh],e.prototype,"refuseFriendApplication",null),i([Xh],e.prototype,"setFriendInfo",null),i([Xh],e.prototype,"checkFriends",null),i([Xh],e.prototype,"getFriends",null),i([Xh],e.prototype,"getFriendApplications",null),i([Xh],e.prototype,"getFriendsInfo",null),i([Xh],e.prototype,"searchFriendsInfo",null),i([Xh],e.prototype,"setFriendAddPermission",null),i([Xh],e.prototype,"getFriendAddPermission",null),i([$h],e.prototype,"getRealtimeConversations",null),i([$h],e.prototype,"getRealtimeConTotalUnreadCount",null),i([$h],e.prototype,"clearRealtimeConUnreadCount",null),i([$h],e.prototype,"removeRealtimeConversations",null),i([$h],e.prototype,"getRealtimeConUnreadCounts",null),e}();exports.APIContext=eg,exports.AppStorage=Gu,exports.BasicEngine=Ru,exports.BasicLogger=Tr,exports.Codec=au,exports.ConversationListFilterType=Hr,exports.EventEmitter=iu,exports.LogTagId=H,exports.MAX_MESSAGE_CONTENT_BYTES=xe,exports.MAX_U32_INTEGER=Xe,exports.MAX_UPLOAD_FILE_SIZE=5368709120,exports.PBCodec=po,exports.PluginContext=Au,exports.RCResult=ft,exports.RTCPluginContext=Pu,exports.SuspendablePromise=Et,exports.UPLOAD_FILE_CHUNK_SIZE=10485760,exports.UUId=nt,exports.Validator=vt,exports.ValidatorManage=Du,exports.VersionManage=et,exports.assert=function(e,t,r,n){if(void 0===n&&(n=!1),!Uu(e,t,r,n))throw new Lu("'".concat(e,"' is invalid: ").concat(JSON.stringify(t)))},exports.fail=gt,exports.fixUrlProtocol=pr,exports.forEach=ou,exports.getMessageTypeDescription=Vr,exports.getUUID=function(){return nt.gen()},exports.getUUID22=function(){return nt.genWithLen(22)},exports.hasMessageTypeDescription=Gr,exports.httpRequest=br,exports.isArray=Ot,exports.isBoolean=function(e){return"boolean"==typeof e},exports.isFunction=Nt,exports.isHttpUrl=Mt,exports.isInteger=Ct,exports.isLimitedArray=function(e){return function(t){if(!Ot(t)||void 0!==e.minLength&&t.length<e.minLength||void 0!==e.maxLength&&t.length>e.maxLength)return!1;if(!e.itemValidator)return!0;var r=!0;return t.every((function(t){var n=e.itemValidator&&e.itemValidator(t);return"object"==typeof n?n.errorKey?(r={errorKey:n.errorKey,valid:n.valid},!1):(r=n.valid,n.valid):(r=!!n,n)})),r}},exports.isLimitedString=St,exports.isNull=function(e){return"[object Null]"===Object.prototype.toString.call(e)},exports.isNumber=Rt,exports.isObject=Pt,exports.isString=Tt,exports.isUndefined=wt,exports.isValidConversation=function(e,t){var r;return Pt(e)?(t&&!t.includes(e.conversationType)&&(r="conversationTypeNotSupport"),xt(e.targetId)||(r="targetId"),Ut(e.conversationType)||(r="conversationType"),wt(e.channelId)||Dt(e.channelId)||(r="channelId"),wt(r)?{valid:!0}:{valid:wt(r),errorKey:r}):{valid:!1,errorKey:"conversation"}},exports.isValidConversationType=Ut,exports.isValidEnum=function(e){return Object.values(e.type).includes(e.value)},exports.isValidFileType=function(e){return Rt(e)&&Object.prototype.hasOwnProperty.call(exports.FileType,e)},exports.isValidGroupId=function(e){return St({minLength:1,maxLength:64})(e)&&/^[a-zA-Z0-9+=\-_|:]*$/.test(e)},exports.isValidNotificationLevel=function(e){return Rt(e)&&Object.prototype.hasOwnProperty.call(exports.NotificationLevel,e)},exports.isValidTargetId=xt,exports.logger=nu,exports.map=su,exports.notEmptyArray=function(e){return Ot(e)&&e.length>0},exports.notEmptyObject=Lt,exports.notEmptyString=At,exports.ok=ht,exports.runtime=lo,exports.trans2IReceivedStatusInfo=Bt,exports.trans2NotificationLevel=function(e){return e===exports.NotificationStatus.OPEN?exports.NotificationLevel.AT_MESSAGE_NOTIFICATION:exports.NotificationLevel.NOT_SET},exports.trans2NotificationStatus=Le,exports.transformReceivedStatusFlag=function(e){var t=exports.ReceivedStatus.UNREAD;return(null==e?void 0:e.isRead)&&(t|=exports.ReceivedStatus.READ),(null==e?void 0:e.isListened)&&(t|=exports.ReceivedStatus.LISTENED),(null==e?void 0:e.isDownload)&&(t|=exports.ReceivedStatus.DOWNLOADED),(null==e?void 0:e.isRetrieved)&&(t|=exports.ReceivedStatus.RETRIEVED),t},exports.usingCppEngine=Ft,exports.validate=Uu;
|
|
16
|
+
var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},e(t,r)};function t(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}var r,n=function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},n.apply(this,arguments)};function i(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s}function o(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))}function s(e,t){var r,n,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,n=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}}function a(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function u(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s}function l(e,t,r){if(r||2===arguments.length)for(var n,i=0,o=t.length;i<o;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))}function c(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)}function d(e,t,r,n,i){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?i.call(e,r):i?i.value=r:t.set(e,r),r}exports.UploadMethod=void 0,(r=exports.UploadMethod||(exports.UploadMethod={}))[r.QINIU=1]="QINIU",r[r.ALI=2]="ALI",r[r.AWS=3]="AWS",r[r.STC=4]="STC",r[r.MINIO=5]="MINIO";var p,f,h,_,b,E,v,y,m,I,T,R,C,O,S,A,P,N,w,M,L,U,D,x,j,V,G,k,F,B,H={L_IMSDK_VER_O:"L-imsdk_ver-O",A_INIT_REPEAT_O:"A_INIT_REPEAT_O",L_INIT_O:"L-init-O",A_DESTROY_O:"A_DESTROY_O",A_CONNECT_T:"A-connect-T",A_CONNECT_R:"A-connect-R",A_CONNECT_S:"A-connect-S",L_QUERY_CMP_T:"L-query_cmp-T",L_QUERY_CMP_R:"L-query_cmp-R",A_DISCONNECT_O:"A-disconnect-O",A_RECONNECT_T:"A-reconnect-T",A_RECONNECT_R:"A_RECONNECT_R",L_CONNECT_T:"L-connect-T",L_CONNECT_O:"L-connect-O",L_CONNECT_R:"L-connect-R",L_CONNECT_S:"L-connect-S",L_DB_UPGRATE_START_S:"L-db_upgrate_start-S",L_DB_UPGRATING_S:"L-db_upgrating-S",L_DB_UPGRATE_COMPLETE_S:"L-db_upgrate_complete-S",L_NOTIFY_ULTRA_ONLINE_S:"L-notify-ultra-online-S",L_ULTRA_SYNC_DONE_S:"L-ultra-sync-done-S",L_BATCH_MESSAGE_O:"L-BATCH_MESSAGE-O",A_MSG_LISTENER_E:"A-MSG_LISTENER-E",O:"L-original-O",T:"L-TEST-O",L_INSTALL_PLUGIN_T:"L-INSTALL_PLUGIN-T",L_INSTALL_PLUGIN_R:"L-INSTALL_PLUGIN-R",L_NAVI_CONF_E:"L-NAVI_CONF_ERROR-E",L_NAVI_CMP_R:"L-NAVI_CPM-R",A_SEND_MSG_T:"A-send_msg-T",A_SEND_MSG_R:"A-send_msg-R",L_SEND_MSG_T:"L-send_msg-T",L_SEND_MSG_R:"L-send_msg-R",L_PULL_MSG_T:"L-pull_msg-T",L_PULL_MSG_R:"L-pull_msg-R",L_PULL_MSG_E:"L-pull_msg-E",L_PULL_MSG_O:"L-pull_msg-O",L_PULL_ULTRA_MSG_T:"L-pull_ultra_msg-T",L_PULL_ULTRA_MSG_R:"L-pull_ultra_msg-R",L_PULL_UG_RELATIONS_T:"L-pull_ug_relations-T",L_PULL_UG_RELATIONS_R:"L-pull_ug_relations-R",L_PULL_CHATROOM_KV_T:"L-pull_chatroom_kv-T",L_PULL_CHATROOM_KV_R:"L-pull_chatroom_kv-R",L_PULL_CHATROOM_MSG_T:"L-pull_chatroom_msg-T",L_PULL_CHATROOM_MSG_R:"L-pull_chatroom_msg-R",L_RECV_MULTI_SYNC_MSG_O:"L-recv_multi_sync_msg-O",L_RECV_S_MSG_O:"L-recv_s_msg-O",A_DELETE_MESSAGES_S:"A-delete_messages-S",P_DELETE_MSG_S:"P-delete_msg-S",A_RECALL_MESSAGE_T:"A-recall_msg-T",A_RECALL_MESSAGE_R:"A-recall_msg-R",A_RECALL_MESSAGE_E:"A-recall_msg-E",A_REGTYP_O:"A-regtyp-O",P_REGTYP_E:"P-regtype-E",L_GET_NAVI_T:"L-get_navi-T",L_GET_NAVI_R:"L-get_navi-R",L_REQUEST_T:"L-request-T",L_REQUEST_R:"L-request-R",L_PARSE_NAVI_E:"L-parse_navi-E",L_ENV_S:"L-Env-S",L_GET_INDEX_NAVI_S:"L-get_index_navi-S",A_JOIN_CHATROOM_T:"A-join_chatroom-T",A_JOIN_CHATROOM_R:"A-join_chatroom-R",L_JOIN_CHATROOM_T:"L-join_chatroom-T",L_JOIN_CHATROOM_R:"L-join_chatroom-R",A_QUIT_CHATROOM_T:"A-quit_chatroom-T",A_QUIT_CHATROOM_R:"A-quit_chatroom-R",L_REJOIN_CHATROOM_T:"L-rejoin_chatroom-T",L_REJOIN_CHATROOM_R:"L-rejoin_chatroom-R",L_REJOIN_CHATROOM_S:"L-rejoin_chatroom-S",L_MEDIA_S:"L-media-S",L_MEDIA_UPLOAD_T:"L-media_upload-T",L_MEDIA_UPLOAD_R:"L-media_upload-R",G_UPLOAD_LOG_S:"G-upload_log-S",G_REPORT_LOG_S:"G-report_log-S",G_UPLOAD_LOG_E:"G-upload_log-E",G_GET_REAL_TIMELOG_COMMAND_S:"G-get_real_timelog_command-S",L_CHECK_ALIVE_IM_T:"L-check_alive_im-T",L_CHECK_ALIVE_IM_R:"L-check_alive_im-R",L_CHECK_ALIVE_IM_S:"L-check_alive_im-S",A_GET_LOCAL_MESSAGE_T:"A-get_local_message-T",A_GET_LOCAL_MESSAGE_R:"A-get_local_message-R",A_GET_HISTORY_MSG_T:"A-get_history_msg-T",A_GET_HISTORY_MSG_R:"A-get_history_msg-R",L_GET_HISTORY_MSG_T:"L-get_history_msg-T",L_GET_HISTORY_MSG_R:"L-get_history_msg-R",L_CALLBACK_E:"L-callback-E",A_SEND_MESSAGE_READ_RECEIPT_V4_T:"A-send_message_read_receipt_V4-T",A_SEND_MESSAGE_READ_RECEIPT_V4_R:"A-send_message_read_receipt_V4-R",A_GET_MESSAGE_READ_RECEIPT_V4_T:"A-get_message_read_receipt_V4-T",A_GET_MESSAGE_READ_RECEIPT_V4_R:"A-get_message_read_receipt_V4-R",A_BATCH_GET_MESSAGE_READ_RECEIPT_INFO_V4_T:"A-batch_get_message_read_receipt_info_V4-T",A_BATCH_GET_MESSAGE_READ_RECEIPT_INFO_V4_R:"A-batch_get_message_read_receipt_info_V4-R",A_SYNC_READ_STATUS_T:"A-sync_read_status-T",A_SYNC_READ_STATUS_R:"A-sync_read_status-R",L_PB_ENCODE_E:"L-pb-encode-E",L_PB_DECODE_E:"L-pb-decode-E",L_NOTIFY_NAVI_CHANGE_E:"L-notify_navi_change-E",L_REPORT_FULL_LOG_O:"L-report_full_log-O",L_REPORT_FULL_LOG_T:"L-report_full_log-T",L_REPORT_FULL_LOG_R:"L-report_full_log-R",L_REPORT_LOG_POLICY_E:"L-parse_navi_logpolicy-E",L_UNSUPPORT_INDEXDB_O:"L-unsupport_IndexDB-O",L_LOGDB_OPEN_FAILED_E:"L-logDB_open_failed-E",L_LOGDB_CLOSED_S:"L-logDB_closed-S",L_LOGDB_ERROR_E:"L-logDB_error-S",L_LOGDB_ABORT_S:"L-logDB_abort-S",L_REALTIME_LOG_T:"L_REALTIME_LOG_T",L_REALTIME_LOG_R:"L_REALTIME_LOG_R",L_REALTIME_LOG_O:"L_REALTIME_LOG_O",L_RECV_RMTP_O:"L_RECV_RMTP_O",L_RECV_RMTP_E:"L_RECV_RMTP_E",L_RECV_S_NTF_O:"L-recv_s_ntf_O",L_RECV_S_CMD_O:"L-recv_s_cmd_O",L_VER_REPORT_T:"L-VER_REPORT-T",L_VER_REPORT_R:"L-VER_REPORT-R",L_CALL_MAIN_SYNC_O:"L_CALL_MAIN_SYNC_O",L_UNSUPPORT_NTF_FROM_MAIN_E:"L_UNSUPPORT_NTF_FROM_MAIN_E",A_SET_MSG_CONTENT_O:"A_SET_MSG_CONTENT_O",A_REMOVE_PROXY_O:"A-remove_proxy-O",A_SET_PROXY_O:"A-set_proxy-O",A_TEST_PROXY_O:"A-test_proxy-O",L_WS_DISACCORD_E:"L-ws_disaccord-E",L_GET_STATIC_CONF_T:"L-get_static_conf-T",L_GET_STATIC_CONF_R:"L-get_static_conf-R",L_GET_STATIC_CONF_E:"L-get_static_conf-E",L_CLOUD_DISABLED:"L-cloud_disabled",L_CLOUD_OVERCLOCK:"L-cloud_overclock",L_CLOUD_APPKEY_REGION_E:"L-cloud_appkey_region_error",L_CLOUD_CONFIG_DATA_E:"L-cloud_config_data_error",L_CLOUD_SET_CACHE_O:"L-cloud_set_cache-O",L_CLOUD_GET_CACHE_O:"L-cloud_get_cache-O",L_CLOUD_SET_AREA_CODE_O:"L-cloud_set_area_code-O",L_CLOUD_SET_MRTR_O:"L-cloud_set_mrtr-O",L_SYNC_SUBSCRIBED_USER_STATUS_FINISHED_S:"L-sync_subscribed_user_status_finished-S",L_PULL_SUBSCRIBED_USER_RELATION_T:"L-pull_subscribed_user_relation-T",L_PULL_SUBSCRIBED_USER_RELATION_R:"L-pull_subscribed_user_relation-R",L_PULL_SUBSCRIBED_USER_STATUS_T:"L-pull_subscribed_user_status-T",L_PULL_SUBSCRIBED_USER_STATUS_R:"L-pull_subscribed_user_status-R",L_OWN_USER_PROFILE_CHANGED_S:"L-own_user_profile_changed-S",L_QUERY_SUBSCRIBE_DATA_T:"L-query_subscribe_data-T",L_QUERY_SUBSCRIBE_DATA_R:"L-query_subscribe_data-R",L_PULL_USER_PROFILE_T:"L-pull_user_profile-T",L_PULL_USER_PROFILE_R:"L-pull_user_profile-R",L_PULL_OWN_PROFILE_T:"L-pull_own_profile-T",L_PULL_OWN_PROFILE_R:"L-pull_own_profile-R",L_QUERY_FRIEND_LIST_T:"L-query_friend_list-T",L_QUERY_FRIEND_LIST_R:"L-query_friend_list-R",L_PULL_USER_PROFILE_REQ_T:"L-pull_user_profile_req-T",L_PULL_USER_PROFILE_REQ_R:"L-pull_user_profile_req-R",L_SERVER_EVENT_NOTIFY_ONLINE_T:"L-server_event_notify_online-T",L_SERVER_EVENT_NOTIFY_ONLINE_R:"L-server_event_notify_online-R",L_PULL_EVENT_CHANGE_T:"L-pull_event_change-T",L_PULL_EVENT_CHANGE_R:"L-pull_event_change-R",L_PARSE_JSON_E:"L-parse_json-E",L_REQ_STREAM_MSG_CONTENT_T:"L-req_stream_msg_content-T",L_REQ_STREAM_MSG_CONTENT_R:"L-req_stream_msg_content-R",L_REQ_STREAM_MSG_CONTENT_O:"L-req_stream_msg_content-O",L_REQ_STREAM_MSG_CONTENT_E:"L-req_stream_msg_content-E",L_PULL_CONVERSATION_SETTINGS_T:"L-pull_conversation_settings-T",L_PULL_CONVERSATION_SETTINGS_R:"L-pull_conversation_settings-R",L_PULL_SG_RELATIONS_T:"L-pull_sg_relations-T",L_PULL_SG_RELATIONS_R:"L-pull_sg_relations-R",A_REMOVE_CONVERSATION_T:"A-remove_conversation-T",A_REMOVE_CONVERSATION_R:"A-remove_conversation-R",A_GET_CONVERSATION_LIST_BY_FILTER_T:"A-get_conversation_list_by_filter-T",A_GET_CONVERSATION_LIST_BY_FILTER_R:"A-get_conversation_list_by_filter-R",A_GET_CONVERSATION_T:"A-get_conversation-T",A_GET_CONVERSATION_R:"A-get_conversation-R",A_BATCH_SET_CONVERSATION_TO_TOP_T:"A-batch_set_conversation_to_top-T",A_BATCH_SET_CONVERSATION_TO_TOP_R:"A-batch_set_conversation_to_top-R",A_BATCH_SET_CONVERSATION_NOTIFICATION_LEVEL_T:"A-batch_set_conversation_notification_level-T",A_BATCH_SET_CONVERSATION_NOTIFICATION_LEVEL_R:"A-batch_set_conversation_notification_level-R",A_CLEAR_ALL_UNREAD_COUNT_O:"A-clear_all_unread_count-O",A_DELETE_REMOTE_MESSAGE_BY_TIMESTAMP_T:"A-delete_remote_message_by_timestamp-T",A_DELETE_REMOTE_MESSAGE_BY_TIMESTAMP_R:"A-delete_remote_message_by_timestamp-R",A_DELETE_REMOTE_MESSAGE_T:"A-delete_remote_message-T",A_DELETE_REMOTE_MESSAGE_R:"A-delete_remote_message-R",A_BATCH_CLEAR_REMOTE_MSG_T:"A-batch_clear_remote_msg-T",A_BATCH_CLEAR_REMOTE_MSG_R:"A-batch_clear_remote_msg-R",L_EVENT_LOOP_BLOCKING_S:"L-event_loop_blocking-S",A_E_SEARCH_CONVERSATION_BY_CONTENT_T:"A-e_search_conversation_by_content-T",A_E_SEARCH_CONVERSATION_BY_CONTENT_R:"A-e_search_conversation_by_content-R",P_GET_SYS_VERSION_E:"P-get_sys_version-E",A_CLEAR_LOCAL_CACHE_O:"A-clear_local_cache-O",A_E_SET_MESSAGE_STATUS_TO_READ_T:"A-e_set_message_status_to_read-T",A_E_SET_MESSAGE_STATUS_TO_READ_R:"A-e_set_message_status_to_read-R",A_SEARCH_MSGS_BY_PARAMS_T:"A-search_msgs_by_params-T",A_SEARCH_MSGS_BY_PARAMS_R:"A-search_msgs_by_params-R",L_PULL_OFFLINE_MESSAGE_FINISHED_S:"L-pull_offline_message_finished-S"};exports.DirectionType=void 0,(p=exports.DirectionType||(exports.DirectionType={}))[p.BOTH=2]="BOTH",exports.QueryFriendsDirectionType=void 0,(f=exports.QueryFriendsDirectionType||(exports.QueryFriendsDirectionType={}))[f.BOTH=2]="BOTH",exports.FriendAddPermission=void 0,(h=exports.FriendAddPermission||(exports.FriendAddPermission={}))[h.FREE=1]="FREE",h[h.NEED_VERIFY=2]="NEED_VERIFY",h[h.NO_ONE_ALLOWED=3]="NO_ONE_ALLOWED",exports.FriendRelationType=void 0,(_=exports.FriendRelationType||(exports.FriendRelationType={}))[_.NONE=0]="NONE",_[_.IN_MY_FRIEND_LIST=1]="IN_MY_FRIEND_LIST",_[_.IN_OTHER_FRIEND_LIST=2]="IN_OTHER_FRIEND_LIST",_[_.BOTH_WAY=3]="BOTH_WAY",exports.FriendApplicationType=void 0,(b=exports.FriendApplicationType||(exports.FriendApplicationType={}))[b.SENT=1]="SENT",b[b.RECEIVED=2]="RECEIVED",exports.FriendApplicationStatus=void 0,(E=exports.FriendApplicationStatus||(exports.FriendApplicationStatus={}))[E.UNHANDLED=0]="UNHANDLED",E[E.ACCEPTED=1]="ACCEPTED",E[E.REFUSED=2]="REFUSED",E[E.EXPIRED=3]="EXPIRED",function(e){e[e.FRIEND_APPLICATION=31]="FRIEND_APPLICATION"}(v||(v={})),function(e){e[e.FRIEND_APPLY=0]="FRIEND_APPLY",e[e.FRIEND_REFUSE=1]="FRIEND_REFUSE",e[e.FRIEND_USER_INFO=2]="FRIEND_USER_INFO",e[e.FRIENDS_INPUT=3]="FRIENDS_INPUT",e[e.FRIEND_CLEAR=4]="FRIEND_CLEAR",e[e.FRIEND_INFO_CHANGE=5]="FRIEND_INFO_CHANGE",e[e.FRIEND_INFO_CHANGE_SYNC=6]="FRIEND_INFO_CHANGE_SYNC"}(y||(y={})),exports.GroupJoinPermission=void 0,(m=exports.GroupJoinPermission||(exports.GroupJoinPermission={}))[m.OWNER_VERIFY=0]="OWNER_VERIFY",m[m.FREE=1]="FREE",m[m.OWNER_OR_MANAGER_VERIFY=2]="OWNER_OR_MANAGER_VERIFY",m[m.NO_ONE_ALLOWED=3]="NO_ONE_ALLOWED",exports.GroupOperationPermission=void 0,(I=exports.GroupOperationPermission||(exports.GroupOperationPermission={}))[I.OWNER=0]="OWNER",I[I.OWNER_OR_MANAGER=1]="OWNER_OR_MANAGER",I[I.EVERYONE=2]="EVERYONE",exports.GroupMemberInfoEditPermission=void 0,(T=exports.GroupMemberInfoEditPermission||(exports.GroupMemberInfoEditPermission={}))[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",exports.GroupInviteHandlePermission=void 0,(R=exports.GroupInviteHandlePermission||(exports.GroupInviteHandlePermission={}))[R.FREE=0]="FREE",R[R.INVITEE_VERIFY=1]="INVITEE_VERIFY",exports.GroupMemberRole=void 0,(C=exports.GroupMemberRole||(exports.GroupMemberRole={}))[C.UNDEF=0]="UNDEF",C[C.NORMAL=1]="NORMAL",C[C.MANAGER=2]="MANAGER",C[C.OWNER=3]="OWNER",exports.GroupOperation=void 0,(O=exports.GroupOperation||(exports.GroupOperation={}))[O.CREATE=0]="CREATE",O[O.JOIN=1]="JOIN",O[O.KICK=2]="KICK",O[O.QUIT=3]="QUIT",O[O.DISMISS=4]="DISMISS",O[O.ADD_MANAGER=5]="ADD_MANAGER",O[O.REMOVE_MANAGER=6]="REMOVE_MANAGER",O[O.TRANSFER_GROUP_OWNER=7]="TRANSFER_GROUP_OWNER",function(e){e[e.GROUP_INFO_CHANGE=0]="GROUP_INFO_CHANGE",e[e.MEMBER_PROFILE_CHANGE=1]="MEMBER_PROFILE_CHANGE",e[e.GROUP_REMARK_SET=2]="GROUP_REMARK_SET",e[e.GROUP_REMARK_DELETE=3]="GROUP_REMARK_DELETE"}(S||(S={})),exports.GroupOperationType=void 0,(A=exports.GroupOperationType||(exports.GroupOperationType={}))[A.ADD=1]="ADD",A[A.REMOVE=2]="REMOVE",exports.GroupApplicationStatus=void 0,(P=exports.GroupApplicationStatus||(exports.GroupApplicationStatus={}))[P.MANAGER_UNHANDLED=0]="MANAGER_UNHANDLED",P[P.MANAGER_REFUSED=1]="MANAGER_REFUSED",P[P.INVITEE_UNHANDLED=2]="INVITEE_UNHANDLED",P[P.INVITEE_REFUSED=3]="INVITEE_REFUSED",P[P.JOINED=4]="JOINED",P[P.EXPIRED=5]="EXPIRED",exports.GroupOperationStatus=void 0,(N=exports.GroupOperationStatus||(exports.GroupOperationStatus={}))[N.REFUSE=0]="REFUSE",N[N.ACCEPT=1]="ACCEPT",exports.GroupOperationRole=void 0,(w=exports.GroupOperationRole||(exports.GroupOperationRole={}))[w.APPLICANT=0]="APPLICANT",w[w.MANAGER=1]="MANAGER",function(e){e[e.GROUP_OPERATION=11]="GROUP_OPERATION",e[e.GROUP_PROFILE_CHANGE=12]="GROUP_PROFILE_CHANGE",e[e.GROUP_APPLICATION_INVITATION=13]="GROUP_APPLICATION_INVITATION",e[e.GROUP_FOLLOW_USER_CHANGE=14]="GROUP_FOLLOW_USER_CHANGE"}(M||(M={})),exports.GroupApplicationType=void 0,(L=exports.GroupApplicationType||(exports.GroupApplicationType={}))[L.APPLICATION=0]="APPLICATION",L[L.INVITATION=1]="INVITATION",exports.GroupApplicationDirection=void 0,(U=exports.GroupApplicationDirection||(exports.GroupApplicationDirection={}))[U.APPLICATION_SENT=0]="APPLICATION_SENT",U[U.INVITATION_SENT=1]="INVITATION_SENT",U[U.INVITATION_RECEIVED=2]="INVITATION_RECEIVED",U[U.APPLICATION_RECEIVED=3]="APPLICATION_RECEIVED",exports.ChatroomEntryType=void 0,(D=exports.ChatroomEntryType||(exports.ChatroomEntryType={}))[D.UPDATE=1]="UPDATE",D[D.DELETE=2]="DELETE",exports.ChrmSyncStatus=void 0,(x=exports.ChrmSyncStatus||(exports.ChrmSyncStatus={}))[x.QUIT=0]="QUIT",x[x.JOIN=1]="JOIN",exports.ChatroomSyncStatusReason=void 0,(j=exports.ChatroomSyncStatusReason||(exports.ChatroomSyncStatusReason={}))[j.LeaveOnMyOwn=0]="LeaveOnMyOwn",j[j.OtherDeviceLogin=1]="OtherDeviceLogin",exports.ChatroomUserChangeType=void 0,(V=exports.ChatroomUserChangeType||(exports.ChatroomUserChangeType={}))[V.QUIT=0]="QUIT",V[V.JOIN=1]="JOIN",exports.ChrmMemBanType=void 0,(G=exports.ChrmMemBanType||(exports.ChrmMemBanType={}))[G.UnmuteUsers=0]="UnmuteUsers",G[G.MuteUsers=1]="MuteUsers",G[G.UnmuteAll=2]="UnmuteAll",G[G.MuteAll=3]="MuteAll",G[G.RemoveWhitelist=4]="RemoveWhitelist",G[G.AddWhitelist=5]="AddWhitelist",G[G.UnmuteGloble=6]="UnmuteGloble",G[G.MuteGloble=7]="MuteGloble",exports.ChrmMemOperateType=void 0,(k=exports.ChrmMemOperateType||(exports.ChrmMemOperateType={}))[k.Deblock=0]="Deblock",k[k.Blocked=1]="Blocked",exports.ErrorCode=void 0,(F=exports.ErrorCode||(exports.ErrorCode={}))[F.SUCCESS=0]="SUCCESS",F[F.ACTIVE_DISCONNECT=2]="ACTIVE_DISCONNECT",F[F.REJECTED_BY_BLACKLIST=405]="REJECTED_BY_BLACKLIST",F[F.FORBIDDEN_IN_PRIVATE=20106]="FORBIDDEN_IN_PRIVATE",F[F.SYS_CONVERSATION_NOT_SUPPORT_MESSAGE=20109]="SYS_CONVERSATION_NOT_SUPPORT_MESSAGE",F[F.CLOUD_DATA_CENTER_INVALID=20512]="CLOUD_DATA_CENTER_INVALID",F[F.SEND_FREQUENCY_TOO_FAST=20604]="SEND_FREQUENCY_TOO_FAST",F[F.OPERATION_BLOCKED=20605]="OPERATION_BLOCKED",F[F.OPERATION_NOT_SUPPORT=20606]="OPERATION_NOT_SUPPORT",F[F.REQUEST_OVER_FREQUENCY=20607]="REQUEST_OVER_FREQUENCY",F[F.NOT_IN_DISCUSSION=21406]="NOT_IN_DISCUSSION",F[F.SENSITIVE_SHIELD=21501]="SENSITIVE_SHIELD",F[F.SENSITIVE_REPLACE=21502]="SENSITIVE_REPLACE",F[F.MESSAGE_EXPAND_NOT_EXIST=22201]="MESSAGE_EXPAND_NOT_EXIST",F[F.MESSAGE_EXPAND_NOT_SUPPORT=22202]="MESSAGE_EXPAND_NOT_SUPPORT",F[F.MESSAGE_EXPAND_FORMAT_ERROR=22203]="MESSAGE_EXPAND_FORMAT_ERROR",F[F.MESSAGE_EXPAND_NOT_AUTHORIZED=22204]="MESSAGE_EXPAND_NOT_AUTHORIZED",F[F.NOT_IN_GROUP=22406]="NOT_IN_GROUP",F[F.FORBIDDEN_IN_GROUP=22408]="FORBIDDEN_IN_GROUP",F[F.NOT_IN_CHATROOM=23406]="NOT_IN_CHATROOM",F[F.GET_USERINFO_ERROR=23407]="GET_USERINFO_ERROR",F[F.FORBIDDEN_IN_CHATROOM=23408]="FORBIDDEN_IN_CHATROOM",F[F.RC_CHATROOM_USER_KICKED=23409]="RC_CHATROOM_USER_KICKED",F[F.RC_CHATROOM_NOT_EXIST=23410]="RC_CHATROOM_NOT_EXIST",F[F.RC_CHATROOM_IS_FULL=23411]="RC_CHATROOM_IS_FULL",F[F.RC_CHATROOM_PATAMETER_INVALID=23412]="RC_CHATROOM_PATAMETER_INVALID",F[F.CHATROOM_GET_HISTORYMSG_ERROR=23413]="CHATROOM_GET_HISTORYMSG_ERROR",F[F.CHATROOM_NOT_OPEN_HISTORYMSG_STORE=23414]="CHATROOM_NOT_OPEN_HISTORYMSG_STORE",F[F.CHATROOM_KV_EXCEED=23423]="CHATROOM_KV_EXCEED",F[F.CHATROOM_KV_OVERWRITE_INVALID=23424]="CHATROOM_KV_OVERWRITE_INVALID",F[F.CHATROOM_SET_PROPERTY_OVER_FREQUENCY=23425]="CHATROOM_SET_PROPERTY_OVER_FREQUENCY",F[F.CHATROOM_KV_STORE_NOT_OPEN=23426]="CHATROOM_KV_STORE_NOT_OPEN",F[F.CHATROOM_KEY_NOT_EXIST=23427]="CHATROOM_KEY_NOT_EXIST",F[F.CHATROOM_KV_STORE_NOT_ALL_SUCCESS=23428]="CHATROOM_KV_STORE_NOT_ALL_SUCCESS",F[F.CHATROOM_KV_STORE_OUT_LIMIT=23429]="CHATROOM_KV_STORE_OUT_LIMIT",F[F.CHATROOM_KV_SET_ERROR=23431]="CHATROOM_KV_SET_ERROR",F[F.HAVNODEVICEID=24001]="HAVNODEVICEID",F[F.DEVICEIDISHAVE=24002]="DEVICEIDISHAVE",F[F.FEILD=24009]="FEILD",F[F.INTERNALERRROR=24015]="INTERNALERRROR",F[F.RC_USER_PROFILE_KEY_NOT_ALLOW_SDK_SET=24360]="RC_USER_PROFILE_KEY_NOT_ALLOW_SDK_SET",F[F.RC_USER_PROFILE_KEY_NOT_EXIST=24361]="RC_USER_PROFILE_KEY_NOT_EXIST",F[F.RC_USER_PROFILE_EXT_KEY_NOT_EXIST=24362]="RC_USER_PROFILE_EXT_KEY_NOT_EXIST",F[F.RC_USER_PROFILE_EXT_KV_COUNT_EXCEED_LIMIT=24363]="RC_USER_PROFILE_EXT_KV_COUNT_EXCEED_LIMIT",F[F.RC_USER_PROFILE_VALUE_LENGTH_EXCEED_LIMIT=24364]="RC_USER_PROFILE_VALUE_LENGTH_EXCEED_LIMIT",F[F.RC_USER_PROFILE_QUERY_COUNT_EXCEED_LIMIT=24365]="RC_USER_PROFILE_QUERY_COUNT_EXCEED_LIMIT",F[F.RC_USER_PROFILE_USER_NOT_EXIST=24366]="RC_USER_PROFILE_USER_NOT_EXIST",F[F.RC_USER_PROFILE_VALUE_CAN_ONLY_BE_NUMBERS=24367]="RC_USER_PROFILE_VALUE_CAN_ONLY_BE_NUMBERS",F[F.RC_USER_PROFILE_VALUE_EXCEED_RANGE=24368]="RC_USER_PROFILE_VALUE_EXCEED_RANGE",F[F.RC_USER_PROFILE_SERVICE_UNAVAILABLE=24369]="RC_USER_PROFILE_SERVICE_UNAVAILABLE",F[F.ULTRA_GROUP_SERVICE_UNAVAILABLE=24401]="ULTRA_GROUP_SERVICE_UNAVAILABLE",F[F.ULTRA_GROUP_SERVICE_ERROR=24402]="ULTRA_GROUP_SERVICE_ERROR",F[F.ULTRA_GROUP_PARAMETER_ERROR=24403]="ULTRA_GROUP_PARAMETER_ERROR",F[F.ULTRA_GROUP_UNKNOWN_ERROR=24404]="ULTRA_GROUP_UNKNOWN_ERROR",F[F.NOT_IN_ULTRA_GROUP=24406]="NOT_IN_ULTRA_GROUP",F[F.FORBIDDEN_IN_ULTRA_GROUP=24408]="FORBIDDEN_IN_ULTRA_GROUP",F[F.ULTRA_GROUP_NOT_EXIST=24410]="ULTRA_GROUP_NOT_EXIST",F[F.ULTRA_GROUP_MEMBERS_OVERSIZE=24411]="ULTRA_GROUP_MEMBERS_OVERSIZE",F[F.ULTRA_GROUP_JOINED_OVERSIZE=24412]="ULTRA_GROUP_JOINED_OVERSIZE",F[F.ULTRA_GROUP_CHANNELS_OVERSIZE=24413]="ULTRA_GROUP_CHANNELS_OVERSIZE",F[F.ULTRA_GROUP_CHANNEL_ID_NOT_EXIST=24414]="ULTRA_GROUP_CHANNEL_ID_NOT_EXIST",F[F.ULTRA_GROUP_MESSAGE_SENT_OVER_FREQUENCY=24415]="ULTRA_GROUP_MESSAGE_SENT_OVER_FREQUENCY",F[F.ULTRA_GROUP_USER_NOT_IN_PRIVATE_CHANNEL=24416]="ULTRA_GROUP_USER_NOT_IN_PRIVATE_CHANNEL",F[F.RECALL_MESSAGE=25101]="RECALL_MESSAGE",F[F.MESSAGE_STORAGE_SERVICE_UNAVAILABLE=25102]="MESSAGE_STORAGE_SERVICE_UNAVAILABLE",F[F.RC_SERVER_UNKOWN_ERROR=25104]="RC_SERVER_UNKOWN_ERROR",F[F.RECALL_MESSAGE_USER_INVALID=25107]="RECALL_MESSAGE_USER_INVALID",F[F.RC_ENTRUST_SERVER_ERROR=25402]="RC_ENTRUST_SERVER_ERROR",F[F.RC_ENTRUST_SERVER_PARAMETER_ERROR=25403]="RC_ENTRUST_SERVER_PARAMETER_ERROR",F[F.RC_GROUP_ILLEGAL_ERROR=25404]="RC_GROUP_ILLEGAL_ERROR",F[F.RC_GROUP_AUTHORITY_ERROR=25405]="RC_GROUP_AUTHORITY_ERROR",F[F.RC_GROUP_PARAMETER_LENGTH_EXCEED_LIMIT=25406]="RC_GROUP_PARAMETER_LENGTH_EXCEED_LIMIT",F[F.RC_GROUP_PARAMETER_FORMAT_ERROR=25407]="RC_GROUP_PARAMETER_FORMAT_ERROR",F[F.RC_GROUP_PARAMETER_VALUE_CAN_ONLY_BE_NUMBERS=25408]="RC_GROUP_PARAMETER_VALUE_CAN_ONLY_BE_NUMBERS",F[F.RC_GROUP_ID_ALREADY_EXIST=25409]="RC_GROUP_ID_ALREADY_EXIST",F[F.RC_GROUP_ID_NOT_EXIST=25410]="RC_GROUP_ID_NOT_EXIST",F[F.RC_GROUP_MEMBERS_COUNT_EXCEED_LIMIT=25411]="RC_GROUP_MEMBERS_COUNT_EXCEED_LIMIT",F[F.RC_GROUP_MEMBERS_ALREADY_IN_GROUP=25412]="RC_GROUP_MEMBERS_ALREADY_IN_GROUP",F[F.RC_GROUP_NOT_ALLOW_SDK_OPERATION=25413]="RC_GROUP_NOT_ALLOW_SDK_OPERATION",F[F.RC_GROUP_NOT_ALLOW_JOIN=25414]="RC_GROUP_NOT_ALLOW_JOIN",F[F.RC_GROUP_EXT_KEY_NOT_EXIST=25415]="RC_GROUP_EXT_KEY_NOT_EXIST",F[F.RC_GROUP_REQUEST_OVERFREQUENCY=25416]="RC_GROUP_REQUEST_OVERFREQUENCY",F[F.RC_GROUP_OWNER_NOT_ALLOW_QUIT_OR_KICK=25417]="RC_GROUP_OWNER_NOT_ALLOW_QUIT_OR_KICK",F[F.RC_GROUP_USER_NOT_IN_GROUP=25418]="RC_GROUP_USER_NOT_IN_GROUP",F[F.RC_GROUP_MANAGER_OR_FOLLOW_COUNT_EXCEED_LIMIT=25419]="RC_GROUP_MANAGER_OR_FOLLOW_COUNT_EXCEED_LIMIT",F[F.RC_GROUP_USER_IS_NOT_MANAGER_IN_GROUP=25420]="RC_GROUP_USER_IS_NOT_MANAGER_IN_GROUP",F[F.RC_GROUP_APPLICATION_NOT_EXIST=25421]="RC_GROUP_APPLICATION_NOT_EXIST",F[F.RC_GROUP_QUERY_GROUP_COUNT_EXCEED_LIMIT=25422]="RC_GROUP_QUERY_GROUP_COUNT_EXCEED_LIMIT",F[F.RC_GROUP_NAME_INVALID=25423]="RC_GROUP_NAME_INVALID",F[F.RC_GROUP_JOIN_GROUP_NEED_MANAGER_ACCEPT=25424]="RC_GROUP_JOIN_GROUP_NEED_MANAGER_ACCEPT",F[F.RC_GROUP_OWNER_NOT_ALLOW_BE_MANAGER=25425]="RC_GROUP_OWNER_NOT_ALLOW_BE_MANAGER",F[F.RC_GROUP_NO_INVITE_PERMISSION=25426]="RC_GROUP_NO_INVITE_PERMISSION",F[F.RC_GROUP_NEED_INVITEE_ACCEPT=25427]="RC_GROUP_NEED_INVITEE_ACCEPT",F[F.RC_GROUP_APPLICATION_ALREADY_HANDLE=25428]="RC_GROUP_APPLICATION_ALREADY_HANDLE",F[F.RC_GROUP_OLD_GROUP_NOT_ENTRUST=25429]="RC_GROUP_OLD_GROUP_NOT_ENTRUST",F[F.RC_GROUP_ID_INVALID=25430]="RC_GROUP_ID_INVALID",F[F.RC_PAGE_TOKEN_PARSING_FAILED=25432]="RC_PAGE_TOKEN_PARSING_FAILED",F[F.RC_FRIEND_ALREADY_FRIEND=25460]="RC_FRIEND_ALREADY_FRIEND",F[F.RC_FRIEND_NEED_ACCEPT=25461]="RC_FRIEND_NEED_ACCEPT",F[F.RC_FRIEND_IN_OTHER_BLACK_LIST=25462]="RC_FRIEND_IN_OTHER_BLACK_LIST",F[F.RC_FRIEND_NOT_IN_OTHER_WHITE_LIST=25463]="RC_FRIEND_NOT_IN_OTHER_WHITE_LIST",F[F.RC_FRIEND_IN_MY_BLACK_LIST=25464]="RC_FRIEND_IN_MY_BLACK_LIST",F[F.RC_FRIEND_NOT_IN_MY_WHITE_LIST=25465]="RC_FRIEND_NOT_IN_MY_WHITE_LIST",F[F.RC_FRIEND_APPLICATION_NOT_EXIST=25466]="RC_FRIEND_APPLICATION_NOT_EXIST",F[F.RC_FRIEND_MY_FRIEND_COUNT_EXCEED_LIMIT=25467]="RC_FRIEND_MY_FRIEND_COUNT_EXCEED_LIMIT",F[F.RC_FRIEND_OTHER_FRIEND_COUNT_EXCEED_LIMIT=25468]="RC_FRIEND_OTHER_FRIEND_COUNT_EXCEED_LIMIT",F[F.RC_FRIEND_NOT_FRIEND=25469]="RC_FRIEND_NOT_FRIEND",F[F.RC_FRIEND_FIELDS_LENGTH_EXCEED_LIMIT=25470]="RC_FRIEND_FIELDS_LENGTH_EXCEED_LIMIT",F[F.RC_FRIEND_OTHER_NOT_ALLOW_ADD_FRIEND=25471]="RC_FRIEND_OTHER_NOT_ALLOW_ADD_FRIEND",F[F.RC_FRIEND_NOT_EXIST=25472]="RC_FRIEND_NOT_EXIST",F[F.RC_FRIEND_NOT_ALLOW_ADD_SELF=25473]="RC_FRIEND_NOT_ALLOW_ADD_SELF",F[F.SERVICE_INFORMATION_AUDIT_FAILED=25480]="SERVICE_INFORMATION_AUDIT_FAILED",F[F.PUSH_PARAMETER_INVALID=26001]="PUSH_PARAMETER_INVALID",F[F.USER_SETTING_SYNCED_ERROR=26002]="USER_SETTING_SYNCED_ERROR",F[F.CONVERSATION_TAG_OVERSIZE=26004]="CONVERSATION_TAG_OVERSIZE",F[F.RC_READ_RECEIPT_V4_INVALID=26005]="RC_READ_RECEIPT_V4_INVALID",F[F.RC_SERVER_DRIVE_UNREAD_COUNT_INVALID=26006]="RC_SERVER_DRIVE_UNREAD_COUNT_INVALID",F[F.RC_SERVER_PARAMETER_MESSAGEUIDS_CONFUSED=26007]="RC_SERVER_PARAMETER_MESSAGEUIDS_CONFUSED",F[F.RC_SERVER_PARAMETER_MESSAGEUID_INVALID=26009]="RC_SERVER_PARAMETER_MESSAGEUID_INVALID",F[F.RC_SERVER_PARAMETER_INVALID=26010]="RC_SERVER_PARAMETER_INVALID",F[F.RC_SUBSCRIBE_ONLINE_SERVICE_UNAVAILABLE=26020]="RC_SUBSCRIBE_ONLINE_SERVICE_UNAVAILABLE",F[F.RC_BESUBSCRIBED_USERIDS_COUNT_EXCEED_LIMIT=26021]="RC_BESUBSCRIBED_USERIDS_COUNT_EXCEED_LIMIT",F[F.RC_SUBSCRIBED_USERIDS_EXCEED_LIMIT=26022]="RC_SUBSCRIBED_USERIDS_EXCEED_LIMIT",F[F.RC_FILE_SIZE_EXCEED_LIMIT=26106]="RC_FILE_SIZE_EXCEED_LIMIT",F[F.INVALID_PARAMETER_SIZE_NOT_FOUND=26107]="INVALID_PARAMETER_SIZE_NOT_FOUND",F[F.RC_NET_CHANNEL_INVALID=30001]="RC_NET_CHANNEL_INVALID",F[F.RC_NET_UNAVAILABLE=30002]="RC_NET_UNAVAILABLE",F[F.RC_MSG_RESP_TIMEOUT=30003]="RC_MSG_RESP_TIMEOUT",F[F.RC_HTTP_SEND_FAIL=30004]="RC_HTTP_SEND_FAIL",F[F.RC_HTTP_REQ_FAIL=30005]="RC_HTTP_REQ_FAIL",F[F.RC_HTTP_RECV_FAIL=30006]="RC_HTTP_RECV_FAIL",F[F.RC_NAVI_REQ_FAILED=30007]="RC_NAVI_REQ_FAILED",F[F.RC_NODE_NOT_FOUND=30008]="RC_NODE_NOT_FOUND",F[F.RC_DOMAIN_NOT_RESOLVE=30009]="RC_DOMAIN_NOT_RESOLVE",F[F.RC_SOCKET_NOT_CREATED=30010]="RC_SOCKET_NOT_CREATED",F[F.RC_SOCKET_DISCONNECTED=30011]="RC_SOCKET_DISCONNECTED",F[F.RC_PING_EXCEED_LIMIT=30012]="RC_PING_EXCEED_LIMIT",F[F.PONG_RECEIVED_ERROR=30013]="PONG_RECEIVED_ERROR",F[F.RC_MSG_SEND_FAIL=30014]="RC_MSG_SEND_FAIL",F[F.CONNECT_OVER_FREQUENCY=30015]="CONNECT_OVER_FREQUENCY",F[F.RC_MSG_CONTENT_EXCEED_LIMIT=30016]="RC_MSG_CONTENT_EXCEED_LIMIT",F[F.MESSAGE_NOT_SUPPORT_SENDING=30017]="MESSAGE_NOT_SUPPORT_SENDING",F[F.RC_NETWORK_DOWN=30019]="RC_NETWORK_DOWN",F[F.RC_TCP_DISCONNECTED_NO_RMTP=30021]="RC_TCP_DISCONNECTED_NO_RMTP",F[F.RC_CONN_ACK_TIMEOUT=31e3]="RC_CONN_ACK_TIMEOUT",F[F.RC_CONN_PROTO_VERSION_ERROR=31001]="RC_CONN_PROTO_VERSION_ERROR",F[F.RC_CONN_IDENTIFIER_REJECTED=31002]="RC_CONN_IDENTIFIER_REJECTED",F[F.RC_CONN_SERVER_UNAVAILABLE=31003]="RC_CONN_SERVER_UNAVAILABLE",F[F.RC_CONN_TOKEN_INCORRECT=31004]="RC_CONN_TOKEN_INCORRECT",F[F.RC_CONN_NOT_AUTHRORIZED=31005]="RC_CONN_NOT_AUTHRORIZED",F[F.RC_CONN_REDIRECTED=31006]="RC_CONN_REDIRECTED",F[F.RC_CONN_PACKAGE_NAME_INVALID=31007]="RC_CONN_PACKAGE_NAME_INVALID",F[F.RC_CONN_APP_BLOCKED_OR_DELETED=31008]="RC_CONN_APP_BLOCKED_OR_DELETED",F[F.RC_CONN_USER_BLOCKED=31009]="RC_CONN_USER_BLOCKED",F[F.RC_DISCONN_KICK=31010]="RC_DISCONN_KICK",F[F.RC_DISCONN_EXCEPTION=31011]="RC_DISCONN_EXCEPTION",F[F.CONNECTION_ENCRYPT_AUTHORIZED_ERROR=31012]="CONNECTION_ENCRYPT_AUTHORIZED_ERROR",F[F.RC_CONN_TOKEN_EXPIRED=31020]="RC_CONN_TOKEN_EXPIRED",F[F.RC_CONN_DEVICE_ERROR=31021]="RC_CONN_DEVICE_ERROR",F[F.RC_CONN_HOSTNAME_ERROR=31022]="RC_CONN_HOSTNAME_ERROR",F[F.RC_DISCONN_SAME_CLIENT_ON_LINE=31023]="RC_DISCONN_SAME_CLIENT_ON_LINE",F[F.RC_LISCENSE_COUNT_OUT_OF_LIMIT=31024]="RC_LISCENSE_COUNT_OUT_OF_LIMIT",F[F.RC_CONN_WRONG_CLUSTER=31025]="RC_CONN_WRONG_CLUSTER",F[F.RC_APP_AUTH_NOT_PASS=31026]="RC_APP_AUTH_NOT_PASS",F[F.RC_OTP_USED=31027]="RC_OTP_USED",F[F.RC_PLATFORM_ERROR=31028]="RC_PLATFORM_ERROR",F[F.RC_ACCOUNT_CANCELLATION=31029]="RC_ACCOUNT_CANCELLATION",F[F.RC_LICENSE_EXPIRED=31030]="RC_LICENSE_EXPIRED",F[F.RC_QUERY_ACK_NO_DATA=32001]="RC_QUERY_ACK_NO_DATA",F[F.RC_MSG_DATA_INCOMPLETE=32002]="RC_MSG_DATA_INCOMPLETE",F[F.RC_UDP_DISCONNECTED=32011]="RC_UDP_DISCONNECTED",F[F.RC_TCP_RESET=32054]="RC_TCP_RESET",F[F.CONNECTION_REFUSED=32061]="CONNECTION_REFUSED",F[F.PROTOCOL_MESSAGE_SAVED_ERROR=33e3]="PROTOCOL_MESSAGE_SAVED_ERROR",F[F.BIZ_ERROR_CLIENT_NOT_INIT=33001]="BIZ_ERROR_CLIENT_NOT_INIT",F[F.BIZ_ERROR_DATABASE_ERROR=33002]="BIZ_ERROR_DATABASE_ERROR",F[F.BIZ_ERROR_INVALID_PARAMETER=33003]="BIZ_ERROR_INVALID_PARAMETER",F[F.BIZ_ERROR_NO_CHANNEL=33004]="BIZ_ERROR_NO_CHANNEL",F[F.BIZ_ERROR_RECONNECT_SUCCESS=33005]="BIZ_ERROR_RECONNECT_SUCCESS",F[F.BIZ_ERROR_CONNECTING=33006]="BIZ_ERROR_CONNECTING",F[F.MSG_ROAMING_SERVICE_UNAVAILABLE=33007]="MSG_ROAMING_SERVICE_UNAVAILABLE",F[F.MSG_INSERT_ERROR=33008]="MSG_INSERT_ERROR",F[F.MSG_DEL_ERROR=33009]="MSG_DEL_ERROR",F[F.TAG_NOT_EXIST=33100]="TAG_NOT_EXIST",F[F.TAG_EXISTS=33101]="TAG_EXISTS",F[F.NO_TAG_IN_CONVER=33102]="NO_TAG_IN_CONVER",F[F.RC_CONNECTION_EXIST=34001]="RC_CONNECTION_EXIST",F[F.PACKAGE_ENVIRONMENT_ERROR=34005]="PACKAGE_ENVIRONMENT_ERROR",F[F.CONNECTION_TIMEOUT=34006]="CONNECTION_TIMEOUT",F[F.MESSAGE_KV_NOT_SUPPORT=34008]="MESSAGE_KV_NOT_SUPPORT",F[F.MESSAGE_EXPANDED_ERROR=34009]="MESSAGE_EXPANDED_ERROR",F[F.EXPANSION_LIMIT_EXCEET=34010]="EXPANSION_LIMIT_EXCEET",F[F.UPLOAD_FAIL=34011]="UPLOAD_FAIL",F[F.CONVER_OUT_LIMIT_ERROR=34013]="CONVER_OUT_LIMIT_ERROR",F[F.READ_RECEIPT_ERROR=34014]="READ_RECEIPT_ERROR",F[F.PUSH_CONTENT_CONFIG_SERVICE_UNAVAILABLE=34016]="PUSH_CONTENT_CONFIG_SERVICE_UNAVAILABLE",F[F.MESSAGE_INTERCEPTION_PRODUCED_NULL_MESSAGE=34017]="MESSAGE_INTERCEPTION_PRODUCED_NULL_MESSAGE",F[F.MEDIA_EXCEPTION=34018]="MEDIA_EXCEPTION",F[F.MESSAGE_NOT_REGISTERED=34021]="MESSAGE_NOT_REGISTERED",F[F.METHOD_NOT_SUPPORT=34022]="METHOD_NOT_SUPPORT",F[F.ULTRA_GROUP_CHANNEL_NOT_EXIST=34024]="ULTRA_GROUP_CHANNEL_NOT_EXIST",F[F.INCONSISTENT_CONVERSATION_TYPE=34025]="INCONSISTENT_CONVERSATION_TYPE",F[F.CONVERSATION_TYPE_NOT_SUPPORT=34201]="CONVERSATION_TYPE_NOT_SUPPORT",F[F.INVALID_PARAMETER_TIMESTAMP=34202]="INVALID_PARAMETER_TIMESTAMP",F[F.INVALID_PARAMETER_MESSAGE_UID=34203]="INVALID_PARAMETER_MESSAGE_UID",F[F.INVALID_PARAMETER_MESSAGE_ID=34204]="INVALID_PARAMETER_MESSAGE_ID",F[F.INVALID_PARAMETER_MESSAGE_CONTENT=34205]="INVALID_PARAMETER_MESSAGE_CONTENT",F[F.MSG_LIMIT_ERROR=34206]="MSG_LIMIT_ERROR",F[F.INVALID_PARAMETER_MEDIA_TYPE=34207]="INVALID_PARAMETER_MEDIA_TYPE",F[F.INVALID_PARAMETER_CONVERSATION_TYPE=34209]="INVALID_PARAMETER_CONVERSATION_TYPE",F[F.INVALID_PARAMETER_TARGET_ID=34210]="INVALID_PARAMETER_TARGET_ID",F[F.INVALID_PARAMETER_CHANNEL_ID=34211]="INVALID_PARAMETER_CHANNEL_ID",F[F.INVALID_PARAMETER_TAG_ID=34212]="INVALID_PARAMETER_TAG_ID",F[F.INVALID_PARAMETER_TAG_NAME=34213]="INVALID_PARAMETER_TAG_NAME",F[F.INVALID_PARAMETER_USER_ID=34214]="INVALID_PARAMETER_USER_ID",F[F.INVALID_PARAMETER_USERIDLIST=34215]="INVALID_PARAMETER_USERIDLIST",F[F.INVALID_PARAMETER_DOWNLOADMEDIAFILENAME=34217]="INVALID_PARAMETER_DOWNLOADMEDIAFILENAME",F[F.INVALID_PARAMETER_MESSAGE_EXPANSION=34220]="INVALID_PARAMETER_MESSAGE_EXPANSION",F[F.INVALID_PARAMETER_TIMESTRING=34224]="INVALID_PARAMETER_TIMESTRING",F[F.INVALID_PARAMETER_CONVERSATION=34225]="INVALID_PARAMETER_CONVERSATION",F[F.INVALID_PARAMETER_NOTIFICATION_LEVEL=34228]="INVALID_PARAMETER_NOTIFICATION_LEVEL",F[F.INVALID_PARAMETER_MESSAGE_ARRAY=34229]="INVALID_PARAMETER_MESSAGE_ARRAY",F[F.INVALID_PARAMETER_RECEIVED_STATUS=34230]="INVALID_PARAMETER_RECEIVED_STATUS",F[F.INVALID_PARAMETER_CHANNEL_TYPE=34231]="INVALID_PARAMETER_CHANNEL_TYPE",F[F.INVALID_PARAMETER_COUNT=34232]="INVALID_PARAMETER_COUNT",F[F.INVALID_PARAMETER_MEDIA_URL=34235]="INVALID_PARAMETER_MEDIA_URL",F[F.INVALID_PARAMETER_UNIQUE_ID=34236]="INVALID_PARAMETER_UNIQUE_ID",F[F.INVALID_PARAMETER_PROXY=34238]="INVALID_PARAMETER_PROXY",F[F.INVALID_PARAMETER_TESTHOST=34239]="INVALID_PARAMETER_TESTHOST",F[F.INVALID_CONNECT_TESTHOST_FAILED=34240]="INVALID_CONNECT_TESTHOST_FAILED",F[F.INVALID_PARAMETER_CONVERSATIONS=34242]="INVALID_PARAMETER_CONVERSATIONS",F[F.INVALID_PARAMETER_SENT_STATUS=34244]="INVALID_PARAMETER_SENT_STATUS",F[F.RC_CONN_PROXY_UNAVAILABLE=34245]="RC_CONN_PROXY_UNAVAILABLE",F[F.INVALID_PARAMETER_RTCROOMID=34259]="INVALID_PARAMETER_RTCROOMID",F[F.INVALID_PARAMETER_KEY=34260]="INVALID_PARAMETER_KEY",F[F.INVALID_PARAMETER_KEYS=34261]="INVALID_PARAMETER_KEYS",F[F.INVALID_PARAMETER_VALUE=34262]="INVALID_PARAMETER_VALUE",F[F.INVALID_PARAMETER_ENTRIES=34263]="INVALID_PARAMETER_ENTRIES",F[F.INVALID_PARAMETER_NOTIFICATION_EXTRA=34264]="INVALID_PARAMETER_NOTIFICATION_EXTRA",F[F.INVALID_PARAMETER_MESSAGE_OBJECT_NAME=34271]="INVALID_PARAMETER_MESSAGE_OBJECT_NAME",F[F.INVALID_PARAMETER_BEFORE=34272]="INVALID_PARAMETER_BEFORE",F[F.INVALID_PARAMETER_AFTER=34273]="INVALID_PARAMETER_AFTER",F[F.INVALID_PARAMETER_KEYWORD=34274]="INVALID_PARAMETER_KEYWORD",F[F.INVALID_PARAMETER_MESSAGE_OBJECT_NAME_LIST=34275]="INVALID_PARAMETER_MESSAGE_OBJECT_NAME_LIST",F[F.INVALID_PARAMETER_OFFSET=34276]="INVALID_PARAMETER_OFFSET",F[F.INVALID_PARAMETER_START_TIME=34277]="INVALID_PARAMETER_START_TIME",F[F.INVALID_PARAMETER_END_TIME=34278]="INVALID_PARAMETER_END_TIME",F[F.INVALID_PARAMETER_LIMIT=34279]="INVALID_PARAMETER_LIMIT",F[F.INVALID_MESSAGE_DIRECTION=34280]="INVALID_MESSAGE_DIRECTION",F[F.INVALID_MESSAGE_SENT_STATUS=34281]="INVALID_MESSAGE_SENT_STATUS",F[F.INVALID_PARAMETER_TARGETID_LIST=34282]="INVALID_PARAMETER_TARGETID_LIST",F[F.INVALID_PARAMETER_SPAN_MINUTES=34283]="INVALID_PARAMETER_SPAN_MINUTES",F[F.INVALID_PARAMETER_CONVERSATION_TYPE_LIST=34284]="INVALID_PARAMETER_CONVERSATION_TYPE_LIST",F[F.INVALID_PARAMETER_CONVERSATION_LIST=34287]="INVALID_PARAMETER_CONVERSATION_LIST",F[F.INVALID_PARAMETER_CLEAR_MESSAGE_OPTION_LIST=34288]="INVALID_PARAMETER_CLEAR_MESSAGE_OPTION_LIST",F[F.INVALID_PARAMETER_START_MESSAGE_UID=34289]="INVALID_PARAMETER_START_MESSAGE_UID",F[F.INVALID_PARAMETER_END_MESSAGE_UID=34290]="INVALID_PARAMETER_END_MESSAGE_UID",F[F.READ_RECEIPT_V4_NOT_SUPPORT=34291]="READ_RECEIPT_V4_NOT_SUPPORT",F[F.READ_RECEIPT_V4_UPDATE_NOT_SUPPORT=34292]="READ_RECEIPT_V4_UPDATE_NOT_SUPPORT",F[F.RC_DIRECTIONAL_MESSAGE_INVALID_CONVERSATION_TYPE=34296]="RC_DIRECTIONAL_MESSAGE_INVALID_CONVERSATION_TYPE",F[F.RC_DB_NOT_INIT=34301]="RC_DB_NOT_INIT",F[F.RC_DB_CORRUPT=34302]="RC_DB_CORRUPT",F[F.RC_DB_SQL_ERROR=34303]="RC_DB_SQL_ERROR",F[F.RC_DB_DATA_NOT_FOUND=34304]="RC_DB_DATA_NOT_FOUND",F[F.RC_NET_DATA_ERROR=34305]="RC_NET_DATA_ERROR",F[F.INVALID_PARAMETER_SUBSCRIBE_TYPE=34306]="INVALID_PARAMETER_SUBSCRIBE_TYPE",F[F.INVALID_PARAMETER_SUBSCRIBE_EXPIRY=34307]="INVALID_PARAMETER_SUBSCRIBE_EXPIRY",F[F.INVALID_PARAMETER_SUBSCRIBE_PUBLISHER_USERIDS=34308]="INVALID_PARAMETER_SUBSCRIBE_PUBLISHER_USERIDS",F[F.INVALID_PARAMETER_SUBSCRIBE_PAGESIZE=34309]="INVALID_PARAMETER_SUBSCRIBE_PAGESIZE",F[F.SUB_PROCESS_EXIT=34310]="SUB_PROCESS_EXIT",F[F.ADDON_NOT_EXIST=34311]="ADDON_NOT_EXIST",F[F.INVALID_PARAMETER_USER_PROFILE=34312]="INVALID_PARAMETER_USER_PROFILE",F[F.INVALID_PARAMETER_USER_PROFILE_VISIBILITY=34313]="INVALID_PARAMETER_USER_PROFILE_VISIBILITY",F[F.INVALID_PARAMETER_EXTRA=34314]="INVALID_PARAMETER_EXTRA",F[F.DB_UPGRADE_FAILED=34315]="DB_UPGRADE_FAILED",F[F.INVALID_PARAMETER_GROUP_INFO=34318]="INVALID_PARAMETER_GROUP_INFO",F[F.INVALID_PARAMETER_GROUP_ID=34319]="INVALID_PARAMETER_GROUP_ID",F[F.INVALID_PARAMETER_GROUP_NAME=34320]="INVALID_PARAMETER_GROUP_NAME",F[F.INVALID_PARAMETER_GROUP_IDS=34321]="INVALID_PARAMETER_GROUP_IDS",F[F.INVALID_PARAMETER_GROUP_MEMBER_ROLE=34322]="INVALID_PARAMETER_GROUP_MEMBER_ROLE",F[F.INVALID_PARAMETER_GROUP_APPLICATION_STATUS=34323]="INVALID_PARAMETER_GROUP_APPLICATION_STATUS",F[F.INVALID_PARAMETER_GROUP_APPLICATION_DIRECTION=34324]="INVALID_PARAMETER_GROUP_APPLICATION_DIRECTION",F[F.INVALID_PARAMETER_NICK_NAME=34325]="INVALID_PARAMETER_NICK_NAME",F[F.INVALID_PARAMETER_REASON=34326]="INVALID_PARAMETER_REASON",F[F.INVALID_PARAMETER_REMARK=34327]="INVALID_PARAMETER_REMARK",F[F.INVALID_PARAMETER_PAGING_QUERY_OPTION=34328]="INVALID_PARAMETER_PAGING_QUERY_OPTION",F[F.NET_DATA_IS_SYNCHRONIZING=34329]="NET_DATA_IS_SYNCHRONIZING",F[F.INVALID_PARAMETER_QUERY_FRIENDS_DIRECTION_TYPE=34330]="INVALID_PARAMETER_QUERY_FRIENDS_DIRECTION_TYPE",F[F.INVALID_PARAMETER_DIRECTION_TYPE=34331]="INVALID_PARAMETER_DIRECTION_TYPE",F[F.INVALID_PARAMETER_FRIEND_APPLICATION_TYPE=34332]="INVALID_PARAMETER_FRIEND_APPLICATION_TYPE",F[F.INVALID_PARAMETER_FRIEND_APPLICATION_STATUS=34333]="INVALID_PARAMETER_FRIEND_APPLICATION_STATUS",F[F.INVALID_PARAMETER_FRIEND_ADD_PERMISSION=34334]="INVALID_PARAMETER_FRIEND_ADD_PERMISSION",F[F.INVALID_PARAMETER_FRIEND_INFO_EXT_FIELDS=34335]="INVALID_PARAMETER_FRIEND_INFO_EXT_FIELDS",F[F.RC_REAL_TIME_CONVERSATION_UNAVAILABLE=34336]="RC_REAL_TIME_CONVERSATION_UNAVAILABLE",F[F.GROUP_SYNC_ERROR=35001]="GROUP_SYNC_ERROR",F[F.GROUP_MATCH_ERROR=35002]="GROUP_MATCH_ERROR",F[F.NOT_SUPPORT=35004]="NOT_SUPPORT",F[F.MAIN_PROCESS_ERROR=35005]="MAIN_PROCESS_ERROR",F[F.CAN_NOT_RECONNECT=35007]="CAN_NOT_RECONNECT",F[F.SERVER_UNAVAILABLE=35008]="SERVER_UNAVAILABLE",F[F.HOSTNAME_ERROR=35009]="HOSTNAME_ERROR",F[F.HAS_OHTER_SAME_CLIENT_ON_LINE=35010]="HAS_OHTER_SAME_CLIENT_ON_LINE",F[F.METHOD_NOT_AVAILABLE=35011]="METHOD_NOT_AVAILABLE",F[F.METHOD_ONLY_SUPPORT_ULTRA_GROUP=35014]="METHOD_ONLY_SUPPORT_ULTRA_GROUP",F[F.DRAFT_SAVE_ERROR=35015]="DRAFT_SAVE_ERROR",F[F.DRAFT_REMOVE_ERROR=35016]="DRAFT_REMOVE_ERROR",F[F.CONVER_REMOVE_ERROR=35020]="CONVER_REMOVE_ERROR",F[F.CONVER_GET_ERROR=35021]="CONVER_GET_ERROR",F[F.SEARCH_PROPS_LIMIT_ERROR=35022]="SEARCH_PROPS_LIMIT_ERROR",F[F.INVALID_PARAMETER_MESSAGE_TYPE=35024]="INVALID_PARAMETER_MESSAGE_TYPE",F[F.INVALID_PARAMETER_ORDER=35025]="INVALID_PARAMETER_ORDER",F[F.INVALID_PARAMETER_DRAFT=35028]="INVALID_PARAMETER_DRAFT",F[F.INVALID_PARAMETER_MESSAGE=35029]="INVALID_PARAMETER_MESSAGE",F[F.INVALID_PARAMETER_PUSH_CONTENT=35030]="INVALID_PARAMETER_PUSH_CONTENT",F[F.INVALID_PARAMETER_SENDOPTIONS=35031]="INVALID_PARAMETER_SENDOPTIONS",F[F.INVALID_PARAMETER_CONTENT_DISPOSITION=35032]="INVALID_PARAMETER_CONTENT_DISPOSITION",F[F.INVALID_PARAMETER_SAVE_NAME=35033]="INVALID_PARAMETER_SAVE_NAME",F[F.INVALID_PARAMETER_SERVER_TYPE=35034]="INVALID_PARAMETER_SERVER_TYPE",F[F.INVALID_PARAMETER_CLEAN_SPACE=35035]="INVALID_PARAMETER_CLEAN_SPACE",F[F.INVALID_PARAMETER_CAN_INCLUDE_EXPANSION=35036]="INVALID_PARAMETER_CAN_INCLUDE_EXPANSION",F[F.INVALID_PARAMETER_DISABLE_NOTIFICATION=35037]="INVALID_PARAMETER_DISABLE_NOTIFICATION",F[F.INVALID_PARAMETER_CHECK_DUPLICATE=35038]="INVALID_PARAMETER_CHECK_DUPLICATE",F[F.INVALID_PARAMETER_IS_AUTO_DELETE=35039]="INVALID_PARAMETER_IS_AUTO_DELETE",F[F.INVALID_PARAMETER_IS_SEND_NOTIFICATION=35040]="INVALID_PARAMETER_IS_SEND_NOTIFICATION",F[F.INVALID_PARAMETER_IS_FORCE=35041]="INVALID_PARAMETER_IS_FORCE",F[F.INVALID_PARAMETER_IS_TOP=35042]="INVALID_PARAMETER_IS_TOP",F[F.INVALID_PARAMETER_IS_UPDATE_TIME=35043]="INVALID_PARAMETER_IS_UPDATE_TIME",F[F.INVALID_PARAMETER_CONTAIN_MUTED=35044]="INVALID_PARAMETER_CONTAIN_MUTED",F[F.INVALID_PARAMETER_IS_STATUS_MESSAGE=35045]="INVALID_PARAMETER_IS_STATUS_MESSAGE",F[F.INVALID_PARAMETER_IS_MENTIONED=35046]="INVALID_PARAMETER_IS_MENTIONED",F[F.INVALID_PARAMETER_IS_VOIP_PUSH=35047]="INVALID_PARAMETER_IS_VOIP_PUSH",F[F.INVALID_PARAMETER_MENTIONED_TYPE=35048]="INVALID_PARAMETER_MENTIONED_TYPE",F[F.INVALID_PARAMETER_PUSH_CONFIG=35049]="INVALID_PARAMETER_PUSH_CONFIG",F[F.INVALID_PARAMETER_PUSH_DATA=35050]="INVALID_PARAMETER_PUSH_DATA",F[F.DNS_PROXY_TIMEOUT=35051]="DNS_PROXY_TIMEOUT",F[F.DNS_PROXY_ERROR=35052]="DNS_PROXY_ERROR",F[F.DNS_PROXY_DATA_DESTRUCTUR_ERROR=35053]="DNS_PROXY_DATA_DESTRUCTUR_ERROR",F[F.INVALID_DISABLE_UPDATE_LAST_MESSAGE=35054]="INVALID_DISABLE_UPDATE_LAST_MESSAGE",F[F.ONLY_DEFAULT_CHANNEL_SUPPORTS_PINNING=35055]="ONLY_DEFAULT_CHANNEL_SUPPORTS_PINNING",F[F.SEND_READ_RECEIPT_CONF_ERROR=35056]="SEND_READ_RECEIPT_CONF_ERROR",F[F.CHATROOM_ID_ISNULL=36001]="CHATROOM_ID_ISNULL",F[F.CHARTOOM_JOIN_ERROR=36002]="CHARTOOM_JOIN_ERROR",F[F.CHATROOM_HISMESSAGE_ERROR=36003]="CHATROOM_HISMESSAGE_ERROR",F[F.CHATROOM_KV_NOT_FOUND=36004]="CHATROOM_KV_NOT_FOUND",F[F.BLACK_ADD_ERROR=37001]="BLACK_ADD_ERROR",F[F.BLACK_GETSTATUS_ERROR=37002]="BLACK_GETSTATUS_ERROR",F[F.BLACK_REMOVE_ERROR=37003]="BLACK_REMOVE_ERROR",F[F.DRAF_GET_ERROR=38001]="DRAF_GET_ERROR",F[F.STREAM_MESSAGE_DISABLE=39001]="STREAM_MESSAGE_DISABLE",F[F.STREAM_MESSAGE_REQUEST_COUNT_LIMIT_EXCEEDED=39002]="STREAM_MESSAGE_REQUEST_COUNT_LIMIT_EXCEEDED",F[F.STREAM_MESSAGE_EXPANSION_KEY_ERROR=39003]="STREAM_MESSAGE_EXPANSION_KEY_ERROR",F[F.STREAM_MESSAGE_REQUEST_FAIL=39005]="STREAM_MESSAGE_REQUEST_FAIL",F[F.STREAM_MESSAGE_REQUEST_IN_PROCESS=39006]="STREAM_MESSAGE_REQUEST_IN_PROCESS",F[F.STREAM_MESSAGE_SYNCED=39007]="STREAM_MESSAGE_SYNCED",F[F.QNTKN_GET_ERROR=41002]="QNTKN_GET_ERROR",F[F.TIMEOUT=-1]="TIMEOUT",exports.ConversationType=void 0,(B=exports.ConversationType||(exports.ConversationType={}))[B.NONE=0]="NONE",B[B.PRIVATE=1]="PRIVATE",B[B.DISCUSSION=2]="DISCUSSION",B[B.GROUP=3]="GROUP",B[B.CHATROOM=4]="CHATROOM",B[B.CUSTOMER_SERVICE=5]="CUSTOMER_SERVICE",B[B.SYSTEM=6]="SYSTEM",B[B.APP_PUBLIC_SERVICE=7]="APP_PUBLIC_SERVICE",B[B.PUBLIC_SERVICE=8]="PUBLIC_SERVICE",B[B.ULTRA_GROUP=10]="ULTRA_GROUP",B[B.RTC_ROOM=12]="RTC_ROOM";var q,Y,K,Q,W,J,z,Z,X,$,ee,te,re,ne,ie,oe,se,ae,ue,le,ce,de,pe,fe,he,ge=0,_e=1,be=2,Ee=3,ve=4,ye=function(e){var t=[exports.ConversationType.PRIVATE,exports.ConversationType.GROUP,exports.ConversationType.SYSTEM,exports.ConversationType.PUBLIC_SERVICE,exports.ConversationType.APP_PUBLIC_SERVICE];switch(e){case ge:return t;case _e:return[exports.ConversationType.PRIVATE,exports.ConversationType.GROUP];case be:return l(l([],u(t),!1),[exports.ConversationType.ULTRA_GROUP],!1);case Ee:return l(l([],u(t),!1),[exports.ConversationType.ULTRA_GROUP,exports.ConversationType.CHATROOM],!1);case ve:return l(l([],u(t),!1),[exports.ConversationType.ULTRA_GROUP,exports.ConversationType.CHATROOM,exports.ConversationType.RTC_ROOM,exports.ConversationType.CUSTOMER_SERVICE,exports.ConversationType.DISCUSSION],!1)}},me=function(e,t){return ye(t).includes(e)};!function(e){e[e.RMTP=1]="RMTP",e[e.TLS=2]="TLS",e[e.RPP=3]="RPP",e[e.QUIC=4]="QUIC",e[e.WS=5]="WS",e[e.WSS=6]="WSS",e[e.HTTP=11]="HTTP",e[e.HTTPS=12]="HTTPS"}(q||(q={})),exports.FileType=void 0,(Y=exports.FileType||(exports.FileType={}))[Y.IMAGE=1]="IMAGE",Y[Y.AUDIO=2]="AUDIO",Y[Y.VIDEO=3]="VIDEO",Y[Y.FILE=4]="FILE",Y[Y.SIGHT=5]="SIGHT",Y[Y.COMBINE_HTML=6]="COMBINE_HTML",exports.MentionedType=void 0,(K=exports.MentionedType||(exports.MentionedType={}))[K.ALL=1]="ALL",K[K.SINGAL=2]="SINGAL",exports.MessageType=void 0,(Q=exports.MessageType||(exports.MessageType={})).TextMessage="RC:TxtMsg",Q.VOICE="RC:VcMsg",Q.HQ_VOICE="RC:HQVCMsg",Q.IMAGE="RC:ImgMsg",Q.GIF="RC:GIFMsg",Q.RICH_CONTENT="RC:ImgTextMsg",Q.LOCATION="RC:LBSMsg",Q.FILE="RC:FileMsg",Q.SIGHT="RC:SightMsg",Q.COMBINE="RC:CombineMsg",Q.COMBINE_V2="RC:CombineV2Msg",Q.CHRM_KV_NOTIFY="RC:chrmKVNotiMsg",Q.LOG_COMMAND="RC:LogCmdMsg",Q.EXPANSION_NOTIFY="RC:MsgExMsg",Q.REFERENCE="RC:ReferenceMsg",Q.RECALL="RC:RcCmd",Q.RECALL_NOTIFICATION_MESSAGE="RC:RcNtf",Q.READ_RECEIPT="RC:ReadNtf",Q.READ_RECEIPT_REQUEST="RC:RRReqMsg",Q.READ_RECEIPT_RESPONSE="RC:RRRspMsg",Q.SYNC_READ_STATUS="RC:SRSMsg",Q.GROUP_READ_RECEIPT_REQUEST="RC:RRMsg",Q.READ_STATE="RC:RSMsg",Q.DELIVERED="RC:Delivered",Q.DELIVERED_MSG="RC:DRMsg",Q.CHATROOM_MERGE_CHANGE="RC:ChrmMemChange",Q.CHATROOM_SYNC_MSG="RC:ChrmSyncMsg",Q.CHATROOM_MERGE_BLOCK="RC:ChrmBlockMsg",Q.CHATROOM_MERGE_BAN="RC:ChrmBanMsg",Q.TYPING_STATUS="RC:TypSts",Q.INTERCEPT="RC:InterceptMsg",Q.CLOUD_CONTROL="RC:CCConfigChangeRequestMsg",Q.STREAM_MESSAGE="RC:StreamMsg",exports.UltraGroupChannelType=void 0,(W=exports.UltraGroupChannelType||(exports.UltraGroupChannelType={}))[W.PUBLIC=0]="PUBLIC",W[W.PRIVATE=1]="PRIVATE",exports.UltraGroupChannelChangeType=void 0,(J=exports.UltraGroupChannelChangeType||(exports.UltraGroupChannelChangeType={}))[J.PUBLIC_TO_PRIVATE=2]="PUBLIC_TO_PRIVATE",J[J.PRIVATE_TO_PUBLIC=3]="PRIVATE_TO_PUBLIC",J[J.PUBLIC_TO_PRIVATE_USER_NOT_IN=6]="PUBLIC_TO_PRIVATE_USER_NOT_IN",function(e){e[e.MSG_EXPANSION=1]="MSG_EXPANSION",e[e.MSG_MODIFY=2]="MSG_MODIFY",e[e.MSG_RECALL=3]="MSG_RECALL",e[e.CHANNEL_CHANGE=4]="CHANNEL_CHANGE",e[e.USER_GROUP_CHANGE=5]="USER_GROUP_CHANGE",e[e.UG_DEL=6]="UG_DEL"}(z||(z={})),function(e){e[e.CHANNEL_DELETE=1]="CHANNEL_DELETE",e[e.PUBLIC_TO_PRIVATE=2]="PUBLIC_TO_PRIVATE",e[e.PRIVATE_TO_PUBLIC=3]="PRIVATE_TO_PUBLIC",e[e.PRIVATE_CHANNEL_USER_JOIN_PUBLIC=4]="PRIVATE_CHANNEL_USER_JOIN_PUBLIC",e[e.CHANNEL_USER_KICKED=5]="CHANNEL_USER_KICKED",e[e.PUBLIC_TO_PRIVATE_USER_NOT_IN=6]="PUBLIC_TO_PRIVATE_USER_NOT_IN"}(Z||(Z={})),function(e){e[e.REMOVE_USER_GROUP=1]="REMOVE_USER_GROUP",e[e.JOIN_USER_GROUP=2]="JOIN_USER_GROUP",e[e.EXIT_USER_GROUP=3]="EXIT_USER_GROUP",e[e.CHANNEL_BIND_USER_GROUP=4]="CHANNEL_BIND_USER_GROUP",e[e.CHANNEL_UNBIND_USER_GROUP=5]="CHANNEL_UNBIND_USER_GROUP"}(X||(X={})),function(e){e[e.NOT_MENTIONED=0]="NOT_MENTIONED",e[e.ALL=1]="ALL",e[e.ME=2]="ME"}($||($={})),exports.SentStatus=void 0,(ee=exports.SentStatus||(exports.SentStatus={}))[ee.SENDING=10]="SENDING",ee[ee.FAILED=20]="FAILED",ee[ee.SENT=30]="SENT",ee[ee.RECEIVED=40]="RECEIVED",ee[ee.READ=50]="READ",ee[ee.DESTROYED=60]="DESTROYED",exports.OperateStatus=void 0,(te=exports.OperateStatus||(exports.OperateStatus={}))[te.typing=0]="typing",exports.OnlineStatus=void 0,(re=exports.OnlineStatus||(exports.OnlineStatus={}))[re.ONLINE=1]="ONLINE",re[re.OFFLINE=0]="OFFLINE",exports.PlatformInfo=void 0,(ne=exports.PlatformInfo||(exports.PlatformInfo={}))[ne.Other=0]="Other",ne[ne.iOS=1]="iOS",ne[ne.Android=2]="Android",ne[ne.Web=3]="Web",ne[ne.PC=4]="PC",ne[ne.Mini=5]="Mini",ne[ne.HarmonyOS=6]="HarmonyOS",exports.SubscribeType=void 0,(ie=exports.SubscribeType||(exports.SubscribeType={}))[ie.ONLINE_STATUS=1]="ONLINE_STATUS",ie[ie.USER_PROFILE=2]="USER_PROFILE",ie[ie.FRIEND_ONLINE_STATUS=3]="FRIEND_ONLINE_STATUS",ie[ie.FRIEND_USER_PROFILE=4]="FRIEND_USER_PROFILE",exports.SubscribeOperationType=void 0,(oe=exports.SubscribeOperationType||(exports.SubscribeOperationType={}))[oe.SUBSCRIBE=0]="SUBSCRIBE",oe[oe.UNSUBSCRIBE=1]="UNSUBSCRIBE",exports.UserProfileVisibility=void 0,(se=exports.UserProfileVisibility||(exports.UserProfileVisibility={}))[se.NOT_SET=0]="NOT_SET",se[se.INVISIBLE=1]="INVISIBLE",se[se.EVERYONE=2]="EVERYONE",se[se.FriendVisible=3]="FriendVisible",exports.RCConnectionStatus=void 0,(ae=exports.RCConnectionStatus||(exports.RCConnectionStatus={}))[ae.CONNECTED=0]="CONNECTED",ae[ae.CONNECTING=1]="CONNECTING",ae[ae.DISCONNECTED=2]="DISCONNECTED",ae[ae.SUSPENDED=3]="SUSPENDED",exports.MessageBlockType=void 0,(ue=exports.MessageBlockType||(exports.MessageBlockType={}))[ue.GLOBAL=1]="GLOBAL",ue[ue.CUSTOM=2]="CUSTOM",ue[ue.THIRD_PARTY=3]="THIRD_PARTY",exports.MessageBlockSourceType=void 0,(le=exports.MessageBlockSourceType||(exports.MessageBlockSourceType={}))[le.MSG_ORIGINAL=0]="MSG_ORIGINAL",le[le.MSG_EXPANSION=1]="MSG_EXPANSION",le[le.MSG_MODIFY=2]="MSG_MODIFY",exports.MessageDirection=void 0,(ce=exports.MessageDirection||(exports.MessageDirection={}))[ce.SEND=1]="SEND",ce[ce.RECEIVE=2]="RECEIVE",exports.PushImportanceHonor=void 0,(de=exports.PushImportanceHonor||(exports.PushImportanceHonor={})).NORMAL="NORMAL",de.LOW="LOW",function(e){e.IM_NAVI="IM-stats_navi-S",e.IM_WEBSOCKET="IM-stats_websocket-S",e.IM_CONNECTION_DURATION="IM-stats_con_dur-S",e.IM_CMP="IM-stats_cmp-S",e.IM_CMP_RMTP="IM-stats_cmp_rmtp-S",e.IM_STATS_CS="IM-stats_cs-S",e.IM_NETWORK_CHANGE="IM-stats_network_change-S",e.L_CLOUD_INFO_FETCH_T="L-cloud_info_fetch-T",e.L_CLOUD_INFO_FETCH_R="L-cloud_info_fetch-R",e.IM_MSG_SEND="IM-msg_send-S",e.IM_MSG_RECEIVE="IM-msg_receive-S"}(pe||(pe={})),exports.NotificationLevel=void 0,(fe=exports.NotificationLevel||(exports.NotificationLevel={}))[fe.ALL_MESSAGE=-1]="ALL_MESSAGE",fe[fe.NOT_SET=0]="NOT_SET",fe[fe.AT_MESSAGE_NOTIFICATION=1]="AT_MESSAGE_NOTIFICATION",fe[fe.AT_USER_NOTIFICATION=2]="AT_USER_NOTIFICATION",fe[fe.AT_GROUP_ALL_USER_NOTIFICATION=4]="AT_GROUP_ALL_USER_NOTIFICATION",fe[fe.NOT_MESSAGE_NOTIFICATION=5]="NOT_MESSAGE_NOTIFICATION",exports.NotificationStatus=void 0,(he=exports.NotificationStatus||(exports.NotificationStatus={}))[he.OPEN=1]="OPEN",he[he.CLOSE=2]="CLOSE";var Ie,Te,Re,Ce,Oe,Se,Ae,Pe,Ne,we,Me,Le=function(e){return e<=exports.NotificationLevel.NOT_SET?exports.NotificationStatus.CLOSE:exports.NotificationStatus.OPEN};exports.ReceivedStatus=void 0,(Ie=exports.ReceivedStatus||(exports.ReceivedStatus={}))[Ie.READ=1]="READ",Ie[Ie.LISTENED=2]="LISTENED",Ie[Ie.DOWNLOADED=4]="DOWNLOADED",Ie[Ie.RETRIEVED=8]="RETRIEVED",Ie[Ie.UNREAD=0]="UNREAD",function(e){e[e.PRIVATE=1]="PRIVATE",e[e.OPEN=0]="OPEN"}(Te||(Te={})),function(e){e[e.NAVI=1]="NAVI",e[e.TCP=2]="TCP",e[e.WS=3]="WS"}(Re||(Re={})),function(e){e[e.REQUEST=0]="REQUEST",e[e.LOCAL=1]="LOCAL"}(Ce||(Ce={})),function(e){e[e.CURRENT=2]="CURRENT"}(Oe||(Oe={})),function(e){e[e.CONNECT=0]="CONNECT",e[e.RECONNECT=1]="RECONNECT"}(Se||(Se={})),function(e){e[e.CONNECT=0]="CONNECT",e[e.RECONNECT=1]="RECONNECT",e[e.REDIRECTED=3]="REDIRECTED",e[e.TIMEOUT=4]="TIMEOUT"}(Ae||(Ae={})),exports.InterruptionLevel=void 0,(Pe=exports.InterruptionLevel||(exports.InterruptionLevel={})).PASSIVE="passive",Pe.ACTIVE="active",Pe.TIME_SENSITIVE="time-sensitive",Pe.CRITICAL="critical",exports.PushNotificationQuietHoursLevel=void 0,(Ne=exports.PushNotificationQuietHoursLevel||(exports.PushNotificationQuietHoursLevel={}))[Ne.PUSH_NOTIFICATION_QUIET_HOURS_LEVEL_DEFAULT=0]="PUSH_NOTIFICATION_QUIET_HOURS_LEVEL_DEFAULT",Ne[Ne.PUSH_NOTIFICATION_QUIET_HOURS_LEVEL_MENTION_MESSAGE=1]="PUSH_NOTIFICATION_QUIET_HOURS_LEVEL_MENTION_MESSAGE",Ne[Ne.PUSH_NOTIFICATION_QUIET_HOURS_LEVEL_BLOCKED=5]="PUSH_NOTIFICATION_QUIET_HOURS_LEVEL_BLOCKED",function(e){e.WIFI="wifi",e.FOUR_G="4g",e.THREE_G="3g",e.TWO_G="2g",e.FIVE_G="2g",e.THREE_GENT="3gnet",e.UNKONWN="unknown"}(we||(we={})),exports.HttpMethod=void 0,(Me=exports.HttpMethod||(exports.HttpMethod={})).GET="GET",Me.POST="POST",Me.PUT="PUT";var Ue=72e5,De=6e4,xe=131072,je="5.20.2-enterprise.12".replace(/-.+$/,""),Ve="rongcloudsystem",Ge=864e5,ke=function(e){return"navi_".concat(e)},Fe=function(e,t){return"RC-con-s-ver-".concat(e,"-").concat(t)},Be=function(e,t){return"RCV4-CONVER-".concat(e,"-").concat(t)},He=function(e,t){return"RCV4-ultragroupconversation-".concat(e,"-").concat(t)},qe=function(e,t){return"outbox_".concat(e,"_").concat(t)},Ye=function(e,t){return"inbox_".concat(e,"_").concat(t)},Ke=function(e,t){return"broadcastbox_".concat(e,"_").concat(t)},Qe=function(e,t){return"send_msg_".concat(e,"_").concat(t)},We=function(e,t){return"RC-us-".concat(e,"-").concat(t)},Je=function(e){return"rc-static-config-".concat(e)},ze=function(e){return"RC-cc-".concat(e)},Ze=function(e,t){return"RC-RR-".concat(e,"-").concat(t)},Xe=Math.pow(2,31)-1,$e="undefined"!=typeof window&&window?(window.__RCVersionInfo||(window.__RCVersionInfo={}),window.__RCVersionInfo):{};$e.engine="5.20.2-enterprise.12";var et=function(){function e(){}return Object.defineProperty(e,"add",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){["imlib-next","engine","electron-main","electron-renderer","imlib-v2-adapter","Global_IM_UIKit","IMKit","imkit-store","rtclib","calllib","callplus","plugin-wechat-rtc"].includes(e)&&($e[e]=t)}}),Object.defineProperty(e,"validEngine",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.match(/\d+\.\d+\.\d+/);if(!t)return!1;var r=t[0].split(".").map((function(e){return e.padStart(3,"0")})).join("");return $e.engine.match(/\d+\.\d+\.\d+/)[0].split(".").map((function(e){return e.padStart(3,"0")})).join("")>=r}}),Object.defineProperty(e,"getInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(){return $e}}),e}();var rt,nt={gen:function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var t=Math.floor(36*Math.random());return("x"===e?t:3&t|8).toString(36)}))},genWithLen:function(e){void 0===e&&(e=22);var t,r=Date.now(),n=r.toString(36),i=Math.floor(Math.random()*r).toString(36),o=e-n.length-i.length;return[i,n,o>0?(t=o,Array.from({length:t}).map((function(){return Math.floor(36*Math.random()).toString(36)})).join("")):""].join("").slice(0,e)}},it=nt.genWithLen(22),ot=Date.now(),st=function(e){function r(t){var r=e.call(this,t)||this;return r.name="CMSYError",r}return t(r,e),Object.defineProperty(r,"InvalidParameters",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return(null==e?void 0:e.length)?new r("Invalid parameter -> ".concat(e)):new r("Invalid parameters.")}}),Object.defineProperty(r,"ParameterTypeError",{enumerable:!1,configurable:!0,writable:!0,value:function(){return new r("Wrong parameter type")}}),r}(Error),at=function(){function e(){rt.set(this,!1)}return Object.defineProperty(e.prototype,"stopPropagation",{enumerable:!1,configurable:!0,writable:!0,value:function(){d(this,rt,!0,"f")}}),Object.defineProperty(e.prototype,"isStopPropagation",{get:function(){return c(this,rt,"f")},enumerable:!1,configurable:!0}),e}();rt=new WeakMap;var ut,lt,ct,dt,pt=function(){function e(){Object.defineProperty(this,"_map",{enumerable:!0,configurable:!0,writable:!0,value:new Map}),Object.defineProperty(this,"_piped",{enumerable:!0,configurable:!0,writable:!0,value:new Set})}return Object.defineProperty(e.prototype,"_addItem",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){void 0===i&&(i=0);var o=Symbol(),s=this._map.get(e)||this._map.set(e,[]).get(e),a={symbol:o,priority:Math.min(i,100),listener:t.bind(n),once:r},u=s.findIndex((function(e){return e.priority>i}));return-1===u?s.push(a):s.splice(u,0,a),o}}),Object.defineProperty(e.prototype,"on",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return void 0===n&&(n=0),this._addItem(e,t,!1,r,n)}}),Object.defineProperty(e.prototype,"once",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return void 0===n&&(n=0),this._addItem(e,t,!0,r,n)}}),Object.defineProperty(e.prototype,"off",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;try{for(var n=a(this._map),i=n.next();!i.done;i=n.next()){var o=u(i.value,2),s=(o[0],o[1]),l=s.findIndex((function(t){return t.symbol===e}));if(-1!==l)return void s.splice(l,1)}}catch(e){t={error:e}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(t)throw t.error}}}}),Object.defineProperty(e.prototype,"emit",{enumerable:!1,configurable:!0,writable:!0,value:function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];var n=this._map.get(e);if(n&&n.length>0)for(var i=new at,o=0;o<n.length;o+=1){var s=n[o],a=s.once,c=s.listener;a&&n.splice(o,1);try{c.apply(void 0,l([i],u(t),!1))}catch(e){null===console||void 0===console||console.error(e)}if(i.isStopPropagation)return}l([],u(this._piped.values()),!1).forEach((function(r){return r.emit.apply(r,l([e],u(t),!1))}))}}),Object.defineProperty(e.prototype,"removeAll",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._map.delete(e)}}),Object.defineProperty(e.prototype,"clear",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._piped.clear(),this._map.clear()}}),Object.defineProperty(e.prototype,"pipe",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._piped.add(e)}}),e}(),ft=function(){function e(e,t,r){Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"msg",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"isOk",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.isOk=0===e}return Object.defineProperty(e.prototype,"next",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){return s(this,(function(t){return this.isOk?[2,e(this.data)]:[2,this.wipe()]}))}))}}),Object.defineProperty(e.prototype,"or",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){return s(this,(function(t){return this.isOk?[2,this]:[2,e(this.code)]}))}))}}),Object.defineProperty(e.prototype,"orSync",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this.isOk?this:e(this.code)}}),Object.defineProperty(e.prototype,"trans",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this.isOk?ht(e(this.data)):this.wipe()}}),Object.defineProperty(e.prototype,"tryTrans",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this.isOk?e(this.data):this.wipe()}}),Object.defineProperty(e.prototype,"errmsg",{enumerable:!1,configurable:!0,writable:!0,value:function(){return JSON.stringify({code:this.code,msg:this.msg})}}),Object.defineProperty(e.prototype,"wipe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.isOk?ht(void 0,this.msg):gt(this.code,this.msg)}}),e}(),ht=function(e,t){return new ft(0,t||"success",e)},gt=function(e,t,r){return new ft(e,t||"fail: ".concat(e),r)},_t=function(){function e(e){var t=this;ut.add(this),Object.defineProperty(this,"_promise",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_resolve",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._promise=new Promise((function(e){t._resolve=e})),e&&c(this,ut,"m",lt).call(this,e)}return Object.defineProperty(e.prototype,"ok",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._resolve(ht(e))}}),Object.defineProperty(e.prototype,"fail",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._resolve(gt(e,"",t))}}),Object.defineProperty(e.prototype,"end",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._resolve(e)}}),Object.defineProperty(e.prototype,"result",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._promise}}),e}();ut=new WeakSet,lt=function(e){var t=this;e().then((function(e){return t._resolve(e)}))};var bt=function(e){function r(){var t=null!==e&&e.apply(this,arguments)||this;return ct.add(t),Object.defineProperty(t,"_versionQueue",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(t,"_pullingPromise",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(t,"_taskQueue",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(t,"_dataVersion",{enumerable:!0,configurable:!0,writable:!0,value:-1}),Object.defineProperty(t,"_invervalTimer",{enumerable:!0,configurable:!0,writable:!0,value:-1}),Object.defineProperty(t,"_started",{enumerable:!0,configurable:!0,writable:!0,value:!1}),t}return t(r,e),Object.defineProperty(r.prototype,"waitingQueueLength",{get:function(){return this._versionQueue.length},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"_isPulling",{get:function(){return null!==this._pullingPromise},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"setInitVersion",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){return s(this,(function(t){return-1!==this._dataVersion||(this._dataVersion=e),[2]}))}))}}),Object.defineProperty(r.prototype,"push",{enumerable:!1,configurable:!0,writable:!0,value:function(e){e<this._dataVersion||(this._versionQueue.push(e),-1!==this._dataVersion&&this._execPulling())}}),Object.defineProperty(r.prototype,"pushTask",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=new _t;return this._taskQueue.push({flag:r,handler:e,checkRetry:t,retryCount:0}),this._execPulling(),r.result()}}),Object.defineProperty(r.prototype,"_execPulling",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t,r,n,i,o,a;return s(this,(function(s){switch(s.label){case 0:return this._pullingPromise?[4,this._pullingPromise]:[3,2];case 1:return s.sent(),[2];case 2:return this._pullingPromise=this._handleSyncData(this._dataVersion),[4,this._pullingPromise];case 3:if(e=s.sent(),t=e.isOk,r=e.data,!t)return this._pullingPromise=null,[2];if(void 0===(null==r?void 0:r.version)||r.version<this._dataVersion)throw this._pullingPromise=null,new Error("version error, please check: lastVersion: ".concat(this._dataVersion,", newVersion: ").concat(null==r?void 0:r.version));return n=r.version,i=r.hasNext,o=this._versionQueue.filter((function(e){return e>n})),this._versionQueue=l([],u(o),!1),this._dataVersion=n,i?(this._pullingPromise=null,[2,this._execPulling()]):this._versionQueue.length>0?(this._versionQueue.length=0,this._pullingPromise=null,[2,this._execPulling()]):[4,c(this,ct,"m",dt).call(this)];case 4:return a=s.sent(),this._pullingPromise=null,a?[2,this._execPulling()]:[2]}}))}))}}),Object.defineProperty(r.prototype,"startInterval",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this;this._started||(this._started=!0,t&&this._execPulling(),this._invervalTimer=setInterval((function(){return r._execPulling()}),e))}}),Object.defineProperty(r.prototype,"stopInterval",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._started&&(this._started=!1,clearInterval(this._invervalTimer),this._invervalTimer=-1)}}),Object.defineProperty(r.prototype,"reset",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.stopInterval(),this._versionQueue.length=0,this._dataVersion=-1}}),r}(pt);ct=new WeakSet,dt=function(){return o(this,void 0,void 0,(function(){var e,t,r,n,i,o,a,u,l,c;return s(this,(function(s){switch(s.label){case 0:return 0===this._taskQueue.length?[2,!1]:(e=this._taskQueue.shift(),t=e.flag,r=e.handler,n=e.checkRetry,i=e.retryCount,[4,r(this._dataVersion)]);case 1:return(o=s.sent()).isOk?(a=o.data,u=a.version,l=a.data,t.ok(l),u>this._dataVersion&&(this._dataVersion=u),[2,!1]):((c=!!n&&n(o,i))&&(e.retryCount+=1,this._taskQueue.unshift(e)),[2,c])}}))}))};var Et=function(){function e(e,t){var r=this;Object.defineProperty(this,"_promise",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_resolve",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_onCancel",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._promise=new Promise((function(t){r._resolve=t,e(r._onResolve.bind(r))})),this._onCancel=t}return Object.defineProperty(e.prototype,"_onResolve",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._resolve(e)}}),Object.defineProperty(e.prototype,"result",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._promise}}),Object.defineProperty(e.prototype,"abort",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._onCancel(this._onResolve.bind(this))}}),e}();!function(){function e(e,t){var r=this;Object.defineProperty(this,"handler",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"validate",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"_data",{enumerable:!0,configurable:!0,writable:!0,value:new Set}),Object.defineProperty(this,"_handlerPromise",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_resolve",{enumerable:!0,configurable:!0,writable:!0,value:null}),this._handlerPromise=new Promise((function(e){r._resolve=e}))}Object.defineProperty(e.prototype,"add",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t;return o(this,void 0,void 0,(function(){return s(this,(function(r){if(!this._resolve)throw new Error("BatchSync is closed");return(null===(t=this.validate)||void 0===t?void 0:t.call(this,e))?(this._data.add(e),[2,this._handlerPromise]):[2]}))}))}}),Object.defineProperty(e.prototype,"start",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t;return s(this,(function(r){switch(r.label){case 0:if(!this._resolve)throw new Error("BatchSync is closed");return e=this._resolve,this._resolve=null,t=l([],u(this._data.values()),!1),this._data.clear(),t.length>0?[4,this.handler(t)]:[3,2];case 1:r.sent(),r.label=2;case 2:return e(),[2,Promise.resolve()]}}))}))}})}();var vt=function(){function e(e){Object.defineProperty(this,"_apiName",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"_isValid",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"_code",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_errmsg",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}return Object.defineProperty(e,"create",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return new e(t)}}),Object.defineProperty(e.prototype,"fail",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return this._isValid||0!==this._code||(this._code=e,this._errmsg=t||this._errmsg),this}}),Object.defineProperty(e.prototype,"result",{enumerable:!1,configurable:!0,writable:!0,value:function(){if(!this._isValid&&0===this._code)throw new Error("Validator: result() should not be called without fail()");return this._isValid?ht():gt(this._code,this._errmsg)}}),Object.defineProperty(e.prototype,"validate",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){if(void 0===n&&(n=!1),!this._isValid)return this;var i=n?r(t):null==t||r(t);return this._isValid=i,i||(this._errmsg="param '".concat(e,"' is invalid")),this}}),Object.defineProperty(e.prototype,"validate2",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){if(void 0===n&&(n=!1),!this._isValid)return this;if(!n&&null==t)return this;var i=r(t);return i.isOk||(this._isValid=!1,this.fail(i.code,i.msg||"param '".concat(e,"' is invalid"))),this}}),Object.defineProperty(e.prototype,"assert",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){if(void 0===n&&(n=!1),!this._isValid)return this;if(this.validate(e,t,r,n),!this._isValid)throw st.InvalidParameters("'".concat(e,"' at '").concat(this._apiName,"'"));return this}}),Object.defineProperty(e.prototype,"isString",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return void 0===r&&(r=!1),this.validate(e,t,(function(){return"string"==typeof t}),r)}}),Object.defineProperty(e.prototype,"assertString",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return void 0===r&&(r=!1),this.assert(e,t,(function(){return"string"==typeof t}),r)}}),Object.defineProperty(e.prototype,"isNotEmptyString",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return void 0===r&&(r=!1),this.isString(e,t,r).validate(e,t,(function(e){return e.trim().length>0}),r)}}),Object.defineProperty(e.prototype,"assertNotEmptyString",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return void 0===r&&(r=!1),this.assertString(e,t,r),this.assert(e,t,(function(e){return e.trim().length>0}),r)}}),Object.defineProperty(e.prototype,"isLimitedString",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){return void 0===i&&(i=!1),this.isString(e,t,i).validate(e,t,(function(e){return e.length>=r&&e.length<=n}),i)}}),Object.defineProperty(e.prototype,"assertLimitedString",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){return void 0===i&&(i=!1),this.assertString(e,t,i),this.assert(e,t,(function(e){return e.length>=r&&e.length<=n}),i)}}),Object.defineProperty(e.prototype,"isBoolean",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return void 0===r&&(r=!1),this.validate(e,t,(function(e){return"boolean"==typeof e}),r)}}),Object.defineProperty(e.prototype,"assertBoolean",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return void 0===r&&(r=!1),this.assert(e,t,(function(e){return"boolean"==typeof e}),r)}}),Object.defineProperty(e.prototype,"isNumber",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return void 0===r&&(r=!1),this.validate(e,t,(function(e){return"number"==typeof e&&!Number.isNaN(e)}),r)}}),Object.defineProperty(e.prototype,"assertNumber",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return void 0===r&&(r=!1),this.assert(e,t,(function(e){return"number"==typeof e&&!Number.isNaN(e)}),r)}}),Object.defineProperty(e.prototype,"isLimitedNumber",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){return void 0===i&&(i=!1),this.isNumber(e,t,i).validate(e,t,(function(e){return e>=r&&e<=n}),i)}}),Object.defineProperty(e.prototype,"assertLimitedNumber",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){return void 0===i&&(i=!1),this.assertNumber(e,t,i),this.assert(e,t,(function(e){return e>=r&&e<=n}),i)}}),Object.defineProperty(e.prototype,"isInteger",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return void 0===r&&(r=!1),this.validate(e,t,(function(e){return Number.isInteger(e)}),r)}}),Object.defineProperty(e.prototype,"assertInteger",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return void 0===r&&(r=!1),this.assert(e,t,(function(e){return Number.isInteger(e)}),r)}}),Object.defineProperty(e.prototype,"isLimitedInteger",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){return void 0===i&&(i=!1),this.isInteger(e,t,i).validate(e,t,(function(e){return e>=r&&e<=n}),i)}}),Object.defineProperty(e.prototype,"assertLimitedInteger",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){return void 0===i&&(i=!1),this.assertInteger(e,t,i),this.assert(e,t,(function(e){return e>=r&&e<=n}),i)}}),Object.defineProperty(e.prototype,"isArray",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return void 0===r&&(r=!1),this.validate(e,t,(function(e){return-1!==Object.prototype.toString.call(e).indexOf("Array")}),r)}}),Object.defineProperty(e.prototype,"assertArray",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return void 0===r&&(r=!1),this.assert(e,t,(function(e){return-1!==Object.prototype.toString.call(e).indexOf("Array")}),r)}}),Object.defineProperty(e.prototype,"isLimitedArray",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){return void 0===n&&(n=!1),void 0===i&&(i=1),this.isArray(e,t,n).validate(e,t,(function(e){return e.length>=i&&e.length<=r}),n)}}),Object.defineProperty(e.prototype,"assertLimitedArray",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){return void 0===n&&(n=!1),void 0===i&&(i=1),this.assertArray(e,t,n),this.assert(e,t,(function(e){return e.length>=i&&e.length<=r}),n)}}),Object.defineProperty(e.prototype,"isTypedArray",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return void 0===n&&(n=!1),this.isArray(e,t,n).validate(e,t,(function(e){return e.every(r)}),n)}}),Object.defineProperty(e.prototype,"assertTypedArray",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return void 0===n&&(n=!1),this.assertArray(e,t,n),this.assert(e,t,(function(e){return e.every(r)}),n)}}),Object.defineProperty(e.prototype,"isLimitedTypedArray",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i,o){return void 0===i&&(i=!1),void 0===o&&(o=1),this.isLimitedArray(e,t,r,i,o).validate(e,t,(function(e){return e.every(n)}),i)}}),Object.defineProperty(e.prototype,"assertLimitedTypedArray",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i,o){return void 0===i&&(i=!1),void 0===o&&(o=1),this.assertLimitedArray(e,t,r,i,o),this.assert(e,t,(function(e){return e.every(n)}),i)}}),Object.defineProperty(e.prototype,"isObject",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return void 0===r&&(r=!1),this.validate(e,t,(function(e){return"[object Object]"===Object.prototype.toString.call(e)}),r)}}),Object.defineProperty(e.prototype,"assertObject",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return void 0===r&&(r=!1),this.assert(e,t,(function(e){return"[object Object]"===Object.prototype.toString.call(e)}),r)}}),Object.defineProperty(e.prototype,"isValueOf",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return void 0===n&&(n=!1),this.validate(e,t,(function(){return Object.values(r).includes(t)}),n)}}),Object.defineProperty(e.prototype,"assertValueOf",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return void 0===n&&(n=!1),this.assert(e,t,(function(){return Object.values(r).includes(t)}),n)}}),Object.defineProperty(e.prototype,"isFunction",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return void 0===r&&(r=!1),this.validate(e,t,(function(e){return"function"==typeof e}),r)}}),Object.defineProperty(e.prototype,"assertFunction",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return void 0===r&&(r=!1),this.assert(e,t,(function(e){return"function"==typeof e}),r)}}),e}(),yt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function mt(e){var t,r,n,i,o,s,a="",u=0;for(e=e.replace(/[^A-Za-z0-9+/=]/g,"");u<e.length;)t=yt.indexOf(e.charAt(u++))<<2|(i=yt.indexOf(e.charAt(u++)))>>4,r=(15&i)<<4|(o=yt.indexOf(e.charAt(u++)))>>2,n=(3&o)<<6|(s=yt.indexOf(e.charAt(u++))),a+=String.fromCharCode(t),64!==o&&(a+=String.fromCharCode(r)),64!==s&&(a+=String.fromCharCode(n));return a}var It=function(){var e,t=new Promise((function(t){e=t}));return{resolve:e,promise:t}},Tt=function(e){return"string"==typeof e},Rt=function(e){return"number"==typeof e&&!Number.isNaN(e)},Ct=function(e){return function(t){return Number.isInteger(t)&&(void 0===e.min||t>=e.min)&&(void 0===e.max||t<=e.max)}},Ot=function(e){return-1!==Object.prototype.toString.call(e).indexOf("Array")},St=function(e){return function(t){return Tt(t)&&(void 0===e.isTrim||0===t.length||t.trim().length>0)&&(void 0===e.minLength||t.length>=e.minLength)&&(void 0===e.maxLength||t.length<=e.maxLength)&&(void 0===e.validator||e.validator(t))}},At=function(e){return Tt(e)&&e.length>0},Pt=function(e){return"[object Object]"===Object.prototype.toString.call(e)},Nt=function(e){return"function"==typeof e},wt=function(e){return void 0===e||"[object Undefined]"===Object.prototype.toString.call(e)},Mt=function(e){return Tt(e)&&/https?:\/\//.test(e)},Lt=function(e){for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!0;return!1},Ut=function(e){return Rt(e)&&Object.prototype.hasOwnProperty.call(exports.ConversationType,e)},Dt=function(e){var t=!1;return Tt(e)&&!/_/g.test(e)&&e.length<=20&&(t=!0),t},xt=function(e){return St({minLength:1,maxLength:64})(e)},jt=function(e){var t=!1,r=!1,n=!1;if(Pt(e)){var i=Object.keys(e).length;for(var o in t=i>20,e)if(r||(r=Tt(o)&&!/^[A-Za-z0-9_=+-]+$/.test(o)),!n){var s=e[o];n=o.length>32||s.length>4096}}return{isExceedLimit:t,isIllgalEx:r,isExKeyOrValLengthExceedLimit:n}},Vt=function(e,t,r){return Gt(vt.create(e),t,r)},Gt=function(e,t,r){return e.isObject("conversatino",t,!0).fail(exports.ErrorCode.INVALID_PARAMETER_CONVERSATION).validate("conversationType",null==t?void 0:t.conversationType,(function(){return me(t.conversationType,r)}),!0).fail(exports.ErrorCode.INVALID_PARAMETER_CONVERSATION_TYPE).validate("targetId",null==t?void 0:t.targetId,xt,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TARGET_ID).validate("channelId",null==t?void 0:t.channelId,Dt).fail(exports.ErrorCode.INVALID_PARAMETER_CHANNEL_ID)},kt=function(e){if(!Pt(e)||void 0===e.low||void 0===e.high)return e;var t=e.low;return t<0&&(t+=4294967296),t=t.toString(16),parseInt(e.high.toString(16)+"00000000".replace(new RegExp("0{".concat(t.length,"}$")),t),16)},Ft=function(){return"undefined"!=typeof RCCppEngine},Bt=function(e){return{isRead:(e&exports.ReceivedStatus.READ)===exports.ReceivedStatus.READ,isListened:(e&exports.ReceivedStatus.LISTENED)===exports.ReceivedStatus.LISTENED,isDownload:(e&exports.ReceivedStatus.DOWNLOADED)===exports.ReceivedStatus.DOWNLOADED,isRetrieved:(e&exports.ReceivedStatus.RETRIEVED)===exports.ReceivedStatus.RETRIEVED}},Ht=function(e){return[exports.PlatformInfo.Android,exports.PlatformInfo.iOS,exports.PlatformInfo.Web,exports.PlatformInfo.PC,exports.PlatformInfo.Mini,exports.PlatformInfo.HarmonyOS].map((function(t){var r=e.findIndex((function(e){return e.platform===t}));return-1===r?{platform:t,changeTime:0,eventValue:0}:e[r]}))},qt=function(e,t,r){var n=t.reduce((function(e,t){return["gender","role","level"].includes(t.key)?e[t.key]=Number(t.value):e[t.key]=t.value,e}),{});return n.userId=e,r.forEach((function(e){n.extraProfile=n.extraProfile||{},n.extraProfile[e.key]=e.value})),n},Yt=function(e,t,r){return t?1===r?q.TLS:q.RMTP:"http"===e?q.WS:q.WSS},Kt=function(e,t){var r=e.server,n=e.backupServer,i=e.bs,o=e.serverAddr,s=e.protocol,a=e.openTLS;if(o)return l([],u(o.filter((function(e){return e.addr}))),!1);var c=[],d=[];return r&&d.push(r),(n||i||"").split(",").forEach((function(e){d.indexOf(e)<0&&d.push(e)})),d.forEach((function(e,n){e&&c.push({addr:e,protocol:Yt(s,t,a),weight:r.length-n,race:!1})})),l([],u(c),!1)},Qt=function(e){return void 0===e&&(e=[]),e.map((function(e){var t,r,n,i,o,s,a,u,l,c=Xt(e.settingProfile)||{},d=e.extProfile||[],p=e.targetId,f=e.baseInfo,h=e.userInfo;return{groupId:p,groupName:null!==(t=c.name)&&void 0!==t?t:"",portraitUri:null!==(r=c.portraitUrl)&&void 0!==r?r:"",introduction:null!==(n=c.introduction)&&void 0!==n?n:"",notice:null!==(i=c.announcement)&&void 0!==i?i:"",extProfile:Xt(d),joinPermission:~~c.joinPerm,removeMemberPermission:~~c.removePerm,invitePermission:~~c.memInvitePerm,inviteHandlePermission:~~c.invitePerm,groupInfoEditPermission:~~c.profilePerm,memberInfoEditPermission:~~c.memProfilePerm,creatorId:null!==(o=null==f?void 0:f.creatorId)&&void 0!==o?o:"",ownerId:null!==(s=null==f?void 0:f.ownerId)&&void 0!==s?s:"",createTime:(null==f?void 0:f.createTime)?kt(f.createTime):0,membersCount:null!==(a=null==f?void 0:f.memberCount)&&void 0!==a?a:0,remark:null!==(u=null==h?void 0:h.remarkName)&&void 0!==u?u:"",joinedTime:(null==h?void 0:h.joinTime)?kt(h.joinTime):0,role:null!==(l=null==h?void 0:h.role)&&void 0!==l?l:exports.GroupMemberRole.UNDEF}}))},Wt=function(e){return void 0===e&&(e=[]),e.map((function(e){var t=Xt(e.settingProfile),r=e.extProfile||[],i=e.targetId,o=e.baseInfo,s=e.userInfo;return JSON.parse(JSON.stringify(n(n({groupId:i},zt(t)),{extProfile:r.length>0?Xt(r):void 0,creatorId:null==o?void 0:o.creatorId,ownerId:null==o?void 0:o.ownerId,createTime:(null==o?void 0:o.createTime)?kt(o.createTime):void 0,membersCount:null==o?void 0:o.memberCount,remark:null==s?void 0:s.remarkName})))}))},Jt=function(e){if(void 0!==e){var t=Number(e);return Number.isNaN(t)?void 0:t}},zt=function(e){return JSON.parse(JSON.stringify({groupName:e.name,portraitUri:e.portraitUrl,introduction:e.introduction,notice:e.announcement,joinPermission:Jt(e.joinPerm),removeMemberPermission:Jt(e.removePerm),invitePermission:Jt(e.memInvitePerm),inviteHandlePermission:Jt(e.invitePerm),groupInfoEditPermission:Jt(e.profilePerm),memberInfoEditPermission:Jt(e.memProfilePerm)}))},Zt=function(e){void 0===e&&(e=[]);var t=e.map((function(e){var t=e||{},r=t.ext,n=t.userId,i=t.name,o=t.portraitUrl,s=r||{},a=s.role,u=s.joinTime,l=s.channelNickName,c=s.additional;return{userId:n,name:i||"",portraitUri:o||"",nickname:l||"",role:a||exports.GroupMemberRole.UNDEF,joinedTime:kt(u)||0,extra:c||""}}));return t},Xt=function(e){var t={};return e&&0!==e.length?(e.forEach((function(e){t[e.key]=e.value})),t):t},$t=function(e){var t,r,n,i;return{userId:e.userId,name:e.name||"",portraitUri:e.portraitUrl||"",nickname:null===(t=e.ext)||void 0===t?void 0:t.channelNickName,extra:null===(r=e.ext)||void 0===r?void 0:r.additional,role:null===(n=e.ext)||void 0===n?void 0:n.role,joinedTime:null===(i=e.ext)||void 0===i?void 0:i.joinTime}},er=function(e){var t=e.joinUserInfo,r=e.inviterInfo,n=e.processInfo;return{groupId:e.targetId,joinMemberInfo:$t(t),inviterInfo:r&&r.userId?$t(r):void 0,operatorInfo:n&&n.userId?$t(n):void 0,status:e.status,direction:e.directionType,type:e.joinType,operationTime:e.applyTime||0,reason:e.detail||""}},tr=function(e,t){if(e=e.replace(/\?$/,""),!t)return e;var r=Object.keys(t).map((function(e){return"".concat(e,"=").concat(t[e])})).filter((function(e){return!!e}));return r.length?[e,r.join("&")].join("?"):e};function rr(e){for(var t=null===window||void 0===window?void 0:window.atob(e),r=new Uint8Array(t.length),n=0;n<t.length;n++)r[n]=t.charCodeAt(n);return r.buffer}var nr,ir=function(e,t){var r=Math.floor(1e3*Math.random()%1e4),n=nt.gen(),i=function(e){e=e||"-";var t=new Date,r=t.getFullYear(),n=t.getMonth()+1,i=t.getDate();return"".concat(r).concat(e).concat(n).concat(e).concat(i)}(),o=(new Date).getTime(),s="";if(t){var a=t.split(".");s=".".concat(a[a.length-1])}return"".concat(e,"__RC-").concat(i,"_").concat(r,"_").concat(o).concat(n).concat(s)},or=function(e,t,r){void 0===e&&(e=0);var i=function(e){return{isVoipPush:!!(1&e),isFilerWhiteBlacklist:!!(2&e),disablePushTitle:!!(4&e),forceShowDetailContent:!!(8&e)}}(e),o=i.disablePushTitle,s=i.forceShowDetailContent,a=sr(null==r?void 0:r.pushConfigs,null==r?void 0:r.pushId);return n({pushTitle:(null==r?void 0:r.title)||"",pushContent:t||"",pushData:"",disablePushTitle:o,forceShowDetailContent:s,templateId:null==r?void 0:r.templateId},a)},sr=function(e,t){var r={},n={notificationId:t||""},i={};if(!e)return{iOSConfig:r,androidConfig:n,harmonyOSConfig:i};try{var o=JSON.parse(e);null==o||o.forEach((function(e){var t,o,s,a,u,l,c,d,p,f,h,g,_=Object.keys(e);if(0!==_.length){var b=_[0];switch(b){case"HW":return n.channelIdHW=null===(t=e[b])||void 0===t?void 0:t.channelId,n.importanceHW=null===(o=e[b])||void 0===o?void 0:o.importance,n.imageUrlHW=null===(s=e[b])||void 0===s?void 0:s.image,void(n.categoryHW=null===(a=e[b])||void 0===a?void 0:a.category);case"MI":return void(n.channelIdMi=null===(u=e[b])||void 0===u?void 0:u.channelId);case"OPPO":return void(n.channelIdOPPO=null===(l=e[b])||void 0===l?void 0:l.channelId);case"VIVO":return n.typeVivo=null===(c=e[b])||void 0===c?void 0:c.classification,void(n.categoryVivo=null===(d=e[b])||void 0===d?void 0:d.category);case"APNS":return r.threadId=e[b]["thread-id"],r.apnsCollapseId=e[b]["apns-collapse-id"],r.category=e[b].category,r.richMediaUri=e[b].richMediaUri,void(r.interruptionLevel=e[b]["interruption-level"]);case"FCM":return void(n.googleConfig={collapseKey:e[b].collapse_key||"",imageUrl:e[b].imageUrl||"",priority:e[b].priority||""});case"HONOR":return n.importanceHonor=null===(p=e[b])||void 0===p?void 0:p.importance,void(n.imageUrlHonor=null===(f=e[b])||void 0===f?void 0:f.image);case"OHOS":i.category=null===(h=e[b])||void 0===h?void 0:h.category,i.image=null===(g=e[b])||void 0===g?void 0:g.image}}}))}catch(e){}return{iOSConfig:r,androidConfig:n,harmonyOSConfig:i}},ar=function(e){var t=/^[A-Za-z0-9_=+-]+$/.test(e),r=e.length;return t&&(r<=128&&r>=1)},ur=function(e){var t=e.length;return t<=4096&&t>=1},lr=(nr=0,function(){var e=((4294967295&Date.now())>>>0).toString(2),t=Math.floor(Math.random()*(Math.pow(2,8)-1)),r=e+nr.toString(2).padStart(11,"0")+t.toString(2).padStart(8,"0");return nr=2047&++nr,parseInt(r,2)}),cr=function(){var e=et.getInfo(),t="electron";for(var r in e)"engine"!==r&&(t=["imlib-v2-adapter","imlib-next"].includes(r)?r:"electron");return t},dr=function(e,t,r){return o(void 0,void 0,void 0,(function(){var n,i;return s(this,(function(o){switch(o.label){case 0:return[4,window.crypto.subtle.importKey("raw",(new TextEncoder).encode(t),"AES-CBC",!0,["decrypt"])];case 1:return n=o.sent(),[4,window.crypto.subtle.decrypt({name:"AES-CBC",iv:(new TextEncoder).encode(r)},n,rr(e))];case 2:return i=o.sent(),[2,(new TextDecoder).decode(i)]}}))}))};function pr(e,t){var r;if(!e)return"";var n="undefined"!=typeof window&&"https:"===(null===(r=null===window||void 0===window?void 0:window.location)||void 0===r?void 0:r.protocol);return/^https?:\/\//.test(e)?n?e.replace(/^https?:\/\//i,"https://"):e:t!==q.HTTP||n?"https://".concat(e):"http://".concat(e)}var fr,hr,gr,_r=function(e,t){if(!e)return"";var r=e.ossConfig,n=void 0===r?"":r,i="";try{var o=JSON.parse(n);if(o.length>0){var s=o.find((function(e){return e.minio}));s&&(i=s.minio)}}catch(e){t.warn(H.L_PARSE_JSON_E,JSON.stringify({ossConfig:n,error:e}))}return i};function br(e){var t=e.method||exports.HttpMethod.GET,r=e.timeout||De,n=e.headers,i=e.query,o=e.body,s=e.onProgress,a=tr(e.url,i),u=new XMLHttpRequest;if(u.open(t,a),n&&u.setRequestHeader)for(var l in n)u.setRequestHeader(l,n[l]);return function(e,t,r,n){return new Et((function(i){e.onreadystatechange=function(){4===e.readyState&&i({data:e.responseText,status:e.status,xhr:e})},e.onerror=function(){i({status:e.status})},n&&(e.upload.onprogress=function(e){return n(e)}),0!==t&&setTimeout((function(){e.abort(),i({status:e.status})}),t),e.send(r)}),(function(t){e.abort(),t({status:-1})}))}(u,r,o,s)}!function(e){e[e.add=1]="add",e[e.update=2]="update",e[e.delete=3]="delete"}(fr||(fr={})),exports.AreaCode=void 0,(gr=exports.AreaCode||(exports.AreaCode={}))[gr.BJ=1]="BJ",gr[gr.SG=2]="SG",gr[gr.NA=3]="NA",gr[gr.SG_A=4]="SG_A",gr[gr.SG_B=4]="SG_B",gr[gr.SA=5]="SA",(hr={})[exports.AreaCode.BJ]={naviUrlBase64:["ZHVhbHN0YWNrLW5hdi5yb25nLWVkZ2UuY29t","bmF2LWIucm9uZy1lZGdlLmNvbQ=="],logUrlBase64:[{addr:"ZHVhbHN0YWNrLWNvbGxlY3Rpb24ucm9uZy1lZGdlLmNvbQ==",protocol:q.HTTPS,weight:-1}],miniCmpBase64:["ZHVhbHN0YWNrLXdzLnJvbmctZWRnZS5jb20=","d3MtYi5yb25nLWVkZ2UuY29t"],staticConfigUrlBase64:["aHR0cHM6Ly9ib290c3RyYXBwcm9maWxlLWMtMS5vc3MtY24tYmVpamluZy5hbGl5dW5jcy5jb20="],cloudControllerUrlBase64:["ZHVhbHN0YWNrLWNsb3VkY29udHJvbC5yb25nLWVkZ2UuY29t","Y2xvdWRjb250cm9sLWIucm9uZy1lZGdlLmNvbQ=="],statsUrlBase64:["aHR0cHM6Ly9zdGF0cy5yb25nLWVkZ2UuY29t"]},hr[exports.AreaCode.SG]={naviUrlBase64:["ZHVhbHN0YWNrLW5hdi5zZy1saWdodC1lZGdlLmNvbQ==","bmF2LWIuc2ctbGlnaHQtZWRnZS5jb20="],logUrlBase64:[{addr:"ZHVhbHN0YWNrLWNvbGxlY3Rpb24uc2ctbGlnaHQtZWRnZS5jb20=",protocol:q.HTTPS,weight:-1}],miniCmpBase64:["ZHVhbHN0YWNrLXdzLnNnLWxpZ2h0LWVkZ2UuY29t","d3MtYi5zZy1saWdodC1lZGdlLmNvbQ=="],staticConfigUrlBase64:["aHR0cHM6Ly9ib290c3RyYXBwcm9maWxlLWItMi5zMy5hcC1zb3V0aGVhc3QtMS5hbWF6b25hd3MuY29t"],cloudControllerUrlBase64:["ZHVhbHN0YWNrLWNsb3VkY29udHJvbC5zZy1saWdodC1lZGdlLmNvbQ==","Y2xvdWRjb250cm9sLWIuc2ctbGlnaHQtZWRnZS5jb20="],statsUrlBase64:["aHR0cHM6Ly9zdGF0cy5zZy1saWdodC1lZGdlLmNvbQ=="]},hr[exports.AreaCode.NA]={naviUrlBase64:["ZHVhbHN0YWNrLW5hdi51cy1saWdodC1lZGdlLmNvbQ==","bmF2LWIudXMtbGlnaHQtZWRnZS5jb20="],logUrlBase64:[{addr:"ZHVhbHN0YWNrLWNvbGxlY3Rpb24udXMtbGlnaHQtZWRnZS5jb20=",protocol:q.HTTPS,weight:-1}],miniCmpBase64:["ZHVhbHN0YWNrLXdzLnVzLWxpZ2h0LWVkZ2UuY29t","d3MtYi51cy1saWdodC1lZGdlLmNvbQ=="],staticConfigUrlBase64:[],cloudControllerUrlBase64:["ZHVhbHN0YWNrLWNsb3VkY29udHJvbC51cy1saWdodC1lZGdlLmNvbQ==","Y2xvdWRjb250cm9sLWIudXMtbGlnaHQtZWRnZS5jb20="],statsUrlBase64:["aHR0cHM6Ly9zdGF0cy51cy1saWdodC1lZGdlLmNvbQ=="]},hr[exports.AreaCode.SG_B]={naviUrlBase64:["bmF2LnNnLWItbGlnaHQtZWRnZS5jb20=","bmF2LWIuc2ctYi1saWdodC1lZGdlLmNvbQ=="],logUrlBase64:[{addr:"Y29sbGVjdGlvbi5zZy1iLWxpZ2h0LWVkZ2UuY29t",protocol:q.HTTPS,weight:-1}],miniCmpBase64:["ZHVhbHN0YWNrLXdzLnNnLWItbGlnaHQtZWRnZS5jb20=","d3MtYi5zZy1iLWxpZ2h0LWVkZ2UuY29t"],staticConfigUrlBase64:[],cloudControllerUrlBase64:["ZHVhbHN0YWNrLWNsb3VkY29udHJvbC5zZy1iLWxpZ2h0LWVkZ2UuY29t","Y2xvdWRjb250cm9sLWIuc2ctYi1saWdodC1lZGdlLmNvbQ=="],statsUrlBase64:["aHR0cHM6Ly9zdGF0cy5zZy1iLWxpZ2h0LWVkZ2UuY29t"]},hr[exports.AreaCode.SA]={naviUrlBase64:["ZHVhbHN0YWNrLW5hdi5zYXUtbGlnaHQtZWRnZS5jb20=","bmF2LWIuc2F1LWxpZ2h0LWVkZ2UuY29t"],logUrlBase64:[{addr:"ZHVhbHN0YWNrLWNvbGxlY3Rpb24uc2F1LWxpZ2h0LWVkZ2UuY29t",protocol:q.HTTPS,weight:-1}],miniCmpBase64:["ZHVhbHN0YWNrLXdzLnNhdS1saWdodC1lZGdlLmNvbQ==","d3MtYi5zYXUtbGlnaHQtZWRnZS5jb20="],staticConfigUrlBase64:[],cloudControllerUrlBase64:["ZHVhbHN0YWNrLWNsb3VkY29udHJvbC5zYXUtbGlnaHQtZWRnZS5jb20=","Y2xvdWRjb250cm9sLWIuc2F1LWxpZ2h0LWVkZ2UuY29t"],statsUrlBase64:["aHR0cHM6Ly9zdGF0cy5zYXUtbGlnaHQtZWRnZS5jb20="]};var Er,vr=function(){function e(){Object.defineProperty(this,"initOption",{enumerable:!0,configurable:!0,writable:!0,value:{}})}return Object.defineProperty(e.prototype,"init",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this.initOption=e}}),Object.defineProperty(e.prototype,"getNaviUrlList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this.initOption||{};r.areaCode;var n=r.navigators,i=[].map((function(e){return mt(e)})),o=[],s=u(e.split("@"),2)[1];t&&(o=s?s.split(";"):[]);var a=n&&n.length>0?l(l([],u(o),!1),u(n),!1):l(l([],u(o),!1),u(i),!1);return a.filter((function(e,t){return a.indexOf(e)===t})).map((function(e){return pr(e)}))}}),Object.defineProperty(e.prototype,"getLogUrlPolicyList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=e||{},i=r.log,o=r.logPolicy,s=this.initOption||{};s.areaCode;var a=s.logServerUrl,c=[].map((function(e){return n(n({},e),{addr:mt(e.addr)})})),d=[],p={level:1,itv:6,times:5};if(i)d.push.apply(d,l([],u(i.addrs),!1)),Object.assign(p,i.policy);else if(o)try{var f=JSON.parse(o);d.push({addr:f.url,protocol:q.HTTPS,weight:1}),p.level=f.level,p.itv=f.itv,p.times=f.times}catch(r){t.warn(H.L_REPORT_LOG_POLICY_E,JSON.stringify({policy:e.logPolicy}))}var h=a?l([{addr:a,protocol:q.HTTPS,weight:101}],u(d),!1):l(l([],u(d),!1),u(c),!1);return{policy:p,addrs:h.filter((function(e,t){return h.findIndex((function(t){return t.addr===e.addr&&t.protocol===e.protocol}))===t})).map((function(e){return n(n({},e),{addr:pr(e.addr,e.protocol)})})).sort((function(e,t){return t.weight-e.weight}))}}}),Object.defineProperty(e.prototype,"getMiniCmpUrlList",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e,t=(null===(e=this.initOption)||void 0===e||e.areaCode,[]).map((function(e){return mt(e)})),r=(this.initOption||{}).miniCMPProxy;return r&&r.length>0?r:t}}),Object.defineProperty(e.prototype,"getStaticConfigUrl",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e;return(null===(e=this.initOption)||void 0===e||e.areaCode,[]).map((function(e){return mt(e)}))}}),Object.defineProperty(e.prototype,"getCloudControllerUrl",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t;return null!=e||null===(t=this.initOption)||void 0===t||t.areaCode,[].map((function(e){return mt(e)}))}}),Object.defineProperty(e.prototype,"getAreaCode",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e,t;return null!==(t=null===(e=this.initOption)||void 0===e?void 0:e.areaCode)&&void 0!==t?t:exports.AreaCode.BJ}}),Object.defineProperty(e.prototype,"setAreaCode",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return!(!e||!exports.AreaCode[e]||e===this.initOption.areaCode)&&(this.initOption.areaCode=e,!0)}}),Object.defineProperty(e.prototype,"getStatsUrlList",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r=e||{},n=r.active,i=r.activeServer,o=(null==n?void 0:n.addrs)||[],s=(null===(t=this.initOption)||void 0===t||t.areaCode,[]).map((function(e){return mt(e)})),a=[];return 0!==o.length?a.push.apply(a,l([],u(o.sort((function(e,t){return t.weight-e.weight})).map((function(e){return pr(e.addr,e.protocol)}))),!1)):i&&a.push(pr(i,q.HTTPS)),s.forEach((function(e){a.includes(e)||a.push(e)})),a}}),e}(),yr=new vr,mr=function(){function e(e,t){Object.defineProperty(this,"appkey",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"logger",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"staticUrls",{enumerable:!0,configurable:!0,writable:!0,value:[]})}return Object.defineProperty(e.prototype,"getStaticConfig",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e;return o(this,void 0,void 0,(function(){var t,r,n,i,o,a,u,l;return s(this,(function(s){switch(s.label){case 0:if(!(t=this.getCache()))return[3,6];s.label=1;case 1:return s.trys.push([1,4,,5]),r=JSON.parse(t),Date.now()-(null==r?void 0:r.time)<18e5?[4,this.decryptData(r.val)]:[3,3];case 2:return n=s.sent(),(i=n.resources.navi.slice()).sort((function(e,t){return t.weight-e.weight})),[2,{navi:i.map((function(e){return pr(e.addr,e.protocol)}))||[]}];case 3:return[3,5];case 4:return o=s.sent(),this.logger.error(H.L_GET_STATIC_CONF_E,JSON.stringify({error:null==o?void 0:o.stack})),[3,5];case 5:this.clearCache(),s.label=6;case 6:return[4,this._requestHandle()];case 7:return(a=s.sent())?[4,this.decryptData(a)]:[2];case 8:return(null==(u=s.sent())?void 0:u.areaCode)!==yr.getAreaCode()?[2]:(this.setCache(JSON.stringify({time:Date.now(),val:a})),this.staticUrls=(null==u?void 0:u.bootstrap)||[],(l=null===(e=null==u?void 0:u.resources)||void 0===e?void 0:e.navi.slice()).sort((function(e,t){return t.weight-e.weight})),[2,{navi:l.map((function(e){return pr(e.addr,e.protocol)}))||[]}])}}))}))}}),Object.defineProperty(e.prototype,"_requestHandle",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t,r,n,i,o,c,d,p,f,h;return s(this,(function(s){switch(s.label){case 0:e=(e=l(l([],u(this.staticUrls),!1),u(yr.getStaticConfigUrl()),!1).map((function(e){return pr(e)}))).filter((function(t,r){return e.indexOf(t)===r})),s.label=1;case 1:s.trys.push([1,6,7,8]),t=a(e),r=t.next(),s.label=2;case 2:return r.done?[3,5]:(n=r.value,this.logger.info(H.L_GET_STATIC_CONF_T,JSON.stringify({url:n})),i=Date.now(),[4,this.sendRequest("".concat(n,"/").concat(this.appkey))]);case 3:if(o=s.sent(),c=o.code,d=o.data,200===c)return this.logger.info(H.L_GET_STATIC_CONF_R,JSON.stringify({url:n,code:c,duration:Date.now()-i})),[2,d];this.logger.warn(H.L_GET_STATIC_CONF_R,JSON.stringify({url:n,code:c,duration:Date.now()-i})),s.label=4;case 4:return r=t.next(),[3,2];case 5:return[3,8];case 6:return p=s.sent(),f={error:p},[3,8];case 7:try{r&&!r.done&&(h=t.return)&&h.call(t)}finally{if(f)throw f.error}return[7];case 8:return[2]}}))}))}}),e}();exports.LogL=void 0,(Er=exports.LogL||(exports.LogL={}))[Er.STATISTICS=-2]="STATISTICS",Er[Er.RECORD=-1]="RECORD",Er[Er.FATAL=0]="FATAL",Er[Er.ERROR=1]="ERROR",Er[Er.WARN=2]="WARN",Er[Er.INFO=3]="INFO",Er[Er.DEBUG=4]="DEBUG";var Ir,Tr=function(){function e(e,t,r){Object.defineProperty(this,"_appkey",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"_id",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"_type",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"outputLevel",{enumerable:!0,configurable:!0,writable:!0,value:exports.LogL.WARN}),Object.defineProperty(this,"debug",{enumerable:!0,configurable:!0,writable:!0,value:this._log.bind(this,exports.LogL.DEBUG)}),Object.defineProperty(this,"info",{enumerable:!0,configurable:!0,writable:!0,value:this._log.bind(this,exports.LogL.INFO)}),Object.defineProperty(this,"warn",{enumerable:!0,configurable:!0,writable:!0,value:this._log.bind(this,exports.LogL.WARN)}),Object.defineProperty(this,"error",{enumerable:!0,configurable:!0,writable:!0,value:this._log.bind(this,exports.LogL.ERROR)}),Object.defineProperty(this,"__statistics",{enumerable:!0,configurable:!0,writable:!0,value:this._log.bind(this,exports.LogL.STATISTICS)}),Object.defineProperty(this,"record",{enumerable:!0,configurable:!0,writable:!0,value:this.__statistics})}return Object.defineProperty(e.prototype,"_write",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.tag,r=e.level,n=e.content,i=e.traceId;/^[\w-]+$/.test(t)?r!==exports.LogL.DEBUG&&this._handleWrite(e):console.error("".concat((new Date).toISOString(),"[").concat(this._id,"]['ERROR']: ").concat(t," | ").concat(n," | ").concat(i))}}),Object.defineProperty(e.prototype,"createTraceId",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"".concat(++e._traceIdCount)}}),Object.defineProperty(e.prototype,"getSessionId",{enumerable:!1,configurable:!0,writable:!0,value:function(){return it}}),Object.defineProperty(e.prototype,"_stdout",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.time,r=e.tag,n=e.content,i=e.traceId,o=e.level,s=e.loggerId;if(console&&!(o<=exports.LogL.FATAL||o>this.outputLevel)){var a=["error","warn","info","debug"][o-1],u="".concat(new Date(t).toISOString(),"[").concat(null!=s?s:this._id,"][").concat((a||"stat").toUpperCase(),"]: ").concat(r," | ").concat(n," | ").concat(i);console[a||"warn"](u)}}}),Object.defineProperty(e.prototype,"setOutputLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e){(function(e){return[exports.LogL.DEBUG,exports.LogL.INFO,exports.LogL.WARN,exports.LogL.ERROR].some((function(t){return t===e}))})(e)&&(this.outputLevel=e)}}),Object.defineProperty(e.prototype,"_log",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){var i={time:Date.now(),level:e,tag:t,content:r,traceId:n,loggerId:this._id,sessionId:this.getSessionId(),type:this._type};this._stdout(i),this._write(i)}}),Object.defineProperty(e.prototype,"summary",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,i,o,s){if(void 0===i&&(i={}),t.isOk){var a=null==o?void 0:o(t.data);this.info(e,JSON.stringify(n(n({isOk:!0},i),a)),r)}else{a=null==s?void 0:s(t.data);this.warn(e,JSON.stringify(n(n({code:t.code,msg:t.msg},i),a)),r)}}}),Object.defineProperty(e,"_traceIdCount",{enumerable:!0,configurable:!0,writable:!0,value:0}),e}(),Rr=function(){function e(e,t,r,n,i,o){void 0===o&&(o=!1),Object.defineProperty(this,"appkey",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"deviceId",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"deviceInfo",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"logDB",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(this,"logger",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"disableLogReport",{enumerable:!0,configurable:!0,writable:!0,value:o}),Object.defineProperty(this,"userId",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(this,"timer",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"started",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"reportFailedNumber",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"itvByNavi",{enumerable:!0,configurable:!0,writable:!0,value:6}),Object.defineProperty(this,"timesByNavi",{enumerable:!0,configurable:!0,writable:!0,value:5})}return Object.defineProperty(e.prototype,"checkStart",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i;return s(this,(function(o){return this.started?[2]:(this.userId=e.userId,!e.logSwitch||this.disableLogReport||(r=yr.getLogUrlPolicyList(e,this.logger),n=r.policy,i=r.addrs,this.started=!0,this.itvByNavi=n.itv,this.timesByNavi=n.times,i.length>0&&this.realtimeReport(i[0].addr,n.level,n.itv,t)),[2])}))}))}}),Object.defineProperty(e.prototype,"_sendLogs2Realtime",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return o(this,void 0,void 0,(function(){var i,o,a,u,l,c,d,p,f,h;return s(this,(function(s){switch(s.label){case 0:return this.logger.debug(H.L_REALTIME_LOG_O,"compress logs: ".concat(e.length)),[4,this.compressLogs(e)];case 1:return i=s.sent(),o=i.success,a=i.data,o?(this.logger.debug(H.L_REALTIME_LOG_O,"compress done",t),u=Mt(r)?r:"https://".concat(r),u+="?version=".concat("5.20.2-enterprise.12","&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:a,method:"POST"})]):(this.logger.warn(H.L_REALTIME_LOG_R,"compress failed",t),[2,{isOk:!1,itv:n}]);case 2:if(l=s.sent(),c=l.status,d=l.data,this.logger.debug(H.L_REALTIME_LOG_R,JSON.stringify({status:c,data:d}),t),200!==c)return this.reportFailedNumber>this.timesByNavi&&this.itvByNavi<60&&(n+=n),this.reportFailedNumber++,[2,{isOk:!1,itv:n}];if(this.reportFailedNumber=0,d)try{(h=JSON.parse(d)).nextTime&&(n=h.nextTime),p=h.level,f=h.logSwitch}catch(e){this.logger.warn(H.L_PARSE_JSON_E,JSON.stringify({error:null==e?void 0:e.stack}),t)}return[2,{isOk:!0,itv:n,level:p,logSwitch:f}]}}))}))}}),Object.defineProperty(e.prototype,"realtimeReport",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return o(this,void 0,void 0,(function(){var i,o,a,c,d,p,f,h,g,_,b,E,v=this;return s(this,(function(s){switch(s.label){case 0:return i=Date.now(),o=this.logDB.getTimestamp4RealtimeLog()||ot,a=Math.max(i-3e4,o+1),c=this.logger.createTraceId(),this.logger.debug(H.L_REALTIME_LOG_T,JSON.stringify({startTime:o,endTime:a,level:t,itv:r}),c),[4,this.logDB.getLogs(o,a,t,!0,n)];case 1:return d=s.sent(),p=d.dbReady,f=d.logs,p?[3,2]:(this.logger.warn(H.L_REALTIME_LOG_R,"get logs failed",c),[3,5]);case 2:return 0!==f.length?[3,3]:(this.logger.debug(H.L_REALTIME_LOG_R,"no logs",c),[3,5]);case 3:return f.length>0?[4,this._sendLogs2Realtime(f,c,e,r)]:[3,5];case 4:h=s.sent(),g=h.itv,_=h.level,b=h.logSwitch,h.isOk&&(E=Math.max.apply(Math,l([],u(f.map((function(e){return e.time}))),!1)),this.logDB.setTimestamp4RealtimeLog(E+1),0===b&&(this.started=!1),void 0!==_&&(t=_)),r=g,s.label=5;case 5:return this.started&&(r>=60&&this.itvByNavi<60&&(r=60),this.timer=setTimeout((function(){return v.realtimeReport(e,t,r,n)}),1e3*r)),[2]}}))}))}}),Object.defineProperty(e.prototype,"report",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i,a,u){return void 0===u&&(u=!1),o(this,void 0,void 0,(function(){var o,l,c,d,p,f,h,g,_,b;return s(this,(function(s){switch(s.label){case 0:return"web"!==r.toLowerCase()||this.disableLogReport?[2]:(o=this.logger.createTraceId(),this.logger.info(H.L_REPORT_FULL_LOG_T,JSON.stringify({startTime:e,endTime:t,logId:i,messageUId:a,isCloudControl:u}),o),[4,this.logDB.getLogs(e,t,exports.LogL.DEBUG,!1)]);case 1:return l=s.sent(),c=l.dbReady,d=l.logs,this.logger.info(H.L_REPORT_FULL_LOG_O,JSON.stringify({count:d.length}),o),p=Mt(n)?n:"https://".concat(n),p+="?version=".concat("5.20.2-enterprise.12","&appkey=").concat(this.appkey,"&userId=").concat(encodeURIComponent(this.userId),"&deviceId=").concat(this.deviceId,"&deviceInfo=").concat(this.deviceInfo,"&platform=Web&logId=").concat(i),c?d.length>0?[4,this.compressLogs(d)]:[3,3]:[3,5];case 2:return h=s.sent(),g=h.success,_=h.data,f=g?_:"compress failed",[3,4];case 3:f="no data",s.label=4;case 4:return[3,6];case 5:f="no database",s.label=6;case 6:return this.logger.debug(H.L_REPORT_FULL_LOG_O,"compress done",o),u&&(p+="&source=cloud"),[4,this.send({url:p,body:f,method:"POST"})];case 7:return b=s.sent().status,this.logger.info(H.L_REPORT_FULL_LOG_R,JSON.stringify({status:b}),o),[2]}}))}))}}),Object.defineProperty(e.prototype,"stop",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.timer&&(clearTimeout(this.timer),this.timer=null),this.started=!1}}),e}(),Cr=function(e){var t=e.sessionId,r=e.level,n=e.loggerId,i=e.traceId,o=e.time,s=e.tag,a=e.type,u=e.content;Tt(u)||(u=JSON.stringify(u));var l=r<0?u||"":JSON.stringify({content:u,traceId:i,from:n});return l='"'.concat(l.replace(/"/g,'""'),'"'),"".concat(t,",").concat(o,",").concat(a,",").concat(r,",").concat(s,",").concat(l,"\n")},Or=function(){function e(){}var t,r,n,i,o,s;return Object.defineProperty(e,"start",{enumerable:!1,configurable:!0,writable:!0,value:function(e){c(this,t,"f",r)||(d(this,t,e,"f",r),e.info(H.L_EVENT_LOOP_BLOCKING_S,"start"),c(this,t,"m",s).call(this))}}),Object.defineProperty(e,"stop",{enumerable:!1,configurable:!0,writable:!0,value:function(){c(this,t,"f",r)&&(c(this,t,"f",r).info(H.L_EVENT_LOOP_BLOCKING_S,"stop"),d(this,t,null,"f",r),c(this,t,"f",n)&&(clearTimeout(c(this,t,"f",n)),d(this,t,null,"f",n)))}}),t=e,s=function e(){var s=this,a=Date.now();d(this,t,setTimeout((function(){var n=Date.now()-a;n>=c(s,t,"f",o)&&c(s,t,"f",r).warn(H.L_EVENT_LOOP_BLOCKING_S,"delta time: ".concat(n,"ms")),c(s,t,"m",e).call(s)}),c(this,t,"f",i)),"f",n)},r={value:null},n={value:null},i={value:30},o={value:1500},e}();!function(e){e[e.init=1]="init",e[e.newWorkChange=2]="newWorkChange",e[e.other=3]="other"}(Ir||(Ir={}));var Sr=function(){function e(e){Object.defineProperty(this,"reporter",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"logId",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(this,"uploadTask",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"taskLock",{enumerable:!0,configurable:!0,writable:!0,value:!0})}return Object.defineProperty(e.prototype,"uploadLogCmdTask",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this.uploadTask.push(e),this.enqueueTask()}}),Object.defineProperty(e.prototype,"reportLogCmdTask",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r,n,i,o=this;this.taskLock=!1;var s=null!==(t=e.startTime)&&void 0!==t?t:0,a=null!==(r=e.endTime)&&void 0!==r?r:0,u=null!==(n=e.platform)&&void 0!==n?n:"",l=null!==(i=e.uri)&&void 0!==i?i:"";e.logId!==this.logId&&""!==l&&(this.logId=e.logId,this.reporter.report(s,a,u,l,e.logId,"",!0).finally((function(){o.taskLock=!0,o.uploadTask.length>0&&o.enqueueTask()})))}}),Object.defineProperty(e.prototype,"enqueueTask",{enumerable:!1,configurable:!0,writable:!0,value:function(){if(this.taskLock){var e=this.uploadTask.shift();e&&this.reportLogCmdTask(e)}}}),e}();var Ar,Pr,Nr,wr,Mr=function(){function e(e,t,r){Object.defineProperty(this,"logger",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"appkey",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"reporter",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"isEable",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"expire",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"interval",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"timestamp",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"lastRequestTime",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"uploadTaskManage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"changeAreaCode",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_cache",{enumerable:!0,configurable:!0,writable:!0,value:null}),this.uploadTaskManage=new Sr(r)}return Object.defineProperty(e.prototype,"init",{enumerable:!1,configurable:!0,writable:!0,value:function(){try{var e=this.getLocalCloudControllerCache();this._cache=e?JSON.parse(e):{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(e){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)))}}),Object.defineProperty(e.prototype,"isExire",{enumerable:!1,configurable:!0,writable:!0,value:function(){return(new Date).getTime()-this.timestamp<this.expire}}),Object.defineProperty(e.prototype,"isOverclock",{enumerable:!1,configurable:!0,writable:!0,value:function(){return(new Date).getTime()-this.lastRequestTime<this.interval}}),Object.defineProperty(e.prototype,"logCmdMsgTasks",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;e.uploadLog&&e.uploadLog.tasks.forEach((function(e){e.objectName===exports.MessageType.LOG_COMMAND&&t.uploadTaskManage.uploadLogCmdTask(e)}))}}),Object.defineProperty(e.prototype,"dataHandle",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this._cache;t.lastRequestTime=this.lastRequestTime,Lt(e)&&(t.timestamp=e.timestamp,e.uploadLog&&!e.uploadLog.temporary&&(t.uploadLog=e.uploadLog),e.cc&&!e.cc.temporary&&(t.cc=e.cc),e.mrtr&&!e.mrtr.temporary&&(t.mrtr=this._handleMrtrData(e.mrtr)),e.mrtr&&this.setMRTRConfig(this._handleMrtrData(e.mrtr))),this.setCloudControllerCache(t),this.expire=t.cc.expire,this.interval=t.cc.interval,this.timestamp=t.timestamp,this.logCmdMsgTasks(e)}}),Object.defineProperty(e.prototype,"request",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n,i,o,a,u,l,c,d,p,f;return s(this,(function(s){switch(s.label){case 0:return!this.isEable&&t===Ir.init&&this.isExire()?(this.logger.info(H.L_CLOUD_DISABLED,JSON.stringify({msg:"cloud controller is disabled"})),[2,this.timestamp]):!this.isEable&&t===Ir.newWorkChange&&this.isOverclock()?(this.logger.info(H.L_CLOUD_OVERCLOCK,JSON.stringify({msg:"cloud controller is overclock"})),[2,this.timestamp]):(n=pr(e),this.lastRequestTime=(new Date).getTime(),i="".concat(n,"/v1/config"),o={"Content-Type":"application/json","RC-App-Key":this.appkey},r&&(o["RC-Token"]=r),a={platform:"web",version:"5.20.2-enterprise.12",timestamp:this.timestamp},this.logger.record(pe.L_CLOUD_INFO_FETCH_T,JSON.stringify({appKey:this.appkey,timestamp:this.timestamp,token:!!r,uri:i})),[4,this.httpRequest(i,exports.HttpMethod.POST,o,a)]);case 1:return u=s.sent(),l=u.code,c=u.data,this.logger.record(pe.L_CLOUD_INFO_FETCH_R,JSON.stringify({appkey:this.appkey,info:c})),l===exports.ErrorCode.CLOUD_DATA_CENTER_INVALID&&c&&c.targetRegion?(d=c.targetRegion,this.changeAreaCode===d?[2,this.timestamp]:(p=yr.setAreaCode(d),this.logger.info(H.L_CLOUD_SET_AREA_CODE_O,JSON.stringify({isChangeSuccess:p,originAreaCode:yr.getAreaCode(),newAreaCode:d})),this.changeAreaCode=d,(f=yr.getCloudControllerUrl(d))[0]?[2,this.request(f[0],Ir.other)]:(this.logger.info(H.L_CLOUD_APPKEY_REGION_E,JSON.stringify({appkey:this.appkey,uri:i,msg:"appkey region error"})),[2,this.timestamp]))):(c&&this.dataHandle(c),[2,this.timestamp||this.lastRequestTime])}}))}))}}),Object.defineProperty(e.prototype,"_handleMrtrData",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return{chatroom:(null==e?void 0:e.chatroom)||0,group:(null==e?void 0:e.group)||0,private:(null==e?void 0:e.private)||0,ultraGroup:(null==e?void 0:e.ultraGroup)||0,temporary:!!(null==e?void 0:e.temporary)}}}),e}(),Lr=function(e){return e===exports.ErrorCode.RC_CONN_REDIRECTED},Ur=function(e){function r(t,r,n){var i=e.call(this)||this;return Ar.add(i),Object.defineProperty(i,"appkey",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(i,"navi",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(i,"logger",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(i,"_fromSuspend",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(i,"token",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(i,"curCmpUrl",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(i,"retryCount",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(i,"uuid",{enumerable:!0,configurable:!0,writable:!0,value:""}),wr.set(i,0),Object.defineProperty(i,"_doConnectReason",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(i,"_network",{enumerable:!0,configurable:!0,writable:!0,value:{status:!0,type:we.UNKONWN}}),Object.defineProperty(i,"_checkAliveTimer",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(i,"_crtConnectionStatus",{enumerable:!0,configurable:!0,writable:!0,value:exports.RCConnectionStatus.DISCONNECTED}),Object.defineProperty(i,"_crtUserId",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(i,"_openCallPlus",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(i,"cmpWeightCache",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(i,"_crtConnectionTask",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(i,"reconnectTimer",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(i,"_failedCount",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(i,"ALLOW_FAILED_TIMES",{enumerable:!0,configurable:!0,writable:!0,value:2}),i}return t(r,e),Object.defineProperty(r.prototype,"getToken",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.token}}),Object.defineProperty(r.prototype,"cid",{get:function(){return"".concat(this.uuid,"_").concat(this.retryCount)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"getCurrentUserId",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._crtUserId}}),Object.defineProperty(r.prototype,"setConnectionStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){if(this._crtConnectionStatus!==e){if(this._crtConnectionStatus===exports.RCConnectionStatus.DISCONNECTED&&e===exports.RCConnectionStatus.CONNECTING&&(this._doConnectReason=Ae.CONNECT,c(this,Ar,"m",Nr).call(this)),this._crtConnectionStatus===exports.RCConnectionStatus.CONNECTED&&e===exports.RCConnectionStatus.SUSPENDED&&(t===exports.ErrorCode.RC_PING_EXCEED_LIMIT?this._doConnectReason=Ae.TIMEOUT:t===exports.ErrorCode.RC_CONN_REDIRECTED?this._doConnectReason=Ae.REDIRECTED:this._doConnectReason=Ae.RECONNECT),this._crtConnectionStatus===exports.RCConnectionStatus.CONNECTED){var r={bid:cr(),cod:t,net:this.getNetwork().type,dur:Date.now()-c(this,wr,"f"),cid:this.cid};this.logger.record(pe.IM_CONNECTION_DURATION,JSON.stringify(r)),e===exports.RCConnectionStatus.SUSPENDED&&c(this,Ar,"m",Nr).call(this)}switch(this._crtConnectionStatus=e,e){case exports.RCConnectionStatus.CONNECTED:this.logger.info(H.L_CONNECT_S,"status: ".concat(e)),this.checkAlive(),c(this,Ar,"m",Pr).call(this).emit("onConnected",this._fromSuspend);break;case exports.RCConnectionStatus.CONNECTING:this.logger.warn(H.L_CONNECT_S,"status: ".concat(e)),c(this,Ar,"m",Pr).call(this).emit("onConnecting");break;case exports.RCConnectionStatus.SUSPENDED:this._fromSuspend=!0,this.logger.warn(H.L_CONNECT_S,"status: ".concat(e,", code: ").concat(t)),Lr(t)&&this.clearCmpWeightCache(),this._checkAliveTimer&&clearTimeout(this._checkAliveTimer),c(this,Ar,"m",Pr).call(this).emit("onSuspend",t);break;default:this._fromSuspend=!1,this._crtUserId="",this.logger.warn(H.L_CONNECT_S,"status: ".concat(e,", code: ").concat(t)),this.clearCmpWeightCache(),this._checkAliveTimer&&clearTimeout(this._checkAliveTimer),c(this,Ar,"m",Pr).call(this).emit("onDisconnected",t)}}}}),Object.defineProperty(r.prototype,"getConnectionStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._crtConnectionStatus}}),Object.defineProperty(r.prototype,"isConnected",{get:function(){return this._crtConnectionStatus===exports.RCConnectionStatus.CONNECTED},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"setNetwork",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){if(!t){var r={cid:this.cid,cn:e.type,on:this._network.type};this.logger.record(pe.IM_NETWORK_CHANGE,JSON.stringify(r))}this._network=e}}),Object.defineProperty(r.prototype,"getNetwork",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._network}}),Object.defineProperty(r.prototype,"connect",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return o(this,void 0,void 0,(function(){var i,o,a;return s(this,(function(s){switch(s.label){case 0:return this._crtConnectionStatus===exports.RCConnectionStatus.CONNECTED?[2,ht(this._crtUserId)]:this._crtConnectionTask?[2,this._crtConnectionTask]:(this._openCallPlus=r,this.token=e,this.setConnectionStatus(exports.RCConnectionStatus.CONNECTING),[4,this.try2Connect(e,t,!1,n,!0)]);case 1:return i=s.sent(),o=i.code,a=i.data,o!==exports.ErrorCode.SUCCESS?(this.setConnectionStatus(exports.RCConnectionStatus.DISCONNECTED,o),[2,gt(o)]):(this.setConnectionStatus(exports.RCConnectionStatus.CONNECTED),[2,ht(a)])}}))}))}}),Object.defineProperty(r.prototype,"try2Connect",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){return o(this,void 0,void 0,(function(){var o;return s(this,(function(s){switch(s.label){case 0:return this._crtConnectionTask?[2,this._crtConnectionTask]:(this._crtConnectionTask=this.createConnectionTask(e,t,r,n,i),[4,this._crtConnectionTask]);case 1:return o=s.sent(),this._crtConnectionTask=null,[2,o]}}))}))}}),Object.defineProperty(r.prototype,"createConnectionTask",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){return o(this,void 0,void 0,(function(){var o,a,u,l,c,p,f,h,g,_;return s(this,(function(s){switch(s.label){case 0:return o={cid:this.cid,reason:this._doConnectReason,net:this.getNetwork().type,spr:1,sts:Date.now(),timelimit:0},this.logger.record(pe.IM_STATS_CS,JSON.stringify(o)),a={retryCount:this.retryCount,uuid:this.uuid,type:this.getNetwork().type,reason:this._doConnectReason},[4,this.navi.request(e,r,!1,n,a)];case 1:return u=s.sent(),l=u.code,c=u.data,l!==exports.ErrorCode.SUCCESS?[2,gt(l)]:(p=c,this.logger.info(H.L_CONNECT_T,JSON.stringify({token:e,reconnectKickEnable:t}),n),[4,this._connectWithToken(e.replace(/@.+$/,"@"),p,t,n)]);case 2:return f=s.sent(),h=f.code,g=f.data,i||h===exports.ErrorCode.SUCCESS||(this.retryCount+=1),Lr(h)?(this.logger.warn(H.L_CONNECT_R,"redirect code: ".concat(h),n),this.clearCmpWeightCache(),[2,this.createConnectionTask(e,t,!0,n,i)]):[exports.ErrorCode.RC_TCP_RESET,exports.ErrorCode.RC_CONN_ACK_TIMEOUT,exports.ErrorCode.RC_TCP_DISCONNECTED_NO_RMTP,exports.ErrorCode.CONNECTION_REFUSED].includes(h)&&this.cmpWeightCache&&this.cmpWeightCache.length>1?(this.updateCmpWeight(this.curCmpUrl,!1),_=this.cmpWeightCache.every((function(e){return e.failed})),i&&_?(this.logger.warn(H.L_CONNECT_R,"cpp code:".concat(h,",reture code:").concat(exports.ErrorCode.SERVER_UNAVAILABLE),n),[2,gt(exports.ErrorCode.SERVER_UNAVAILABLE)]):(this.logger.warn(H.L_CONNECT_R,"cmp ack timeout, code: ".concat(h),n),this.setConnectionStatus(exports.RCConnectionStatus.SUSPENDED,h),this.setConnectionStatus(exports.RCConnectionStatus.CONNECTING),[2,this.createConnectionTask(e,t,!1,n,i)])):h!==exports.ErrorCode.SUCCESS?(this.logger.warn(H.L_CONNECT_R,"code: ".concat(h),n),[2,gt(h)]):(this.logger.info(H.L_CONNECT_R,"userId: ".concat(g),n),d(this,wr,Date.now(),"f"),this._crtUserId=g,[2,ht(g)])}}))}))}}),Object.defineProperty(r.prototype,"try2Reconnect",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i=this;return s(this,(function(a){return r=this.logger.createTraceId(),this.logger.debug(H.T,"try2Reconnect -> ignoreNaviCache: ".concat(e,", reason: ").concat(t),r),this.stopReconnectTimer(),n=function(){return o(i,void 0,void 0,(function(){var i;return s(this,(function(o){switch(o.label){case 0:return this._crtConnectionStatus!==exports.RCConnectionStatus.SUSPENDED?[2]:(this.setConnectionStatus(exports.RCConnectionStatus.CONNECTING,t),[4,this.try2Connect(this.token,!0,e,r,!1)]);case 1:return i=o.sent().code,this.reconnectTimer=null,i===exports.ErrorCode.SUCCESS?(this.setConnectionStatus(exports.RCConnectionStatus.CONNECTED),[2]):[exports.ErrorCode.SERVER_UNAVAILABLE,exports.ErrorCode.TIMEOUT,exports.ErrorCode.RC_SOCKET_DISCONNECTED,exports.ErrorCode.RC_SOCKET_NOT_CREATED,exports.ErrorCode.RC_CONN_ACK_TIMEOUT,exports.ErrorCode.RC_TCP_RESET,exports.ErrorCode.RC_NAVI_REQ_FAILED,exports.ErrorCode.RC_NETWORK_DOWN,exports.ErrorCode.RC_TCP_DISCONNECTED_NO_RMTP].includes(i)?(this._crtConnectionStatus!==exports.RCConnectionStatus.CONNECTING||(this.setConnectionStatus(exports.RCConnectionStatus.SUSPENDED,i),this.reconnectTimer=setTimeout(n,5e3)),[2]):(this.setConnectionStatus(exports.RCConnectionStatus.DISCONNECTED,i),[2])}}))}))},n(),[2]}))}))}}),Object.defineProperty(r.prototype,"onDisconnectByServer",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this;return Lr(e)?(this.setConnectionStatus(exports.RCConnectionStatus.SUSPENDED,e),void this.try2Reconnect(!0,e)):e===exports.ErrorCode.RC_UDP_DISCONNECTED?(this.setConnectionStatus(exports.RCConnectionStatus.SUSPENDED,e),void setTimeout((function(){r.try2Reconnect(!0,e)}),1e3*(t||0))):void this.setConnectionStatus(exports.RCConnectionStatus.DISCONNECTED,e)}}),Object.defineProperty(r.prototype,"onDisconenctUnusual",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this.setConnectionStatus(exports.RCConnectionStatus.SUSPENDED,e),this.try2Reconnect(!1,e)}}),Object.defineProperty(r.prototype,"checkAlive",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t,r=this;return s(this,(function(n){switch(n.label){case 0:return this._crtConnectionStatus!==exports.RCConnectionStatus.CONNECTED?(this._failedCount=0,this.logger.debug(H.L_CHECK_ALIVE_IM_S,"stop ping because of no connection"),[2]):(e=this.logger.createTraceId(),this.logger.debug(H.L_CHECK_ALIVE_IM_T,null,e),[4,this.sendPing(15e3)]);case 1:return(t=n.sent())===exports.ErrorCode.SUCCESS?(this.logger.debug(H.L_CHECK_ALIVE_IM_R,t,e),this._failedCount=0,this._checkAliveTimer=setTimeout((function(){return r.checkAlive()}),15e3),[2]):this._crtConnectionStatus!==exports.RCConnectionStatus.CONNECTED?[2]:(this._failedCount+=1,this.logger.debug(H.L_CHECK_ALIVE_IM_R,"code: ".concat(t,", count: ").concat(this._failedCount),e),this._failedCount<this.ALLOW_FAILED_TIMES?[2,this.checkAlive()]:(this._failedCount=0,this.logger.warn(H.L_CHECK_ALIVE_IM_S,"ping timeout, close connection to reconnect!"),[4,this.close(!0)]));case 2:return n.sent(),this.setConnectionStatus(exports.RCConnectionStatus.SUSPENDED,exports.ErrorCode.RC_PING_EXCEED_LIMIT),this.try2Reconnect(!1,exports.ErrorCode.RC_PING_EXCEED_LIMIT),[2]}}))}))}}),Object.defineProperty(r.prototype,"disconnect",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){return s(this,(function(r){switch(r.label){case 0:return this.stopReconnectTimer(),this._crtConnectionTask?[4,this._crtConnectionTask]:[3,2];case 1:r.sent(),r.label=2;case 2:return this.setConnectionStatus(exports.RCConnectionStatus.DISCONNECTED,exports.ErrorCode.ACTIVE_DISCONNECT),[2,this.close(!1,e,t)]}}))}))}}),Object.defineProperty(r.prototype,"stopReconnectTimer",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null)}}),Object.defineProperty(r.prototype,"getCmpList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){if(this.cmpWeightCache&&this.cmpWeightCache.length>0)return l([],u(this.cmpWeightCache),!1);var r=Kt(e,t);return this.cmpWeightCache=l([],u(r),!1),l([],u(r),!1)}}),Object.defineProperty(r.prototype,"updateCmpWeight",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){if(this.cmpWeightCache){var n=this.cmpWeightCache.find((function(t){return r?t.addr===e&&t.protocol===q.QUIC:t.addr===e}));if(n)if(t){var i=Math.max.apply(Math,l([],u(this.cmpWeightCache.map((function(e){return e.weight}))),!1));n.weight!==i&&(n.weight=i+1)}else{var o=Math.min.apply(Math,l([],u(this.cmpWeightCache.map((function(e){return e.weight}))),!1));n.weight!==o&&(n.weight=o-1),n.failed=!0}}}}),Object.defineProperty(r.prototype,"clearCmpWeightCache",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.cmpWeightCache=void 0}}),Object.defineProperty(r.prototype,"reconnect",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){this.token=e,this._openCallPlus=r,this.onDisconenctUnusual(n)}}),r}(pt);wr=new WeakMap,Ar=new WeakSet,Pr=function(){return this},Nr=function(){this.uuid=nt.gen(),this.retryCount=0};var Dr=function(e){return e.replace(/@.+$/,"@")},xr=function(){function e(e,t,r,n,i,o){void 0===n&&(n=!0),void 0===i&&(i=!0),void 0===o&&(o=!1),Object.defineProperty(this,"appkey",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"logger",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"staticConfigManager",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"isRequestProfile",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(this,"isUseDynamicNaviUrl",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"useNaviV2",{enumerable:!0,configurable:!0,writable:!0,value:o}),Object.defineProperty(this,"crtRequest",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"_environment",{enumerable:!0,configurable:!0,writable:!0,value:"default"})}return Object.defineProperty(e.prototype,"getCatchKey",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return e+(this._environment?"-".concat(this._environment):"")}}),Object.defineProperty(e.prototype,"request",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){return o(this,void 0,void 0,(function(){var o;return s(this,(function(s){switch(s.label){case 0:return this.crtRequest?[2,this.crtRequest]:(this.crtRequest=this.sendRequest(e,t,r,n,i),[4,this.crtRequest]);case 1:return o=s.sent(),this.crtRequest=null,[2,o]}}))}))}}),Object.defineProperty(e.prototype,"sendRequest",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){var a;return o(this,void 0,void 0,(function(){var o,u,l,c,d,p,f,h,g,_,b,E,v,y,m,I,T;return s(this,(function(s){switch(s.label){case 0:return o=Dr(e),u=this.getNaviCache(o),!t&&u&&(l=u.timestamp,c=u.naviInfo,r||Date.now()-l<Ue)?(this.logger.info(H.L_REQUEST_T,JSON.stringify({fromCache:!0,naviInfo:c}),n),i&&(d=i.uuid,p=i.retryCount,f=i.reason,h={bid:cr(),ptc:Re.NAVI,cod:exports.ErrorCode.SUCCESS,net:i.type,dur:0,spr:1,pr:null!==(a=c.type)&&void 0!==a?a:0,hos:"",cache:Ce.LOCAL,v:Oe.CURRENT,rsn:f,cid:"".concat(d,"_").concat(p),count:p},this.logger.record(pe.IM_NAVI,JSON.stringify(h),n)),[2,ht(c)]):(g=yr.getNaviUrlList(e,this.isUseDynamicNaviUrl),this.logger.info(H.L_GET_NAVI_T,JSON.stringify({token:e,uris:g}),n),[4,this.requestHandler(g,e,n,i)]);case 1:return _=s.sent(),b=_.code,E=_.data,b===exports.ErrorCode.RC_NAVI_REQ_FAILED&&this.isRequestProfile?[4,this.staticConfigManager.getStaticConfig()]:[3,4];case 2:return(null==(v=s.sent())?void 0:v.navi)&&(null==v?void 0:v.navi.length)>0?(y=v.navi,[4,this.requestHandler(y,e,n,i)]):[3,4];case 3:m=s.sent(),b=m.code,E=m.data,s.label=4;case 4:return b!==exports.ErrorCode.SUCCESS?(this.logger.warn(H.L_GET_NAVI_R,b,n),[2,gt(b)]):(I=E).code&&200!==I.code?(this.logger.warn(H.L_GET_NAVI_R,I.code,n),[2,gt(this.transHttpCode(I.code))]):Kt(I).length>0?(this.logger.info(H.L_GET_NAVI_R,JSON.stringify({naviInfo:I}),n),this.setNaviCache(o,I),[2,ht(I)]):(T={server:I.server,backupServer:I.backupServer,serverAddr:I.serverAddr,bs:I.bs},this.logger.warn(H.L_GET_NAVI_R,"navi server address invalid: ".concat(JSON.stringify(T)),n),[2,gt(exports.ErrorCode.SERVER_UNAVAILABLE)])}}))}))}}),Object.defineProperty(e.prototype,"requestHandler",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return o(this,void 0,void 0,(function(){var i,o,a,u,l,c,d,p,f;return s(this,(function(s){switch(s.label){case 0:i=0,o=e.length,s.label=1;case 1:return i<o?(a=i===e.length-1,u=this.useV2Navi()?this.httpRequestV2:this.httpRequest,l=Date.now(),[4,u.call(this,e[i],this.appkey,t,r,a)]):[3,4];case 2:if(c=s.sent(),d=c.code,p=c.data,f={bid:cr(),ptc:Re.NAVI,cod:d,net:null==n?void 0:n.type,dur:Date.now()-l,spr:1,pr:(null==p?void 0:p.type)||0,hos:e[i],cache:Ce.REQUEST,v:Oe.CURRENT,rsn:null==n?void 0:n.reason,cid:"".concat(null==n?void 0:n.uuid,"_").concat(null==n?void 0:n.retryCount),count:null==n?void 0:n.retryCount},this.logger.record(pe.IM_NAVI,JSON.stringify(f),r),[exports.ErrorCode.SUCCESS,exports.ErrorCode.RC_CONN_TOKEN_INCORRECT,exports.ErrorCode.RC_LICENSE_EXPIRED].includes(d))return[2,d===exports.ErrorCode.SUCCESS?ht(p):gt(d)];s.label=3;case 3:return i+=1,[3,1];case 4:return[2,gt(exports.ErrorCode.RC_NAVI_REQ_FAILED)]}}))}))}}),Object.defineProperty(e.prototype,"transHttpCode",{enumerable:!1,configurable:!0,writable:!0,value:function(e){switch(e){case 401:case 403:return exports.ErrorCode.RC_CONN_TOKEN_INCORRECT;case 416:return exports.ErrorCode.RC_LICENSE_EXPIRED;default:return exports.ErrorCode.RC_NAVI_REQ_FAILED}}}),Object.defineProperty(e.prototype,"getNaviInfoFromCache",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this.getNaviCache(Dr(e));return t?t.naviInfo:null}}),Object.defineProperty(e.prototype,"updateVoipCallInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this.getNaviInfoFromCache(e);r&&this.setNaviCache(Dr(e),n(n({},r),{voipCallInfo:t}))}}),Object.defineProperty(e.prototype,"getNaviV2RequestOption",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r=e.uri,n=e.token,i=e.platform,o=e.protocol,s=e.mac;t="".concat(r,"/v2/navi.json?cloud=").concat(1);var a="token=".concat(encodeURIComponent(n),"&v=").concat(je,"&platfrom=").concat(i);return s&&(a+="&m=".concat(s)),{method:"POST",headers:{"RC-Appkey":this.appkey,"Content-Type":"Application/x-www-form-urlencoded","RC-Negotiate":"conn=".concat(o,";rtc=4;log=2;iptype=v4,v6")},body:a,url:t,timeout:1e4}}}),Object.defineProperty(e.prototype,"useV2Navi",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.useNaviV2}}),e}(),jr=new Map([["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:StreamMsg",{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:RcNtf",{isCounted:!1,isPersited:!0}],["RC:CmdMsg",{isCounted:!1,isPersited:!1}],["RC:TypSts",{isCounted:!1,isPersited:!1,isStatusMessage:!0}],["RC:PSCmd",{isCounted:!1,isPersited:!1}],["RC:SRSMsg",{isCounted:!1,isPersited:!1}],["RC:RcCmd",{isCounted:!1,isPersited:!0}],["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,isStatusMessage:!0}],["RC:RLJoin",{isCounted:!1,isPersited:!1}],["RC:RLQuit",{isCounted:!1,isPersited:!1}],["RC:RL",{isCounted:!1,isPersited:!1,isStatusMessage:!0}],["RC:CCConfigChangeRequestMsg",{isCounted:!1,isPersited:!1}]]);function Vr(e){return jr.get(e)||{isCustom:!0,isPersited:!1,isCounted:!1,isStatusMessage:!1}}function Gr(e){return jr.has(e)}var kr,Fr,Br,Hr={TIMESTAMP:0,TOP:1,BLOCKED:2,UNREAD:3,ALL:4,PAGE_INDEX:5},qr=function(e,t){var r=vt.create(e).isObject("filter",t,!0).fail(exports.ErrorCode.CONVER_GET_ERROR,"filter must be an object").isValueOf("type",t.type,Hr,!0).fail(exports.ErrorCode.CONVER_GET_ERROR,"filter type invalid"),n=t.type,i=t.params;switch(n){case Hr.TIMESTAMP:!function(e,t){e.isObject("params",t,!0).fail(exports.ErrorCode.CONVER_GET_ERROR,"filter's params must be an object").isInteger("startTime",null==t?void 0:t.startTime,!0).fail(exports.ErrorCode.INVALID_PARAMETER_START_TIME).isInteger("count",null==t?void 0:t.count,!0).fail(exports.ErrorCode.INVALID_PARAMETER_COUNT).isLimitedInteger("order",null==t?void 0:t.order,0,1).fail(exports.ErrorCode.INVALID_PARAMETER_ORDER).validate("channelId",null==t?void 0:t.channelId,Dt).fail(exports.ErrorCode.INVALID_PARAMETER_CHANNEL_ID).isTypedArray("conversationTypes",null==t?void 0:t.conversationTypes,(function(e){return me(e,be)})).fail(exports.ErrorCode.INVALID_PARAMETER_CONVERSATION_TYPE_LIST)}(r,i);break;case Hr.BLOCKED:break;case Hr.TOP:!function(e,t){e.isObject("params",t).fail(exports.ErrorCode.CONVER_GET_ERROR,"filter's params must be an object or undefined").isTypedArray("conversationTypes",null==t?void 0:t.conversationTypes,(function(e){return me(e,be)})).fail(exports.ErrorCode.INVALID_PARAMETER_CONVERSATION_TYPE_LIST).validate("channelId",null==t?void 0:t.channelId,Dt).fail(exports.ErrorCode.INVALID_PARAMETER_CHANNEL_ID)}(r,i);break;case Hr.UNREAD:!function(e,t){e.isObject("params",t).fail(exports.ErrorCode.CONVER_GET_ERROR,"filter's params must be an object or undefined").isTypedArray("conversationTypes",null==t?void 0:t.conversationTypes,(function(e){return me(e,be)})).fail(exports.ErrorCode.INVALID_PARAMETER_CONVERSATION_TYPE_LIST)}(r,i);break;case Hr.ALL:!function(e,t){e.isObject("params",t).fail(exports.ErrorCode.CONVER_GET_ERROR,"filter's params must be an object or undefined").validate("channelId",null==t?void 0:t.channelId,Dt).fail(exports.ErrorCode.INVALID_PARAMETER_CHANNEL_ID)}(r,i);break;case Hr.PAGE_INDEX:!function(e,t){e.isObject("params",t).fail(exports.ErrorCode.CONVER_GET_ERROR,"filter's params must be an object or undefined").isInteger("index",null==t?void 0:t.index,!0).fail(exports.ErrorCode.CONVER_GET_ERROR,"page index must be an integer").isInteger("limit",null==t?void 0:t.limit,!0).fail(exports.ErrorCode.INVALID_PARAMETER_LIMIT).isTypedArray("conversationTypes",null==t?void 0:t.conversationTypes,(function(e){return me(e,be)})).fail(exports.ErrorCode.INVALID_PARAMETER_CONVERSATION_TYPE_LIST)}(r,i)}return r.result()},Yr=function(){return!("undefined"==typeof uni||!function(e){for(var t=["request","getSystemInfo"],r=0,n=t.length;r<n;r++)if(!e[t[r]])return!1;return!0}(uni))},Kr=function(){function e(e){kr.add(this),Fr.set(this,void 0),Object.defineProperty(this,"_logger",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),d(this,Fr,e,"f"),this._logger=e.logger}return Object.defineProperty(e.prototype,"open",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){return s(this,(function(t){return e=e.sort((function(e,t){return t.weight-e.weight})),[2,c(this,kr,"m",Br).call(this,e,c(this,Fr,"f"))]}))}))}}),e}();Fr=new WeakMap,kr=new WeakSet,Br=function e(t,r){return o(this,void 0,void 0,(function(){var n,i,a,u=this;return s(this,(function(l){switch(l.label){case 0:return 0===t.length?[2,gt(exports.ErrorCode.STREAM_MESSAGE_REQUEST_FAIL,"All addrs failed")]:(n=t.shift(),i=pr(n.addr,n.protocol),i="".concat(i,"/v3/message/get_stream.json?sdkVersion=").concat("5.20.2-enterprise.12","&platform=Websocket&messageUID=").concat(r.msgUId),this._logger.info(H.L_REQ_STREAM_MSG_CONTENT_O,"try open -> ".concat(i)),[4,this._openHandler(i,r)]);case 1:return[2,(a=l.sent()).or((function(n){return o(u,void 0,void 0,(function(){return s(this,(function(i){return-1===n?[2,c(this,kr,"m",e).call(this,t,r)]:[2,a]}))}))}))]}}))}))};var Qr=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return t(r,e),Object.defineProperty(r.prototype,"_openHandler",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i,o,a=this;return s(this,(function(s){return r=It(),n=r.resolve,i=r.promise,(o=new XMLHttpRequest).open("GET",e,!0),o.timeout=t.timeout,o.ontimeout=function(){a._logger.warn(H.L_REQ_STREAM_MSG_CONTENT_E,"timeout -> ".concat(e)),n(gt(-1,"timeout"))},o.onreadystatechange=function(r){if(o.readyState===XMLHttpRequest.HEADERS_RECEIVED){var i=o.getResponseHeader("Content-Type"),s=null==i?void 0:i.startsWith("text/event-stream");if(200===o.status&&s){n(ht());var u=0;o.onprogress=function(e){var r=o.response.slice(u);u=o.response.length,t.onRawContent(r)},o.onerror=function(r){a._logger.warn(H.L_REQ_STREAM_MSG_CONTENT_E,"network error in transit -> ".concat(e)),o.onprogress=null,o.abort(),t.onNetworkError(exports.ErrorCode.STREAM_MESSAGE_REQUEST_FAIL)}}else o.onloadend=function(){var e=JSON.parse(o.response);n(gt(e.code,e.message))}}},o.onerror=function(t){a._logger.warn(H.L_REQ_STREAM_MSG_CONTENT_E,"req fail -> ".concat(e)),n(gt(-1))},o.setRequestHeader("Content-Type","application/json;charset=UTF-8"),o.setRequestHeader("App-Key",t.appkey),o.setRequestHeader("Authorization","Bearer ".concat(t.token)),o.send(),[2,i]}))}))}}),r}(Kr),Wr=Yr();var Jr=null,zr=function(e){return o(void 0,void 0,void 0,(function(){var t;return s(this,(function(r){switch(r.label){case 0:return[4,Xr.getNetworkType()];case 1:return t=r.sent(),Jr({status:"online"===e.type,type:t}),[2]}}))}))};var Zr,Xr={tag:"browser",httpReq:function(e){return br(e).result()},localStorage:null===window||void 0===window?void 0:window.localStorage,sessionStorage:null===window||void 0===window?void 0:window.sessionStorage,useNavi:!0,connectPlatform:"",isFromUniapp:Wr,createWebSocket:function(e,t){var r=new WebSocket(e,t);return r.binaryType="arraybuffer",{id:Date.now(),onClose:function(e){r.onclose=function(t){var r=t.code,n=t.reason;e(r,n)}},onError:function(e){r.onerror=e},onMessage:function(e){r.onmessage=function(t){e(t.data)}},onOpen:function(e){r.onopen=e},send:function(e){r.send(e)},close:function(e,t){r.close()}}},getNetworkType:function(){var e=navigator.connection||navigator.mozConnection||navigator.webkitConnection||{effectiveType:we.UNKONWN},t=e.type,r=e.effectiveType,n=t||r||we.UNKONWN;return Promise.resolve(n)},setNetworkStatusListener:function(e){Jr=e,"undefined"!=typeof window&&window&&(window.addEventListener("offline",zr),window.addEventListener("online",zr))},removeNetworkStatusListener:function(){"undefined"!=typeof window&&window&&(window.removeEventListener("offline",zr),window.removeEventListener("online",zr)),Jr=null},createSSEClient:function(e){return ht(new Qr(e))},getApiVer:function(){var e=Xr.runtimeInfo,t=e.type,r=e.version;return"|".concat(t,"|").concat(r)},get runtimeInfo(){var e,t,r=navigator.userAgent,n={IE:/rv:([\d.]+)\) like Gecko|MSIE ([\d.]+)/,Edge:/Edge\/([\d.]+)/,Firefox:/Firefox\/([\d.]+)/,Opera:/(?:OPERA|OPR).([\d.]+)/,WeChat:/MicroMessenger\/([\d.]+)/,QQBrowser:/QQBrowser\/([\d.]+)/,Chrome:/Chrome\/([\d.]+)/,Safari:/Version\/([\d.]+).*Safari/,iOSChrome:/Mobile\/([\d.]+).*Safari/};for(var i in n)if(n.hasOwnProperty(i)){var o=r.match(n[i]);if(o){t=i,e=o[1]||o[2];break}}return{type:t||"Unknown",version:e||"Unknown"}}};!function(e){e[e.ppMsgP=1]="ppMsgP",e[e.ppMsgS=2]="ppMsgS",e[e.pgMsgS=3]="pgMsgS",e[e.pgMsgP=4]="pgMsgP",e[e.chatMsg=5]="chatMsg",e[e.pcMsgP=6]="pcMsgP",e[e.prMsgS=7]="prMsgS",e[e.pbMsgP=8]="pbMsgP",e[e.qryPMsg=9]="qryPMsg",e[e.qryGMsg=10]="qryGMsg",e[e.qryCHMsg=11]="qryCHMsg",e[e.qryCMsg=12]="qryCMsg",e[e.qrySMsg=13]="qrySMsg",e[e.qryMCMsg=14]="qryMCMsg",e[e.qryMPMsg=15]="qryMPMsg",e[e.recallMsg=16]="recallMsg",e[e.rrMsg=17]="rrMsg",e[e.rrList=18]="rrList",e[e.s_ntf=19]="s_ntf",e[e.s_msg=20]="s_msg",e[e.s_stat=21]="s_stat",e[e.s_cmd=22]="s_cmd",e[e.s_us=23]="s_us",e[e.pullUS=24]="pullUS",e[e.sendMsgRead=25]="sendMsgRead",e[e.qryMsgRead=26]="qryMsgRead",e[e.qryMsgReadCntBatch=27]="qryMsgReadCntBatch",e[e.updRTime=28]="updRTime",e[e.chatMsgS=29]="chatMsgS",e[e.qrySessionsAtt=30]="qrySessionsAtt",e[e.pullMsg=31]="pullMsg",e[e.qrySessions=32]="qrySessions",e[e.delSessions=33]="delSessions",e[e.delMsg=34]="delMsg",e[e.delUgMsg=35]="delUgMsg",e[e.delUgSe=36]="delUgSe",e[e.updRRTime=37]="updRRTime",e[e.qrySessionsUnread=38]="qrySessionsUnread",e[e.setTypeUnpush=39]="setTypeUnpush",e[e.chrmPull=40]="chrmPull",e[e.joinChrm=41]="joinChrm",e[e.joinChrmR=42]="joinChrmR",e[e.exitChrm=43]="exitChrm",e[e.queryChrmI=44]="queryChrmI",e[e.setKV=45]="setKV",e[e.delKV=46]="delKV",e[e.setKVS=47]="setKVS",e[e.delKVS=48]="delKVS",e[e.pullKV=49]="pullKV",e[e.qryRelation=50]="qryRelation",e[e.qryRelationR=51]="qryRelationR",e[e.delRelation=52]="delRelation",e[e.delRelationBatch=53]="delRelationBatch",e[e.pullSeAtts=54]="pullSeAtts",e[e.setSeAtt=55]="setSeAtt",e[e.qnTkn=56]="qnTkn",e[e.qnUrl=57]="qnUrl",e[e.aliUrl=58]="aliUrl",e[e.s3Url=59]="s3Url",e[e.stcUrl=60]="stcUrl",e[e.minioUrl=61]="minioUrl",e[e.cleanPMsg=62]="cleanPMsg",e[e.cleanGMsg=63]="cleanGMsg",e[e.cleanCMsg=64]="cleanCMsg",e[e.cleanSMsg=65]="cleanSMsg",e[e.cleanMCMsg=66]="cleanMCMsg",e[e.cleanMPMsg=67]="cleanMPMsg",e[e.cleanMsgBatch=68]="cleanMsgBatch",e[e.rtcPing=69]="rtcPing",e[e.rtc_ntf=70]="rtc_ntf",e[e.rtcSetOutData=71]="rtcSetOutData",e[e.rtcQryUserOutData=72]="rtcQryUserOutData",e[e.addSeTag=73]="addSeTag",e[e.delSeTag=74]="delSeTag",e[e.addTag=75]="addTag",e[e.delTag=76]="delTag",e[e.disTag=77]="disTag",e[e.reportsdk=78]="reportsdk",e[e.pullUgSes=79]="pullUgSes",e[e.pullUgMsg=80]="pullUgMsg",e[e.ugMsg=81]="ugMsg",e[e.qryUgMsg=82]="qryUgMsg",e[e.updUgRTime=83]="updUgRTime",e[e.upMsgEx=84]="upMsgEx",e[e.modifyMsg=85]="modifyMsg",e[e.qryMsgChange=86]="qryMsgChange",e[e.qryMsg=87]="qryMsg",e[e.operate=88]="operate",e[e.s_opNtf=89]="s_opNtf",e[e.ugUnpushQuery=90]="ugUnpushQuery",e[e.ugUnpushSet=91]="ugUnpushSet",e[e.setRtcRoomId=92]="setRtcRoomId",e[e.qryUgUal=93]="qryUgUal",e[e.updUserSub=94]="updUserSub",e[e.pullUserSub=95]="pullUserSub",e[e.pullSubData=96]="pullSubData",e[e.qrySubData=97]="qrySubData",e[e.pullUserProfile=98]="pullUserProfile",e[e.pullOwnProfile=99]="pullOwnProfile",e[e.updProfilePermiss=100]="updProfilePermiss",e[e.qProfilePermiss=101]="qProfilePermiss",e[e.searchUserProfile=102]="searchUserProfile",e[e.updUserProfile=103]="updUserProfile",e[e.pullEventChange=104]="pullEventChange",e[e.channelCreate=105]="channelCreate",e[e.upChannelInfo=106]="upChannelInfo",e[e.qChannelInfo=107]="qChannelInfo",e[e.channelMemKick=108]="channelMemKick",e[e.channelMemQuit=109]="channelMemQuit",e[e.channelDismiss=110]="channelDismiss",e[e.channelTransfer=111]="channelTransfer",e[e.upChannelManager=112]="upChannelManager",e[e.qChannelMem=113]="qChannelMem",e[e.qChannelSpeMem=114]="qChannelSpeMem",e[e.upChannelMem=115]="upChannelMem",e[e.channelMemJoin=116]="channelMemJoin",e[e.channelMemInvite=117]="channelMemInvite",e[e.channelApplyResp=118]="channelApplyResp",e[e.qChannelApplyList=119]="qChannelApplyList",e[e.qChannelMemJoin=120]="qChannelMemJoin",e[e.qChannelMemSpeJoin=121]="qChannelMemSpeJoin",e[e.upChannelRemark=122]="upChannelRemark",e[e.qChannelRemark=123]="qChannelRemark",e[e.upChannelFollow=124]="upChannelFollow",e[e.qChannelFollow=125]="qChannelFollow",e[e.qSimpleUserProfile=126]="qSimpleUserProfile",e[e.friendAdd=127]="friendAdd",e[e.friendDel=128]="friendDel",e[e.friendHandle=129]="friendHandle",e[e.friendSetPf=130]="friendSetPf",e[e.friendCheck=131]="friendCheck",e[e.friendsQuery=132]="friendsQuery",e[e.friendApplyDel=133]="friendApplyDel",e[e.friendsInfoQry=134]="friendsInfoQry",e[e.friendAuthSet=135]="friendAuthSet",e[e.friendAuthGet=136]="friendAuthGet",e[e.addUnpush=137]="addUnpush",e[e.qryUnpush=138]="qryUnpush",e[e.delUnpush=139]="delUnpush",e[e.s_pubCall=140]="s_pubCall",e[e.reqCall=141]="reqCall",e[e.pullKvMsg=142]="pullKvMsg",e[e.readReceipt=143]="readReceipt",e[e.qryReceipt=144]="qryReceipt"}(Zr||(Zr={}));var $r,en,tn,rn=function(e){var t=Zr[e];return t},nn=function(e){return Zr[e]};!function(e){e[e.AT_MOST_ONCE=0]="AT_MOST_ONCE",e[e.AT_LEAST_ONCE=1]="AT_LEAST_ONCE",e[e.EXACTLY_ONCE=2]="EXACTLY_ONCE",e[e.DEFAULT=3]="DEFAULT"}($r||($r={})),function(e){e[e.SYMMETRIC=0]="SYMMETRIC",e[e.CONNECT=1]="CONNECT",e[e.CONN_ACK=2]="CONN_ACK",e[e.PUBLISH=3]="PUBLISH",e[e.PUB_ACK=4]="PUB_ACK",e[e.QUERY=5]="QUERY",e[e.QUERY_ACK=6]="QUERY_ACK",e[e.QUERY_CONFIRM=7]="QUERY_CONFIRM",e[e.PING=12]="PING",e[e.PONG=13]="PONG",e[e.DISCONNECT=14]="DISCONNECT",e[e.PCONNECT=8]="PCONNECT",e[e.PCONNECT_ACK=9]="PCONNECT_ACK",e[e.RESERVED=10]="RESERVED",e[e.RESERVED_2=11]="RESERVED_2",e[e.RESERVED_3=15]="RESERVED_3"}(en||(en={})),function(e){e[e.V4=4]="V4",e[e.V3=3]="V3"}(tn||(tn={}));var on="rtcRJoin_data",sn="rtcRExit",an="rtcRInfo",un="rtcUData",ln="rtcUPut",cn="rtcUDel",dn="rtcSetData",pn="userSetData",fn="rtcQryData",hn="rtcDelData",gn="rtcToken",_n="rtcUserState",bn="rtcUList",En="viewerJoinR",vn="viewerExitR",yn="rtcPullKv",mn="rtcIdentityChange",In="rtcInvite",Tn="rtcCancelInvite",Rn="rtcInviteAnswer",Cn="rtcEndInvite",On="rtcQueryJoined",Sn=0,An=1,Pn=2,Nn=3,wn=4,Mn=5,Ln=6,Un=7,Dn=8,xn=9,jn=10,Vn=11,Gn=12,kn=13,Fn=14,Bn=15,Hn=16,qn=17,Yn=18,Kn=19,Qn=20,Wn=1,Jn=2,zn=4,Zn=5,Xn=6,$n=7,ei=8,ti=9,ri=function(){function e(){}return Object.defineProperty(e,"writeUTF",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){for(var r=this._getBackAndByteSize(e),n=r.back,i=r.byteSize,o=0,s=n.length;o<s;o++)n[o]>255&&(n[o]&=255);return t?n:i<=255?[0,i].concat(n):[i>>8,255&i].concat(n)}}),Object.defineProperty(e,"_getBackAndByteSize",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=[],r=0;if("string"==typeof e)for(var n=0,i=e.length;n<i;n++){var o=e.charCodeAt(n);o>=0&&o<=127?(r+=1,t.push(o)):o>=128&&o<=2047?(r+=2,t.push(192|31&o>>6),t.push(128|63&o)):o>=2048&&o<=65535&&(r+=3,t.push(224|15&o>>12),t.push(128|63&o>>6),t.push(128|63&o))}return{byteSize:r,back:t}}}),Object.defineProperty(e,"readUTF",{enumerable:!1,configurable:!0,writable:!0,value:function(e){for(var t,r,n=[],i=-1,o=e,s="";++i<o.length;){var a=Number(o[i]);if(a===(127&a)||(240&~a?224&~a?192&~a||(a=(a^=192)<<6|128^o[++i]):a=(a=(a^=224)<<6|128^o[++i])<<6|128^o[++i]:a=(a=(a=(a^=240)<<6|128^o[++i])<<6|128^o[++i])<<6|128^o[++i]),!Number.isFinite(a)||a<0||a>1114111||Math.floor(a)!==a)throw RangeError("Invalid code point: ".concat(a));a<=65535?n.push(a):(t=(a-=65536)>>10|55296,r=a%1024|56320,n.push(t,r)),(i+1===o.length||n.length>16384)&&(s+=String.fromCharCode.apply(null,n),n.length=0)}return s}}),e}(),ni=function(){function e(e){Object.defineProperty(this,"_pool",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_position",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_poolLen",{enumerable:!0,configurable:!0,writable:!0,value:0}),this._pool=e,this._poolLen=e.length}return Object.defineProperty(e.prototype,"check",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._position>=this._pool.length}}),Object.defineProperty(e.prototype,"read2Byte",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this;if(e.check())return-1;for(var t="",r=0;r<2;r++){var n=e._pool[e._position++].toString(16);1===n.length&&(n="0".concat(n)),t+=n.toString()}return parseInt(t,16)}}),Object.defineProperty(e.prototype,"readInt32",{enumerable:!1,configurable:!0,writable:!0,value:function(){return(this.readByte()<<24)+(this.readByte()<<16)+(this.readByte()<<8)+this.readByte()}}),Object.defineProperty(e.prototype,"readLong",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this;if(e.check())return-1;for(var t="",r=0;r<8;r++){var n=e._pool[e._position++].toString(16);1===n.length&&(n="0".concat(n)),t+=n}return parseInt(t,16)}}),Object.defineProperty(e.prototype,"readByte",{enumerable:!1,configurable:!0,writable:!0,value:function(){if(this.check())return-1;var e=this._pool[this._position++];return e>255&&(e&=255),e}}),Object.defineProperty(e.prototype,"readUTF",{enumerable:!1,configurable:!0,writable:!0,value:function(){if(this.check())return"";var e=this.readByte()<<8|this.readByte(),t=this._position;this._position+=e;var r=this._pool.subarray(t,this._position);return ri.readUTF(r)}}),Object.defineProperty(e.prototype,"readAll",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._pool.subarray(this._position,this._poolLen)}}),e}(),ii=function(){function e(){Object.defineProperty(this,"_pool",{enumerable:!0,configurable:!0,writable:!0,value:[]})}return Object.defineProperty(e.prototype,"writeByte",{enumerable:!1,configurable:!0,writable:!0,value:function(e){e>=0&&(e>255&&(e&=255),this._pool.push(e))}}),Object.defineProperty(e.prototype,"writeBuffer",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._pool=this._pool.concat(l([],u(new Int8Array(e)),!1))}}),Object.defineProperty(e.prototype,"writeArr",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._pool=this._pool.concat(e)}}),Object.defineProperty(e.prototype,"writeUTF",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=ri.writeUTF(e);this._pool=this._pool.concat(t)}}),Object.defineProperty(e.prototype,"getBytesArray",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._pool}}),e}(),oi=function(){function e(e,t,r,n,i){void 0===t&&(t=$r.AT_LEAST_ONCE),void 0===r&&(r=!1),void 0===n&&(n=!1),void 0===i&&(i=!1),Object.defineProperty(this,"command",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"qos",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"_retain",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"_dup",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(this,"syncMsg",{enumerable:!0,configurable:!0,writable:!0,value:i})}return Object.defineProperty(e,"parse",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return new e(t>>4&15,(6&t)>>1,(1&t)>0,(8&t)>0,!(8&~t))}}),Object.defineProperty(e.prototype,"encode",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this.command<<4;return e|=this._retain?1:0,e|=this.qos<<1,e|=this._dup?8:0}}),e}(),si=function(){function e(e){Object.defineProperty(this,"header",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"timestamp",{enumerable:!0,configurable:!0,writable:!0,value:0})}return Object.defineProperty(e.prototype,"read",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){this.readMessage(e,t,r)}}),Object.defineProperty(e.prototype,"readMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return{stream:e,length:t}}}),e}(),ai=function(){function e(e){Object.defineProperty(this,"_header",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"messageId",{enumerable:!0,configurable:!0,writable:!0,value:0}),this._header=new oi(e,$r.AT_MOST_ONCE)}return Object.defineProperty(e.prototype,"write",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this.getHeaderFlag();e.writeByte(t),this.writeMessage(e)}}),Object.defineProperty(e.prototype,"setHeaderQos",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._header.qos=e}}),Object.defineProperty(e.prototype,"getHeaderFlag",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._header.encode()}}),Object.defineProperty(e.prototype,"getArrayBuffer",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=new ii;this.write(e);var t=e.getBytesArray();return new Int8Array(t).buffer}}),e}(),ui=function(e){function r(){var t=null!==e&&e.apply(this,arguments)||this;return Object.defineProperty(t,"status",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(t,"userId",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(t,"timestamp",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(t,"messageId",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(t,"sessionId",{enumerable:!0,configurable:!0,writable:!0,value:""}),t}return t(r,e),Object.defineProperty(r.prototype,"readMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){if(e.readByte(),this.status=e.readByte(),t<=r.MESSAGE_LENGTH)return{stream:e,length:t};if(n===tn.V4){var i=e.readByte();1&i&&(this.userId=e.readUTF()),2&i&&(this.sessionId=e.readUTF()),4&i&&(this.timestamp=e.readLong()),8&i&&(this.messageId=e.read2Byte())}else this.userId=e.readUTF(),this.sessionId=e.readUTF(),this.timestamp=e.readLong();return{stream:e,length:t}}}),Object.defineProperty(r,"MESSAGE_LENGTH",{enumerable:!0,configurable:!0,writable:!0,value:2}),r}(si),li=function(e){function r(t){var r=e.call(this,en.DISCONNECT)||this;return Object.defineProperty(r,"status",{enumerable:!0,configurable:!0,writable:!0,value:t}),r}return t(r,e),Object.defineProperty(r.prototype,"writeMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){e.writeArr([0,this.status])}}),r}(ai),ci=function(e){function r(){var t=null!==e&&e.apply(this,arguments)||this;return Object.defineProperty(t,"status",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(t,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),t}return t(r,e),Object.defineProperty(r.prototype,"readMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return e.readByte(),this.status=e.readByte(),this.data=e.readAll(),{stream:e,length:t}}}),Object.defineProperty(r,"MESSAGE_LENGTH",{enumerable:!0,configurable:!0,writable:!0,value:2}),r}(si),di=function(e){function r(){return e.call(this,en.PING)||this}return t(r,e),Object.defineProperty(r.prototype,"writeMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){}}),r}(ai),pi=function(e){function r(t){return e.call(this,t)||this}return t(r,e),r}(si),fi=function(e){function r(){var t=null!==e&&e.apply(this,arguments)||this;return Object.defineProperty(t,"messageId",{enumerable:!0,configurable:!0,writable:!0,value:0}),t}return t(r,e),Object.defineProperty(r.prototype,"readMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=256*e.readByte()+e.readByte();return this.messageId=parseInt(r.toString(),10),{stream:e,length:t}}}),r}(si),hi=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return t(r,e),Object.defineProperty(r.prototype,"writeMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this.messageId,r=255&t,n=(65280&t)>>8;e.writeByte(n),e.writeByte(r)}}),r}(ai),gi=function(e){function r(t){var r=e.call(this,t)||this;return Object.defineProperty(r,"topic",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(r,"pbData",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(r,"targetId",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(r,"date",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(r,"syncMsg",{enumerable:!0,configurable:!0,writable:!0,value:!1}),r.syncMsg=t.syncMsg,r}return t(r,e),Object.defineProperty(r.prototype,"readMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){return this.date=t.readInt32(),this.topic=t.readUTF(),this.targetId=t.readUTF(),e.prototype.readMessage.call(this,t,r),this.pbData=t.readAll(),{stream:t,length:r}}}),r}(fi),_i=function(e){function r(t,r,n,i){var o=e.call(this,t)||this;return Object.defineProperty(o,"targetId",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(o,"pbData",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(o,"topic",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),o.topic="string"==typeof r?r:nn(r),o}return t(r,e),Object.defineProperty(r.prototype,"writeMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(t){t.writeUTF(this.topic),t.writeUTF(this.targetId),e.prototype.writeMessage.call(this,t),t.writeBuffer(this.pbData)}}),r}(hi),bi=function(e){function r(t,r,n){return e.call(this,en.QUERY,t,n,r)||this}return t(r,e),r}(_i),Ei=function(e){function r(t,r,n){return e.call(this,en.PUBLISH,t,n,r)||this}return t(r,e),r}(_i),vi=function(e){function r(){var t=null!==e&&e.apply(this,arguments)||this;return Object.defineProperty(t,"status",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(t,"date",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(t,"millisecond",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(t,"messageUId",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(t,"timestamp",{enumerable:!0,configurable:!0,writable:!0,value:0}),t}return t(r,e),Object.defineProperty(r.prototype,"readMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){return e.prototype.readMessage.call(this,t,r),this.date=t.readInt32(),this.status=256*t.readByte()+t.readByte(),this.millisecond=256*t.readByte()+t.readByte(),this.timestamp=1e3*this.date+this.millisecond,this.messageUId=t.readUTF(),{stream:t,length:r}}}),r}(fi),yi=function(e){function r(t){var r=e.call(this,en.PUB_ACK)||this;return r.messageId=t,r}return t(r,e),r}(hi),mi=function(e){function r(t){var r=e.call(this,en.QUERY_CONFIRM)||this;return r.messageId=t,r}return t(r,e),r}(hi),Ii=function(e){function r(){var t=null!==e&&e.apply(this,arguments)||this;return Object.defineProperty(t,"pbData",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(t,"status",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(t,"date",{enumerable:!0,configurable:!0,writable:!0,value:0}),t}return t(r,e),Object.defineProperty(r.prototype,"readMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){return e.prototype.readMessage.call(this,t,r),this.date=t.readInt32(),this.status=256*t.readByte()+t.readByte(),this.pbData=t.readAll(),{stream:t,length:r}}}),r}(fi),Ti=function(e,t){var r=new Uint8Array(e),n=new ni(r),i=n.readByte(),o=function(e){var t,r=e.command;switch(r){case en.CONN_ACK:t=new ui(e);break;case en.PUBLISH:t=new gi(e);break;case en.PUB_ACK:t=new vi(e);break;case en.QUERY_ACK:t=new Ii(e);break;case en.PONG:t=new pi(e);break;case en.DISCONNECT:t=new ci(e);break;default:console.error("No support for deserializing ".concat(r," messages"))}return t}(oi.parse(i));return o&&o.read(n,r.length-1,t),o},Ri=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return t(r,e),Object.defineProperty(r.prototype,"_openHandler",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=It(),n=r.resolve,i=r.promise,o=this._logger,s=wx.request({url:e,enableChunked:!0,method:"GET",timeout:t.timeout,header:{"Content-Type":"application/json;charset=UTF-8","App-Key":t.appkey,Authorization:"Bearer ".concat(t.token)},success:function(e){var t;if(200===e.statusCode&&(null===(t=e.header["Content-Type"])||void 0===t?void 0:t.startsWith("text/event-stream")))n(ht());else{var r=JSON.parse(e.data),i=r.code,o=r.message;n(gt(i,o))}},fail:function(t){var r=t.errMsg,i=t.errno;o.warn(H.L_REQ_STREAM_MSG_CONTENT_E,JSON.stringify({url:e,errMsg:r,errno:i})),n(gt(-1,t.errMsg))},complete:function(){o.debug(H.L_REQ_STREAM_MSG_CONTENT_O,"req complete -> ".concat(e))}});return s.onChunkReceived((function(e){var r=ri.readUTF(new Uint8Array(e.data));o.debug(H.L_REQ_STREAM_MSG_CONTENT_O,"chunk received -> ".concat(r)),t.onRawContent(r)})),i}}),r}(Kr),Ci=Yr(),Oi=function(e){return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];try{return wx[e].apply(wx,l([],u(t),!1))}catch(e){null===console||void 0===console||console.error(e)}}},Si={setItem:Oi("setStorageSync"),getItem:Oi("getStorageSync"),removeItem:Oi("removeStorageSync"),clear:Oi("clearStorageSync")},Ai=null,Pi=function(e){var t=e.isConnected,r=e.networkType;Ai({status:t,type:r})};var Ni={tag:"wechat",httpReq:function(e){var t=e.method||exports.HttpMethod.GET,r=e.timeout||De,n=e.headers,i=e.query,o=e.body,s=tr(e.url,i);return new Promise((function(e){wx.request({url:s,method:t,header:n,timeout:r,data:o,success:function(t){e({data:t.data,status:t.statusCode})},fail:function(){e({status:exports.ErrorCode.RC_HTTP_REQ_FAIL})}})}))},localStorage:Si,sessionStorage:Si,useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:Ci,createWebSocket:function(e,t){var r=wx.connectSocket({url:e,protocols:t});return{id:Date.now(),onClose:function(e){r.onClose((function(t){e(t.code,t.reason)}))},onError:function(e){r.onError((function(t){e(t.errMsg)}))},onMessage:function(e){r.onMessage((function(t){e(t.data)}))},onOpen:function(e){r.onOpen(e)},send:function(e){r.send({data:e})},close:function(e,t){r.close({code:e,reason:t})}}},getNetworkType:function(){return new Promise((function(e){wx.getNetworkType({success:function(t){var r=t.networkType;e(r)},fail:function(){e(we.UNKONWN)}})}))},setNetworkStatusListener:function(e){Ai=e,wx.onNetworkStatusChange(Pi)},removeNetworkStatusListener:function(){wx.offNetworkStatusChange(Pi),Ai=null},createSSEClient:function(e){return ht(new Ri(e))},get runtimeInfo(){return{type:Ni.tag,version:"Unknown"}}},wi=Yr(),Mi=function(e){return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];try{if("setStorageSync"===e)return my[e]({key:t[0],data:JSON.parse(t[1])});if("clearStorageSync"===e)return my[e]();if("removeStorageSync"===e)return my[e]({key:t[0]});var n=my[e]({key:t[0]}).data;return n?JSON.stringify(n):n}catch(e){}}},Li={setItem:Mi("setStorageSync"),getItem:Mi("getStorageSync"),removeItem:Mi("removeStorageSync"),clear:Mi("clearStorageSync")},Ui=null,Di=function(e){var t=e.isConnected,r=e.networkType;Ui({status:t,type:r})};var xi={tag:"alipay",httpReq:function(e){var t=e.method||exports.HttpMethod.GET,r=e.timeout||De,n=e.headers,i=e.query,o=e.body,s=tr(e.url,i),a=e.dataType||"json";return new Promise((function(e){my.request({url:s,method:t,headers:n,timeout:r,data:o,dataType:a,success:function(t){e({data:t.data,status:t.status})},fail:function(){e({status:exports.ErrorCode.RC_HTTP_REQ_FAIL})}})}))},localStorage:Li,sessionStorage:Li,useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:wi,createWebSocket:function(e){var t=my.connectSocket({url:e,multiple:!0});return{id:Date.now(),onClose:function(e){t.onClose(e)},onError:function(e){t.onError((function(t){e(t.errMsg)}))},onMessage:function(e){t.onMessage((function(t){t.data.isBuffer?e(my.base64ToArrayBuffer(t.data.data)):e(t.data.data)}))},onOpen:function(e){t.onOpen(e)},send:function(e){t.send({data:my.arrayBufferToBase64(e),isBuffer:!0})},close:function(){t.close()}}},getNetworkType:function(){return new Promise((function(e){my.getNetworkType({success:function(t){var r=t.networkType;e(r)},fail:function(){e(we.UNKONWN)}})}))},setNetworkStatusListener:function(e){Ui=e,my.onNetworkStatusChange(Di)},removeNetworkStatusListener:function(){my.offNetworkStatusChange(Di),Ui=null},createSSEClient:function(e){return gt(exports.ErrorCode.NOT_SUPPORT,"Not supported yet")},get runtimeInfo(){return{type:xi.tag,version:"Unknown"}}},ji=Yr(),Vi=function(e){return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];try{return tt[e].apply(tt,l([],u(t),!1))}catch(e){}}},Gi={setItem:Vi("setStorageSync"),getItem:Vi("getStorageSync"),removeItem:Vi("removeStorageSync"),clear:Vi("clearStorageSync")},ki=null,Fi=function(e){var t=e.isConnected,r=e.networkType;ki({status:t,type:r})};var Bi={tag:"toutiao",useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:ji,localStorage:Gi,sessionStorage:Gi,httpReq:function(e){return new Promise((function(t){tt.request({url:e.url,data:e.body,header:e.headers,method:e.method,success:function(e){var r=(null==e?void 0:e.data)||{},n={data:JSON.stringify(r),status:e.statusCode};t(n)},fail:function(e){t({status:exports.ErrorCode.RC_HTTP_REQ_FAIL})}})}))},createWebSocket:function(e,t){var r=tt.connectSocket({url:e,protocols:t});return{id:Date.now(),onOpen:function(e){r.onOpen(e)},onClose:function(e){r.onClose((function(t){return e(t.code,t.reason)}))},onError:function(e){r.onError((function(t){return e(t.errMsg)}))},onMessage:function(e){r.onMessage((function(t){return e(t.data)}))},send:function(e){r.send({data:e})},close:function(e,t){r.close({code:e,reason:t})}}},getNetworkType:function(){return new Promise((function(e){tt.getNetworkType({success:function(t){var r=t.networkType;e(r)},fail:function(){e(we.UNKONWN)}})}))},setNetworkStatusListener:function(e){ki=e,tt.onNetworkStatusChange(Fi)},removeNetworkStatusListener:function(){tt.offNetworkStatusChange(Fi),ki=null},createSSEClient:function(e){return gt(exports.ErrorCode.NOT_SUPPORT)},get runtimeInfo(){return{type:Bi.tag,version:"Unknown"}}},Hi=Yr(),qi=function(e){return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];try{return swan[e].apply(swan,l([],u(t),!1))}catch(e){}}},Yi={setItem:qi("setStorageSync"),getItem:qi("getStorageSync"),removeItem:qi("removeStorageSync"),clear:qi("clearStorageSync")},Ki=null,Qi=function(e){var t=e.isConnected,r=e.networkType;Ki({status:t,type:r})};var Wi={tag:"baidu",useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:Hi,localStorage:Yi,sessionStorage:Yi,httpReq:function(e){return new Promise((function(t){swan.request({url:e.url,data:e.body,header:e.headers,method:e.method,success:function(e){var r=(null==e?void 0:e.data)||{},n={data:JSON.stringify(r),status:e.statusCode};t(n)},fail:function(e){t({status:exports.ErrorCode.RC_HTTP_REQ_FAIL})}})}))},createWebSocket:function(e,t){var r=swan.connectSocket({url:e,protocols:t});return{id:Date.now(),onOpen:function(e){r.onOpen(e)},onClose:function(e){r.onClose((function(t){return e(t.code,t.reason)}))},onError:function(e){r.onError((function(t){return e(t.errMsg)}))},onMessage:function(e){r.onMessage((function(t){return e(t.data)}))},send:function(e){r.send({data:e})},close:function(e,t){r.close({code:e,reason:t})}}},getNetworkType:function(){return o(this,void 0,void 0,(function(){return s(this,(function(e){return[2,new Promise((function(e){swan.getNetworkType({success:function(t){var r=t.networkType;e(r)},fail:function(){e(we.UNKONWN)}})}))]}))}))},setNetworkStatusListener:function(e){Ki=e,swan.onNetworkStatusChange(Qi)},removeNetworkStatusListener:function(){swan.offNetworkStatusChange(Qi),Ki=null},createSSEClient:function(e){return gt(exports.ErrorCode.NOT_SUPPORT)},get runtimeInfo(){return{type:Wi.tag,version:"Unknown"}}},Ji=Yr(),zi=function(e){return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];try{return jd[e].apply(jd,l([],u(t),!1))}catch(e){null===console||void 0===console||console.error(e)}}},Zi={setItem:zi("setStorageSync"),getItem:zi("getStorageSync"),removeItem:zi("removeStorageSync"),clear:zi("clearStorageSync")},Xi=null,$i=function(e){var t=e.isConnected,r=e.networkType;Xi({status:t,type:r})};var eo={tag:"jingdong",httpReq:function(e){var t=e.method||exports.HttpMethod.GET,r=e.timeout||De,n=e.headers,i=e.query,o=e.body,s=tr(e.url,i);return new Promise((function(e){jd.request({url:s,method:t,header:n,timeout:r,data:o,success:function(t){e({data:t.data,status:t.statusCode})},fail:function(){e({status:exports.ErrorCode.RC_HTTP_REQ_FAIL})}})}))},localStorage:Zi,sessionStorage:Zi,useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:Ji,createWebSocket:function(e,t){return jd.connectSocket({url:e,protocols:t}),{id:Date.now(),onClose:function(e){jd.onSocketClose((function(t){e(t.code,t.reason)}))},onError:function(e){jd.onSocketError((function(t){e(t.errMsg)}))},onMessage:function(e){jd.onSocketMessage((function(t){e(t.data)}))},onOpen:function(e){jd.onSocketOpen(e)},send:function(e){jd.sendSocketMessage({data:e})},close:function(e,t){jd.closeSocket({code:e,reason:t})}}},getNetworkType:function(){return new Promise((function(e){jd.getNetworkType({success:function(t){var r=t.networkType;e(r)},fail:function(){e(we.UNKONWN)}})}))},setNetworkStatusListener:function(e){Xi=e,jd.onNetworkStatusChange($i)},removeNetworkStatusListener:function(){jd.offNetworkStatusChange($i),Xi=null},createSSEClient:function(e){return gt(exports.ErrorCode.NOT_SUPPORT)},get runtimeInfo(){return{type:eo.tag,version:"Unknown"}}},to=function(e){return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];try{return uni[e].apply(uni,l([],u(t),!1))}catch(e){null===console||void 0===console||console.error(e)}}},ro={setItem:to("setStorageSync"),getItem:to("getStorageSync"),removeItem:to("removeStorageSync"),clear:to("clearStorageSync")},no=null,io=function(e){var t=e.isConnected,r=e.networkType;no({status:t,type:r})};var oo,so,ao={tag:"uniapp",httpReq:function(e){var t=e.method||exports.HttpMethod.GET,r=e.timeout||De,n=e.headers,i=e.query,o=e.body,s=tr(e.url,i);return new Promise((function(e){uni.request({url:s,method:t,header:n,timeout:r,data:o,success:function(t){e({data:t.data,status:t.statusCode})},fail:function(){e({status:exports.ErrorCode.RC_HTTP_REQ_FAIL})}})}))},localStorage:ro,sessionStorage:ro,useNavi:!0,get connectPlatform(){var e=uni.getSystemInfoSync(),t=e.uniPlatform,r=e.osName;return["app","app-plus"].includes(t)&&r||""},isFromUniapp:!0,createWebSocket:function(e,t){var r={complete:function(){},url:e,protocols:t},n=uni.connectSocket(r);return{id:Date.now(),onClose:function(e){n.onClose((function(t){e(t.code,t.reason)}))},onError:function(e){n.onError((function(t){e(t.errMsg)}))},onMessage:function(e){n.onMessage((function(t){e(t.data)}))},onOpen:function(e){n.onOpen(e)},send:function(e){n.send({data:e})},close:function(e,t){n.close({code:e,reason:t})}}},getNetworkType:function(){return new Promise((function(e){uni.getNetworkType({success:function(t){var r=t.networkType;e(r)},fail:function(){e(we.UNKONWN)}})}))},setNetworkStatusListener:function(e){no=e,uni.onNetworkStatusChange(io)},removeNetworkStatusListener:function(){uni.offNetworkStatusChange(io),no=null},createSSEClient:function(e){return gt(exports.ErrorCode.NOT_SUPPORT)},getApiVer:function(){var e=uni.getSystemInfoSync(),t=e.osAndroidAPILevel,r=e.deviceModel,n=e.deviceBrand,i=e.osVersion,o="android"===e.osName?t:i;return"".concat(n||"","|").concat(r||"","|").concat(o||"","|||uniapp").replace(/-/g,"_")},get runtimeInfo(){return{type:ao.tag,version:"Unknown"}}},uo=function(e){return e&&e.request&&e.getSystemInfo},lo="undefined"!=typeof uni&&uo(uni)?function(){switch(process.env.VUE_APP_PLATFORM){case"app-plus":case"app":case"app-harmony":return ao;case"mp-jd":return eo;case"mp-baidu":return Wi;case"mp-toutiao":return Bi;case"mp-alipay":return xi;case"mp-weixin":return Ni;default:return Xr}}():"undefined"!=typeof jd&&uo(jd)?eo:"undefined"!=typeof my&&uo(my)?xi:"undefined"!=typeof tt&&uo(tt)?Bi:"undefined"!=typeof swan&&uo(swan)?Wi:"undefined"!=typeof wx&&uo(wx)?Ni:Xr;function co(e){var t=function(){function e(e,t,r){this.low=0|e,this.high=0|t,this.unsigned=!!r}function t(e){return!0===(e&&e.__isLong__)}function r(e,t){var r,n,o;return t?(o=(e>>>=0)>=0&&e<256)&&(n=u[e])?n:(r=i(e,(0|e)<0?-1:0,!0),o&&(u[e]=r),r):(o=(e|=0)>=-128&&e<128)&&(n=a[e])?n:(r=i(e,e<0?-1:0,!1),o&&(a[e]=r),r)}function n(e,t){if(isNaN(e)||!isFinite(e))return t?g:h;if(t){if(e<0)return g;if(e>=d)return y}else{if(-p>=e)return m;if(e+1>=p)return v}return e<0?n(-e,t).neg():i(0|e%c,0|e/c,t)}function i(t,r,n){return new e(t,r,n)}function o(e,t,r){var i,s,a,u,c,d,p;if(0===e.length)throw Error("empty string");if("NaN"===e||"Infinity"===e||"+Infinity"===e||"-Infinity"===e)return h;if("number"==typeof t?(r=t,t=!1):t=!!t,(r=r||10)<2||r>36)throw RangeError("radix");if((i=e.indexOf("-"))>0)throw Error("interior hyphen");if(0===i)return o(e.substring(1),t,r).neg();for(s=n(l(r,8)),a=h,u=0;u<e.length;u+=8)c=Math.min(8,e.length-u),d=parseInt(e.substring(u,u+c),r),c<8?(p=n(l(r,c)),a=a.mul(p).add(n(d))):a=(a=a.mul(s)).add(n(d));return a.unsigned=t,a}function s(t){return t instanceof e?t:"number"==typeof t?n(t):"string"==typeof t?o(t):i(t.low,t.high,t.unsigned)}var a,u,l,c,d,p,f,h,g,_,b,E,v,y,m,I;return e.prototype.__isLong__,Object.defineProperty(e.prototype,"__isLong__",{value:!0,enumerable:!1,configurable:!1}),e.isLong=t,a={},u={},e.fromInt=r,e.fromNumber=n,e.fromBits=i,l=Math.pow,e.fromString=o,e.fromValue=s,p=(d=(c=4294967296)*c)/2,f=r(16777216),h=r(0),e.ZERO=h,g=r(0,!0),e.UZERO=g,_=r(1),e.ONE=_,b=r(1,!0),e.UONE=b,E=r(-1),e.NEG_ONE=E,v=i(-1,2147483647,!1),e.MAX_VALUE=v,y=i(-1,-1,!0),e.MAX_UNSIGNED_VALUE=y,m=i(0,-2147483648,!1),e.MIN_VALUE=m,(I=e.prototype).toInt=function(){return this.unsigned?this.low>>>0:this.low},I.toNumber=function(){return this.unsigned?(this.high>>>0)*c+(this.low>>>0):this.high*c+(this.low>>>0)},I.toString=function(e){var t,r,i,o,s,a,u,c;if((e=e||10)<2||e>36)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative())return this.eq(m)?(t=n(e),i=(r=this.div(t)).mul(t).sub(this),r.toString(e)+i.toInt().toString(e)):"-"+this.neg().toString(e);for(o=n(l(e,6),this.unsigned),s=this,a="";;){if(u=s.div(o),c=(s.sub(u.mul(o)).toInt()>>>0).toString(e),(s=u).isZero())return c+a;for(;c.length<6;)c="0"+c;a=""+c+a}},I.getHighBits=function(){return this.high},I.getHighBitsUnsigned=function(){return this.high>>>0},I.getLowBits=function(){return this.low},I.getLowBitsUnsigned=function(){return this.low>>>0},I.getNumBitsAbs=function(){var e,t;if(this.isNegative())return this.eq(m)?64:this.neg().getNumBitsAbs();for(e=0!=this.high?this.high:this.low,t=31;t>0&&!(e&1<<t);t--);return 0!=this.high?t+33:t+1},I.isZero=function(){return 0===this.high&&0===this.low},I.isNegative=function(){return!this.unsigned&&this.high<0},I.isPositive=function(){return this.unsigned||this.high>=0},I.isOdd=function(){return!(1&~this.low)},I.isEven=function(){return!(1&this.low)},I.equals=function(e){return t(e)||(e=s(e)),(this.unsigned===e.unsigned||this.high>>>31!=1||e.high>>>31!=1)&&(this.high===e.high&&this.low===e.low)},I.eq=I.equals,I.notEquals=function(e){return!this.eq(e)},I.neq=I.notEquals,I.lessThan=function(e){return this.comp(e)<0},I.lt=I.lessThan,I.lessThanOrEqual=function(e){return this.comp(e)<=0},I.lte=I.lessThanOrEqual,I.greaterThan=function(e){return this.comp(e)>0},I.gt=I.greaterThan,I.greaterThanOrEqual=function(e){return this.comp(e)>=0},I.gte=I.greaterThanOrEqual,I.compare=function(e){if(t(e)||(e=s(e)),this.eq(e))return 0;var r=this.isNegative(),n=e.isNegative();return r&&!n?-1:!r&&n?1:this.unsigned?e.high>>>0>this.high>>>0||e.high===this.high&&e.low>>>0>this.low>>>0?-1:1:this.sub(e).isNegative()?-1:1},I.comp=I.compare,I.negate=function(){return!this.unsigned&&this.eq(m)?m:this.not().add(_)},I.neg=I.negate,I.add=function(e){var r,n,o,a,u,l,c,d,p,f,h;return t(e)||(e=s(e)),r=this.high>>>16,n=65535&this.high,o=this.low>>>16,a=65535&this.low,u=e.high>>>16,l=65535&e.high,c=e.low>>>16,d=0,p=0,f=0,h=0,f+=(h+=a+(65535&e.low))>>>16,p+=(f+=o+c)>>>16,d+=(p+=n+l)>>>16,d+=r+u,i((f&=65535)<<16|(h&=65535),(d&=65535)<<16|(p&=65535),this.unsigned)},I.subtract=function(e){return t(e)||(e=s(e)),this.add(e.neg())},I.sub=I.subtract,I.multiply=function(e){var r,o,a,u,l,c,d,p,g,_,b,E;return this.isZero()?h:(t(e)||(e=s(e)),e.isZero()?h:this.eq(m)?e.isOdd()?m:h:e.eq(m)?this.isOdd()?m:h:this.isNegative()?e.isNegative()?this.neg().mul(e.neg()):this.neg().mul(e).neg():e.isNegative()?this.mul(e.neg()).neg():this.lt(f)&&e.lt(f)?n(this.toNumber()*e.toNumber(),this.unsigned):(r=this.high>>>16,o=65535&this.high,a=this.low>>>16,u=65535&this.low,l=e.high>>>16,c=65535&e.high,d=e.low>>>16,g=0,_=0,b=0,E=0,b+=(E+=u*(p=65535&e.low))>>>16,_+=(b+=a*p)>>>16,b&=65535,_+=(b+=u*d)>>>16,g+=(_+=o*p)>>>16,_&=65535,g+=(_+=a*d)>>>16,_&=65535,g+=(_+=u*c)>>>16,g+=r*p+o*d+a*c+u*l,i((b&=65535)<<16|(E&=65535),(g&=65535)<<16|(_&=65535),this.unsigned)))},I.mul=I.multiply,I.divide=function(e){var r,i,o,a,u,c,d;if(t(e)||(e=s(e)),e.isZero())throw Error("division by zero");if(this.isZero())return this.unsigned?g:h;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return g;if(e.gt(this.shru(1)))return b;o=g}else{if(this.eq(m))return e.eq(_)||e.eq(E)?m:e.eq(m)?_:(r=this.shr(1).div(e).shl(1)).eq(h)?e.isNegative()?_:E:(i=this.sub(e.mul(r)),o=r.add(i.div(e)));if(e.eq(m))return this.unsigned?g:h;if(this.isNegative())return e.isNegative()?this.neg().div(e.neg()):this.neg().div(e).neg();if(e.isNegative())return this.div(e.neg()).neg();o=h}for(i=this;i.gte(e);){for(r=Math.max(1,Math.floor(i.toNumber()/e.toNumber())),u=(a=Math.ceil(Math.log(r)/Math.LN2))<=48?1:l(2,a-48),d=(c=n(r)).mul(e);d.isNegative()||d.gt(i);)d=(c=n(r-=u,this.unsigned)).mul(e);c.isZero()&&(c=_),o=o.add(c),i=i.sub(d)}return o},I.div=I.divide,I.modulo=function(e){return t(e)||(e=s(e)),this.sub(this.div(e).mul(e))},I.mod=I.modulo,I.not=function(){return i(~this.low,~this.high,this.unsigned)},I.and=function(e){return t(e)||(e=s(e)),i(this.low&e.low,this.high&e.high,this.unsigned)},I.or=function(e){return t(e)||(e=s(e)),i(this.low|e.low,this.high|e.high,this.unsigned)},I.xor=function(e){return t(e)||(e=s(e)),i(this.low^e.low,this.high^e.high,this.unsigned)},I.shiftLeft=function(e){return t(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?i(this.low<<e,this.high<<e|this.low>>>32-e,this.unsigned):i(0,this.low<<e-32,this.unsigned)},I.shl=I.shiftLeft,I.shiftRight=function(e){return t(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?i(this.low>>>e|this.high<<32-e,this.high>>e,this.unsigned):i(this.high>>e-32,this.high>=0?0:-1,this.unsigned)},I.shr=I.shiftRight,I.shiftRightUnsigned=function(e){var r;return t(e)&&(e=e.toInt()),0===(e&=63)?this:(r=this.high,e<32?i(this.low>>>e|r<<32-e,r>>>e,this.unsigned):i(32===e?r:r>>>e-32,0,this.unsigned))},I.shru=I.shiftRightUnsigned,I.toSigned=function(){return this.unsigned?i(this.low,this.high,!1):this},I.toUnsigned=function(){return this.unsigned?this:i(this.low,this.high,!0)},I.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()},I.toBytesLE=function(){var e=this.high,t=this.low;return[255&t,255&t>>>8,255&t>>>16,255&t>>>24,255&e,255&e>>>8,255&e>>>16,255&e>>>24]},I.toBytesBE=function(){var e=this.high,t=this.low;return[255&e>>>24,255&e>>>16,255&e>>>8,255&e,255&t>>>24,255&t>>>16,255&t>>>8,255&t]},e}(),r=function(e){function t(e){var t=0;return function(){return t<e.length?e.charCodeAt(t++):null}}function r(){var e=[],t=[];return function(){return 0===arguments.length?t.join("")+a.apply(String,e):(e.length+arguments.length>1024&&(t.push(a.apply(String,e)),e.length=0),void Array.prototype.push.apply(e,arguments))}}function n(e,t,r,n,i){var o,s,a=8*i-n-1,u=(1<<a)-1,l=u>>1,c=-7,d=r?i-1:0,p=r?-1:1,f=e[t+d];for(d+=p,o=f&(1<<-c)-1,f>>=-c,c+=a;c>0;o=256*o+e[t+d],d+=p,c-=8);for(s=o&(1<<-c)-1,o>>=-c,c+=n;c>0;s=256*s+e[t+d],d+=p,c-=8);if(0===o)o=1-l;else{if(o===u)return s?NaN:1/0*(f?-1:1);s+=Math.pow(2,n),o-=l}return(f?-1:1)*s*Math.pow(2,o-n)}function i(e,t,r,n,i,o){var s,a,u,l=8*o-i-1,c=(1<<l)-1,d=c>>1,p=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,f=n?0:o-1,h=n?1:-1,g=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||1/0===t?(a=isNaN(t)?1:0,s=c):(s=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-s))<1&&(s--,u*=2),(t+=s+d>=1?p/u:p*Math.pow(2,1-d))*u>=2&&(s++,u/=2),s+d>=c?(a=0,s=c):s+d>=1?(a=(t*u-1)*Math.pow(2,i),s+=d):(a=t*Math.pow(2,d-1)*Math.pow(2,i),s=0));i>=8;e[r+f]=255&a,f+=h,a/=256,i-=8);for(s=s<<i|a,l+=i;l>0;e[r+f]=255&s,f+=h,s/=256,l-=8);e[r+f-h]|=128*g}var o,s,a,u,l,c=function(e,t,r){if(void 0===e&&(e=c.DEFAULT_CAPACITY),void 0===t&&(t=c.DEFAULT_ENDIAN),void 0===r&&(r=c.DEFAULT_NOASSERT),!r){if((e|=0)<0)throw RangeError("Illegal capacity");t=!!t,r=!!r}this.buffer=0===e?s:new ArrayBuffer(e),this.view=0===e?null:new Uint8Array(this.buffer),this.offset=0,this.markedOffset=-1,this.limit=e,this.littleEndian=t,this.noAssert=r};return c.VERSION="5.0.1",c.LITTLE_ENDIAN=!0,c.BIG_ENDIAN=!1,c.DEFAULT_CAPACITY=16,c.DEFAULT_ENDIAN=c.BIG_ENDIAN,c.DEFAULT_NOASSERT=!1,c.Long=e||null,(o=c.prototype).__isByteBuffer__,Object.defineProperty(o,"__isByteBuffer__",{value:!0,enumerable:!1,configurable:!1}),s=new ArrayBuffer(0),a=String.fromCharCode,c.accessor=function(){return Uint8Array},c.allocate=function(e,t,r){return new c(e,t,r)},c.concat=function(e,t,r,n){var i,o,s,a,u,l;for(("boolean"==typeof t||"string"!=typeof t)&&(n=r,r=t,t=void 0),i=0,s=0,a=e.length;a>s;++s)c.isByteBuffer(e[s])||(e[s]=c.wrap(e[s],t)),(o=e[s].limit-e[s].offset)>0&&(i+=o);if(0===i)return new c(0,r,n);for(l=new c(i,r,n),s=0;a>s;)(o=(u=e[s++]).limit-u.offset)<=0||(l.view.set(u.view.subarray(u.offset,u.limit),l.offset),l.offset+=o);return l.limit=l.offset,l.offset=0,l},c.isByteBuffer=function(e){return!0===(e&&e.__isByteBuffer__)},c.type=function(){return ArrayBuffer},c.wrap=function(e,t,r,n){var i,s;if("string"!=typeof t&&(n=r,r=t,t=void 0),"string"==typeof e)switch(void 0===t&&(t="utf8"),t){case"base64":return c.fromBase64(e,r);case"hex":return c.fromHex(e,r);case"binary":return c.fromBinary(e,r);case"utf8":return c.fromUTF8(e,r);case"debug":return c.fromDebug(e,r);default:throw Error("Unsupported encoding: "+t)}if(null===e||"object"!=typeof e)throw TypeError("Illegal buffer");if(c.isByteBuffer(e))return(i=o.clone.call(e)).markedOffset=-1,i;if(e instanceof Uint8Array)i=new c(0,r,n),e.length>0&&(i.buffer=e.buffer,i.offset=e.byteOffset,i.limit=e.byteOffset+e.byteLength,i.view=new Uint8Array(e.buffer));else if(e instanceof ArrayBuffer)i=new c(0,r,n),e.byteLength>0&&(i.buffer=e,i.offset=0,i.limit=e.byteLength,i.view=e.byteLength>0?new Uint8Array(e):null);else{if("[object Array]"!==Object.prototype.toString.call(e))throw TypeError("Illegal buffer");for((i=new c(e.length,r,n)).limit=e.length,s=0;s<e.length;++s)i.view[s]=e[s]}return i},o.writeBitSet=function(e,t){var r,n,i,o,s,a,u=void 0===t;if(u&&(t=this.offset),!this.noAssert){if(!(e instanceof Array))throw TypeError("Illegal BitSet: Not an array");if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}for(n=t,o=(i=e.length)>>3,s=0,t+=this.writeVarint32(i,t);o--;)r=1&!!e[s++]|(1&!!e[s++])<<1|(1&!!e[s++])<<2|(1&!!e[s++])<<3|(1&!!e[s++])<<4|(1&!!e[s++])<<5|(1&!!e[s++])<<6|(1&!!e[s++])<<7,this.writeByte(r,t++);if(i>s){for(a=0,r=0;i>s;)r|=(1&!!e[s++])<<a++;this.writeByte(r,t++)}return u?(this.offset=t,this):t-n},o.readBitSet=function(e){var t,r,n,i,o,s,a,u=void 0===e;for(u&&(e=this.offset),i=(n=(r=this.readVarint32(e)).value)>>3,o=0,s=[],e+=r.length;i--;)t=this.readByte(e++),s[o++]=!!(1&t),s[o++]=!!(2&t),s[o++]=!!(4&t),s[o++]=!!(8&t),s[o++]=!!(16&t),s[o++]=!!(32&t),s[o++]=!!(64&t),s[o++]=!!(128&t);if(n>o)for(a=0,t=this.readByte(e++);n>o;)s[o++]=!!(1&t>>a++);return u&&(this.offset=e),s},o.readBytes=function(e,t){var r,n=void 0===t;if(n&&(t=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+e>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+"+e+") <= "+this.buffer.byteLength)}return r=this.slice(t,t+e),n&&(this.offset+=e),r},o.writeBytes=o.append,o.writeInt8=function(e,t){var r,n=void 0===t;if(n&&(t=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e|=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}return(t+=1)>(r=this.buffer.byteLength)&&this.resize((r*=2)>t?r:t),t-=1,this.view[t]=e,n&&(this.offset+=1),this},o.writeByte=o.writeInt8,o.readInt8=function(e){var t,r=void 0===e;if(r&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+1) <= "+this.buffer.byteLength)}return!(128&~(t=this.view[e]))&&(t=-(255-t+1)),r&&(this.offset+=1),t},o.readByte=o.readInt8,o.writeUint8=function(e,t){var r,n=void 0===t;if(n&&(t=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e>>>=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}return(t+=1)>(r=this.buffer.byteLength)&&this.resize((r*=2)>t?r:t),t-=1,this.view[t]=e,n&&(this.offset+=1),this},o.writeUInt8=o.writeUint8,o.readUint8=function(e){var t,r=void 0===e;if(r&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+1) <= "+this.buffer.byteLength)}return t=this.view[e],r&&(this.offset+=1),t},o.readUInt8=o.readUint8,o.writeInt16=function(e,t){var r,n=void 0===t;if(n&&(t=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e|=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}return(t+=2)>(r=this.buffer.byteLength)&&this.resize((r*=2)>t?r:t),t-=2,this.littleEndian?(this.view[t+1]=(65280&e)>>>8,this.view[t]=255&e):(this.view[t]=(65280&e)>>>8,this.view[t+1]=255&e),n&&(this.offset+=2),this},o.writeShort=o.writeInt16,o.readInt16=function(e){var t,r=void 0===e;if(r&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+2>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+2) <= "+this.buffer.byteLength)}return t=0,this.littleEndian?(t=this.view[e],t|=this.view[e+1]<<8):(t=this.view[e]<<8,t|=this.view[e+1]),!(32768&~t)&&(t=-(65535-t+1)),r&&(this.offset+=2),t},o.readShort=o.readInt16,o.writeUint16=function(e,t){var r,n=void 0===t;if(n&&(t=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e>>>=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}return(t+=2)>(r=this.buffer.byteLength)&&this.resize((r*=2)>t?r:t),t-=2,this.littleEndian?(this.view[t+1]=(65280&e)>>>8,this.view[t]=255&e):(this.view[t]=(65280&e)>>>8,this.view[t+1]=255&e),n&&(this.offset+=2),this},o.writeUInt16=o.writeUint16,o.readUint16=function(e){var t,r=void 0===e;if(r&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+2>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+2) <= "+this.buffer.byteLength)}return t=0,this.littleEndian?(t=this.view[e],t|=this.view[e+1]<<8):(t=this.view[e]<<8,t|=this.view[e+1]),r&&(this.offset+=2),t},o.readUInt16=o.readUint16,o.writeInt32=function(e,t){var r,n=void 0===t;if(n&&(t=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e|=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}return(t+=4)>(r=this.buffer.byteLength)&&this.resize((r*=2)>t?r:t),t-=4,this.littleEndian?(this.view[t+3]=255&e>>>24,this.view[t+2]=255&e>>>16,this.view[t+1]=255&e>>>8,this.view[t]=255&e):(this.view[t]=255&e>>>24,this.view[t+1]=255&e>>>16,this.view[t+2]=255&e>>>8,this.view[t+3]=255&e),n&&(this.offset+=4),this},o.writeInt=o.writeInt32,o.readInt32=function(e){var t,r=void 0===e;if(r&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+4>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+4) <= "+this.buffer.byteLength)}return t=0,this.littleEndian?(t=this.view[e+2]<<16,t|=this.view[e+1]<<8,t|=this.view[e],t+=this.view[e+3]<<24>>>0):(t=this.view[e+1]<<16,t|=this.view[e+2]<<8,t|=this.view[e+3],t+=this.view[e]<<24>>>0),t|=0,r&&(this.offset+=4),t},o.readInt=o.readInt32,o.writeUint32=function(e,t){var r,n=void 0===t;if(n&&(t=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e>>>=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}return(t+=4)>(r=this.buffer.byteLength)&&this.resize((r*=2)>t?r:t),t-=4,this.littleEndian?(this.view[t+3]=255&e>>>24,this.view[t+2]=255&e>>>16,this.view[t+1]=255&e>>>8,this.view[t]=255&e):(this.view[t]=255&e>>>24,this.view[t+1]=255&e>>>16,this.view[t+2]=255&e>>>8,this.view[t+3]=255&e),n&&(this.offset+=4),this},o.writeUInt32=o.writeUint32,o.readUint32=function(e){var t,r=void 0===e;if(r&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+4>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+4) <= "+this.buffer.byteLength)}return t=0,this.littleEndian?(t=this.view[e+2]<<16,t|=this.view[e+1]<<8,t|=this.view[e],t+=this.view[e+3]<<24>>>0):(t=this.view[e+1]<<16,t|=this.view[e+2]<<8,t|=this.view[e+3],t+=this.view[e]<<24>>>0),r&&(this.offset+=4),t},o.readUInt32=o.readUint32,e&&(o.writeInt64=function(t,r){var n,i,o,s=void 0===r;if(s&&(r=this.offset),!this.noAssert){if("number"==typeof t)t=e.fromNumber(t);else if("string"==typeof t)t=e.fromString(t);else if(!(t&&t instanceof e))throw TypeError("Illegal value: "+t+" (not an integer or Long)");if("number"!=typeof r||r%1!=0)throw TypeError("Illegal offset: "+r+" (not an integer)");if((r>>>=0)<0||r+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+r+" (+0) <= "+this.buffer.byteLength)}return"number"==typeof t?t=e.fromNumber(t):"string"==typeof t&&(t=e.fromString(t)),(r+=8)>(n=this.buffer.byteLength)&&this.resize((n*=2)>r?n:r),r-=8,i=t.low,o=t.high,this.littleEndian?(this.view[r+3]=255&i>>>24,this.view[r+2]=255&i>>>16,this.view[r+1]=255&i>>>8,this.view[r]=255&i,r+=4,this.view[r+3]=255&o>>>24,this.view[r+2]=255&o>>>16,this.view[r+1]=255&o>>>8,this.view[r]=255&o):(this.view[r]=255&o>>>24,this.view[r+1]=255&o>>>16,this.view[r+2]=255&o>>>8,this.view[r+3]=255&o,r+=4,this.view[r]=255&i>>>24,this.view[r+1]=255&i>>>16,this.view[r+2]=255&i>>>8,this.view[r+3]=255&i),s&&(this.offset+=8),this},o.writeLong=o.writeInt64,o.readInt64=function(t){var r,n,i,o=void 0===t;if(o&&(t=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+8>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+8) <= "+this.buffer.byteLength)}return r=0,n=0,this.littleEndian?(r=this.view[t+2]<<16,r|=this.view[t+1]<<8,r|=this.view[t],r+=this.view[t+3]<<24>>>0,t+=4,n=this.view[t+2]<<16,n|=this.view[t+1]<<8,n|=this.view[t],n+=this.view[t+3]<<24>>>0):(n=this.view[t+1]<<16,n|=this.view[t+2]<<8,n|=this.view[t+3],n+=this.view[t]<<24>>>0,t+=4,r=this.view[t+1]<<16,r|=this.view[t+2]<<8,r|=this.view[t+3],r+=this.view[t]<<24>>>0),i=new e(r,n,!1),o&&(this.offset+=8),i},o.readLong=o.readInt64,o.writeUint64=function(t,r){var n,i,o,s=void 0===r;if(s&&(r=this.offset),!this.noAssert){if("number"==typeof t)t=e.fromNumber(t);else if("string"==typeof t)t=e.fromString(t);else if(!(t&&t instanceof e))throw TypeError("Illegal value: "+t+" (not an integer or Long)");if("number"!=typeof r||r%1!=0)throw TypeError("Illegal offset: "+r+" (not an integer)");if((r>>>=0)<0||r+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+r+" (+0) <= "+this.buffer.byteLength)}return"number"==typeof t?t=e.fromNumber(t):"string"==typeof t&&(t=e.fromString(t)),(r+=8)>(n=this.buffer.byteLength)&&this.resize((n*=2)>r?n:r),r-=8,i=t.low,o=t.high,this.littleEndian?(this.view[r+3]=255&i>>>24,this.view[r+2]=255&i>>>16,this.view[r+1]=255&i>>>8,this.view[r]=255&i,r+=4,this.view[r+3]=255&o>>>24,this.view[r+2]=255&o>>>16,this.view[r+1]=255&o>>>8,this.view[r]=255&o):(this.view[r]=255&o>>>24,this.view[r+1]=255&o>>>16,this.view[r+2]=255&o>>>8,this.view[r+3]=255&o,r+=4,this.view[r]=255&i>>>24,this.view[r+1]=255&i>>>16,this.view[r+2]=255&i>>>8,this.view[r+3]=255&i),s&&(this.offset+=8),this},o.writeUInt64=o.writeUint64,o.readUint64=function(t){var r,n,i,o=void 0===t;if(o&&(t=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+8>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+8) <= "+this.buffer.byteLength)}return r=0,n=0,this.littleEndian?(r=this.view[t+2]<<16,r|=this.view[t+1]<<8,r|=this.view[t],r+=this.view[t+3]<<24>>>0,t+=4,n=this.view[t+2]<<16,n|=this.view[t+1]<<8,n|=this.view[t],n+=this.view[t+3]<<24>>>0):(n=this.view[t+1]<<16,n|=this.view[t+2]<<8,n|=this.view[t+3],n+=this.view[t]<<24>>>0,t+=4,r=this.view[t+1]<<16,r|=this.view[t+2]<<8,r|=this.view[t+3],r+=this.view[t]<<24>>>0),i=new e(r,n,!0),o&&(this.offset+=8),i},o.readUInt64=o.readUint64),o.writeFloat32=function(e,t){var r,n=void 0===t;if(n&&(t=this.offset),!this.noAssert){if("number"!=typeof e)throw TypeError("Illegal value: "+e+" (not a number)");if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}return(t+=4)>(r=this.buffer.byteLength)&&this.resize((r*=2)>t?r:t),t-=4,i(this.view,e,t,this.littleEndian,23,4),n&&(this.offset+=4),this},o.writeFloat=o.writeFloat32,o.readFloat32=function(e){var t,r=void 0===e;if(r&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+4>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+4) <= "+this.buffer.byteLength)}return t=n(this.view,e,this.littleEndian,23,4),r&&(this.offset+=4),t},o.readFloat=o.readFloat32,o.writeFloat64=function(e,t){var r,n=void 0===t;if(n&&(t=this.offset),!this.noAssert){if("number"!=typeof e)throw TypeError("Illegal value: "+e+" (not a number)");if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}return(t+=8)>(r=this.buffer.byteLength)&&this.resize((r*=2)>t?r:t),t-=8,i(this.view,e,t,this.littleEndian,52,8),n&&(this.offset+=8),this},o.writeDouble=o.writeFloat64,o.readFloat64=function(e){var t,r=void 0===e;if(r&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+8>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+8) <= "+this.buffer.byteLength)}return t=n(this.view,e,this.littleEndian,52,8),r&&(this.offset+=8),t},o.readDouble=o.readFloat64,c.MAX_VARINT32_BYTES=5,c.calculateVarint32=function(e){return(e>>>=0)<128?1:e<16384?2:1<<21>e?3:1<<28>e?4:5},c.zigZagEncode32=function(e){return((e|=0)<<1^e>>31)>>>0},c.zigZagDecode32=function(e){return e>>>1^-(1&e)},o.writeVarint32=function(e,t){var r,n,i,o=void 0===t;if(o&&(t=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e|=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}for((t+=n=c.calculateVarint32(e))>(i=this.buffer.byteLength)&&this.resize((i*=2)>t?i:t),t-=n,e>>>=0;e>=128;)r=128|127&e,this.view[t++]=r,e>>>=7;return this.view[t++]=e,o?(this.offset=t,this):n},o.writeVarint32ZigZag=function(e,t){return this.writeVarint32(c.zigZagEncode32(e),t)},o.readVarint32=function(e){var t,r,n,i,o=void 0===e;if(o&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+1) <= "+this.buffer.byteLength)}r=0,n=0;do{if(!this.noAssert&&e>this.limit)throw(i=Error("Truncated")).truncated=!0,i;t=this.view[e++],r<5&&(n|=(127&t)<<7*r),++r}while(128&t);return n|=0,o?(this.offset=e,n):{value:n,length:r}},o.readVarint32ZigZag=function(e){var t=this.readVarint32(e);return"object"==typeof t?t.value=c.zigZagDecode32(t.value):t=c.zigZagDecode32(t),t},e&&(c.MAX_VARINT64_BYTES=10,c.calculateVarint64=function(t){"number"==typeof t?t=e.fromNumber(t):"string"==typeof t&&(t=e.fromString(t));var r=t.toInt()>>>0,n=t.shiftRightUnsigned(28).toInt()>>>0,i=t.shiftRightUnsigned(56).toInt()>>>0;return 0==i?0==n?r<16384?r<128?1:2:1<<21>r?3:4:n<16384?n<128?5:6:1<<21>n?7:8:i<128?9:10},c.zigZagEncode64=function(t){return"number"==typeof t?t=e.fromNumber(t,!1):"string"==typeof t?t=e.fromString(t,!1):!1!==t.unsigned&&(t=t.toSigned()),t.shiftLeft(1).xor(t.shiftRight(63)).toUnsigned()},c.zigZagDecode64=function(t){return"number"==typeof t?t=e.fromNumber(t,!1):"string"==typeof t?t=e.fromString(t,!1):!1!==t.unsigned&&(t=t.toSigned()),t.shiftRightUnsigned(1).xor(t.and(e.ONE).toSigned().negate()).toSigned()},o.writeVarint64=function(t,r){var n,i,o,s,a,u=void 0===r;if(u&&(r=this.offset),!this.noAssert){if("number"==typeof t)t=e.fromNumber(t);else if("string"==typeof t)t=e.fromString(t);else if(!(t&&t instanceof e))throw TypeError("Illegal value: "+t+" (not an integer or Long)");if("number"!=typeof r||r%1!=0)throw TypeError("Illegal offset: "+r+" (not an integer)");if((r>>>=0)<0||r+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+r+" (+0) <= "+this.buffer.byteLength)}switch("number"==typeof t?t=e.fromNumber(t,!1):"string"==typeof t?t=e.fromString(t,!1):!1!==t.unsigned&&(t=t.toSigned()),n=c.calculateVarint64(t),i=t.toInt()>>>0,o=t.shiftRightUnsigned(28).toInt()>>>0,s=t.shiftRightUnsigned(56).toInt()>>>0,(r+=n)>(a=this.buffer.byteLength)&&this.resize((a*=2)>r?a:r),r-=n,n){case 10:this.view[r+9]=1&s>>>7;case 9:this.view[r+8]=9!==n?128|s:127&s;case 8:this.view[r+7]=8!==n?128|o>>>21:127&o>>>21;case 7:this.view[r+6]=7!==n?128|o>>>14:127&o>>>14;case 6:this.view[r+5]=6!==n?128|o>>>7:127&o>>>7;case 5:this.view[r+4]=5!==n?128|o:127&o;case 4:this.view[r+3]=4!==n?128|i>>>21:127&i>>>21;case 3:this.view[r+2]=3!==n?128|i>>>14:127&i>>>14;case 2:this.view[r+1]=2!==n?128|i>>>7:127&i>>>7;case 1:this.view[r]=1!==n?128|i:127&i}return u?(this.offset+=n,this):n},o.writeVarint64ZigZag=function(e,t){return this.writeVarint64(c.zigZagEncode64(e),t)},o.readVarint64=function(t){var r,n,i,o,s,a,u=void 0===t;if(u&&(t=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+1) <= "+this.buffer.byteLength)}if(r=t,n=0,i=0,o=0,s=0,n=127&(s=this.view[t++]),128&s&&(n|=(127&(s=this.view[t++]))<<7,(128&s||this.noAssert&&void 0===s)&&(n|=(127&(s=this.view[t++]))<<14,(128&s||this.noAssert&&void 0===s)&&(n|=(127&(s=this.view[t++]))<<21,(128&s||this.noAssert&&void 0===s)&&(i=127&(s=this.view[t++]),(128&s||this.noAssert&&void 0===s)&&(i|=(127&(s=this.view[t++]))<<7,(128&s||this.noAssert&&void 0===s)&&(i|=(127&(s=this.view[t++]))<<14,(128&s||this.noAssert&&void 0===s)&&(i|=(127&(s=this.view[t++]))<<21,(128&s||this.noAssert&&void 0===s)&&(o=127&(s=this.view[t++]),(128&s||this.noAssert&&void 0===s)&&(o|=(127&(s=this.view[t++]))<<7,128&s||this.noAssert&&void 0===s))))))))))throw Error("Buffer overrun");return a=e.fromBits(n|i<<28,i>>>4|o<<24,!1),u?(this.offset=t,a):{value:a,length:t-r}},o.readVarint64ZigZag=function(t){var r=this.readVarint64(t);return r&&r.value instanceof e?r.value=c.zigZagDecode64(r.value):r=c.zigZagDecode64(r),r}),o.writeCString=function(e,r){var n,i,o,s=void 0===r;if(s&&(r=this.offset),i=e.length,!this.noAssert){if("string"!=typeof e)throw TypeError("Illegal str: Not a string");for(n=0;i>n;++n)if(0===e.charCodeAt(n))throw RangeError("Illegal str: Contains NULL-characters");if("number"!=typeof r||r%1!=0)throw TypeError("Illegal offset: "+r+" (not an integer)");if((r>>>=0)<0||r+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+r+" (+0) <= "+this.buffer.byteLength)}return i=l.calculateUTF16asUTF8(t(e))[1],r+=i+1,o=this.buffer.byteLength,r>o&&this.resize((o*=2)>r?o:r),r-=i+1,l.encodeUTF16toUTF8(t(e),function(e){this.view[r++]=e}.bind(this)),this.view[r++]=0,s?(this.offset=r,this):i},o.readCString=function(e){var t,n,i,o=void 0===e;if(o&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+1) <= "+this.buffer.byteLength)}return t=e,i=-1,l.decodeUTF8toUTF16(function(){if(0===i)return null;if(e>=this.limit)throw RangeError("Illegal range: Truncated data, "+e+" < "+this.limit);return 0===(i=this.view[e++])?null:i}.bind(this),n=r(),!0),o?(this.offset=e,n()):{string:n(),length:e-t}},o.writeIString=function(e,r){var n,i,o,s=void 0===r;if(s&&(r=this.offset),!this.noAssert){if("string"!=typeof e)throw TypeError("Illegal str: Not a string");if("number"!=typeof r||r%1!=0)throw TypeError("Illegal offset: "+r+" (not an integer)");if((r>>>=0)<0||r+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+r+" (+0) <= "+this.buffer.byteLength)}if(i=r,n=l.calculateUTF16asUTF8(t(e),this.noAssert)[1],r+=4+n,o=this.buffer.byteLength,r>o&&this.resize((o*=2)>r?o:r),r-=4+n,this.littleEndian?(this.view[r+3]=255&n>>>24,this.view[r+2]=255&n>>>16,this.view[r+1]=255&n>>>8,this.view[r]=255&n):(this.view[r]=255&n>>>24,this.view[r+1]=255&n>>>16,this.view[r+2]=255&n>>>8,this.view[r+3]=255&n),r+=4,l.encodeUTF16toUTF8(t(e),function(e){this.view[r++]=e}.bind(this)),r!==i+4+n)throw RangeError("Illegal range: Truncated data, "+r+" == "+(r+4+n));return s?(this.offset=r,this):r-i},o.readIString=function(e){var t,r,n,i=void 0===e;if(i&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+4>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+4) <= "+this.buffer.byteLength)}return t=e,r=this.readUint32(e),n=this.readUTF8String(r,c.METRICS_BYTES,e+=4),e+=n.length,i?(this.offset=e,n.string):{string:n.string,length:e-t}},c.METRICS_CHARS="c",c.METRICS_BYTES="b",o.writeUTF8String=function(e,r){var n,i,o,s=void 0===r;if(s&&(r=this.offset),!this.noAssert){if("number"!=typeof r||r%1!=0)throw TypeError("Illegal offset: "+r+" (not an integer)");if((r>>>=0)<0||r+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+r+" (+0) <= "+this.buffer.byteLength)}return i=r,n=l.calculateUTF16asUTF8(t(e))[1],r+=n,o=this.buffer.byteLength,r>o&&this.resize((o*=2)>r?o:r),r-=n,l.encodeUTF16toUTF8(t(e),function(e){this.view[r++]=e}.bind(this)),s?(this.offset=r,this):r-i},o.writeString=o.writeUTF8String,c.calculateUTF8Chars=function(e){return l.calculateUTF16asUTF8(t(e))[0]},c.calculateUTF8Bytes=function(e){return l.calculateUTF16asUTF8(t(e))[1]},c.calculateString=c.calculateUTF8Bytes,o.readUTF8String=function(e,t,n){var i,o,s,a,u;if("number"==typeof t&&(n=t,t=void 0),(i=void 0===n)&&(n=this.offset),void 0===t&&(t=c.METRICS_CHARS),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal length: "+e+" (not an integer)");if(e|=0,"number"!=typeof n||n%1!=0)throw TypeError("Illegal offset: "+n+" (not an integer)");if((n>>>=0)<0||n+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+0) <= "+this.buffer.byteLength)}if(s=0,a=n,t===c.METRICS_CHARS){if(o=r(),l.decodeUTF8(function(){return e>s&&n<this.limit?this.view[n++]:null}.bind(this),(function(e){++s,l.UTF8toUTF16(e,o)})),s!==e)throw RangeError("Illegal range: Truncated data, "+s+" == "+e);return i?(this.offset=n,o()):{string:o(),length:n-a}}if(t===c.METRICS_BYTES){if(!this.noAssert){if("number"!=typeof n||n%1!=0)throw TypeError("Illegal offset: "+n+" (not an integer)");if((n>>>=0)<0||n+e>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+"+e+") <= "+this.buffer.byteLength)}if(u=n+e,l.decodeUTF8toUTF16(function(){return u>n?this.view[n++]:null}.bind(this),o=r(),this.noAssert),n!==u)throw RangeError("Illegal range: Truncated data, "+n+" == "+u);return i?(this.offset=n,o()):{string:o(),length:n-a}}throw TypeError("Unsupported metrics: "+t)},o.readString=o.readUTF8String,o.writeVString=function(e,r){var n,i,o,s,a=void 0===r;if(a&&(r=this.offset),!this.noAssert){if("string"!=typeof e)throw TypeError("Illegal str: Not a string");if("number"!=typeof r||r%1!=0)throw TypeError("Illegal offset: "+r+" (not an integer)");if((r>>>=0)<0||r+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+r+" (+0) <= "+this.buffer.byteLength)}if(o=r,n=l.calculateUTF16asUTF8(t(e),this.noAssert)[1],i=c.calculateVarint32(n),r+=i+n,s=this.buffer.byteLength,r>s&&this.resize((s*=2)>r?s:r),r-=i+n,r+=this.writeVarint32(n,r),l.encodeUTF16toUTF8(t(e),function(e){this.view[r++]=e}.bind(this)),r!==o+n+i)throw RangeError("Illegal range: Truncated data, "+r+" == "+(r+n+i));return a?(this.offset=r,this):r-o},o.readVString=function(e){var t,r,n,i=void 0===e;if(i&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+1) <= "+this.buffer.byteLength)}return t=e,r=this.readVarint32(e),n=this.readUTF8String(r.value,c.METRICS_BYTES,e+=r.length),e+=n.length,i?(this.offset=e,n.string):{string:n.string,length:e-t}},o.append=function(e,t,r){var n,i,o;if(("number"==typeof t||"string"!=typeof t)&&(r=t,t=void 0),(n=void 0===r)&&(r=this.offset),!this.noAssert){if("number"!=typeof r||r%1!=0)throw TypeError("Illegal offset: "+r+" (not an integer)");if((r>>>=0)<0||r+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+r+" (+0) <= "+this.buffer.byteLength)}return e instanceof c||(e=c.wrap(e,t)),(i=e.limit-e.offset)<=0||((r+=i)>(o=this.buffer.byteLength)&&this.resize((o*=2)>r?o:r),r-=i,this.view.set(e.view.subarray(e.offset,e.limit),r),e.offset+=i,n&&(this.offset+=i)),this},o.appendTo=function(e,t){return e.append(this,t),this},o.assert=function(e){return this.noAssert=!e,this},o.capacity=function(){return this.buffer.byteLength},o.clear=function(){return this.offset=0,this.limit=this.buffer.byteLength,this.markedOffset=-1,this},o.clone=function(e){var t=new c(0,this.littleEndian,this.noAssert);return e?(t.buffer=new ArrayBuffer(this.buffer.byteLength),t.view=new Uint8Array(t.buffer)):(t.buffer=this.buffer,t.view=this.view),t.offset=this.offset,t.markedOffset=this.markedOffset,t.limit=this.limit,t},o.compact=function(e,t){var r,n,i;if(void 0===e&&(e=this.offset),void 0===t&&(t=this.limit),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal begin: Not an integer");if(e>>>=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal end: Not an integer");if(t>>>=0,e<0||e>t||t>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+e+" <= "+t+" <= "+this.buffer.byteLength)}return 0===e&&t===this.buffer.byteLength?this:0===(r=t-e)?(this.buffer=s,this.view=null,this.markedOffset>=0&&(this.markedOffset-=e),this.offset=0,this.limit=0,this):(n=new ArrayBuffer(r),(i=new Uint8Array(n)).set(this.view.subarray(e,t)),this.buffer=n,this.view=i,this.markedOffset>=0&&(this.markedOffset-=e),this.offset=0,this.limit=r,this)},o.copy=function(e,t){if(void 0===e&&(e=this.offset),void 0===t&&(t=this.limit),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal begin: Not an integer");if(e>>>=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal end: Not an integer");if(t>>>=0,e<0||e>t||t>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+e+" <= "+t+" <= "+this.buffer.byteLength)}if(e===t)return new c(0,this.littleEndian,this.noAssert);var r=t-e,n=new c(r,this.littleEndian,this.noAssert);return n.offset=0,n.limit=r,n.markedOffset>=0&&(n.markedOffset-=e),this.copyTo(n,0,e,t),n},o.copyTo=function(e,t,r,n){var i,o,s;if(!this.noAssert&&!c.isByteBuffer(e))throw TypeError("Illegal target: Not a ByteBuffer");if(t=(o=void 0===t)?e.offset:0|t,r=(i=void 0===r)?this.offset:0|r,n=void 0===n?this.limit:0|n,t<0||t>e.buffer.byteLength)throw RangeError("Illegal target range: 0 <= "+t+" <= "+e.buffer.byteLength);if(r<0||n>this.buffer.byteLength)throw RangeError("Illegal source range: 0 <= "+r+" <= "+this.buffer.byteLength);return 0===(s=n-r)?e:(e.ensureCapacity(t+s),e.view.set(this.view.subarray(r,n),t),i&&(this.offset+=s),o&&(e.offset+=s),this)},o.ensureCapacity=function(e){var t=this.buffer.byteLength;return e>t?this.resize((t*=2)>e?t:e):this},o.fill=function(e,t,r){var n=void 0===t;if(n&&(t=this.offset),"string"==typeof e&&e.length>0&&(e=e.charCodeAt(0)),void 0===t&&(t=this.offset),void 0===r&&(r=this.limit),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e|=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal begin: Not an integer");if(t>>>=0,"number"!=typeof r||r%1!=0)throw TypeError("Illegal end: Not an integer");if(r>>>=0,t<0||t>r||r>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+t+" <= "+r+" <= "+this.buffer.byteLength)}if(t>=r)return this;for(;r>t;)this.view[t++]=e;return n&&(this.offset=t),this},o.flip=function(){return this.limit=this.offset,this.offset=0,this},o.mark=function(e){if(e=void 0===e?this.offset:e,!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+0) <= "+this.buffer.byteLength)}return this.markedOffset=e,this},o.order=function(e){if(!this.noAssert&&"boolean"!=typeof e)throw TypeError("Illegal littleEndian: Not a boolean");return this.littleEndian=!!e,this},o.LE=function(e){return this.littleEndian=void 0===e||!!e,this},o.BE=function(e){return this.littleEndian=void 0!==e&&!e,this},o.prepend=function(e,t,r){var n,i,o,s,a;if(("number"==typeof t||"string"!=typeof t)&&(r=t,t=void 0),(n=void 0===r)&&(r=this.offset),!this.noAssert){if("number"!=typeof r||r%1!=0)throw TypeError("Illegal offset: "+r+" (not an integer)");if((r>>>=0)<0||r+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+r+" (+0) <= "+this.buffer.byteLength)}return e instanceof c||(e=c.wrap(e,t)),(i=e.limit-e.offset)<=0||((o=i-r)>0?(s=new ArrayBuffer(this.buffer.byteLength+o),(a=new Uint8Array(s)).set(this.view.subarray(r,this.buffer.byteLength),i),this.buffer=s,this.view=a,this.offset+=o,this.markedOffset>=0&&(this.markedOffset+=o),this.limit+=o,r+=o):new Uint8Array(this.buffer),this.view.set(e.view.subarray(e.offset,e.limit),r-i),e.offset=e.limit,n&&(this.offset-=i)),this},o.prependTo=function(e,t){return e.prepend(this,t),this},o.printDebug=function(e){"function"!=typeof e&&(e=console.log.bind(console)),e(this.toString()+"\n-------------------------------------------------------------------\n"+this.toDebug(!0))},o.remaining=function(){return this.limit-this.offset},o.reset=function(){return this.markedOffset>=0?(this.offset=this.markedOffset,this.markedOffset=-1):this.offset=0,this},o.resize=function(e){var t,r;if(!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal capacity: "+e+" (not an integer)");if((e|=0)<0)throw RangeError("Illegal capacity: 0 <= "+e)}return this.buffer.byteLength<e&&(t=new ArrayBuffer(e),(r=new Uint8Array(t)).set(this.view),this.buffer=t,this.view=r),this},o.reverse=function(e,t){if(void 0===e&&(e=this.offset),void 0===t&&(t=this.limit),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal begin: Not an integer");if(e>>>=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal end: Not an integer");if(t>>>=0,e<0||e>t||t>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+e+" <= "+t+" <= "+this.buffer.byteLength)}return e===t||Array.prototype.reverse.call(this.view.subarray(e,t)),this},o.skip=function(e){if(!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal length: "+e+" (not an integer)");e|=0}var t=this.offset+e;if(!this.noAssert&&(t<0||t>this.buffer.byteLength))throw RangeError("Illegal length: 0 <= "+this.offset+" + "+e+" <= "+this.buffer.byteLength);return this.offset=t,this},o.slice=function(e,t){if(void 0===e&&(e=this.offset),void 0===t&&(t=this.limit),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal begin: Not an integer");if(e>>>=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal end: Not an integer");if(t>>>=0,e<0||e>t||t>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+e+" <= "+t+" <= "+this.buffer.byteLength)}var r=this.clone();return r.offset=e,r.limit=t,r},o.toBuffer=function(e){var t,r=this.offset,n=this.limit;if(!this.noAssert){if("number"!=typeof r||r%1!=0)throw TypeError("Illegal offset: Not an integer");if(r>>>=0,"number"!=typeof n||n%1!=0)throw TypeError("Illegal limit: Not an integer");if(n>>>=0,r<0||r>n||n>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+r+" <= "+n+" <= "+this.buffer.byteLength)}return e||0!==r||n!==this.buffer.byteLength?r===n?s:(t=new ArrayBuffer(n-r),new Uint8Array(t).set(new Uint8Array(this.buffer).subarray(r,n),0),t):this.buffer},o.toArrayBuffer=o.toBuffer,o.toString=function(e,t,r){if(void 0===e)return"ByteBufferAB(offset="+this.offset+",markedOffset="+this.markedOffset+",limit="+this.limit+",capacity="+this.capacity()+")";switch("number"==typeof e&&(r=t=e="utf8"),e){case"utf8":return this.toUTF8(t,r);case"base64":return this.toBase64(t,r);case"hex":return this.toHex(t,r);case"binary":return this.toBinary(t,r);case"debug":return this.toDebug();case"columns":return this.toColumns();default:throw Error("Unsupported encoding: "+e)}},u=function(){var e,t,r={},n=[65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,48,49,50,51,52,53,54,55,56,57,43,47],i=[];for(e=0,t=n.length;t>e;++e)i[n[e]]=e;return r.encode=function(e,t){for(var r,i;null!==(r=e());)t(n[63&r>>2]),i=(3&r)<<4,null!==(r=e())?(t(n[63&((i|=15&r>>4)|15&r>>4)]),i=(15&r)<<2,null!==(r=e())?(t(n[63&(i|3&r>>6)]),t(n[63&r])):(t(n[63&i]),t(61))):(t(n[63&i]),t(61),t(61))},r.decode=function(e,t){function r(e){throw Error("Illegal character code: "+e)}for(var n,o,s;null!==(n=e());)if(void 0===(o=i[n])&&r(n),null!==(n=e())&&(void 0===(s=i[n])&&r(n),t(o<<2>>>0|(48&s)>>4),null!==(n=e()))){if(void 0===(o=i[n])){if(61===n)break;r(n)}if(t((15&s)<<4>>>0|(60&o)>>2),null!==(n=e())){if(void 0===(s=i[n])){if(61===n)break;r(n)}t((3&o)<<6>>>0|s)}}},r.test=function(e){return/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/.test(e)},r}(),o.toBase64=function(e,t){if(void 0===e&&(e=this.offset),void 0===t&&(t=this.limit),t|=0,(e|=0)<0||t>this.capacity||e>t)throw RangeError("begin, end");var n;return u.encode(function(){return t>e?this.view[e++]:null}.bind(this),n=r()),n()},c.fromBase64=function(e,r){if("string"!=typeof e)throw TypeError("str");var n=new c(e.length/4*3,r),i=0;return u.decode(t(e),(function(e){n.view[i++]=e})),n.limit=i,n},c.btoa=function(e){return c.fromBinary(e).toBase64()},c.atob=function(e){return c.fromBase64(e).toBinary()},o.toBinary=function(e,t){if(void 0===e&&(e=this.offset),void 0===t&&(t=this.limit),t|=0,(e|=0)<0||t>this.capacity()||e>t)throw RangeError("begin, end");if(e===t)return"";for(var r=[],n=[];t>e;)r.push(this.view[e++]),r.length>=1024&&(n.push(String.fromCharCode.apply(String,r)),r=[]);return n.join("")+String.fromCharCode.apply(String,r)},c.fromBinary=function(e,t){if("string"!=typeof e)throw TypeError("str");for(var r,n=0,i=e.length,o=new c(i,t);i>n;){if((r=e.charCodeAt(n))>255)throw RangeError("illegal char code: "+r);o.view[n++]=r}return o.limit=i,o},o.toDebug=function(e){for(var t,r=-1,n=this.buffer.byteLength,i="",o="",s="";n>r;){if(-1!==r&&(i+=(t=this.view[r])<16?"0"+t.toString(16).toUpperCase():t.toString(16).toUpperCase(),e&&(o+=t>32&&t<127?String.fromCharCode(t):".")),++r,e&&r>0&&r%16==0&&r!==n){for(;i.length<51;)i+=" ";s+=i+o+"\n",i=o=""}i+=r===this.offset&&r===this.limit?r===this.markedOffset?"!":"|":r===this.offset?r===this.markedOffset?"[":"<":r===this.limit?r===this.markedOffset?"]":">":r===this.markedOffset?"'":e||0!==r&&r!==n?" ":""}if(e&&" "!==i){for(;i.length<51;)i+=" ";s+=i+o+"\n"}return e?s:i},c.fromDebug=function(e,t,r){for(var n,i,o=e.length,s=new c(0|(o+1)/3,t,r),a=0,u=0,l=!1,d=!1,p=!1,f=!1,h=!1;o>a;){switch(n=e.charAt(a++)){case"!":if(!r){if(d||p||f){h=!0;break}d=p=f=!0}s.offset=s.markedOffset=s.limit=u,l=!1;break;case"|":if(!r){if(d||f){h=!0;break}d=f=!0}s.offset=s.limit=u,l=!1;break;case"[":if(!r){if(d||p){h=!0;break}d=p=!0}s.offset=s.markedOffset=u,l=!1;break;case"<":if(!r){if(d){h=!0;break}d=!0}s.offset=u,l=!1;break;case"]":if(!r){if(f||p){h=!0;break}f=p=!0}s.limit=s.markedOffset=u,l=!1;break;case">":if(!r){if(f){h=!0;break}f=!0}s.limit=u,l=!1;break;case"'":if(!r){if(p){h=!0;break}p=!0}s.markedOffset=u,l=!1;break;case" ":l=!1;break;default:if(!r&&l){h=!0;break}if(i=parseInt(n+e.charAt(a++),16),!r&&(isNaN(i)||i<0||i>255))throw TypeError("Illegal str: Not a debug encoded string");s.view[u++]=i,l=!0}if(h)throw TypeError("Illegal str: Invalid symbol at "+a)}if(!r){if(!d||!f)throw TypeError("Illegal str: Missing offset or limit");if(u<s.buffer.byteLength)throw TypeError("Illegal str: Not a debug encoded string (is it hex?) "+u+" < "+o)}return s},o.toHex=function(e,t){if(e=void 0===e?this.offset:e,t=void 0===t?this.limit:t,!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal begin: Not an integer");if(e>>>=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal end: Not an integer");if(t>>>=0,e<0||e>t||t>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+e+" <= "+t+" <= "+this.buffer.byteLength)}for(var r,n=new Array(t-e);t>e;)(r=this.view[e++])<16?n.push("0",r.toString(16)):n.push(r.toString(16));return n.join("")},c.fromHex=function(e,t,r){var n,i,o,s,a;if(!r){if("string"!=typeof e)throw TypeError("Illegal str: Not a string");if(e.length%2!=0)throw TypeError("Illegal str: Length not a multiple of 2")}for(i=e.length,o=new c(0|i/2,t),s=0,a=0;i>s;s+=2){if(n=parseInt(e.substring(s,s+2),16),!r&&(!isFinite(n)||n<0||n>255))throw TypeError("Illegal str: Contains non-hex characters");o.view[a++]=n}return o.limit=a,o},l=function(){var e={MAX_CODEPOINT:1114111,encodeUTF8:function(e,t){var r=null;for("number"==typeof e&&(r=e,e=function(){return null});null!==r||null!==(r=e());)r<128?t(127&r):r<2048?(t(192|31&r>>6),t(128|63&r)):r<65536?(t(224|15&r>>12),t(128|63&r>>6),t(128|63&r)):(t(240|7&r>>18),t(128|63&r>>12),t(128|63&r>>6),t(128|63&r)),r=null},decodeUTF8:function(e,t){for(var r,n,i,o,s=function(e){e=e.slice(0,e.indexOf(null));var t=Error(e.toString());throw t.name="TruncatedError",t.bytes=e,t};null!==(r=e());)if(128&r)if(192==(224&r))null===(n=e())&&s([r,n]),t((31&r)<<6|63&n);else if(224==(240&r))(null===(n=e())||null===(i=e()))&&s([r,n,i]),t((15&r)<<12|(63&n)<<6|63&i);else{if(240!=(248&r))throw RangeError("Illegal starting byte: "+r);(null===(n=e())||null===(i=e())||null===(o=e()))&&s([r,n,i,o]),t((7&r)<<18|(63&n)<<12|(63&i)<<6|63&o)}else t(r)},UTF16toUTF8:function(e,t){for(var r,n=null;null!==(r=null!==n?n:e());)r>=55296&&r<=57343&&null!==(n=e())&&n>=56320&&n<=57343?(t(1024*(r-55296)+n-56320+65536),n=null):t(r);null!==n&&t(n)},UTF8toUTF16:function(e,t){var r=null;for("number"==typeof e&&(r=e,e=function(){return null});null!==r||null!==(r=e());)r<=65535?t(r):(t(55296+((r-=65536)>>10)),t(r%1024+56320)),r=null},encodeUTF16toUTF8:function(t,r){e.UTF16toUTF8(t,(function(t){e.encodeUTF8(t,r)}))},decodeUTF8toUTF16:function(t,r){e.decodeUTF8(t,(function(t){e.UTF8toUTF16(t,r)}))},calculateCodePoint:function(e){return e<128?1:e<2048?2:e<65536?3:4},calculateUTF8:function(e){for(var t,r=0;null!==(t=e());)r+=t<128?1:t<2048?2:t<65536?3:4;return r},calculateUTF16asUTF8:function(t){var r=0,n=0;return e.UTF16toUTF8(t,(function(e){++r,n+=e<128?1:e<2048?2:e<65536?3:4})),[r,n]}};return e}(),o.toUTF8=function(e,t){if(void 0===e&&(e=this.offset),void 0===t&&(t=this.limit),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal begin: Not an integer");if(e>>>=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal end: Not an integer");if(t>>>=0,e<0||e>t||t>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+e+" <= "+t+" <= "+this.buffer.byteLength)}var n;try{l.decodeUTF8toUTF16(function(){return t>e?this.view[e++]:null}.bind(this),n=r())}catch(r){if(e!==t)throw RangeError("Illegal range: Truncated data, "+e+" != "+t)}return n()},c.fromUTF8=function(e,r,n){if(!n&&"string"!=typeof e)throw TypeError("Illegal str: Not a string");var i=new c(l.calculateUTF16asUTF8(t(e),!0)[1],r,n),o=0;return l.encodeUTF16toUTF8(t(e),(function(e){i.view[o++]=e})),i.limit=o,i},c}(t),n=function(t,r){var n,i,o={};return o.ByteBuffer=t,o.c=t,n=t,o.Long=r||null,o.VERSION="5.0.1",o.WIRE_TYPES={},o.WIRE_TYPES.VARINT=0,o.WIRE_TYPES.BITS64=1,o.WIRE_TYPES.LDELIM=2,o.WIRE_TYPES.STARTGROUP=3,o.WIRE_TYPES.ENDGROUP=4,o.WIRE_TYPES.BITS32=5,o.PACKABLE_WIRE_TYPES=[o.WIRE_TYPES.VARINT,o.WIRE_TYPES.BITS64,o.WIRE_TYPES.BITS32],o.TYPES={int32:{name:"int32",wireType:o.WIRE_TYPES.VARINT,defaultValue:0},uint32:{name:"uint32",wireType:o.WIRE_TYPES.VARINT,defaultValue:0},sint32:{name:"sint32",wireType:o.WIRE_TYPES.VARINT,defaultValue:0},int64:{name:"int64",wireType:o.WIRE_TYPES.VARINT,defaultValue:o.Long?o.Long.ZERO:void 0},uint64:{name:"uint64",wireType:o.WIRE_TYPES.VARINT,defaultValue:o.Long?o.Long.UZERO:void 0},sint64:{name:"sint64",wireType:o.WIRE_TYPES.VARINT,defaultValue:o.Long?o.Long.ZERO:void 0},bool:{name:"bool",wireType:o.WIRE_TYPES.VARINT,defaultValue:!1},double:{name:"double",wireType:o.WIRE_TYPES.BITS64,defaultValue:0},string:{name:"string",wireType:o.WIRE_TYPES.LDELIM,defaultValue:""},bytes:{name:"bytes",wireType:o.WIRE_TYPES.LDELIM,defaultValue:null},fixed32:{name:"fixed32",wireType:o.WIRE_TYPES.BITS32,defaultValue:0},sfixed32:{name:"sfixed32",wireType:o.WIRE_TYPES.BITS32,defaultValue:0},fixed64:{name:"fixed64",wireType:o.WIRE_TYPES.BITS64,defaultValue:o.Long?o.Long.UZERO:void 0},sfixed64:{name:"sfixed64",wireType:o.WIRE_TYPES.BITS64,defaultValue:o.Long?o.Long.ZERO:void 0},float:{name:"float",wireType:o.WIRE_TYPES.BITS32,defaultValue:0},enum:{name:"enum",wireType:o.WIRE_TYPES.VARINT,defaultValue:0},message:{name:"message",wireType:o.WIRE_TYPES.LDELIM,defaultValue:null},group:{name:"group",wireType:o.WIRE_TYPES.STARTGROUP,defaultValue:null}},o.MAP_KEY_TYPES=[o.TYPES.int32,o.TYPES.sint32,o.TYPES.sfixed32,o.TYPES.uint32,o.TYPES.fixed32,o.TYPES.int64,o.TYPES.sint64,o.TYPES.sfixed64,o.TYPES.uint64,o.TYPES.fixed64,o.TYPES.bool,o.TYPES.string,o.TYPES.bytes],o.ID_MIN=1,o.ID_MAX=536870911,o.convertFieldsToCamelCase=!1,o.populateAccessors=!0,o.populateDefaults=!0,o.Util=function(){var e={};return e.IS_NODE=!("object"!=typeof process||process+""!="[object process]"||process.browser),e.XHR=function(){var e,t=[function(){return new XMLHttpRequest},function(){return new ActiveXObject("Msxml2.XMLHTTP")},function(){return new ActiveXObject("Msxml3.XMLHTTP")},function(){return new ActiveXObject("Microsoft.XMLHTTP")}],r=null;for(e=0;e<t.length;e++){try{r=t[e]()}catch(e){continue}break}if(!r)throw Error("XMLHttpRequest is not supported");return r},e.fetch=function(t,r){if(r&&"function"!=typeof r&&(r=null),e.IS_NODE)if(r)g.readFile(t,(function(e,t){r(e?null:""+t)}));else try{return g.readFileSync(t)}catch(e){return null}else{var n=e.XHR();if(n.open("GET",t,!!r),n.setRequestHeader("Accept","text/plain"),"function"==typeof n.overrideMimeType&&n.overrideMimeType("text/plain"),!r)return n.send(null),200==n.status||0==n.status&&"string"==typeof n.responseText?n.responseText:null;if(n.onreadystatechange=function(){4==n.readyState&&(200==n.status||0==n.status&&"string"==typeof n.responseText?r(n.responseText):r(null))},4==n.readyState)return;n.send(null)}},e.toCamelCase=function(e){return e.replace(/_([a-zA-Z])/g,(function(e,t){return t.toUpperCase()}))},e}(),o.Lang={DELIM:/[\s\{\}=;:\[\],'"\(\)<>]/g,RULE:/^(?:required|optional|repeated|map)$/,TYPE:/^(?:double|float|int32|uint32|sint32|int64|uint64|sint64|fixed32|sfixed32|fixed64|sfixed64|bool|string|bytes)$/,NAME:/^[a-zA-Z_][a-zA-Z_0-9]*$/,TYPEDEF:/^[a-zA-Z][a-zA-Z_0-9]*$/,TYPEREF:/^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)+$/,FQTYPEREF:/^(?:\.[a-zA-Z][a-zA-Z_0-9]*)+$/,NUMBER:/^-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+|([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?)|inf|nan)$/,NUMBER_DEC:/^(?:[1-9][0-9]*|0)$/,NUMBER_HEX:/^0[xX][0-9a-fA-F]+$/,NUMBER_OCT:/^0[0-7]+$/,NUMBER_FLT:/^([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?|inf|nan)$/,BOOL:/^(?:true|false)$/i,ID:/^(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,NEGID:/^\-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,WHITESPACE:/\s/,STRING:/(?:"([^"\\]*(?:\\.[^"\\]*)*)")|(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g,STRING_DQ:/(?:"([^"\\]*(?:\\.[^"\\]*)*)")/g,STRING_SQ:/(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g},o.DotProto=function(e,t){function r(e,r){var n=-1,i=1;if("-"==e.charAt(0)&&(i=-1,e=e.substring(1)),t.NUMBER_DEC.test(e))n=parseInt(e);else if(t.NUMBER_HEX.test(e))n=parseInt(e.substring(2),16);else{if(!t.NUMBER_OCT.test(e))throw Error("illegal id value: "+(i<0?"-":"")+e);n=parseInt(e.substring(1),8)}if(n=0|i*n,!r&&n<0)throw Error("illegal id value: "+(i<0?"-":"")+e);return n}function n(e){var r=1;if("-"==e.charAt(0)&&(r=-1,e=e.substring(1)),t.NUMBER_DEC.test(e))return r*parseInt(e,10);if(t.NUMBER_HEX.test(e))return r*parseInt(e.substring(2),16);if(t.NUMBER_OCT.test(e))return r*parseInt(e.substring(1),8);if("inf"===e)return 1/0*r;if("nan"===e)return NaN;if(t.NUMBER_FLT.test(e))return r*parseFloat(e);throw Error("illegal number value: "+(r<0?"-":"")+e)}function i(e,t,r){void 0===e[t]?e[t]=r:(Array.isArray(e[t])||(e[t]=[e[t]]),e[t].push(r))}var o,s,a={},u=function(e){this.source=e+"",this.index=0,this.line=1,this.stack=[],this._stringOpen=null},l=u.prototype;return l._readString=function(){var e,r='"'===this._stringOpen?t.STRING_DQ:t.STRING_SQ;if(r.lastIndex=this.index-1,!(e=r.exec(this.source)))throw Error("unterminated string");return this.index=r.lastIndex,this.stack.push(this._stringOpen),this._stringOpen=null,e[1]},l.next=function(){var e,r,n,i,o;if(this.stack.length>0)return this.stack.shift();if(this.index>=this.source.length)return null;if(null!==this._stringOpen)return this._readString();do{for(e=!1;t.WHITESPACE.test(n=this.source.charAt(this.index));)if("\n"===n&&++this.line,++this.index===this.source.length)return null;if("/"===this.source.charAt(this.index))if(++this.index,"/"===this.source.charAt(this.index)){for(;"\n"!==this.source.charAt(++this.index);)if(this.index==this.source.length)return null;++this.index,++this.line,e=!0}else{if("*"!==(n=this.source.charAt(this.index)))return"/";do{if("\n"===n&&++this.line,++this.index===this.source.length)return null;r=n,n=this.source.charAt(this.index)}while("*"!==r||"/"!==n);++this.index,e=!0}}while(e);if(this.index===this.source.length)return null;if(i=this.index,t.DELIM.lastIndex=0,!t.DELIM.test(this.source.charAt(i++)))for(;i<this.source.length&&!t.DELIM.test(this.source.charAt(i));)++i;return('"'===(o=this.source.substring(this.index,this.index=i))||"'"===o)&&(this._stringOpen=o),o},l.peek=function(){if(0===this.stack.length){var e=this.next();if(null===e)return null;this.stack.push(e)}return this.stack[0]},l.skip=function(e){var t=this.next();if(t!==e)throw Error("illegal '"+t+"', '"+e+"' expected")},l.omit=function(e){return this.peek()===e&&(this.next(),!0)},l.toString=function(){return"Tokenizer ("+this.index+"/"+this.source.length+" at line "+this.line+")"},a.Tokenizer=u,o=function(e){this.tn=new u(e),this.proto3=!1},(s=o.prototype).parse=function(){var e,r={name:"[ROOT]",package:null,messages:[],enums:[],imports:[],options:{},services:[]},n=!0;try{for(;e=this.tn.next();)switch(e){case"package":if(!n||null!==r.package)throw Error("unexpected 'package'");if(e=this.tn.next(),!t.TYPEREF.test(e))throw Error("illegal package name: "+e);this.tn.skip(";"),r.package=e;break;case"import":if(!n)throw Error("unexpected 'import'");"public"===(e=this.tn.peek())&&this.tn.next(),e=this._readString(),this.tn.skip(";"),r.imports.push(e);break;case"syntax":if(!n)throw Error("unexpected 'syntax'");this.tn.skip("="),"proto3"===(r.syntax=this._readString())&&(this.proto3=!0),this.tn.skip(";");break;case"message":this._parseMessage(r,null),n=!1;break;case"enum":this._parseEnum(r),n=!1;break;case"option":this._parseOption(r);break;case"service":this._parseService(r);break;case"extend":this._parseExtend(r);break;default:throw Error("unexpected '"+e+"'")}}catch(e){throw e.message="Parse error at line "+this.tn.line+": "+e.message,e}return delete r.name,r},o.parse=function(e){return new o(e).parse()},s._readString=function(){var e,t,r="";do{if("'"!==(t=this.tn.next())&&'"'!==t)throw Error("illegal string delimiter: "+t);r+=this.tn.next(),this.tn.skip(t),e=this.tn.peek()}while('"'===e||'"'===e);return r},s._readValue=function(e){var r=this.tn.peek();if('"'===r||"'"===r)return this._readString();if(this.tn.next(),t.NUMBER.test(r))return n(r);if(t.BOOL.test(r))return"true"===r.toLowerCase();if(e&&t.TYPEREF.test(r))return r;throw Error("illegal value: "+r)},s._parseOption=function(e,r){var n,i=this.tn.next(),o=!1;if("("===i&&(o=!0,i=this.tn.next()),!t.TYPEREF.test(i))throw Error("illegal option name: "+i);n=i,o&&(this.tn.skip(")"),n="("+n+")",i=this.tn.peek(),t.FQTYPEREF.test(i)&&(n+=i,this.tn.next())),this.tn.skip("="),this._parseOptionValue(e,n),r||this.tn.skip(";")},s._parseOptionValue=function(e,r){var n=this.tn.peek();if("{"!==n)i(e.options,r,this._readValue(!0));else for(this.tn.skip("{");"}"!==(n=this.tn.next());){if(!t.NAME.test(n))throw Error("illegal option name: "+r+"."+n);this.tn.omit(":")?i(e.options,r+"."+n,this._readValue(!0)):this._parseOptionValue(e,r+"."+n)}},s._parseService=function(e){var r,n=this.tn.next();if(!t.NAME.test(n))throw Error("illegal service name at line "+this.tn.line+": "+n);for(r={name:n,rpc:{},options:{}},this.tn.skip("{");"}"!==(n=this.tn.next());)if("option"===n)this._parseOption(r);else{if("rpc"!==n)throw Error("illegal service token: "+n);this._parseServiceRPC(r)}this.tn.omit(";"),e.services.push(r)},s._parseServiceRPC=function(e){var r,n,i="rpc",o=this.tn.next();if(!t.NAME.test(o))throw Error("illegal rpc service method name: "+o);if(r=o,n={request:null,response:null,request_stream:!1,response_stream:!1,options:{}},this.tn.skip("("),"stream"===(o=this.tn.next()).toLowerCase()&&(n.request_stream=!0,o=this.tn.next()),!t.TYPEREF.test(o))throw Error("illegal rpc service request type: "+o);if(n.request=o,this.tn.skip(")"),"returns"!==(o=this.tn.next()).toLowerCase())throw Error("illegal rpc service request type delimiter: "+o);if(this.tn.skip("("),"stream"===(o=this.tn.next()).toLowerCase()&&(n.response_stream=!0,o=this.tn.next()),n.response=o,this.tn.skip(")"),"{"===(o=this.tn.peek())){for(this.tn.next();"}"!==(o=this.tn.next());){if("option"!==o)throw Error("illegal rpc service token: "+o);this._parseOption(n)}this.tn.omit(";")}else this.tn.skip(";");void 0===e[i]&&(e[i]={}),e[i][r]=n},s._parseMessage=function(e,n){var i=!!n,o=this.tn.next(),s={name:"",fields:[],enums:[],messages:[],options:{},services:[],oneofs:{}};if(!t.NAME.test(o))throw Error("illegal "+(i?"group":"message")+" name: "+o);for(s.name=o,i&&(this.tn.skip("="),n.id=r(this.tn.next()),s.isGroup=!0),"["===(o=this.tn.peek())&&n&&this._parseFieldOptions(n),this.tn.skip("{");"}"!==(o=this.tn.next());)if(t.RULE.test(o))this._parseMessageField(s,o);else if("oneof"===o)this._parseMessageOneOf(s);else if("enum"===o)this._parseEnum(s);else if("message"===o)this._parseMessage(s);else if("option"===o)this._parseOption(s);else if("service"===o)this._parseService(s);else if("extensions"===o)s.extensions=this._parseExtensionRanges();else if("reserved"===o)this._parseIgnored();else if("extend"===o)this._parseExtend(s);else{if(!t.TYPEREF.test(o))throw Error("illegal message token: "+o);if(!this.proto3)throw Error("illegal field rule: "+o);this._parseMessageField(s,"optional",o)}return this.tn.omit(";"),e.messages.push(s),s},s._parseIgnored=function(){for(;";"!==this.tn.peek();)this.tn.next();this.tn.skip(";")},s._parseMessageField=function(e,n,i){var o,s,a;if(!t.RULE.test(n))throw Error("illegal message field rule: "+n);if(o={rule:n,type:"",name:"",options:{},id:0},"map"===n){if(i)throw Error("illegal type: "+i);if(this.tn.skip("<"),s=this.tn.next(),!t.TYPE.test(s)&&!t.TYPEREF.test(s))throw Error("illegal message field type: "+s);if(o.keytype=s,this.tn.skip(","),s=this.tn.next(),!t.TYPE.test(s)&&!t.TYPEREF.test(s))throw Error("illegal message field: "+s);if(o.type=s,this.tn.skip(">"),s=this.tn.next(),!t.NAME.test(s))throw Error("illegal message field name: "+s);o.name=s,this.tn.skip("="),o.id=r(this.tn.next()),"["===(s=this.tn.peek())&&this._parseFieldOptions(o),this.tn.skip(";")}else if("group"===(i=void 0!==i?i:this.tn.next())){if(a=this._parseMessage(e,o),!/^[A-Z]/.test(a.name))throw Error("illegal group name: "+a.name);o.type=a.name,o.name=a.name.toLowerCase(),this.tn.omit(";")}else{if(!t.TYPE.test(i)&&!t.TYPEREF.test(i))throw Error("illegal message field type: "+i);if(o.type=i,s=this.tn.next(),!t.NAME.test(s))throw Error("illegal message field name: "+s);o.name=s,this.tn.skip("="),o.id=r(this.tn.next()),"["===(s=this.tn.peek())&&this._parseFieldOptions(o),this.tn.skip(";")}return e.fields.push(o),o},s._parseMessageOneOf=function(e){var r,n,i,o=this.tn.next();if(!t.NAME.test(o))throw Error("illegal oneof name: "+o);for(n=o,i=[],this.tn.skip("{");"}"!==(o=this.tn.next());)(r=this._parseMessageField(e,"optional",o)).oneof=n,i.push(r.id);this.tn.omit(";"),e.oneofs[n]=i},s._parseFieldOptions=function(e){this.tn.skip("[");for(var t=!0;"]"!==this.tn.peek();)t||this.tn.skip(","),this._parseOption(e,!0),t=!1;this.tn.next()},s._parseEnum=function(e){var n,i={name:"",values:[],options:{}},o=this.tn.next();if(!t.NAME.test(o))throw Error("illegal name: "+o);for(i.name=o,this.tn.skip("{");"}"!==(o=this.tn.next());)if("option"===o)this._parseOption(i);else{if(!t.NAME.test(o))throw Error("illegal name: "+o);this.tn.skip("="),n={name:o,id:r(this.tn.next(),!0)},"["===(o=this.tn.peek())&&this._parseFieldOptions({options:{}}),this.tn.skip(";"),i.values.push(n)}this.tn.omit(";"),e.enums.push(i)},s._parseExtensionRanges=function(){var t,r,i,o=[];do{for(r=[];;){switch(t=this.tn.next()){case"min":i=e.ID_MIN;break;case"max":i=e.ID_MAX;break;default:i=n(t)}if(r.push(i),2===r.length)break;if("to"!==this.tn.peek()){r.push(i);break}this.tn.next()}o.push(r)}while(this.tn.omit(","));return this.tn.skip(";"),o},s._parseExtend=function(e){var r,n=this.tn.next();if(!t.TYPEREF.test(n))throw Error("illegal extend reference: "+n);for(r={ref:n,fields:[]},this.tn.skip("{");"}"!==(n=this.tn.next());)if(t.RULE.test(n))this._parseMessageField(r,n);else{if(!t.TYPEREF.test(n))throw Error("illegal extend token: "+n);if(!this.proto3)throw Error("illegal field rule: "+n);this._parseMessageField(r,"optional",n)}return this.tn.omit(";"),e.messages.push(r),r},s.toString=function(){return"Parser at line "+this.tn.line},a.Parser=o,a}(o,o.Lang),o.Reflect=function(e){function r(t,r){if(t&&"number"==typeof t.low&&"number"==typeof t.high&&"boolean"==typeof t.unsigned&&t.low==t.low&&t.high==t.high)return new e.Long(t.low,t.high,void 0===r?t.unsigned:r);if("string"==typeof t)return e.Long.fromString(t,r||!1,10);if("number"==typeof t)return e.Long.fromNumber(t,r||!1);throw Error("not convertible to Long")}function i(t,r){var n=r.readVarint32(),o=7&n,s=n>>>3;switch(o){case e.WIRE_TYPES.VARINT:do{n=r.readUint8()}while(!(128&~n));break;case e.WIRE_TYPES.BITS64:r.offset+=8;break;case e.WIRE_TYPES.LDELIM:n=r.readVarint32(),r.offset+=n;break;case e.WIRE_TYPES.STARTGROUP:i(s,r);break;case e.WIRE_TYPES.ENDGROUP:if(s===t)return!1;throw Error("Illegal GROUPEND after unknown group: "+s+" ("+t+" expected)");case e.WIRE_TYPES.BITS32:r.offset+=4;break;default:throw Error("Illegal wire type in unknown group "+t+": "+o)}return!0}var o,s,a,u,l,c,d,p,f,h,g,_,b,E,v,y,m={},I=function(e,t,r){this.builder=e,this.parent=t,this.name=r,this.className},T=I.prototype;return T.fqn=function(){for(var e=this.name,t=this;null!=(t=t.parent);)e=t.name+"."+e;return e},T.toString=function(e){return(e?this.className+" ":"")+this.fqn()},T.build=function(){throw Error(this.toString(!0)+" cannot be built directly")},m.T=I,o=function(e,t,r,n,i){I.call(this,e,t,r),this.className="Namespace",this.children=[],this.options=n||{},this.syntax=i||"proto2"},(s=o.prototype=Object.create(I.prototype)).getChildren=function(e){var t,r,n;if(null==(e=e||null))return this.children.slice();for(t=[],r=0,n=this.children.length;n>r;++r)this.children[r]instanceof e&&t.push(this.children[r]);return t},s.addChild=function(e){var t;if(t=this.getChild(e.name))if(t instanceof l.Field&&t.name!==t.originalName&&null===this.getChild(t.originalName))t.name=t.originalName;else{if(!(e instanceof l.Field&&e.name!==e.originalName&&null===this.getChild(e.originalName)))throw Error("Duplicate name in namespace "+this.toString(!0)+": "+e.name);e.name=e.originalName}this.children.push(e)},s.getChild=function(e){var t,r,n="number"==typeof e?"id":"name";for(t=0,r=this.children.length;r>t;++t)if(this.children[t][n]===e)return this.children[t];return null},s.resolve=function(e,t){var r,n="string"==typeof e?e.split("."):e,i=this,o=0;if(""===n[o]){for(;null!==i.parent;)i=i.parent;o++}do{do{if(!(i instanceof m.Namespace)){i=null;break}if(!((r=i.getChild(n[o]))&&r instanceof m.T&&(!t||r instanceof m.Namespace))){i=null;break}i=r,o++}while(o<n.length);if(null!=i)break;if(null!==this.parent)return this.parent.resolve(e,t)}while(null!=i);return i},s.qn=function(e){var t,r,n=[],i=e;do{n.unshift(i.name),i=i.parent}while(null!==i);for(t=1;t<=n.length;t++)if(r=n.slice(n.length-t),e===this.resolve(r,e instanceof m.Namespace))return r.join(".");return e.fqn()},s.build=function(){var e,t,r,n={},i=this.children;for(t=0,r=i.length;r>t;++t)(e=i[t])instanceof o&&(n[e.name]=e.build());return Object.defineProperty&&Object.defineProperty(n,"$options",{value:this.buildOpt()}),n},s.buildOpt=function(){var e,t,r,n,i={},o=Object.keys(this.options);for(e=0,t=o.length;t>e;++e)r=o[e],n=this.options[o[e]],i[r]=n;return i},s.getOption=function(e){return void 0===e?this.options:void 0!==this.options[e]?this.options[e]:null},m.Namespace=o,a=function(t,r,n,i){if(this.type=t,this.resolvedType=r,this.isMapKey=n,this.syntax=i,n&&e.MAP_KEY_TYPES.indexOf(t)<0)throw Error("Invalid map key type: "+t.name)},u=a.prototype,a.defaultFieldValue=function(t){if("string"==typeof t&&(t=e.TYPES[t]),void 0===t.defaultValue)throw Error("default value for type "+t.name+" is not supported");return t==e.TYPES.bytes?new n(0):t.defaultValue},u.verifyValue=function(n){var i,o,s,a=function(e,t){throw Error("Illegal value for "+this.toString(!0)+" of type "+this.type.name+": "+e+" ("+t+")")}.bind(this);switch(this.type){case e.TYPES.int32:case e.TYPES.sint32:case e.TYPES.sfixed32:return("number"!=typeof n||n==n&&n%1!=0)&&a(typeof n,"not an integer"),n>4294967295?0|n:n;case e.TYPES.uint32:case e.TYPES.fixed32:return("number"!=typeof n||n==n&&n%1!=0)&&a(typeof n,"not an integer"),n<0?n>>>0:n;case e.TYPES.int64:case e.TYPES.sint64:case e.TYPES.sfixed64:if(e.Long)try{return r(n,!1)}catch(e){a(typeof n,e.message)}else a(typeof n,"requires Long.js");case e.TYPES.uint64:case e.TYPES.fixed64:if(e.Long)try{return r(n,!0)}catch(e){a(typeof n,e.message)}else a(typeof n,"requires Long.js");case e.TYPES.bool:return"boolean"!=typeof n&&a(typeof n,"not a boolean"),n;case e.TYPES.float:case e.TYPES.double:return"number"!=typeof n&&a(typeof n,"not a number"),n;case e.TYPES.string:return"string"==typeof n||n&&n instanceof String||a(typeof n,"not a string"),""+n;case e.TYPES.bytes:return t.isByteBuffer(n)?n:t.wrap(n);case e.TYPES.enum:for(i=this.resolvedType.getChildren(e.Reflect.Enum.Value),s=0;s<i.length;s++){if(i[s].name==n)return i[s].id;if(i[s].id==n)return i[s].id}if("proto3"===this.syntax)return("number"!=typeof n||n==n&&n%1!=0)&&a(typeof n,"not an integer"),(n>4294967295||n<0)&&a(typeof n,"not in range for uint32"),n;a(n,"not a valid enum value");case e.TYPES.group:case e.TYPES.message:if(n&&"object"==typeof n||a(typeof n,"object expected"),n instanceof this.resolvedType.clazz)return n;if(n instanceof e.Builder.Message){for(s in o={},n)n.hasOwnProperty(s)&&(o[s]=n[s]);n=o}return new this.resolvedType.clazz(n)}throw Error("[INTERNAL] Illegal value for "+this.toString(!0)+": "+n+" (undefined type "+this.type+")")},u.calculateLength=function(t,r){if(null===r)return 0;var i;switch(this.type){case e.TYPES.int32:return r<0?n.calculateVarint64(r):n.calculateVarint32(r);case e.TYPES.uint32:return n.calculateVarint32(r);case e.TYPES.sint32:return n.calculateVarint32(n.zigZagEncode32(r));case e.TYPES.fixed32:case e.TYPES.sfixed32:case e.TYPES.float:return 4;case e.TYPES.int64:case e.TYPES.uint64:return n.calculateVarint64(r);case e.TYPES.sint64:return n.calculateVarint64(n.zigZagEncode64(r));case e.TYPES.fixed64:case e.TYPES.sfixed64:return 8;case e.TYPES.bool:return 1;case e.TYPES.enum:return n.calculateVarint32(r);case e.TYPES.double:return 8;case e.TYPES.string:return i=n.calculateUTF8Bytes(r),n.calculateVarint32(i)+i;case e.TYPES.bytes:if(r.remaining()<0)throw Error("Illegal value for "+this.toString(!0)+": "+r.remaining()+" bytes remaining");return n.calculateVarint32(r.remaining())+r.remaining();case e.TYPES.message:return i=this.resolvedType.calculate(r),n.calculateVarint32(i)+i;case e.TYPES.group:return(i=this.resolvedType.calculate(r))+n.calculateVarint32(t<<3|e.WIRE_TYPES.ENDGROUP)}throw Error("[INTERNAL] Illegal value to encode in "+this.toString(!0)+": "+r+" (unknown type)")},u.encodeValue=function(t,r,i){var o,s;if(null===r)return i;switch(this.type){case e.TYPES.int32:r<0?i.writeVarint64(r):i.writeVarint32(r);break;case e.TYPES.uint32:i.writeVarint32(r);break;case e.TYPES.sint32:i.writeVarint32ZigZag(r);break;case e.TYPES.fixed32:i.writeUint32(r);break;case e.TYPES.sfixed32:i.writeInt32(r);break;case e.TYPES.int64:case e.TYPES.uint64:i.writeVarint64(r);break;case e.TYPES.sint64:i.writeVarint64ZigZag(r);break;case e.TYPES.fixed64:i.writeUint64(r);break;case e.TYPES.sfixed64:i.writeInt64(r);break;case e.TYPES.bool:"string"==typeof r?i.writeVarint32("false"===r.toLowerCase()?0:!!r):i.writeVarint32(r?1:0);break;case e.TYPES.enum:i.writeVarint32(r);break;case e.TYPES.float:i.writeFloat32(r);break;case e.TYPES.double:i.writeFloat64(r);break;case e.TYPES.string:i.writeVString(r);break;case e.TYPES.bytes:if(r.remaining()<0)throw Error("Illegal value for "+this.toString(!0)+": "+r.remaining()+" bytes remaining");o=r.offset,i.writeVarint32(r.remaining()),i.append(r),r.offset=o;break;case e.TYPES.message:s=(new n).LE(),this.resolvedType.encode(r,s),i.writeVarint32(s.offset),i.append(s.flip());break;case e.TYPES.group:this.resolvedType.encode(r,i),i.writeVarint32(t<<3|e.WIRE_TYPES.ENDGROUP);break;default:throw Error("[INTERNAL] Illegal value to encode in "+this.toString(!0)+": "+r+" (unknown type)")}return i},u.decode=function(t,r,n){if(r!=this.type.wireType)throw Error("Unexpected wire type for element");var i,o;switch(this.type){case e.TYPES.int32:return 0|t.readVarint32();case e.TYPES.uint32:return t.readVarint32()>>>0;case e.TYPES.sint32:return 0|t.readVarint32ZigZag();case e.TYPES.fixed32:return t.readUint32()>>>0;case e.TYPES.sfixed32:return 0|t.readInt32();case e.TYPES.int64:return t.readVarint64();case e.TYPES.uint64:return t.readVarint64().toUnsigned();case e.TYPES.sint64:return t.readVarint64ZigZag();case e.TYPES.fixed64:return t.readUint64();case e.TYPES.sfixed64:return t.readInt64();case e.TYPES.bool:return!!t.readVarint32();case e.TYPES.enum:return t.readVarint32();case e.TYPES.float:return t.readFloat();case e.TYPES.double:return t.readDouble();case e.TYPES.string:return t.readVString();case e.TYPES.bytes:if(o=t.readVarint32(),t.remaining()<o)throw Error("Illegal number of bytes for "+this.toString(!0)+": "+o+" required but got only "+t.remaining());return(i=t.clone()).limit=i.offset+o,t.offset+=o,i;case e.TYPES.message:return o=t.readVarint32(),this.resolvedType.decode(t,o);case e.TYPES.group:return this.resolvedType.decode(t,-1,n)}throw Error("[INTERNAL] Illegal decode type")},u.valueFromString=function(t){if(!this.isMapKey)throw Error("valueFromString() called on non-map-key element");switch(this.type){case e.TYPES.int32:case e.TYPES.sint32:case e.TYPES.sfixed32:case e.TYPES.uint32:case e.TYPES.fixed32:return this.verifyValue(parseInt(t));case e.TYPES.int64:case e.TYPES.sint64:case e.TYPES.sfixed64:case e.TYPES.uint64:case e.TYPES.fixed64:return this.verifyValue(t);case e.TYPES.bool:return"true"===t;case e.TYPES.string:return this.verifyValue(t);case e.TYPES.bytes:return n.fromBinary(t)}},u.valueToString=function(t){if(!this.isMapKey)throw Error("valueToString() called on non-map-key element");return this.type===e.TYPES.bytes?t.toString("binary"):t.toString()},m.Element=a,l=function(e,t,r,n,i,s){o.call(this,e,t,r,n,s),this.className="Message",this.extensions=void 0,this.clazz=null,this.isGroup=!!i,this._fields=null,this._fieldsById=null,this._fieldsByName=null},(c=l.prototype=Object.create(o.prototype)).build=function(r){var i,o,s,a;if(this.clazz&&!r)return this.clazz;for(i=function(e,r){function i(t,r,o,s){var a,u,l,c,d,p,f;if(null===t||"object"!=typeof t)return s&&s instanceof e.Reflect.Enum&&null!==(a=e.Reflect.Enum.getName(s.object,t))?a:t;if(n.isByteBuffer(t))return r?t.toBase64():t.toBuffer();if(e.Long.isLong(t))return o?t.toString():e.Long.fromValue(t);if(Array.isArray(t))return u=[],t.forEach((function(e,t){u[t]=i(e,r,o,s)})),u;if(u={},t instanceof e.Map){for(c=(l=t.entries()).next();!c.done;c=l.next())u[t.keyElem.valueToString(c.value[0])]=i(c.value[1],r,o,t.valueElem.resolvedType);return u}for(f in d=t.$type,p=void 0,t)t.hasOwnProperty(f)&&(u[f]=d&&(p=d.getChild(f))?i(t[f],r,o,p.resolvedType):i(t[f],r,o));return u}var o,s,a=r.getChildren(e.Reflect.Message.Field),u=r.getChildren(e.Reflect.Message.OneOf),l=function(t){var i,o,s,c;for(e.Builder.Message.call(this),i=0,o=u.length;o>i;++i)this[u[i].name]=null;for(i=0,o=a.length;o>i;++i)this[(s=a[i]).name]=s.repeated?[]:s.map?new e.Map(s):null,!s.required&&"proto3"!==r.syntax||null===s.defaultValue||(this[s.name]=s.defaultValue);if(arguments.length>0)if(1!==arguments.length||null===t||"object"!=typeof t||!("function"!=typeof t.encode||t instanceof l)||Array.isArray(t)||t instanceof e.Map||n.isByteBuffer(t)||t instanceof ArrayBuffer||e.Long&&t instanceof e.Long)for(i=0,o=arguments.length;o>i;++i)void 0!==(c=arguments[i])&&this.$set(a[i].name,c);else this.$set(t)},c=l.prototype=Object.create(e.Builder.Message.prototype);for(c.add=function(t,n,i){var o=r._fieldsByName[t];if(!i){if(!o)throw Error(this+"#"+t+" is undefined");if(!(o instanceof e.Reflect.Message.Field))throw Error(this+"#"+t+" is not a field: "+o.toString(!0));if(!o.repeated)throw Error(this+"#"+t+" is not a repeated field");n=o.verifyValue(n,!0)}return null===this[t]&&(this[t]=[]),this[t].push(n),this},c.$add=c.add,c.set=function(t,n,i){var o,s,a;if(t&&"object"==typeof t){for(o in i=n,t)t.hasOwnProperty(o)&&void 0!==(n=t[o])&&this.$set(o,n,i);return this}if(s=r._fieldsByName[t],i)this[t]=n;else{if(!s)throw Error(this+"#"+t+" is not a field: undefined");if(!(s instanceof e.Reflect.Message.Field))throw Error(this+"#"+t+" is not a field: "+s.toString(!0));this[s.name]=n=s.verifyValue(n)}return s&&s.oneof&&(a=this[s.oneof.name],null!==n?(null!==a&&a!==s.name&&(this[a]=null),this[s.oneof.name]=s.name):a===t&&(this[s.oneof.name]=null)),this},c.$set=c.set,c.get=function(t,n){if(n)return this[t];var i=r._fieldsByName[t];if(!(i&&i instanceof e.Reflect.Message.Field))throw Error(this+"#"+t+" is not a field: undefined");if(!(i instanceof e.Reflect.Message.Field))throw Error(this+"#"+t+" is not a field: "+i.toString(!0));return this[i.name]},c.$get=c.get,o=0;o<a.length;o++)(s=a[o])instanceof e.Reflect.Message.ExtensionField||r.builder.options.populateAccessors&&function(e){var t,n,i,o=e.originalName.replace(/(_[a-zA-Z])/g,(function(e){return e.toUpperCase().replace("_","")}));o=o.substring(0,1).toUpperCase()+o.substring(1),t=e.originalName.replace(/([A-Z])/g,(function(e){return"_"+e})),n=function(t,r){return this[e.name]=r?t:e.verifyValue(t),this},i=function(){return this[e.name]},null===r.getChild("set"+o)&&(c["set"+o]=n),null===r.getChild("set_"+t)&&(c["set_"+t]=n),null===r.getChild("get"+o)&&(c["get"+o]=i),null===r.getChild("get_"+t)&&(c["get_"+t]=i)}(s);return c.encode=function(e,n){var i,o;"boolean"==typeof e&&(n=e,e=void 0),i=!1,e||(e=new t,i=!0),o=e.littleEndian;try{return r.encode(this,e.LE(),n),(i?e.flip():e).LE(o)}catch(t){throw e.LE(o),t}},l.encode=function(e,t,r){return new l(e).encode(t,r)},c.calculate=function(){return r.calculate(this)},c.encodeDelimited=function(e){var t,i=!1;return e||(e=new n,i=!0),t=(new n).LE(),r.encode(this,t).flip(),e.writeVarint32(t.remaining()),e.append(t),i?e.flip():e},c.encodeAB=function(){try{return this.encode().toArrayBuffer()}catch(e){throw e.encoded&&(e.encoded=e.encoded.toArrayBuffer()),e}},c.toArrayBuffer=c.encodeAB,c.encodeNB=function(){try{return this.encode().toBuffer()}catch(e){throw e.encoded&&(e.encoded=e.encoded.toBuffer()),e}},c.toBuffer=c.encodeNB,c.encode64=function(){try{return this.encode().toBase64()}catch(e){throw e.encoded&&(e.encoded=e.encoded.toBase64()),e}},c.toBase64=c.encode64,c.encodeHex=function(){try{return this.encode().toHex()}catch(e){throw e.encoded&&(e.encoded=e.encoded.toHex()),e}},c.toHex=c.encodeHex,c.toRaw=function(e,t){return i(this,!!e,!!t,this.$type)},c.encodeJSON=function(){return JSON.stringify(i(this,!0,!0,this.$type))},l.decode=function(e,t){var i,o;"string"==typeof e&&(e=n.wrap(e,t||"base64")),i=(e=n.isByteBuffer(e)?e:n.wrap(e)).littleEndian;try{return o=r.decode(e.LE()),e.LE(i),o}catch(t){throw e.LE(i),t}},l.decodeDelimited=function(e,t){var i,o,s;if("string"==typeof e&&(e=n.wrap(e,t||"base64")),(e=n.isByteBuffer(e)?e:n.wrap(e)).remaining()<1)return null;if(i=e.offset,o=e.readVarint32(),e.remaining()<o)return e.offset=i,null;try{return s=r.decode(e.slice(e.offset,e.offset+o).LE()),e.offset+=o,s}catch(t){throw e.offset+=o,t}},l.decode64=function(e){return l.decode(e,"base64")},l.decodeHex=function(e){return l.decode(e,"hex")},l.decodeJSON=function(e){return new l(JSON.parse(e))},c.toString=function(){return r.toString()},Object.defineProperty&&(Object.defineProperty(l,"$options",{value:r.buildOpt()}),Object.defineProperty(c,"$options",{value:l.$options}),Object.defineProperty(l,"$type",{value:r}),Object.defineProperty(c,"$type",{value:r})),l}(e,this),this._fields=[],this._fieldsById={},this._fieldsByName={},s=0,a=this.children.length;a>s;s++)if((o=this.children[s])instanceof g||o instanceof l||o instanceof E){if(i.hasOwnProperty(o.name))throw Error("Illegal reflect child of "+this.toString(!0)+": "+o.toString(!0)+" cannot override static property '"+o.name+"'");i[o.name]=o.build()}else if(o instanceof l.Field)o.build(),this._fields.push(o),this._fieldsById[o.id]=o,this._fieldsByName[o.name]=o;else if(!(o instanceof l.OneOf||o instanceof b))throw Error("Illegal reflect child of "+this.toString(!0)+": "+this.children[s].toString(!0));return this.clazz=i},c.encode=function(e,t,r){var n,i,o,s,a,u=null;for(o=0,s=this._fields.length;s>o;++o)i=e[(n=this._fields[o]).name],n.required&&null===i?null===u&&(u=n):n.encode(r?i:n.verifyValue(i),t,e);if(null!==u)throw(a=Error("Missing at least one required field for "+this.toString(!0)+": "+u)).encoded=t,a;return t},c.calculate=function(e){for(var t,r,n=0,i=0,o=this._fields.length;o>i;++i){if(r=e[(t=this._fields[i]).name],t.required&&null===r)throw Error("Missing at least one required field for "+this.toString(!0)+": "+t);n+=t.calculate(r,e)}return n},c.decode=function(t,r,n){var o,s,a,u,l,c,d,p,f,h,g,_;for(r="number"==typeof r?r:-1,l=t.offset,c=new this.clazz;t.offset<l+r||-1===r&&t.remaining()>0;){if(a=(o=t.readVarint32())>>>3,(s=7&o)===e.WIRE_TYPES.ENDGROUP){if(a!==n)throw Error("Illegal group end indicator for "+this.toString(!0)+": "+a+" ("+(n?n+" expected":"not a group")+")");break}if(u=this._fieldsById[a])u.repeated&&!u.options.packed?c[u.name].push(u.decode(s,t)):u.map?(p=u.decode(s,t),c[u.name].set(p[0],p[1])):(c[u.name]=u.decode(s,t),u.oneof&&(null!==(f=c[u.oneof.name])&&f!==u.name&&(c[f]=null),c[u.oneof.name]=u.name));else switch(s){case e.WIRE_TYPES.VARINT:t.readVarint32();break;case e.WIRE_TYPES.BITS32:t.offset+=4;break;case e.WIRE_TYPES.BITS64:t.offset+=8;break;case e.WIRE_TYPES.LDELIM:d=t.readVarint32(),t.offset+=d;break;case e.WIRE_TYPES.STARTGROUP:for(;i(a,t););break;default:throw Error("Illegal wire type for unknown field "+a+" in "+this.toString(!0)+"#decode: "+s)}}for(h=0,g=this._fields.length;g>h;++h)if(null===c[(u=this._fields[h]).name])if("proto3"===this.syntax)c[u.name]=u.defaultValue;else{if(u.required)throw(_=Error("Missing at least one required field for "+this.toString(!0)+": "+u.name)).decoded=c,_;e.populateDefaults&&null!==u.defaultValue&&(c[u.name]=u.defaultValue)}return c},m.Message=l,d=function(t,r,n,i,o,s,a,u,c,d){I.call(this,t,r,s),this.className="Message.Field",this.required="required"===n,this.repeated="repeated"===n,this.map="map"===n,this.keyType=i||null,this.type=o,this.resolvedType=null,this.id=a,this.options=u||{},this.defaultValue=null,this.oneof=c||null,this.syntax=d||"proto2",this.originalName=this.name,this.element=null,this.keyElement=null,!this.builder.options.convertFieldsToCamelCase||this instanceof l.ExtensionField||(this.name=e.Util.toCamelCase(this.name))},(p=d.prototype=Object.create(I.prototype)).build=function(){this.element=new a(this.type,this.resolvedType,!1,this.syntax),this.map&&(this.keyElement=new a(this.keyType,void 0,!0,this.syntax)),"proto3"!==this.syntax||this.repeated||this.map?void 0!==this.options.default&&(this.defaultValue=this.verifyValue(this.options.default)):this.defaultValue=a.defaultFieldValue(this.type)},p.verifyValue=function(t,r){var n,i,o;if(r=r||!1,n=function(e,t){throw Error("Illegal value for "+this.toString(!0)+" of type "+this.type.name+": "+e+" ("+t+")")}.bind(this),null===t)return this.required&&n(typeof t,"required"),"proto3"===this.syntax&&this.type!==e.TYPES.message&&n(typeof t,"proto3 field without field presence cannot be null"),null;if(this.repeated&&!r){for(Array.isArray(t)||(t=[t]),o=[],i=0;i<t.length;i++)o.push(this.element.verifyValue(t[i]));return o}return this.map&&!r?t instanceof e.Map?t:(t instanceof Object||n(typeof t,"expected ProtoBuf.Map or raw object for map field"),new e.Map(this,t)):(!this.repeated&&Array.isArray(t)&&n(typeof t,"no array expected"),this.element.verifyValue(t))},p.hasWirePresence=function(t,r){if("proto3"!==this.syntax)return null!==t;if(this.oneof&&r[this.oneof.name]===this.name)return!0;switch(this.type){case e.TYPES.int32:case e.TYPES.sint32:case e.TYPES.sfixed32:case e.TYPES.uint32:case e.TYPES.fixed32:return 0!==t;case e.TYPES.int64:case e.TYPES.sint64:case e.TYPES.sfixed64:case e.TYPES.uint64:case e.TYPES.fixed64:return 0!==t.low||0!==t.high;case e.TYPES.bool:return t;case e.TYPES.float:case e.TYPES.double:return 0!==t;case e.TYPES.string:return t.length>0;case e.TYPES.bytes:return t.remaining()>0;case e.TYPES.enum:return 0!==t;case e.TYPES.message:return null!==t;default:return!0}},p.encode=function(t,r,i){var o,s,a,u,l;if(null===this.type||"object"!=typeof this.type)throw Error("[INTERNAL] Unresolved type in "+this.toString(!0)+": "+this.type);if(null===t||this.repeated&&0==t.length)return r;try{if(this.repeated)if(this.options.packed&&e.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType)>=0){for(r.writeVarint32(this.id<<3|e.WIRE_TYPES.LDELIM),r.ensureCapacity(r.offset+=1),s=r.offset,o=0;o<t.length;o++)this.element.encodeValue(this.id,t[o],r);a=r.offset-s,(u=n.calculateVarint32(a))>1&&(l=r.slice(s,r.offset),s+=u-1,r.offset=s,r.append(l)),r.writeVarint32(a,s-u)}else for(o=0;o<t.length;o++)r.writeVarint32(this.id<<3|this.type.wireType),this.element.encodeValue(this.id,t[o],r);else this.map?t.forEach((function(t,i){var o=n.calculateVarint32(8|this.keyType.wireType)+this.keyElement.calculateLength(1,i)+n.calculateVarint32(16|this.type.wireType)+this.element.calculateLength(2,t);r.writeVarint32(this.id<<3|e.WIRE_TYPES.LDELIM),r.writeVarint32(o),r.writeVarint32(8|this.keyType.wireType),this.keyElement.encodeValue(1,i,r),r.writeVarint32(16|this.type.wireType),this.element.encodeValue(2,t,r)}),this):this.hasWirePresence(t,i)&&(r.writeVarint32(this.id<<3|this.type.wireType),this.element.encodeValue(this.id,t,r))}catch(e){throw Error("Illegal value for "+this.toString(!0)+": "+t+" ("+e+")")}return r},p.calculate=function(t,r){var i,o,s;if(t=this.verifyValue(t),null===this.type||"object"!=typeof this.type)throw Error("[INTERNAL] Unresolved type in "+this.toString(!0)+": "+this.type);if(null===t||this.repeated&&0==t.length)return 0;i=0;try{if(this.repeated)if(this.options.packed&&e.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType)>=0){for(i+=n.calculateVarint32(this.id<<3|e.WIRE_TYPES.LDELIM),s=0,o=0;o<t.length;o++)s+=this.element.calculateLength(this.id,t[o]);i+=n.calculateVarint32(s),i+=s}else for(o=0;o<t.length;o++)i+=n.calculateVarint32(this.id<<3|this.type.wireType),i+=this.element.calculateLength(this.id,t[o]);else this.map?t.forEach((function(t,r){var o=n.calculateVarint32(8|this.keyType.wireType)+this.keyElement.calculateLength(1,r)+n.calculateVarint32(16|this.type.wireType)+this.element.calculateLength(2,t);i+=n.calculateVarint32(this.id<<3|e.WIRE_TYPES.LDELIM),i+=n.calculateVarint32(o),i+=o}),this):this.hasWirePresence(t,r)&&(i+=n.calculateVarint32(this.id<<3|this.type.wireType),i+=this.element.calculateLength(this.id,t))}catch(e){throw Error("Illegal value for "+this.toString(!0)+": "+t+" ("+e+")")}return i},p.decode=function(t,r,n){var i,o,s,u,l,c,d;if(!(!this.map&&t==this.type.wireType||!n&&this.repeated&&this.options.packed&&t==e.WIRE_TYPES.LDELIM||this.map&&t==e.WIRE_TYPES.LDELIM))throw Error("Illegal wire type for field "+this.toString(!0)+": "+t+" ("+this.type.wireType+" expected)");if(t==e.WIRE_TYPES.LDELIM&&this.repeated&&this.options.packed&&e.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType)>=0&&!n){for(o=r.readVarint32(),o=r.offset+o,s=[];r.offset<o;)s.push(this.decode(this.type.wireType,r,!0));return s}if(this.map){if(u=a.defaultFieldValue(this.keyType),i=a.defaultFieldValue(this.type),o=r.readVarint32(),r.remaining()<o)throw Error("Illegal number of bytes for "+this.toString(!0)+": "+o+" required but got only "+r.remaining());for((l=r.clone()).limit=l.offset+o,r.offset+=o;l.remaining()>0;)if(t=7&(c=l.readVarint32()),1===(d=c>>>3))u=this.keyElement.decode(l,t,d);else{if(2!==d)throw Error("Unexpected tag in map field key/value submessage");i=this.element.decode(l,t,d)}return[u,i]}return this.element.decode(r,t,this.id)},m.Message.Field=d,f=function(e,t,r,n,i,o,s){d.call(this,e,t,r,null,n,i,o,s),this.extension},f.prototype=Object.create(d.prototype),m.Message.ExtensionField=f,h=function(e,t,r){I.call(this,e,t,r),this.fields=[]},m.Message.OneOf=h,g=function(e,t,r,n,i){o.call(this,e,t,r,n,i),this.className="Enum",this.object=null},g.getName=function(e,t){var r,n,i=Object.keys(e);for(n=0;n<i.length;++n)if(e[r=i[n]]===t)return r;return null},(g.prototype=Object.create(o.prototype)).build=function(t){var r,n,i,o;if(this.object&&!t)return this.object;for(r=new e.Builder.Enum,i=0,o=(n=this.getChildren(g.Value)).length;o>i;++i)r[n[i].name]=n[i].id;return Object.defineProperty&&Object.defineProperty(r,"$options",{value:this.buildOpt(),enumerable:!1}),this.object=r},m.Enum=g,_=function(e,t,r,n){I.call(this,e,t,r),this.className="Enum.Value",this.id=n},_.prototype=Object.create(I.prototype),m.Enum.Value=_,b=function(e,t,r,n){I.call(this,e,t,r),this.field=n},b.prototype=Object.create(I.prototype),m.Extension=b,E=function(e,t,r,n){o.call(this,e,t,r,n),this.className="Service",this.clazz=null},(E.prototype=Object.create(o.prototype)).build=function(t){return this.clazz&&!t?this.clazz:this.clazz=function(e,t){var r,i=function(t){e.Builder.Service.call(this),this.rpcImpl=t||function(e,t,r){setTimeout(r.bind(this,Error("Not implemented, see: https://github.com/dcodeIO/ProtoBuf.js/wiki/Services")),0)}},o=i.prototype=Object.create(e.Builder.Service.prototype),s=t.getChildren(e.Reflect.Service.RPCMethod);for(r=0;r<s.length;r++)!function(e){o[e.name]=function(r,i){try{try{r=e.resolvedRequestType.clazz.decode(n.wrap(r))}catch(e){if(!(e instanceof TypeError))throw e}if(null===r||"object"!=typeof r)throw Error("Illegal arguments");r instanceof e.resolvedRequestType.clazz||(r=new e.resolvedRequestType.clazz(r)),this.rpcImpl(e.fqn(),r,(function(r,n){if(!r){try{n=e.resolvedResponseType.clazz.decode(n)}catch(e){}return n&&n instanceof e.resolvedResponseType.clazz?void i(null,n):void i(Error("Illegal response type received in service method "+t.name+"#"+e.name))}i(r)}))}catch(e){setTimeout(i.bind(this,e),0)}},i[e.name]=function(t,r,n){new i(t)[e.name](r,n)},Object.defineProperty&&(Object.defineProperty(i[e.name],"$options",{value:e.buildOpt()}),Object.defineProperty(o[e.name],"$options",{value:i[e.name].$options}))}(s[r]);return Object.defineProperty&&(Object.defineProperty(i,"$options",{value:t.buildOpt()}),Object.defineProperty(o,"$options",{value:i.$options}),Object.defineProperty(i,"$type",{value:t}),Object.defineProperty(o,"$type",{value:t})),i}(e,this)},m.Service=E,v=function(e,t,r,n){I.call(this,e,t,r),this.className="Service.Method",this.options=n||{}},(v.prototype=Object.create(I.prototype)).buildOpt=s.buildOpt,m.Service.Method=v,y=function(e,t,r,n,i,o,s,a){v.call(this,e,t,r,a),this.className="Service.RPCMethod",this.requestName=n,this.responseName=i,this.requestStream=o,this.responseStream=s,this.resolvedRequestType=null,this.resolvedResponseType=null},y.prototype=Object.create(v.prototype),m.Service.RPCMethod=y,m}(o),o.Builder=function(e,t,r){function n(e){e.messages&&e.messages.forEach((function(t){t.syntax=e.syntax,n(t)})),e.enums&&e.enums.forEach((function(t){t.syntax=e.syntax}))}var i=function(e){this.ns=new r.Namespace(this,null,""),this.ptr=this.ns,this.resolved=!1,this.result=null,this.files={},this.importRoot=null,this.options=e||{}},o=i.prototype;return i.isMessage=function(e){return"string"==typeof e.name&&(void 0===e.values&&void 0===e.rpc)},i.isMessageField=function(e){return"string"==typeof e.rule&&"string"==typeof e.name&&"string"==typeof e.type&&void 0!==e.id},i.isEnum=function(e){return"string"==typeof e.name&&!(void 0===e.values||!Array.isArray(e.values)||0===e.values.length)},i.isService=function(e){return!("string"!=typeof e.name||"object"!=typeof e.rpc||!e.rpc)},i.isExtend=function(e){return"string"==typeof e.ref},o.reset=function(){return this.ptr=this.ns,this},o.define=function(e){if("string"!=typeof e||!t.TYPEREF.test(e))throw Error("illegal namespace: "+e);return e.split(".").forEach((function(e){var t=this.ptr.getChild(e);null===t&&this.ptr.addChild(t=new r.Namespace(this,this.ptr,e)),this.ptr=t}),this),this},o.create=function(t){var n,o,s,a,u;if(!t)return this;if(Array.isArray(t)){if(0===t.length)return this;t=t.slice()}else t=[t];for(n=[t];n.length>0;){if(t=n.pop(),!Array.isArray(t))throw Error("not a valid namespace: "+JSON.stringify(t));for(;t.length>0;){if(o=t.shift(),i.isMessage(o)){if(s=new r.Message(this,this.ptr,o.name,o.options,o.isGroup,o.syntax),a={},o.oneofs&&Object.keys(o.oneofs).forEach((function(e){s.addChild(a[e]=new r.Message.OneOf(this,s,e))}),this),o.fields&&o.fields.forEach((function(e){if(null!==s.getChild(0|e.id))throw Error("duplicate or invalid field id in "+s.name+": "+e.id);if(e.options&&"object"!=typeof e.options)throw Error("illegal field options in "+s.name+"#"+e.name);var t=null;if("string"==typeof e.oneof&&!(t=a[e.oneof]))throw Error("illegal oneof in "+s.name+"#"+e.name+": "+e.oneof);e=new r.Message.Field(this,s,e.rule,e.keytype,e.type,e.name,e.id,e.options,t,o.syntax),t&&t.fields.push(e),s.addChild(e)}),this),u=[],o.enums&&o.enums.forEach((function(e){u.push(e)})),o.messages&&o.messages.forEach((function(e){u.push(e)})),o.services&&o.services.forEach((function(e){u.push(e)})),o.extensions&&(s.extensions="number"==typeof o.extensions[0]?[o.extensions]:o.extensions),this.ptr.addChild(s),u.length>0){n.push(t),t=u,u=null,this.ptr=s,s=null;continue}u=null}else if(i.isEnum(o))s=new r.Enum(this,this.ptr,o.name,o.options,o.syntax),o.values.forEach((function(e){s.addChild(new r.Enum.Value(this,s,e.name,e.id))}),this),this.ptr.addChild(s);else if(i.isService(o))s=new r.Service(this,this.ptr,o.name,o.options),Object.keys(o.rpc).forEach((function(e){var t=o.rpc[e];s.addChild(new r.Service.RPCMethod(this,s,e,t.request,t.response,!!t.request_stream,!!t.response_stream,t.options))}),this),this.ptr.addChild(s);else{if(!i.isExtend(o))throw Error("not a valid definition: "+JSON.stringify(o));if(s=this.ptr.resolve(o.ref,!0))o.fields.forEach((function(t){var n,i,o,a;if(null!==s.getChild(0|t.id))throw Error("duplicate extended field id in "+s.name+": "+t.id);if(s.extensions&&(n=!1,s.extensions.forEach((function(e){t.id>=e[0]&&t.id<=e[1]&&(n=!0)})),!n))throw Error("illegal extended field id in "+s.name+": "+t.id+" (not within valid ranges)");i=t.name,this.options.convertFieldsToCamelCase&&(i=e.Util.toCamelCase(i)),o=new r.Message.ExtensionField(this,s,t.rule,t.type,this.ptr.fqn()+"."+i,t.id,t.options),a=new r.Extension(this,this.ptr,t.name,o),o.extension=a,this.ptr.addChild(a),s.addChild(o)}),this);else if(!/\.?google\.protobuf\./.test(o.ref))throw Error("extended message "+o.ref+" is not defined")}o=null,s=null}t=null,this.ptr=this.ptr.parent}return this.resolved=!1,this.result=null,this},o.import=function(t,r){var i,o,s,a,u,l,c,d,p="/";if("string"==typeof r){if(e.Util.IS_NODE,!0===this.files[r])return this.reset();this.files[r]=!0}else if("object"==typeof r){if(i=r.root,e.Util.IS_NODE,(i.indexOf("\\")>=0||r.file.indexOf("\\")>=0)&&(p="\\"),o=i+p+r.file,!0===this.files[o])return this.reset();this.files[o]=!0}if(t.imports&&t.imports.length>0){for(a=!1,"object"==typeof r?(this.importRoot=r.root,a=!0,s=this.importRoot,r=r.file,(s.indexOf("\\")>=0||r.indexOf("\\")>=0)&&(p="\\")):"string"==typeof r?this.importRoot?s=this.importRoot:r.indexOf("/")>=0?""===(s=r.replace(/\/[^\/]*$/,""))&&(s="/"):r.indexOf("\\")>=0?(s=r.replace(/\\[^\\]*$/,""),p="\\"):s=".":s=null,u=0;u<t.imports.length;u++)if("string"==typeof t.imports[u]){if(!s)throw Error("cannot determine import root");if("google/protobuf/descriptor.proto"===(l=t.imports[u]))continue;if(l=s+p+l,!0===this.files[l])continue;if(/\.proto$/i.test(l)&&!e.DotProto&&(l=l.replace(/\.proto$/,".json")),null===(c=e.Util.fetch(l)))throw Error("failed to import '"+l+"' in '"+r+"': file not found");/\.json$/i.test(l)?this.import(JSON.parse(c+""),l):this.import(e.DotProto.Parser.parse(c),l)}else r?/\.(\w+)$/.test(r)?this.import(t.imports[u],r.replace(/^(.+)\.(\w+)$/,(function(e,t,r){return t+"_import"+u+"."+r}))):this.import(t.imports[u],r+"_import"+u):this.import(t.imports[u]);a&&(this.importRoot=null)}return t.package&&this.define(t.package),t.syntax&&n(t),d=this.ptr,t.options&&Object.keys(t.options).forEach((function(e){d.options[e]=t.options[e]})),t.messages&&(this.create(t.messages),this.ptr=d),t.enums&&(this.create(t.enums),this.ptr=d),t.services&&(this.create(t.services),this.ptr=d),t.extends&&this.create(t.extends),this.reset()},o.resolveAll=function(){var n;if(null==this.ptr||"object"==typeof this.ptr.type)return this;if(this.ptr instanceof r.Namespace)this.ptr.children.forEach((function(e){this.ptr=e,this.resolveAll()}),this);else if(this.ptr instanceof r.Message.Field){if(t.TYPE.test(this.ptr.type))this.ptr.type=e.TYPES[this.ptr.type];else{if(!t.TYPEREF.test(this.ptr.type))throw Error("illegal type reference in "+this.ptr.toString(!0)+": "+this.ptr.type);if(!(n=(this.ptr instanceof r.Message.ExtensionField?this.ptr.extension.parent:this.ptr.parent).resolve(this.ptr.type,!0)))throw Error("unresolvable type reference in "+this.ptr.toString(!0)+": "+this.ptr.type);if(this.ptr.resolvedType=n,n instanceof r.Enum){if(this.ptr.type=e.TYPES.enum,"proto3"===this.ptr.syntax&&"proto3"!==n.syntax)throw Error("proto3 message cannot reference proto2 enum")}else{if(!(n instanceof r.Message))throw Error("illegal type reference in "+this.ptr.toString(!0)+": "+this.ptr.type);this.ptr.type=n.isGroup?e.TYPES.group:e.TYPES.message}}if(this.ptr.map){if(!t.TYPE.test(this.ptr.keyType))throw Error("illegal key type for map field in "+this.ptr.toString(!0)+": "+this.ptr.keyType);this.ptr.keyType=e.TYPES[this.ptr.keyType]}}else if(this.ptr instanceof e.Reflect.Service.Method){if(!(this.ptr instanceof e.Reflect.Service.RPCMethod))throw Error("illegal service type in "+this.ptr.toString(!0));if(!((n=this.ptr.parent.resolve(this.ptr.requestName,!0))&&n instanceof e.Reflect.Message))throw Error("Illegal type reference in "+this.ptr.toString(!0)+": "+this.ptr.requestName);if(this.ptr.resolvedRequestType=n,!((n=this.ptr.parent.resolve(this.ptr.responseName,!0))&&n instanceof e.Reflect.Message))throw Error("Illegal type reference in "+this.ptr.toString(!0)+": "+this.ptr.responseName);this.ptr.resolvedResponseType=n}else if(!(this.ptr instanceof e.Reflect.Message.OneOf||this.ptr instanceof e.Reflect.Extension||this.ptr instanceof e.Reflect.Enum.Value))throw Error("illegal object in namespace: "+typeof this.ptr+": "+this.ptr);return this.reset()},o.build=function(e){var t,r,n;if(this.reset(),this.resolved||(this.resolveAll(),this.resolved=!0,this.result=null),null===this.result&&(this.result=this.ns.build()),!e)return this.result;for(t="string"==typeof e?e.split("."):e,r=this.result,n=0;n<t.length;n++){if(!r[t[n]]){r=null;break}r=r[t[n]]}return r},o.lookup=function(e,t){return e?this.ns.resolve(e,t):this.ns},o.toString=function(){return"Builder"},i.Message=function(){},i.Enum=function(){},i.Service=function(){},i}(o,o.Lang,o.Reflect),o.Map=function(e,t){function r(e){var t=0;return{next:function(){return t<e.length?{done:!1,value:e[t++]}:{done:!0}}}}var n=function(e,r){var n,i,o,s;if(!e.map)throw Error("field is not a map");if(this.field=e,this.keyElem=new t.Element(e.keyType,null,!0,e.syntax),this.valueElem=new t.Element(e.type,e.resolvedType,!1,e.syntax),this.map={},Object.defineProperty(this,"size",{get:function(){return Object.keys(this.map).length}}),r)for(n=Object.keys(r),i=0;i<n.length;i++)o=this.keyElem.valueFromString(n[i]),s=this.valueElem.verifyValue(r[n[i]]),this.map[this.keyElem.valueToString(o)]={key:o,value:s}},i=n.prototype;return i.clear=function(){this.map={}},i.delete=function(e){var t=this.keyElem.valueToString(this.keyElem.verifyValue(e)),r=t in this.map;return delete this.map[t],r},i.entries=function(){var e,t,n=[],i=Object.keys(this.map);for(t=0;t<i.length;t++)n.push([(e=this.map[i[t]]).key,e.value]);return r(n)},i.keys=function(){var e,t=[],n=Object.keys(this.map);for(e=0;e<n.length;e++)t.push(this.map[n[e]].key);return r(t)},i.values=function(){var e,t=[],n=Object.keys(this.map);for(e=0;e<n.length;e++)t.push(this.map[n[e]].value);return r(t)},i.forEach=function(e,t){var r,n,i=Object.keys(this.map);for(n=0;n<i.length;n++)e.call(t,(r=this.map[i[n]]).value,r.key,this)},i.set=function(e,t){var r=this.keyElem.verifyValue(e),n=this.valueElem.verifyValue(t);return this.map[this.keyElem.valueToString(r)]={key:r,value:n},this},i.get=function(e){var t=this.keyElem.valueToString(this.keyElem.verifyValue(e));return t in this.map?this.map[t].value:void 0},i.has=function(e){return this.keyElem.valueToString(this.keyElem.verifyValue(e))in this.map},n}(0,o.Reflect),o.loadProto=function(e,t,r){return("string"==typeof t||t&&"string"==typeof t.file&&"string"==typeof t.root)&&(r=t,t=void 0),o.loadJson(o.DotProto.Parser.parse(e),t,r)},o.protoFromString=o.loadProto,o.loadProtoFile=function(e,t,r){if(t&&"object"==typeof t?(r=t,t=null):t&&"function"==typeof t||(t=null),t)return o.Util.fetch("string"==typeof e?e:e.root+"/"+e.file,(function(n){if(null!==n)try{t(null,o.loadProto(n,r,e))}catch(e){t(e)}else t(Error("Failed to fetch file"))}));var n=o.Util.fetch("object"==typeof e?e.root+"/"+e.file:e);return null===n?null:o.loadProto(n,r,e)},o.protoFromFile=o.loadProtoFile,o.newBuilder=function(e){return void 0===(e=e||{}).convertFieldsToCamelCase&&(e.convertFieldsToCamelCase=o.convertFieldsToCamelCase),void 0===e.populateAccessors&&(e.populateAccessors=o.populateAccessors),new o.Builder(e)},o.loadJson=function(e,t,r){return("string"==typeof t||t&&"string"==typeof t.file&&"string"==typeof t.root)&&(r=t,t=null),t&&"object"==typeof t||(t=o.newBuilder()),"string"==typeof e&&(e=JSON.parse(e)),t.import(e,r),t.resolveAll(),t},o.loadJsonFile=function(e,t,r){if(t&&"object"==typeof t?(r=t,t=null):t&&"function"==typeof t||(t=null),t)return o.Util.fetch("string"==typeof e?e:e.root+"/"+e.file,(function(n){if(null!==n)try{t(null,o.loadJson(JSON.parse(n),r,e))}catch(e){t(e)}else t(Error("Failed to fetch file"))}));var n=o.Util.fetch("object"==typeof e?e.root+"/"+e.file:e);return null===n?null:o.loadJson(JSON.parse(n),r,e)},i=e,o.loadProto(i,void 0,"").build("Modules").probuf}(r,t);return n}var po=function(){function e(e,t){oo.add(this),Object.defineProperty(this,"nestedMap",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"pbModules",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.pbModules=co(e)}return Object.defineProperty(e.prototype,"_encode",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n=this,i=new this.pbModules[e],o="";if(t)try{Object.keys(t).forEach((function(r){var s=t[r];if(void 0!==s){var a=n.nestedMap.get("".concat(e,"_").concat(r));if(o="set".concat(function(e,t,r){if(void 0===t||void 0===r)return e.toUpperCase();var n=e.slice(t,r);return e.replace(n,(function(e){return e.toUpperCase()}))}(r,0,1)),a){var u=s instanceof Array?s.map((function(e){return n._encode(a,e,!0)})):n._encode(a,s,!0);i[o](u)}else i[o](s)}}))}catch(t){var s="name: ".concat(e,", method: ").concat(o,", stack: ").concat(t.stack);null===console||void 0===console||console.error("pb encode error!",s)}return r?i:i.toArrayBuffer()}}),Object.defineProperty(e.prototype,"encode",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return this._encode(e,t)}}),Object.defineProperty(e.prototype,"decode",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this.pbModules[e].decode(t);return c(this,oo,"m",so).call(this,r)}}),Object.defineProperty(e.prototype,"getModule",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return new this.pbModules[e]}}),e}();oo=new WeakSet,so=function e(t){var r,n=this;if(t instanceof Array)return t.map((function(t){return c(n,oo,"m",e).call(n,t)}));if(r=t,"[object Object]"!==Object.prototype.toString.call(r))return t;if(t.buffer instanceof ArrayBuffer&&"number"==typeof t.offset&&"number"==typeof t.limit){var i=t.buffer,o=t.offset,s=t.limit;return i.slice(o,s)}if(void 0!==t.low&&void 0!==t.high&&Object.prototype.hasOwnProperty.call(t,"unsigned")){var a=t.low;return a<0&&(a+=4294967296),a=a.toString(16),parseInt(t.high.toString(16)+"00000000".replace(new RegExp("0{".concat(a.length,"}$")),a),16)}var u=t;return Object.keys(t).forEach((function(r){u[r]=c(n,oo,"m",e).call(n,t[r])})),u};var fo,ho,go,_o,bo="NotifyMsg",Eo="SyncRequestMsg",vo="UpStreamMessage",yo="PushExtra",mo="DownStreamMessages",Io="ChrmDownStreamMessages",To="DownStreamMessage",Ro="GetQNupTokenInput",Co="GetDownloadUrlInput",Oo="GetQNupTokenOutput",So="GetDownloadUrlOutput",Ao="ChrmInput",Po="ChrmOutput",No="ChrmPullMsg",wo="RelationQryInput",Mo="RelationsInput",Lo="RelationsOutput",Uo="QryRemindListReq",Do="QryRemindListResp",xo="CleanHisMsgInput",jo="CleanMsgBatchReq",Vo="QueryChatRoomInfoInput",Go="QueryChatRoomInfoOutput",ko="HistoryMsgInput",Fo="HistoryMsgOuput",Bo="SessionsAttQryInput",Ho="SessionsAttOutput",qo="SessionMsgReadInput",Yo="DeleteSessionsInput",Ko="SessionInfo",Qo="QuerySessionsInput",Wo="QuerySessionsOutPut",Jo="RelationDelBatchReq",zo="RelationOpInput",Zo="DeleteMsgInput",Xo="SetChrmKV",$o="SetChrmKVS",es="ChrmKVOutput",ts="ChrmKVSOutput",rs="QueryChrmKV",ns="SetUserSettingOutput",is="PullUserSettingInput",os="PullUserSettingOutput",ss="SessionReq",as="SessionStates",us="SessionState",ls="SessionStateItem",cs="SessionStateModifyReq",ds="GroupUnpushQuery",ps="GroupUnpushSet",fs="GroupUnpushResult",hs="SessionStateModifyResp",gs="TypeUnpushInput",_s="TypeUnpushOutput",bs="GrpReadReceiptMsg",Es="ReadReceipt",vs="QueryReceiptReq",ys="ReceiptResp",ms="GrpReadReceiptQryResp",Is="SessionTagAddInput",Ts="SessionTagItem",Rs="SessionTagDelInput",Cs="UserSettingNotification",Os="ReportSDKInput",Ss="UltraGrpPullSes",As="UltraGrpPullMsg",Ps="MsgChangeReq",Ns="QueryMsgChange",ws="EventChangeList",Ms="MsgChangeList",Ls="MsgQuery",Us="MsgQueryAck",Ds="OperateStatus",xs="OperateStatusNotify",js="SetRtcRoomIdInput",Vs="CallInfoUpStream",Gs="CallInfoDownStream",ks="KvInput",Fs="KvOutput",Bs="ReadReceiptMsg",Hs="ReceiptQryReq",qs="QueryReceiptResp",Ys="ReceiptCntQryReq",Ks="ReceiptCntQryResp",Qs="UpdateUserSubReq",Ws="UserSubDetail",Js="UpdateUserSubResp",zs="PullUserSubReq",Zs="PUllUserSubResp",Xs="PullSubDataReq",$s="PullSubDataResp",ea="SubDataDetail",ta="QrySubDataReq",ra="UserProfile",na="ProfileInfo",ia="SetUserProfileResp",oa="PullUserProfileReq",sa="UserProfiles",aa="UserProfileInput",ua="UserProfilePermission",la="SearchUserProfile",ca="ChannelsInput",da="ChannelsOutput",pa="MultiChannels",fa="ModifyChannelsInput",ha="QuitChannelsSetting",ga="ChannelsQueryInput",_a="ChannelsPageParam",ba="ChannelsListResult",Ea="ChannelsInviteStatusInfos",va="ChannelsUserInfos",ya="ChannelsJoinedInfos",ma="ChannelsMemberUpdateInput",Ia="ChannelsMemberResponseInput",Ta="ChannelsMembersInput",Ra="FriendInput",Ca="FriendsInput",Oa="FriendsCheckOutput",Sa="FriendProfileInput",Aa="FriendProfileOutput",Pa="FriendQueryInput",Na="FriendsListInput",wa="FriendLevelSet",Ma="FriendUserInfos",La="FriendInviteInfos",Ua="ChannelApplyInfo",Da="AddUnpushPeriodInput",xa="DeleteUnpushPeriodInput",ja="QueryUnpushPeriodInput",Va="QueryUnpushPeriodOutput",Ga="RelationDel",ka="MsgReadEvent",Fa=new Map([["UpStreamMessage_pushExt","PushExtra"],["DownStreamMessages_list","DownStreamMessage"],["DownStreamMessage_pushExt","PushExtra"],["ChannelInfosOutput_channels","ChannelInfoOutput"],["GroupMembersOutput_members","MemberInfo"],["GroupInput_groupInfo","GroupInfo"],["RelationsInput_msg","DownStreamMessage"],["RelationsOutput_info","RelationInfo"],["RelationInfo_msg","DownStreamMessage"],["RelationInfo_msgInfo","UnreadMsgInfo"],["QryRemindListResp_msgInfo","UnreadMsgInfo"],["CleanMsgBatchReq_input","CleanHisMsgInput"],["HistoryMessagesOuput_list","DownStreamMessage"],["QueryChatRoomInfoOutput_userInfos","ChrmMember"],["MPFollowOutput_info","MpInfo"],["MCFollowOutput_info","MpInfo"],["SearchMpOutput_info","MpInfo"],["PullMpOutput_info","MpInfo"],["HistoryMsgOuput_list","DownStreamMessage"],["DeleteSessionsInput_sessions","SessionInfo"],["QuerySessionsInput_sessions","SessionInfo"],["QuerySessionsOutPut_sessions","SessionInfo"],["RelationDelBatchReq_relation","RelationOpInput"],["DeleteMsgInput_msgs","DeleteMsg"],["SetChrmKV_entry","ChrmKVEntity"],["SetChrmKV_notification","UpStreamMessage"],["SetChrmKVS_entry","ChrmKVEntity"],["SetChrmKVS_notification","UpStreamMessage"],["DeleteChrmKVS_entry","ChrmKVEntity"],["DeleteChrmKVS_notification","UpStreamMessage"],["ChrmKVOutput_entries","ChrmKVEntity"],["ChrmKVSOutput_errorKeys","ChrmKVSOutputEntity"],["ChrmKVSOutput_keysVersion","ChrmKVSVersionEntity"],["PullUserSettingOutput_items","UserSettingItem"],["UserSettingItem_tags","SessionTagItem"],["SessionStates_state","SessionState"],["SessionState_stateItem","SessionStateItem"],["SessionStateItem_tags","SessionTagItem"],["SessionStateModifyReq_state","SessionState"],["ReceiptResp_resp","QueryReceiptRespItem"],["QueryReceiptRespItem_readUser","ReceiptUser"],["QueryReceiptRespItem_unreadUser","ReceiptUser"],["GrpReadReceiptQryResp_list","GrpMsgReadUser"],["SessionTagAddInput_tags","SessionTagItem"],["SessionTagDelInput_tags","SessionTagItem"],["EventChangeList_list","EventChange"],["MsgChangeList_list","MsgChange"],["MsgQuery_query","MessageQueryInfo"],["MsgQueryAck_list","DownStreamMessage"],["OperateStatusNotify_info","OperateInfo"],["OperateStatusNotify_summary","OperateSummary"],["KvOutput_info","KvInfo"],["QueryReceiptResp_list","ReceiptUser"],["ReceiptCntQryResp_result","MsgReadCnt"],["UpdateUserSubReq_subUsers","UserSubDetail"],["UpdateUserSubResp_subUsers","UserSubDetail"],["PUllUserSubResp_list","UserSubList"],["UserSubList_subUsers","UserSubDetail"],["PullSubDataResp_list","SubDataDetail"],["SubDataDetail_data","SubData"],["QrySubDataReq_subUsers","UserSubDetail"],["UserProfile_userProfile","ProfileInfo"],["UserProfile_userExtProfile","ProfileInfo"],["UserProfiles_UserProfile","UserProfile"],["ChannelsInput_settingProfile","ProfileInfo"],["ChannelsInput_extProfile","ProfileInfo"],["ChannelsInput_baseInfo","ChannelBaseInfo"],["ChannelsOutput_channelInfo","ChannelsJoinedInfo"],["ChannelsOutput_userInfos","ChannelsUserInfo"],["ChannelsOutput_friendInviteInfo","FriendInviteInfo"],["ChannelsOutput_friendUserInfo","FriendUserInfo"],["MultiChannels_list","ChannelsInput"],["ModifyChannelsInput_settingInfo","QuitChannelsSetting"],["ChannelsQueryInput_page","ChannelsPageParam"],["ChannelsListResult_page","ChannelsPageParam"],["ChannelsInviteStatusInfos_list","ChannelsInviteStatusInfo"],["ChannelsUserInfos_list","ChannelsUserInfo"],["ChannelsJoinedInfos_list","ChannelsJoinedInfo"],["ChannelsUserInfo_ext","ChannelsUserExtInfo"],["ChannelsJoinedInfo_settingProfile","ProfileInfo"],["ChannelsJoinedInfo_extProfile","ProfileInfo"],["ChannelsJoinedInfo_baseInfo","ChannelBaseInfo"],["ChannelsJoinedInfo_userInfo","ChannelsUserExtInfo"],["ChannelsInviteStatusInfo_joinUserInfo","ChannelsUserInfo"],["ChannelsInviteStatusInfo_inviterInfo","ChannelsUserInfo"],["ChannelsInviteStatusInfo_processInfo","ChannelsUserInfo"],["FriendsOutput_list","FriendOutput"],["FriendsCheckOutput_list","FriendCheckOutput"],["FriendProfileInput_extProfile","ProfileInfo"],["FriendQueryInput_page","ChannelsPageParam"],["FriendUserInfo_extProfile","ProfileInfo"],["FriendUserInfos_list","FriendUserInfo"],["FriendInviteInfos_list","FriendInviteInfo"],["UpdateChannnelInfo_channelInfo","ChannelsJoinedInfo"],["UpdateChannnelInfo_userInfo","ChannelsUserInfo"],["UpdateUserInfo_updatedUserInfo","ChannelsUserInfo"],["UpdateUserInfo_optUserInfo","ChannelsUserInfo"],["ChannelApplyInfo_statusInfo","ChannelsInviteStatusInfo"],["ChannelEventData_optUserInfo","ChannelsUserInfo"],["ChannelEventData_channelInfo","ChannelsJoinedInfo"],["ChannelEventData_userInfos","ChannelsUserInfo"],["ChannelEventData_channelFullInfo","ChannelsJoinedInfo"],["FriendUpdateEvent_extProfile","ProfileInfo"],["MsgReadEvent_readList","ReceiptUser"]]);!function(e){e[e.PERSON=1]="PERSON",e[e.PERSONS=2]="PERSONS",e[e.GROUP=3]="GROUP",e[e.TEMPGROUP=4]="TEMPGROUP",e[e.CUSTOMERSERVICE=5]="CUSTOMERSERVICE",e[e.NOTIFY=6]="NOTIFY",e[e.MC=7]="MC",e[e.MP=8]="MP",e[e.ULTRAGROUP=10]="ULTRAGROUP"}(fo||(fo={})),function(e){e[e.IMAGE=1]="IMAGE",e[e.AUDIO=2]="AUDIO",e[e.VIDEO=3]="VIDEO",e[e.FILE=4]="FILE",e[e.SIGHT=5]="SIGHT",e[e.COMBINE_HTML=6]="COMBINE_HTML"}(ho||(ho={})),function(e){e[e.GROUP_SUCCESS=0]="GROUP_SUCCESS",e[e.GROUP_FAILURE=1]="GROUP_FAILURE"}(go||(go={})),function(e){e[e.IsSilent=1]="IsSilent",e[e.IsTop=2]="IsTop",e[e.Tags=3]="Tags"}(_o||(_o={}));var Ba,Ha,qa,Ya,Ka,Qa,Wa,Ja,za,Za=new po("package Modules;\nmessage probuf {\n message SetUserStatusOutput {\n optional int32 nothing=1;\n }\n message GetUserStatusInput {\n optional int32 nothing=1;\n }\n message GetUserStatusOutput {\n optional string status=1;\n optional string subUserId=2;\n }\n message SubUserStatusInput {\n repeated string userid =1;\n }\n message SubUserStatusOutput {\n optional int32 nothing=1;\n }\n message VoipDynamicInput {\n required int32 engineType = 1;\n required string channelName = 2;\n optional string channelExtra = 3;\n }\n message VoipDynamicOutput {\n required string dynamicKey=1;\n }\n message NotifyMsg {\n required int32 type = 1;\n optional int64 time = 2;\n optional string chrmId=3;\n }\n message SyncRequestMsg {\n required int64 syncTime = 1;\n required bool ispolling = 2;\n optional bool isweb=3;\n optional bool isPullSend=4;\n optional bool isKeeping=5;\n optional int64 sendBoxSyncTime=6;\n optional int64 broadcastSyncTime=7;\n optional int64 endTime = 8;\n optional bool compressioEnabled = 9;\n }\n message UpStreamMessage {\n required int32 sessionId = 1;\n required string classname = 2;\n required string content = 3;\n optional string pushText = 4;\n optional string appData = 5;\n repeated string toUserIds = 6;\n optional int64 delMsgTime = 7;\n optional string delMsgId = 8;\n optional int32 configFlag = 9;\n optional int64 clientUniqueId = 10;\n optional string extraContent = 11;\n optional PushExtra pushExt = 12;\n optional string busChannel = 13;\n optional bool isResend = 14;\n optional string systemId = 16;\n optional string senderPortrait = 21;\n optional int64 optionBits = 22;\n }\n message PushExtra {\n optional string title = 1;\n optional int32 templateIdNoUse= 2;\n optional string pushId = 3;\n optional string pushConfigs = 4;\n optional string templateId = 5;\n }\n message DownStreamMessages {\n repeated DownStreamMessage list = 1;\n required int64 syncTime = 2;\n optional bool finished = 3;\n optional int64 broadcastSyncTime = 4;\n optional int64 systemTime = 5;\n optional int64 credibleStartTime = 6;\n optional int64 credibleEndTime = 7;\n optional bool compressioEnabled = 8;\n optional bytes compressedData = 9;\n }\n message ChrmDownStreamMessages {\n repeated bytes list = 1;\n required int64 syncTime = 2;\n optional bool compressioEnabled = 3;\n optional bytes compressedData = 4;\n }\n message DownStreamMessage {\n required string fromUserId = 1;\n required ChannelType type = 2;\n optional string groupId = 3;\n required string classname = 4;\n required string content = 5;\n required int64 dataTime = 6;\n required int64 status = 7;\n optional int64 extra = 8;\n optional string msgId = 9;\n optional int32 direction = 10;\n optional int32 plantform =11;\n optional int32 isRemoved = 12;\n optional string source = 13;\n optional int64 clientUniqueId = 14;\n optional string extraContent = 15;\n optional string pushContent = 16;\n optional int32 configFlag = 17;\n optional PushExtra pushExt = 18;\n optional string busChannel = 19;\n optional int64 extStatus = 20;\n repeated string toUserIds = 21;\n optional int32 groupUnpush = 22;\n optional int64 optionBits = 23;\n }\n enum ChannelType {\n PERSON = 1;\n PERSONS = 2;\n GROUP = 3;\n TEMPGROUP = 4;\n CUSTOMERSERVICE = 5;\n NOTIFY = 6;\n MC=7;\n MP=8;\n ULTRAGROUP = 10;\n }\n message CreateDiscussionInput {\n optional string name = 1;\n }\n message CreateDiscussionOutput {\n required string id = 1;\n }\n message ChannelInvitationInput {\n repeated string users = 1;\n }\n message LeaveChannelInput {\n required int32 nothing = 1;\n }\n message ChannelEvictionInput {\n required string user = 1;\n }\n message RenameChannelInput {\n required string name = 1;\n }\n message ChannelInfoInput {\n required int32 nothing = 1;\n }\n message ChannelInfoOutput {\n required ChannelType type = 1;\n required string channelId = 2;\n required string channelName = 3;\n required string adminUserId = 4;\n repeated string firstTenUserIds = 5;\n required int32 openStatus = 6;\n }\n message ChannelInfosInput {\n required int32 page = 1;\n optional int32 number = 2;\n }\n message ChannelInfosOutput {\n repeated ChannelInfoOutput channels = 1;\n required int32 total = 2;\n }\n message MemberInfo {\n required string userId = 1;\n required string userName = 2;\n required string userPortrait = 3;\n required string extension = 4;\n }\n message GroupMembersInput {\n required int32 page = 1;\n optional int32 number = 2;\n }\n message GroupMembersOutput {\n repeated MemberInfo members = 1;\n required int32 total = 2;\n }\n message GetUserInfoInput {\n required int32 nothing = 1;\n }\n message GetUserInfoOutput {\n required string userId = 1;\n required string userName = 2;\n required string userPortrait = 3;\n }\n message GetSessionIdInput {\n required int32 nothing = 1;\n }\n message GetSessionIdOutput {\n required int32 sessionId = 1;\n }\n enum FileType {\n IMAGE = 1;\n AUDIO = 2;\n VIDEO = 3;\n FILE = 4;\n SIGHT = 5;\n COMBINE_HTML = 6;\n }\n message GetQNupTokenInput {\n required FileType type = 1;\n optional string key = 2;\n optional string httpMethod = 3;\n optional string queryString = 4;\n optional string url = 5;\n optional string ext = 6;\n optional int64 size = 7;\n optional int32 ipType = 8;\n }\n message GetQNdownloadUrlInput {\n required FileType type = 1;\n required string key = 2;\n optional string fileName = 3;\n }\n message GetDownloadUrlInput {\n required FileType type = 1;\n required string key = 2;\n optional string fileName = 3;\n optional string ext = 4;\n optional int64 size = 5;\n optional int32 ipType = 6;\n }\n message GetQNupTokenOutput {\n required int64 deadline = 1;\n required string token = 2;\n optional string bosToken = 3;\n optional string bosDate = 4;\n optional string path = 5;\n\n optional string osskeyId = 6;\n optional string ossPolicy = 7;\n optional string ossSign = 8;\n optional string ossBucketName = 9;\n\n optional string s3Credential = 10;\n optional string s3Algorithm = 11;\n optional string s3Date = 12;\n optional string s3Policy = 13;\n optional string s3Signature = 14;\n optional string s3BucketName = 15;\n\n optional string stcAuthorization = 16;\n optional string stcContentSha256 = 17;\n optional string stcDate = 18;\n optional string stcBucketName = 19;\n\n optional string minioAuthorization = 20;\n optional string minioContentSha256 = 21;\n optional string minioDate = 22;\n optional string minioBucketName = 23;\n\n optional string downloadAuthInfo = 24;\n optional string ossConfig = 25;\n }\n message GetQNdownloadUrlOutput {\n required string downloadUrl = 1;\n }\n message GetDownloadUrlOutput {\n required string downloadUrl = 1;\n }\n message Add2BlackListInput {\n required string userId = 1;\n }\n message RemoveFromBlackListInput {\n required string userId = 1;\n }\n message QueryBlackListInput {\n required int32 nothing = 1;\n }\n message QueryBlackListOutput {\n repeated string userIds = 1;\n }\n message BlackListStatusInput {\n required string userId = 1;\n }\n message BlockPushInput {\n required string blockeeId = 1;\n }\n message ModifyPermissionInput {\n required int32 openStatus = 1;\n }\n message GroupInput {\n repeated GroupInfo groupInfo = 1;\n }\n message GroupOutput {\n required int32 nothing = 1;\n }\n message GroupInfo {\n required string id = 1;\n required string name = 2;\n }\n message GroupHashInput {\n required string userId = 1;\n required string groupHashCode = 2;\n }\n message GroupHashOutput {\n required GroupHashType result = 1;\n }\n enum GroupHashType {\n GROUP_SUCCESS = 0x00;\n GROUP_FAILURE = 0x01;\n }\n message ChrmInput {\n required int32 nothing = 1;\n optional string extra = 2;\n }\n message ChrmOutput {\n required int32 nothing = 1;\n optional string sessionId = 2;\n optional int64 joinTime = 3;\n optional int64 createTime = 4;\n optional int32 memberCount = 5;\n optional int32 chatroomBanState = 6;\n optional int32 whiteListState = 7;\n }\n message ChrmPullMsg {\n required int64 syncTime = 1;\n required int32 count = 2;\n optional int32 pullMsgType = 3;\n optional bool compressioEnabled = 4;\n }\n message ChrmPullMsgNew {\n required int32 count = 1;\n required int64 syncTime = 2;\n optional string chrmId=3;\n }\n message RelationQryInput {\n optional ChannelType type = 1;\n optional int32 count = 2;\n optional int64 startTime = 3;\n optional int32 order = 4;\n optional bool isEraseMsgContent = 5;\n optional int64 endTime = 6;\n optional bool compressioEnabled = 7;\n optional int32 qryType = 8;\n }\n message RelationsInput {\n required ChannelType type = 1;\n optional DownStreamMessage msg =2;\n optional int32 count = 3;\n repeated string busChannel = 4;\n optional int64 startTime = 5;\n optional int64 endTime = 6;\n }\n message RelationsOutput {\n repeated RelationInfo info = 1;\n optional bool isFinished = 2;\n optional int64 pullTime = 3;\n optional bool compressioEnabled = 4; \n optional bytes compressedData = 5;\n }\n message RelationInfo {\n required ChannelType type = 1;\n required string userId = 2;\n optional DownStreamMessage msg =3;\n optional int64 readMsgTime= 4;\n optional int64 unreadCount= 5;\n optional string busChannel = 6;\n optional int64 versionTime = 7;\n optional int64 remindCount = 8;\n optional int32 busChannelType = 9;\n optional UnreadMsgInfo msgInfo = 10;\n optional int32 remindMeCount = 11;\n }\n message UnreadMsgInfo {\n required string msgId = 1;\n required int64 msgTime= 2;\n optional int32 remindType= 3;\n optional string className = 4;\n }\n message QryRemindListReq {\n required string groupId = 1;\n optional string busChannel = 2;\n optional int64 msgTime = 3;\n optional int32 size = 4;\n }\n message QryRemindListResp {\n repeated UnreadMsgInfo msgInfo = 1;\n }\n message RelationInfoReadTime {\n required ChannelType type = 1;\n required int64 readMsgTime= 2;\n required string targetId = 3;\n }\n message CleanHisMsgInput {\n required string targetId = 1;\n required int64 dataTime = 2;\n optional int32 conversationType= 3;\n optional string busChannel = 4;\n }\n message CleanMsgBatchReq {\n repeated CleanHisMsgInput input = 1;\n }\n message HistoryMessageInput {\n required string targetId = 1;\n required int64 dataTime =2;\n required int32 size = 3;\n }\n\n message HistoryMessagesOuput {\n repeated DownStreamMessage list = 1;\n required int64 syncTime = 2;\n required int32 hasMsg = 3;\n optional int64 credibleStartTime = 4;\n optional int64 credibleEndTime = 5;\n optional bool compressioEnabled = 6; \n optional bytes compressedData = 7;\n }\n message QueryChatRoomInfoInput {\n required int32 count= 1;\n optional int32 order= 2;\n }\n\n message QueryChatRoomInfoOutput {\n optional int32 userTotalNums = 1;\n repeated ChrmMember userInfos = 2;\n }\n message ChrmMember {\n required int64 time = 1;\n required string id = 2;\n }\n message MPFollowInput {\n required string id = 1;\n }\n\n message MPFollowOutput {\n required int32 nothing = 1;\n optional MpInfo info =2;\n }\n\n message MCFollowOutput {\n required int32 nothing = 1;\n optional MpInfo info =2;\n }\n\n message MpInfo {\n required string mpid=1;\n required string name = 2;\n required string type = 3;\n required int64 time=4;\n optional string portraitUrl=5;\n optional string extra =6;\n }\n\n message SearchMpInput {\n required int32 type=1;\n required string id=2;\n }\n\n message SearchMpOutput {\n required int32 nothing=1;\n repeated MpInfo info = 2;\n }\n\n message PullMpInput {\n required int64 time=1;\n required string mpid=2;\n }\n\n message PullMpOutput {\n required int32 status=1;\n repeated MpInfo info = 2;\n }\n message HistoryMsgInput {\n optional string targetId = 1;\n optional int64 time = 2;\n optional int32 count = 3;\n optional int32 order = 4;\n optional string busChannel = 5;\n optional bool compressioEnabled = 6;\n }\n\n message HistoryMsgOuput {\n repeated DownStreamMessage list=1;\n required int64 syncTime=2;\n required int32 hasMsg=3;\n optional int64 credibleStartTime = 4;\n optional int64 credibleEndTime = 5;\n optional bool compressioEnabled = 6;\n optional bytes compressedData = 7;\n }\n message SessionsAttQryInput {\n required int32 nothing = 1;\n }\n message SessionsAttOutput {\n required int64 inboxTime = 1;\n required int64 sendboxTime = 2;\n required int64 totalUnreadCount = 3;\n }\n message SessionMsgReadInput {\n required ChannelType type = 1;\n required int64 msgTime = 2;\n required string channelId = 3;\n optional string busChannel = 4;\n }\n message SessionMsgReadOutput {\n optional int32 nothing=1;\n }\n message DeleteSessionsInput {\n repeated SessionInfo sessions = 1;\n }\n message SessionInfo {\n required ChannelType type = 1;\n required string channelId = 2;\n optional int64 unreadCount = 3;\n optional string busChannel = 4;\n }\n message QuerySessionsInput {\n repeated SessionInfo sessions = 1;\n }\n message QuerySessionsOutPut {\n repeated SessionInfo sessions = 1;\n }\n message DeleteSessionsOutput {\n optional int32 nothing=1;\n }\n message RelationDelBatchReq {\n repeated RelationOpInput relation = 1;\n }\n message RelationOpInput {\n required string conversationId = 1;\n required ChannelType conversationType = 2;\n optional string busChannel = 3;\n }\n message DeleteMsgInput {\n optional ChannelType type = 1;\n optional string conversationId = 2;\n repeated DeleteMsg msgs = 3;\n optional string busChannel = 4;\n }\n message DeleteMsg {\n optional string msgId = 1;\n optional int64 msgDataTime = 2;\n optional int32 direct = 3;\n }\n message ChrmKVEntity {\n required string key = 1;\n required string value = 2;\n optional int32 status = 3;\n optional int64 timestamp = 4;\n optional string uid = 5;\n optional int64 version = 6;\n }\n message SetChrmKV {\n required ChrmKVEntity entry = 1;\n optional bool bNotify = 2;\n optional UpStreamMessage notification = 3;\n optional ChannelType type = 4;\n }\n message SetChrmKVS {\n repeated ChrmKVEntity entry = 1;\n optional bool bNotify = 2;\n optional UpStreamMessage notification = 3;\n optional ChannelType type = 4;\n }\n message DeleteChrmKVS {\n repeated ChrmKVEntity entry = 1;\n optional bool bNotify = 2;\n optional UpStreamMessage notification = 3;\n optional ChannelType type = 4;\n }\n message ChrmKVOutput {\n repeated ChrmKVEntity entries = 1;\n optional bool bFullUpdate = 2;\n optional int64 syncTime = 3;\n optional bool compressioEnabled = 4; \n optional bytes compressedData = 5;\n }\n message ChrmKVSVersionEntity {\n optional int64 version = 1;\n optional string key = 2;\n }\n\n message ChrmKVSOutput {\n repeated ChrmKVSOutputEntity errorKeys = 1;\n repeated ChrmKVSVersionEntity keysVersion = 2;\n }\n message ChrmKVSOutputEntity {\n optional string key = 1;\n optional int32 errorCode = 2;\n }\n message QueryChrmKV {\n required int64 timestamp = 1;\n optional bool compressioEnabled = 2;\n }\n message SetUserSettingInput {\n required int64 version=1;\n required string value=2;\n }\n message SetUserSettingOutput {\n required int64 version=1;\n required bool reserve=2;\n }\n message PullUserSettingInput {\n required int64 version=1;\n optional bool reserve=2;\n optional int32 ipType = 3;\n }\n message PullUserSettingOutput {\n repeated UserSettingItem items = 1;\n required int64 version=2;\n }\n message UserSettingItem {\n required string targetId= 1;\n required ChannelType type = 2;\n required string key = 4;\n required bytes value = 5;\n required int64 version=6;\n required int32 status=7;\n repeated SessionTagItem tags= 8;\n }\n message SessionReq {\n required int64 time = 1;\n }\n message SessionStates {\n optional int64 version=1;\n repeated SessionState state= 2;\n }\n message SessionState {\n required ChannelType type = 1;\n required string channelId = 2;\n optional int64 time = 3;\n repeated SessionStateItem stateItem = 4;\n optional string busChannel = 5;\n }\n message SessionStateItem {\n required SessionStateType sessionStateType = 1;\n required string value = 2;\n repeated SessionTagItem tags = 3;\n }\n enum SessionStateType {\n IsSilent = 1;\n IsTop = 2;\n Tags = 3;\n }\n message SessionStateModifyReq {\n required int64 version=1;\n repeated SessionState state= 2;\n }\n message GroupUnpushQuery {\n optional string busChannel = 1;\n }\n message GroupUnpushSet{\n optional string busChannel = 1;\n required int32 unpushLevel = 2;\n }\n message GroupUnpushResult {\n required string groupId = 1;\n optional string busChannel = 2;\n required int32 unpushLevel = 3;\n }\n message SessionStateModifyResp {\n required int64 version=1;\n }\n message TypeUnpushInput {\n required ChannelType type = 1;\n required int64 version = 2;\n required int32 unpushLevel = 3;\n }\n message TypeUnpushOutput {\n required int64 version = 1;\n }\n message GrpReadReceiptMsg {\n repeated string msgId=1;\n optional string channelId = 2;\n }\n message GrpReadReceiptQryReq {\n repeated string msgId=1;\n optional string channelId = 2;\n }\n message ReadReceipt {\n optional string targetId = 1;\n optional int32 type = 2;\n optional string channelId = 3;\n optional int32 readType =4 ;\n repeated string msgIds= 5 ;\n optional string fromId = 6;\n }\n message QueryReceiptReq{ \n optional string targetId = 1;\n optional string busChannel =2;\n optional int32 type = 3;\n repeated string msgIds = 4;\n optional int32 qryType = 5;\n optional int32 order =6;\n optional bool compress = 7;\n optional int32 readType = 8;\n optional int32 pageType = 9; \n optional int32 pageSize = 10;\n optional string pageToken = 11;\n repeated string users = 12;\n }\n message ReceiptResp {\n repeated QueryReceiptRespItem resp = 1;\n optional bool compress = 2;\n optional bytes compressData = 3;\n optional string pageToken = 4;\n }\n message QueryReceiptRespItem {\n optional string msgId = 1;\n optional int64 msgTime = 2;\n optional int32 totalCnt = 3;\n optional int64 readCnt = 4;\n repeated ReceiptUser readUser = 5;\n repeated string unreadList = 6;\n optional int64 unreadCnt = 7;\n repeated ReceiptUser unreadUser = 8;\n }\n message GrpReadReceiptQryResp {\n required int32 totalMemberNum = 1;\n repeated GrpMsgReadUser list = 2;\n }\n message GrpMsgReadUser {\n required int64 readTime = 1;\n required string userId = 2;\n }\n message SessionTagAddInput {\n required int64 version=1;\n repeated SessionTagItem tags=2;\n }\n message SessionTagItem {\n required string tagId=1;\n optional string name=2;\n optional int64 createdTime=3;\n optional bool isTop=4;\n }\n message SessionTagDelInput {\n required int64 version=1;\n repeated SessionTagItem tags=2;\n }\n message SessionDisTagReq {\n repeated string tagId=1;\n }\n message UserSettingNotification {\n required int64 version=1;\n required bool reserve=2;\n }\n message ReportSDKInput {\n required string sdkInfo=1;\n }\n message ReportSDKOutput {\n optional int32 nothing=1;\n }\n message UltraGrpPullSes {\n required int64 syncTime = 1;\n optional bool isEraseMsgContent = 2;\n }\n message UltraGrpPullMsg {\n required int64 syncTime = 1;\n optional bool compressioEnabled = 2;\n }\n message MsgChangeReq {\n required string fromUserId = 1;\n required string targetId = 2;\n required ChannelType type = 3;\n required string msgUID = 4;\n required int64 msgTime = 5;\n optional string busChannel = 6;\n optional string content = 7;\n }\n message QueryMsgChange {\n required int64 syncTime = 1;\n optional int32 needCompress = 2;\n optional int64 onlineTime = 3;\n optional string targetId = 4;\n }\n message EventChangeList {\n repeated EventChange list = 1;\n required int64 syncTime = 2;\n optional bool hasNext = 3 ;\n optional string targetId = 4;\n optional bool isCompress = 5 ;\n }\n message EventChange {\n optional string businessId = 1;\n optional ChannelType channelType = 2;\n optional int64 time = 3;\n optional int32 changeType = 4;\n optional string originalId = 5;\n optional int64 originalTime = 6;\n optional string secondaryId = 7;\n optional bool isAdmin = 8;\n optional bool additionalMark = 9; \n optional string operatorId = 10;\n optional int32 subChangeType = 11;\n optional int32 secondaryType = 12;\n optional bool isRemindMe = 13;\n repeated string extIds = 14;\n optional int32 remindType = 15;\n optional bytes eventData = 16;\n }\n message MsgChangeList {\n repeated MsgChange list = 1;\n required int64 syncTime = 2;\n optional bool hasNext = 3 ;\n }\n message MsgChange {\n required string targetId = 1;\n required ChannelType type = 2;\n required int64 time = 3;\n required int32 changeType = 4;\n required string msgUID = 5;\n required int64 msgTime = 6;\n optional string busChannel = 7;\n optional bool isAdmin = 8;\n optional bool isDel = 9;\n optional string operatorId = 10;\n optional int32 subChangeType = 11;\n optional int32 busChannelType = 12;\n optional bool isRemindMe = 13;\n repeated string userGroupIds = 14;\n optional int32 remindType = 15;\n }\n message MsgQuery {\n required string targetId = 1;\n required ChannelType type = 2;\n repeated MessageQueryInfo query = 3; //\n }\n message MessageQueryInfo {\n required int64 msgTime = 1;\n required string msgUID = 2;\n optional string busChannel = 3;\n }\n message MsgQueryAck {\n repeated DownStreamMessage list = 1;\n }\n message OperateStatus {\n optional string targetId = 1;\n optional ChannelType type = 2;\n optional int32 opType = 3;\n optional string busChannel = 4;\n }\n message OperateStatusNotify {\n optional ChannelType type = 1;\n optional int64 notifyType = 2;\n repeated OperateInfo info = 3 ;\n repeated OperateSummary summary = 4 ;\n }\n message OperateInfo {\n optional string targetId = 1;\n optional string busChannel = 2;\n optional string userId = 3;\n optional int32 opType = 4;\n optional int64 optime = 5;\n }\n \n message OperateSummary {\n optional string targetId = 1;\n optional string busChannel = 2;\n optional int32 count = 3;\n optional int32 opType = 4;\n }\n\n message SetRtcRoomIdInput {\n required string rtcRoomId= 1;\n }\n message SetRtcRoomIdOutput {\n required int32 nothing = 1;\n }\n message CallInfoUpStream {\n required string key= 1;\n required string dataContent=2;\n }\n message CallInfoDownStream {\n required string key= 1;\n required string dataContent=2;\n required int64 maxTime=3;\n }\n message KvInput {\n required int64 syncTime = 1;\n }\n message KvOutput {\n required int64 maxTime = 1;\n repeated KvInfo info = 2;\n }\n message KvInfo {\n required string key =1;\n required string value =2;\n }\n message ReadReceiptMsg {\n required string targetId = 1;\n required ChannelType type = 2;\n optional string busChannel = 3;\n optional string startMsgId = 4;\n optional string endMsgId = 5;\n }\n message ReceiptQryReq {\n required string msgId = 1;\n optional string busChannel = 2;\n required string targetId = 3;\n }\n message QueryReceiptResp {\n optional int32 num = 1;\n repeated ReceiptUser list = 2;\n optional int32 readCnt = 3;\n }\n message ReceiptUser {\n optional int64 receiptTime = 1;\n optional string userId = 2;\n optional string name = 3;\n optional string portrait = 4;\n optional bool mentioned= 5;\n }\n message ReceiptCntQryReq {\n optional ChannelType type = 1;\n optional string channelId = 2;\n optional string busChannel = 3;\n repeated string msgId = 4;\n }\n message ReceiptCntQryResp {\n repeated MsgReadCnt result= 1;\n }\n\n message MsgReadCnt {\n optional string msgId = 1;\n optional int32 cnt = 2;\n optional int32 tmn = 3;\n }\n message UpdateUserSubReq {\n optional int32 subType = 1;\n repeated UserSubDetail subUsers = 2;\n optional int32 opType = 3;\n optional int32 expiry = 4;\n }\n message UserSubDetail {\n optional string subUserId = 1;\n }\n message UpdateUserSubResp {\n repeated UserSubDetail subUsers = 1;\n optional int64 subTime = 2;\n }\n message PullUserSubReq {\n optional int64 version = 1;\n optional string pageToken = 2;\n }\n message PUllUserSubResp {\n repeated UserSubList list = 1;\n optional int64 version = 2;\n optional bool hasNext = 3;\n optional string pageToken = 4;\n optional bool isFull = 5;\n }\n message UserSubList {\n repeated UserSubDetail subUsers = 1;\n optional int32 subType = 2;\n optional int64 subTime = 3;\n optional int32 expiry = 4;\n optional int32 opType = 5;\n }\n message PullSubDataReq {\n optional int64 versionTime = 1;\n optional bool needAllData = 2;\n optional string pageToken = 3;\n }\n message PullSubDataResp {\n repeated SubDataDetail list = 1;\n optional int64 versionTime = 2;\n optional bool hasNext = 3;\n optional string pageToken = 4;\n optional bool isFull = 5;\n }\n message SubDataDetail {\n optional string statusStr = 1;\n optional string subUserId = 2;\n repeated SubData data = 3;\n optional int32 subType = 4;\n }\n\n message SubData {\n optional int32 platformInfo = 1;\n optional int32 value = 2;\n optional int64 versionTime = 3;\n }\n message QrySubDataReq {\n optional int32 subType = 1;\n repeated UserSubDetail subUsers = 2;\n }\n message UserProfile {\n optional int64 version = 1;\n optional string userId = 2;\n repeated ProfileInfo userProfile = 3;\n repeated ProfileInfo userExtProfile = 4;\n }\n message ProfileInfo {\n optional string key = 1;\n optional string value = 2;\n }\n message SetUserProfileResp {\n optional int64 version = 1;\n optional string key = 2;\n repeated string censorFailedFields = 3;\n }\n message PullUserProfileReq {\n repeated string userId = 1;\n }\n message UserProfiles {\n repeated UserProfile UserProfile = 1;\n }\n message UserProfileInput {\n required int32 nothing = 1;\n }\n message UserProfilePermission {\n optional int32 permission = 1;\n }\n message UserProfileOutput {\n required int32 nothing = 1;\n }\n message SearchUserProfile {\n optional string uniqueId = 1;\n }\n message ChannelsInput {\n optional string targetId = 1;\n optional ChannelType type = 2;\n repeated ProfileInfo settingProfile = 3;\n repeated ProfileInfo extProfile = 4;\n optional ChannelBaseInfo baseInfo = 5;\n repeated string users = 6;\n }\n\n message ChannelBaseInfo {\n optional string creatorId = 1;\n optional string ownerId = 2;\n optional int64 createTime = 3;\n optional int32 memberCount = 4;\n }\n\n message ChannelsOutput {\n optional int64 operateTime = 1;\n optional int32 flag = 2;\n optional string msg = 3;\n optional int32 processCode = 4;\n optional ChannelsJoinedInfo channelInfo = 5;\n repeated ChannelsUserInfo userInfos = 6;\n optional FriendInviteInfo friendInviteInfo = 7;\n optional FriendUserInfo friendUserInfo = 8;\n repeated string censorFailedFields = 9;\n }\n\n message MultiChannels {\n optional ChannelType type = 1;\n repeated ChannelsInput list = 2;\n }\n\n message ModifyChannelsInput {\n optional string targetId = 1;\n optional ChannelType type = 2;\n optional QuitChannelsSetting settingInfo = 3;\n repeated string users = 4;\n optional int32 operateType = 5;\n }\n\n message QuitChannelsSetting {\n optional bool isQuit = 1;\n optional bool isDelBan = 2;\n optional bool isDelWhite = 3;\n optional bool isDelAttention = 4;\n }\n\n message ChannelsQueryInput {\n optional string targetId = 1;\n optional ChannelType type = 2;\n optional ChannelsPageParam page = 3;\n repeated string ids = 4;\n optional int32 roleType = 5;\n }\n\n message ChannelsPageParam {\n optional int32 size = 1;\n optional string pageToken = 2;\n optional bool hasNext = 3 ;\n optional int32 total = 4 ;\n optional int32 order = 5 ;\n }\n\n message ChannelsListResult {\n optional int32 listType = 1;\n optional bytes result = 2;\n optional ChannelsPageParam page = 3;\n }\n \n message ChannelsInviteStatusInfos {\n repeated ChannelsInviteStatusInfo list = 1;\n }\n \n message ChannelsUserInfos {\n repeated ChannelsUserInfo list = 1;\n }\n \n message ChannelsJoinedInfos {\n repeated ChannelsJoinedInfo list = 1;\n }\n\n message ChannelsUserInfo {\n optional string userId = 1;\n optional ChannelsUserExtInfo ext = 2;\n optional int64 opTime = 3;\n optional string name = 4;\n optional string portraitUrl = 5;\n }\n\n message ChannelsUserExtInfo {\n optional int32 role = 1;\n optional int64 joinTime = 2;\n optional string channelNickName = 3;\n optional string additional = 4;\n optional string remarkName = 5;\n }\n\n message ChannelsMemberUpdateInput {\n optional string targetId = 1;\n optional ChannelType type = 2;\n optional string userId = 3;\n optional string channelNickName = 4;\n optional string additional = 5;\n optional int32 operateType = 6;\n }\n message ChannelsJoinedInfo {\n optional string targetId = 1;\n repeated ProfileInfo settingProfile = 2;\n repeated ProfileInfo extProfile = 3;\n optional ChannelBaseInfo baseInfo = 4;\n optional ChannelsUserExtInfo userInfo = 5;\n }\n message ChannelsInviteStatusInfo {\n optional string targetId = 1;\n optional ChannelsUserInfo joinUserInfo = 2;\n optional ChannelsUserInfo inviterInfo = 3;\n optional int32 status = 4;\n optional int32 directionType = 5;\n optional int32 joinType = 6;\n optional string detail = 7;\n optional int64 applyTime = 8;\n optional ChannelsUserInfo processInfo = 9;\n optional int64 processTime = 10;\n }\n message ChannelsMemberResponseInput {\n optional string targetId = 1;\n optional ChannelType type = 2;\n optional int32 optType = 3;\n optional int32 optResult = 4;\n optional string joinUserId = 5;\n optional string inviterId = 6;\n optional string detail = 7;\n }\n message ChannelsMembersInput {\n optional string targetId = 1;\n optional ChannelType type = 2;\n repeated string userIds = 3;\n }\n message FriendInput {\n optional string targetId = 1;\n optional int32 type = 2;\n optional string info = 3;\n }\n message FriendsOutput {\n repeated FriendOutput list = 1;\n }\n message FriendOutput {\n optional string userId = 1;\n optional int64 operateTime = 2;\n optional string flag = 3;\n }\n message FriendsInput {\n repeated string targetId = 1;\n optional int32 type = 2;\n }\n message FriendsCheckOutput {\n repeated FriendCheckOutput list = 1;\n }\n\n message FriendCheckOutput {\n optional string targetId = 1;\n optional int32 status = 2;\n }\n message FriendProfileInput {\n optional string targetId = 1;\n optional string remarkName = 2;\n repeated ProfileInfo extProfile = 3;\n }\n message FriendProfileOutput {\n repeated string censorFailedFields = 1;\n }\n message FriendQueryInput {\n optional int32 queryType = 1;\n optional ChannelsPageParam page = 2;\n optional int32 friendType= 3;\n }\n message FriendUserInfo {\n optional string userId = 1;\n optional int64 relationTime = 2;\n optional int32 friendType = 3;\n optional int32 flag = 4;\n optional string remarkName = 5;\n optional string name = 6;\n optional string portraitUrl = 7;\n repeated ProfileInfo extProfile = 8;\n \n }\n message FriendInviteInfo {\n optional string userId = 1;\n optional string name = 2;\n optional string portraitUrl = 3;\n optional int32 type = 4;\n optional int32 status = 5;\n optional int64 operateTime = 6;\n optional string info = 7;\n optional int32 friendType = 8;\n }\n message FriendsListInput {\n repeated string targetId = 1;\n optional int32 type = 2;\n }\n message FriendLevelSet {\n optional int32 level = 1;\n }\n\n message FriendPageParam {\n optional int32 size = 1;\n optional string pageToken = 2;\n }\n message FriendUserInfos {\n repeated FriendUserInfo list = 1;\n }\n\n message FriendInviteInfos {\n repeated FriendInviteInfo list = 1;\n }\n \n message FriendApplyEvent {\n optional int32 applyType = 1;\n optional int32 friendType = 2;\n optional string info = 3;\n optional string name = 4;\n optional string portraitUrl = 5;\n }\n message UpdateChannnelInfo {\n optional ChannelsJoinedInfo channelInfo = 1;\n optional ChannelsUserInfo userInfo = 2;\n }\n message UpdateUserInfo {\n optional ChannelsUserInfo updatedUserInfo = 1;\n optional ChannelsUserInfo optUserInfo = 2;\n }\n message ChannelApplyInfo {\n repeated ChannelsInviteStatusInfo statusInfo = 1;\n }\n message ChannelEventData {\n optional ChannelsUserInfo optUserInfo = 1;\n optional ChannelsJoinedInfo channelInfo = 2;\n repeated ChannelsUserInfo userInfos = 3;\n optional ChannelsJoinedInfo channelFullInfo = 4;\n }\n message FriendTypeChangeEvent {\n optional string friendId = 1;\n optional int32 friendType = 2;\n }\n message FriendUpdateEvent {\n optional string remarkname = 1;\n repeated ProfileInfo extProfile = 2;\n }\n message AddUnpushPeriodInput {\n required string startTime = 1;\n required int32 spanMinutes = 2;\n optional int32 level = 3;\n optional string timezone = 4;\n }\n message DeleteUnpushPeriodInput {\n required int32 nothing = 1;\n }\n message QueryUnpushPeriodInput {\n required int32 nothing = 1;\n }\n message QueryUnpushPeriodOutput {\n required int32 isUnpush = 1;\n optional string startTime = 2;\n optional int32 spanMinutes = 3;\n optional int32 level = 4;\n optional string timezone = 5;\n }\n message RelationDel {\n optional string targetId = 1;\n optional ChannelType type = 2;\n repeated string busChannel = 3;\n optional bool cleanMsg = 4;\n }\n message MsgReadEvent {\n optional string msgId = 1;\n optional int64 msgTime = 2;\n optional int32 totalCnt = 3;\n optional int32 readCnt = 4;\n optional int32 unreadCnt = 5;\n repeated ReceiptUser readList =6;\n }\n}\n",Fa);exports.LogLevel=void 0,(Ba=exports.LogLevel||(exports.LogLevel={}))[Ba.LOG=0]="LOG",Ba[Ba.DEBUG=0]="DEBUG",Ba[Ba.INFO=1]="INFO",Ba[Ba.WARN=2]="WARN",Ba[Ba.ERROR=3]="ERROR",Ba[Ba.FATAL=4]="FATAL",Ba[Ba.STATISTICS=6]="STATISTICS",Ba[Ba.NONE=1e3]="NONE",exports.LogSource=void 0,(Ha=exports.LogSource||(exports.LogSource={})).IM="IM",Ha.RTC="RTC",exports.ConnectionStatus=void 0,(qa=exports.ConnectionStatus||(exports.ConnectionStatus={}))[qa.CONNECTED=0]="CONNECTED",qa[qa.CONNECTING=1]="CONNECTING",qa[qa.DISCONNECTED=2]="DISCONNECTED",qa[qa.NETWORK_UNAVAILABLE=3]="NETWORK_UNAVAILABLE",qa[qa.CONNECTION_CLOSED=4]="CONNECTION_CLOSED",qa[qa.KICKED_OFFLINE_BY_OTHER_CLIENT=6]="KICKED_OFFLINE_BY_OTHER_CLIENT",qa[qa.WEBSOCKET_UNAVAILABLE=7]="WEBSOCKET_UNAVAILABLE",qa[qa.WEBSOCKET_ERROR=8]="WEBSOCKET_ERROR",qa[qa.BLOCKED=9]="BLOCKED",qa[qa.DOMAIN_INCORRECT=12]="DOMAIN_INCORRECT",qa[qa.DISCONNECT_BY_SERVER=13]="DISCONNECT_BY_SERVER",qa[qa.REDIRECT=14]="REDIRECT",qa[qa.USER_LOGOUT=19]="USER_LOGOUT",qa[qa.APPKEY_IS_FAKE=20]="APPKEY_IS_FAKE",qa[qa.FORBID_RECONNECT_BY_OTHER_SAME_CLIENT=31023]="FORBID_RECONNECT_BY_OTHER_SAME_CLIENT",qa[qa.ULTRALIMIT=1101]="ULTRALIMIT",qa[qa.REQUEST_NAVI=201]="REQUEST_NAVI",qa[qa.RESPONSE_NAVI=202]="RESPONSE_NAVI",qa[qa.RESPONSE_NAVI_ERROR=203]="RESPONSE_NAVI_ERROR",qa[qa.RESPONSE_NAVI_TIMEOUT=204]="RESPONSE_NAVI_TIMEOUT",qa[qa.RC_LICENSE_EXPIRED=31030]="RC_LICENSE_EXPIRED",qa[qa.RC_CONN_USER_OR_PASSWD_ERROR=31004]="RC_CONN_USER_OR_PASSWD_ERROR",exports.RTCMode=void 0,(Ya=exports.RTCMode||(exports.RTCMode={}))[Ya.RTC=0]="RTC",Ya[Ya.LIVE=2]="LIVE",Ya[Ya.SIP=4]="SIP",Ya[Ya.CALL=5]="CALL",Ya[Ya.MEETING=6]="MEETING",Ya[Ya.CROSS_MUTI=7]="CROSS_MUTI",Ya[Ya.CROSS_LIVE=8]="CROSS_LIVE",function(e){e[e.AUDIO_AND_VIDEO=0]="AUDIO_AND_VIDEO",e[e.AUDIO=1]="AUDIO"}(Ka||(Ka={})),function(e){e[e.ANCHOR=1]="ANCHOR",e[e.AUDIENCE=2]="AUDIENCE"}(Qa||(Qa={})),exports.RTCApiType=void 0,(Wa=exports.RTCApiType||(exports.RTCApiType={}))[Wa.ROOM=1]="ROOM",Wa[Wa.PERSON=2]="PERSON",function(e){e[e.AnchorToViewer=1]="AnchorToViewer",e[e.ViewerToAnchor=2]="ViewerToAnchor"}(Ja||(Ja={})),exports.RTCJoinType=void 0,(za=exports.RTCJoinType||(exports.RTCJoinType={}))[za.KICK=0]="KICK",za[za.REFUSE=1]="REFUSE",za[za.COEXIST=2]="COEXIST";var Xa=null;function $a(e,t,r,n){void 0===r&&(r={});var i=["error","warn","info","debug"][3-e];if(Xa&&e<exports.LogLevel.FATAL)try{var o=JSON.stringify(r);Xa[i](t,o)}catch(e){console.error(e)}}var eu,tu,ru=$a.bind(null,exports.LogLevel.DEBUG),nu={init:function(e){Xa=e},info:$a.bind(null,exports.LogLevel.INFO),debug:ru,warn:$a.bind(null,exports.LogLevel.WARN),error:$a.bind(null,exports.LogLevel.ERROR),fatal:$a.bind(null,exports.LogLevel.FATAL)},iu=function(){function e(){Object.defineProperty(this,"_map",{enumerable:!0,configurable:!0,writable:!0,value:{}})}return Object.defineProperty(e.prototype,"on",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n=this._map[e]||(this._map[e]=[]);n.some((function(e){return e.listener===t&&e.target===r}))||n.push({listener:t,target:r})}}),Object.defineProperty(e.prototype,"once",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n=this._map[e]||(this._map[e]=[]);n.some((function(e){return e.listener===t&&e.target===r}))||n.push({listener:t,target:r,once:!0})}}),Object.defineProperty(e.prototype,"off",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n=this._map[e];n&&((n=n.filter((function(e){return e.listener!==t||e.target!==r}))).length?this._map[e]=n:delete this._map[e])}}),Object.defineProperty(e.prototype,"emit",{enumerable:!1,configurable:!0,writable:!0,value:function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];var n=this._map[e];if(n)for(var i=n.length-1;i>=0;i-=1){var o=n[i],s=o.target,a=o.once,c=o.listener;a&&n.splice(i,1);try{c.call.apply(c,l([s],u(t),!1))}catch(e){null===console||void 0===console||console.error(e)}}}}),Object.defineProperty(e.prototype,"removeAll",{enumerable:!1,configurable:!0,writable:!0,value:function(e){delete this._map[e]}}),Object.defineProperty(e.prototype,"clear",{enumerable:!1,configurable:!0,writable:!0,value:function(){Object.keys(this._map).forEach(this.removeAll,this)}}),e}(),ou=function(e,t,r){var n=null==r?void 0:r.isReverse;Pt(e)&&function(){for(var r in e)t(e[r],r,e)}(),(Ot(e)||Tt(e))&&function(){if(n)for(var r=e.length-1;r>=0;r--)t(e[r],r);else for(var i=0,o=e.length;i<o;i++)t(e[i],i)}()},su=function(e,t){return ou(e,(function(r,n){e[n]=t(r,n)})),e},au=function(){function e(e,t,r){Object.defineProperty(this,"pbmaps",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"logger",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"pbModules",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.pbModules=co(t)}return Object.defineProperty(e.prototype,"getModule",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return new this.pbModules[e]}}),Object.defineProperty(e.prototype,"encode",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n=new this.pbModules[e];if(t)try{this.pbmaps[e].forEach((function(e){var r=t[e];void 0!==r&&n["set".concat(function(e,t,r){if(void 0===t||void 0===r)return e.toUpperCase();var n=e.slice(t,r);return e.replace(n,(function(e){return e.toUpperCase()}))}(e,0,1))](r)}))}catch(t){var i="pbname: ".concat(e,", stack: ").concat(t.stack);this.logger?this.logger.error(H.L_PB_ENCODE_E,i):null===console||void 0===console||console.error(H.L_PB_ENCODE_E,i)}return r?n:n.toArrayBuffer()}}),Object.defineProperty(e.prototype,"decode",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this.pbModules[e].decode(t);return this.fixInt64Values(r)}}),Object.defineProperty(e.prototype,"fixInt64Values",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;if(e instanceof Array)return e.map((function(e){return t.fixInt64Values(e)}));if(!Pt(e))return e;if(void 0!==e.low&&void 0!==e.high&&Object.prototype.hasOwnProperty.call(e,"unsigned")){var r=e.low;return r<0&&(r+=4294967296),r=r.toString(16),parseInt(e.high.toString(16)+"00000000".replace(new RegExp("0{".concat(r.length,"}$")),r),16)}for(var n in e)e[n]=this.fixInt64Values(e[n]);return e}}),e}();!function(e){e.RtcInput="RtcInput",e.RtcUserListOutput="RtcUserListOutput",e.SetUserStatusInput="SetUserStatusInput",e.RtcSetDataInput="RtcSetDataInput",e.RtcUserSetDataInput="RtcUserSetDataInput",e.RtcDataInput="RtcDataInput",e.RtcSetOutDataInput="RtcSetOutDataInput",e.MCFollowInput="MCFollowInput",e.RtcTokenOutput="RtcTokenOutput",e.RtcQryOutput="RtcQryOutput",e.RtcQryUserOutDataInput="RtcQryUserOutDataInput",e.RtcUserOutDataOutput="RtcUserOutDataOutput",e.RtcQueryListInput="RtcQueryListInput",e.RtcRoomInfoOutput="RtcRoomInfoOutput",e.RtcValueInfo="RtcValueInfo",e.RtcKeyDeleteInput="RtcKeyDeleteInput",e.RtcNotifyMsg="RtcNotifyMsg",e.RtcPullKV="RtcPullKV",e.RtcKVOutput="RtcKVOutput",e.RtcQueryUserJoinedInput="RtcQueryUserJoinedInput",e.RtcQueryUserJoinedOutput="RtcQueryUserJoinedOutput",e.RtcViewerJoinedOutput="RtcViewerJoinedOutput",e.RtcInviteInput="RtcInviteInput",e.RtcCancelInviteInput="RtcCancelInviteInput",e.RtcInviteAnswerInput="RtcInviteAnswerInput",e.RtcEndInviteInput="RtcEndInviteInput",e.RtcOutput="RtcOutput"}(tu||(tu={}));var uu,lu,cu,du,pu,fu,hu,gu,_u,bu,Eu,vu=((eu={})[tu.RtcInput]=["roomType","broadcastType","extraInnerData","needSysChatroom","identityChangeType","joinType","innerDatas","outerDatas"],eu[tu.RtcUserListOutput]=["users","token","sessionId","roomInfo"],eu[tu.SetUserStatusInput]=["status"],eu[tu.RtcSetDataInput]=["interior","target","key","value","objectName","content"],eu[tu.RtcUserSetDataInput]=["valueInfo","objectName","content"],eu[tu.RtcDataInput]=["interior","target","key","objectName","content"],eu[tu.RtcSetOutDataInput]=["target","valueInfo","objectName","content"],eu[tu.MCFollowInput]=["state"],eu[tu.RtcTokenOutput]=["rtcToken"],eu[tu.RtcQryOutput]=["outInfo"],eu[tu.RtcQryUserOutDataInput]=["userId"],eu[tu.RtcUserOutDataOutput]=["user"],eu[tu.RtcQueryListInput]=["order"],eu[tu.RtcRoomInfoOutput]=["roomId","roomData","userCount","list"],eu[tu.RtcValueInfo]=["key","value"],eu[tu.RtcKeyDeleteInput]=["key"],eu[tu.RtcNotifyMsg]=["type","time","roomId"],eu[tu.RtcPullKV]=["timestamp","roomId"],eu[tu.RtcKVOutput]=["entries","bFullUpdate","syncTime"],eu[tu.RtcQueryUserJoinedInput]=["userId"],eu[tu.RtcQueryUserJoinedOutput]=["info"],eu[tu.RtcInviteInput]=["invitedUserId","timeoutTime","invitedRoomId","inviteInfo","inviteSessionId"],eu[tu.RtcCancelInviteInput]=["invitedUserId","invitedRoomId","inviteInfo","inviteSessionId"],eu[tu.RtcInviteAnswerInput]=["inviteUserId","answerCode","inviteRoomId","inviteSessionId","content","key","value"],eu[tu.RtcEndInviteInput]=["inviteRoomId","inviteSessionId","inviteContent","inviteRoomKeys"],eu),yu="\npackage Modules;\nmessage probuf {\n enum JoinType {\n KICK = 0; //踢前一个设备\n REFUSE = 1; //当前加入拒绝\n COEXIST = 2; //两个设备共存\n }\n enum targetType {\n ROOM =1 ;\n PERSON = 2;\n }\n message ".concat(tu.SetUserStatusInput,"\n {\n optional int32 status=1;\n }\n message ").concat(tu.MCFollowInput,"\n {\n required string state = 1;\n }\n message ").concat(tu.RtcQueryListInput,"{\n optional int32 order=1;\n }\n message ").concat(tu.RtcKeyDeleteInput,"{\n repeated string key=1;\n }\n message ").concat(tu.RtcValueInfo,"{\n required string key=1;\n required string value=2;\n }\n message RtcUserInfo{\n required string userId=1;\n repeated ").concat(tu.RtcValueInfo," userData=2; //用户资源信息\n }\n message ").concat(tu.RtcUserListOutput,"{\n repeated RtcUserInfo users=1;\n optional string token=2;\n optional string sessionId=3;\n repeated RtcValueInfo roomInfo = 4; //房间 key value\n repeated RtcKVEntity entries = 5;//直播 KV 属性对象集合\n optional int64 syncTime = 6;//所有属性的最大时间戳(下次拉取 KV 时用)。\n optional int32 offlineKickTime = 7;//server 超时踢人时间,默认 60s\n }\n message RtcRoomInfoOutput{\n optional string roomId = 1;\n repeated ").concat(tu.RtcValueInfo," roomData = 2;\n optional int32 userCount = 3;\n repeated RtcUserInfo list=4;\n }\n message ").concat(tu.RtcInput,"{\n required int32 roomType=1;\n optional int32 broadcastType=2;\n optional RtcValueInfo extraInnerData = 3;\n optional bool needSysChatroom = 4; //是否需要同步聊天室\n optional IdentityChangeType identityChangeType = 5; //身份变更类型\n optional JoinType joinType = 6; // 加入房间类型\n repeated ").concat(tu.RtcValueInfo," innerDatas = 7; //用户内部 inner 数据,角色或者连麦信息等\n repeated ").concat(tu.RtcValueInfo," outerDatas = 8; //用户内部 outer 数据,自定义数据结构 RtcInput。\n }\n message ").concat(tu.RtcQryOutput,"{\n repeated ").concat(tu.RtcValueInfo," outInfo=1;\n }\n message ").concat(tu.RtcDataInput,"{\n required bool interior=1;\n required targetType target=2;\n repeated string key=3;\n optional string objectName=4;\n optional string content=5;\n }\n message ").concat(tu.RtcSetDataInput,"{\n required bool interior=1;\n required targetType target=2;\n required string key=3;\n required string value=4;\n optional string objectName=5;\n optional string content=6;\n }\n message ").concat(tu.RtcUserSetDataInput," {\n repeated ").concat(tu.RtcValueInfo," valueInfo = 1;\n required string objectName = 2;\n repeated ").concat(tu.RtcValueInfo," content = 3;\n }\n message RtcQryInput{\n required bool isInterior=1;\n required targetType target=2;\n repeated string key=3;\n }\n message RtcDelDataInput{\n repeated string key=1;\n required bool isInterior=2;\n required targetType target=3;\n }\n message RtcOutput\n {\n optional int32 nothing=1;\n optional int64 version=2;\n }\n message ").concat(tu.RtcTokenOutput,"{\n required string rtcToken=1;\n }\n message ").concat(tu.RtcSetOutDataInput,"{\n required targetType target=1;\n repeated ").concat(tu.RtcValueInfo," valueInfo=2;\n optional string objectName=3;\n optional string content=4;\n }\n message ").concat(tu.RtcQryUserOutDataInput,"{\n repeated string userId = 1;\n }\n message ").concat(tu.RtcUserOutDataOutput,"{\n repeated RtcUserInfo user = 1;\n }\n message ").concat(tu.RtcNotifyMsg," \n {\n required int32 type= 1; //(通知类型 1:rtc 房间状态 KV 变更通知)\n optional int64 time= 2; //消息产生时间\n optional string roomId=3; //主播房间 id\n }\n message ").concat(tu.RtcPullKV,"\n {\n required int64 timestamp = 1;\n required string roomId = 2;\n }\n message RtcKVEntity \n {\n required string key = 1;\n required string value = 2;\n optional int32 status = 3;\n optional int64 timestamp = 4;\n optional string uid = 5;\n }\n message ").concat(tu.RtcKVOutput,"\n {\n repeated RtcKVEntity entries = 1;\n optional bool bFullUpdate = 2;\n optional int64 syncTime = 3; \n }\n enum IdentityChangeType \n {\n AnchorToViewer = 1; //1 为主播变观众\n ViewerToAnchor = 2; //2 为观众变主播\n }\n message ").concat(tu.RtcQueryUserJoinedInput,"\n {\n required string userId = 1;\n }\n message RtcJoinedInfo\n {\n required string deviceId = 1; //设备 ID\n required string roomId = 2; //加入的房间 ID\n optional int64 joinTime = 3; //加入的时间\n }\n message ").concat(tu.RtcQueryUserJoinedOutput,"\n {\n repeated RtcJoinedInfo info = 1;\n }\n message ").concat(tu.RtcViewerJoinedOutput,"\n {\n required string rtcToken=1;\n repeated RtcKVEntity entries = 2;//KV 属性对象集合\n optional int64 syncTime = 3;//所有属性的最大时间戳(下次拉取 KV 时用)。\n }\n message ").concat(tu.RtcInviteInput,"\n {\n required string invitedUserId=1; //被邀请的人的 uid\n optional int32 timeoutTime=2; //邀请超时时间 (秒),默认三十秒\n required string invitedRoomId=3; //被邀请的房间\n required string inviteInfo=4; //邀请的信息 (包含邀请人,被邀请人,各自 userid) 客户端定义好。协议栈和 server 透传\n required string inviteSessionId= 5; //客户端保证唯一性 (建议 roomid_userid_时间戳_随机数)\n }\n message ").concat(tu.RtcCancelInviteInput,"\n {\n required string invitedUserId=1; //被邀请的人的 uid\n required string invitedRoomId=2; //被邀请的房间\n required string inviteInfo=3; //取消邀请的信息 (包含邀请人,被邀请人,各自 userid) 客户端定义好。协议栈和 server 透传\n required string inviteSessionId=4; //邀请的 sessionId,客户端发起邀请时产生\n }\n message ").concat(tu.RtcInviteAnswerInput,"\n {\n required string inviteUserId=1; //邀请的人的 uid\n required int32 answerCode=2; //是否接受连麦邀请.0 为拒绝,1 为接受\n required string inviteRoomId=3; //邀请的房间\n required string inviteSessionId=4; //邀请的 sessionId\n required string content=5; //需要转发的 content\n optional string key=6; //如果接受的话,需要加这个字段,放在 room 级别的 k 和 v,新加入房间的能拉取到\n optional string value=7; //如果接受的话,需要加这个字段,放在 room 级别的 k 和 v,新加入房间的能拉取到\n }\n message ").concat(tu.RtcEndInviteInput,"\n {\n required string inviteRoomId=1; //邀请的房间\n required string inviteSessionId=2; //邀请的 sessionId\n required string inviteContent=3; //结束连麦的信息 (需要透传给房间内其他人)\n repeated string inviteRoomKeys=4; //需要删除连麦的信息的 key\n }\n}\n"),mu=function(e,t,r,n,i,o){var s=i?Object.keys(i).map((function(t){return e.encode(tu.RtcValueInfo,{key:t,value:i[t]},!0)})):void 0,a=o?Object.keys(o).map((function(t){return e.encode(tu.RtcValueInfo,{key:t,value:o[t]},!0)})):void 0;return e.encode(tu.RtcInput,{roomType:t,broadcastType:r,joinType:n,innerDatas:s,outerDatas:a})},Iu=function(e,t){var r=e.decode(tu.RtcUserListOutput,t),n=r.users,i=r.token,o=r.sessionId,s=r.roomInfo,a=r.entries,u=r.offlineKickTime,l={};return ou(n,(function(e){var t=e.userId,r=e.userData,n={};ou(r,(function(e){var t=e.key,r=e.value;n[t]=r})),l[t]=n})),{users:l,token:i,sessionId:o,roomInfo:s,kvEntries:a,offlineKickTime:u}},Tu=function(){function e(e){Object.defineProperty(this,"_pullQueue",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_isPulling",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_engine",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_pullTime",{enumerable:!0,configurable:!0,writable:!0,value:0}),this._engine=e}return Object.defineProperty(e.prototype,"_startPull",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t,r,n,i,o,a;return s(this,(function(s){switch(s.label){case 0:return this._isPulling||0===this._pullQueue.length?[2]:(this._isPulling=!0,e=this._pullQueue.splice(0,1)[0],t=e.roomId,r=e.timestamp,(n=this._pullTime)>r?(this._isPulling=!1,this._startPull(),[2]):[4,this._engine.pullRTCRoomEntry(t,n)]);case 1:return i=s.sent(),o=i.code,a=i.data,o===exports.ErrorCode.SUCCESS?(this._isPulling=!1,this._pullTime=a||0,this._startPull()):this._startPull(),[2]}}))}))}}),Object.defineProperty(e.prototype,"pullEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._pullQueue.push({roomId:e,timestamp:t}),this._startPull()}}),Object.defineProperty(e.prototype,"reset",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._pullTime=0,this._isPulling=!1}}),e}(),Ru=function(){function e(e,t,r,n){Object.defineProperty(this,"rtcCodec",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"_watcher",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"_options",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"logger",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(this,"_appkey",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_rtcKVManager",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_rtcSignalingListener",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._appkey=this._options.appkey,this._rtcKVManager=new Tu(this)}return Object.defineProperty(e.prototype,"registerRTCSignalingListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._rtcSignalingListener=e}}),Object.defineProperty(e.prototype,"getInnerLogger",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.logger}}),Object.defineProperty(e.prototype,"pullRTCRoomEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var t,r,i,o,a,u,l;return s(this,(function(s){switch(s.label){case 0:return t=this.rtcCodec.encode(tu.RtcPullKV,{timestamp:0,roomId:e}),[4,this.rtcSignaling(e,yn,!0,t)];case 1:return r=s.sent(),i=r.code,o=r.buffer,i!==exports.ErrorCode.SUCCESS?[2,{code:i}]:(a=this.rtcCodec.decode(tu.RtcKVOutput,o),u=a.entries,l=a.syncTime,u=(u||[]).map((function(e){return n(n({},e),{timestamp:kt(e.timestamp)})})),this._watcher.onRTCDataChange(u,e),[2,{code:i,data:l}])}}))}))}}),Object.defineProperty(e.prototype,"_receiveRtcKv",{enumerable:!1,configurable:!0,writable:!0,value:function(e){if(this._rtcSignalingListener)this._rtcSignalingListener(e);else{var t=this.rtcCodec.decode(tu.RtcNotifyMsg,e),r=t.time,n=t.type,i=t.roomId;1===n&&this._rtcKVManager.pullEntry(i,kt(r))}}}),Object.defineProperty(e.prototype,"destroy",{enumerable:!1,configurable:!0,writable:!0,value:function(){}}),e}();exports.StreamMessageResponseEventType=void 0,(uu=exports.StreamMessageResponseEventType||(exports.StreamMessageResponseEventType={})).INIT="INIT",uu.DATA="DATA",uu.END="END";var Cu=function(e){function r(t,r){var n=e.call(this)||this;return lu.add(n),cu.set(n,void 0),du.set(n,new Map),pu.set(n,void 0),d(n,cu,t,"f"),d(n,pu,r,"f"),n}return t(r,e),Object.defineProperty(r.prototype,"requestStreamMessageContent",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n=this;return s(this,(function(i){switch(i.label){case 0:return t=c(this,lu,"a",fu).createTraceId(),c(this,lu,"a",fu).info(H.L_REQ_STREAM_MSG_CONTENT_T,"messageUId: ".concat(e),t),[4,vt.create("requestStreamMessageContent").isLimitedString("messageUId",e,1,64,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_UID,"messageUId is invalid.").result().tryTrans(c(this,cu,"f").validateConnected).tryTrans((function(e){var t,r;return(null===(r=null===(t=null==e?void 0:e.streamServer)||void 0===t?void 0:t.addrs)||void 0===r?void 0:r.length)?ht(e.streamServer.addrs):gt(exports.ErrorCode.STREAM_MESSAGE_DISABLE)})).next((function(t){return c(n,lu,"m",Eu).call(n,e,t)}))];case 1:return r=i.sent(),c(this,lu,"a",fu).summary(H.L_REQ_STREAM_MSG_CONTENT_R,r,t,{messageUId:e}),[2,r.wipe()]}}))}))}}),r}(pt);cu=new WeakMap,du=new WeakMap,pu=new WeakMap,lu=new WeakSet,fu=function(){return c(this,cu,"f").logger},hu=function(e,t,r){var n=c(this,du,"f").get(e);n&&(c(this,du,"f").delete(e),c(this,lu,"m",gu).call(this,e,exports.StreamMessageResponseEventType.END,t,n.msg))},gu=function(e,t,r,n,i){this.emit("message",{code:r,messageUId:e,type:t,chunk:i,message:n})},_u=function(e,t){e.content=n(n({},e.content),t),c(this,cu,"f").setMessageContent(e.messageId,e.content,e.messageType)},bu=function(e,t,r){var n,i,o=c(this,du,"f").get(t);switch(e){case"init":o.msg&&c(this,lu,"m",_u).call(this,o.msg,{content:"",stopReason:0,completeReason:0,isSynced:!1}),c(this,lu,"m",gu).call(this,t,exports.StreamMessageResponseEventType.INIT,exports.ErrorCode.SUCCESS,o.msg);break;case"complete":i=(n=r.length?JSON.parse(r):{}).complete||!1,o.msg&&c(this,lu,"m",_u).call(this,o.msg,{stopReason:n.stopReason||0,completeReason:n.completeReason||0,complete:i,isSynced:i}),c(this,lu,"m",hu).call(this,t,n.stopReason||0,i);break;default:n=JSON.parse(r),o.cached+=n.content,o.msg&&c(this,lu,"m",_u).call(this,o.msg,{content:o.cached}),c(this,lu,"m",gu).call(this,t,exports.StreamMessageResponseEventType.DATA,exports.ErrorCode.SUCCESS,o.msg,{content:n.content,fullContent:o.cached})}},Eu=function(e,t){return o(this,void 0,void 0,(function(){var r,n,i,o,a,u,l,d=this;return s(this,(function(s){switch(s.label){case 0:return c(this,du,"f").has(e)?[2,gt(exports.ErrorCode.STREAM_MESSAGE_REQUEST_IN_PROCESS,"Request in process, msgUId: ".concat(e))]:c(this,du,"f").size>=3?[2,gt(exports.ErrorCode.STREAM_MESSAGE_REQUEST_COUNT_LIMIT_EXCEEDED,"The request queue is full")]:(r=lo.createSSEClient({logger:c(this,lu,"a",fu),msgUId:e,appkey:c(this,cu,"f").appkey,token:c(this,cu,"f").token,timeout:3e4,onRawContent:function(t){t.split("\n\n").forEach((function(t){if(0!==t.length){t.startsWith("data:")&&(t="event:delta\n".concat(t));var r=t.indexOf("\n"),n=t.slice(0,r).replace("event:",""),i=t.slice(r+1+5);c(d,lu,"m",bu).call(d,n,e,i.trim())}}))},onNetworkError:function(t){c(d,lu,"m",hu).call(d,e,t,!1)}}),r.isOk?(n=r.data,i={client:n,cached:"",msg:void 0},c(this,du,"f").set(e,i),c(this,pu,"f")?[4,c(this,cu,"f").getLocalMessage(e)]:[3,2]):[2,r.wipe()]);case 1:if(o=s.sent(),a=o.code,!(u=o.data))return c(this,du,"f").delete(e),[2,gt(a,"message not found, msgUId: ".concat(e))];if(u.content.isSynced)return c(this,du,"f").delete(e),[2,gt(exports.ErrorCode.STREAM_MESSAGE_SYNCED,"synced")];i.msg=u,s.label=2;case 2:return[4,n.open(t.slice())];case 3:return(l=s.sent()).isOk||c(this,du,"f").delete(e),[2,l.wipe()]}}))}))};var Ou,Su,Au=function(){function e(e){Object.defineProperty(this,"_context",{enumerable:!0,configurable:!0,writable:!0,value:e})}return Object.defineProperty(e.prototype,"__getContext",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._context}}),Object.defineProperty(e.prototype,"createCodec",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return new au(e,t)}}),Object.defineProperty(e.prototype,"createPBCodec",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return new po(e,t)}}),Object.defineProperty(e.prototype,"refetchNaviInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){return s(this,(function(e){return[2,this._context.refetchNaviInfo()]}))}))}}),Object.defineProperty(e.prototype,"getNaviInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._context.getNaviInfoFromCache()}}),Object.defineProperty(e.prototype,"getCoreVersion",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"5.20.2-enterprise.12"}}),Object.defineProperty(e.prototype,"getAPIVersion",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"5.20.2-enterprise.12"}}),Object.defineProperty(e.prototype,"getAppkey",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._context.appkey}}),Object.defineProperty(e.prototype,"getCurrentId",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._context.getCurrentUserId()}}),Object.defineProperty(e.prototype,"getUserToken",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._context.token}}),Object.defineProperty(e.prototype,"getConnectionStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._context.getConnectionStatus()}}),Object.defineProperty(e.prototype,"getDeviceId",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._context.getDeviceId()}}),Object.defineProperty(e.prototype,"setPushConfig",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._context.setPushConfig(e)}}),Object.defineProperty(e.prototype,"sendMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return this._context.sendMessage(e,t,r)}}),Object.defineProperty(e.prototype,"registerMessageType",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){void 0===n&&(n=[]),this._context.registerMessageType(e,t,r,n)}}),Object.defineProperty(e.prototype,"getServerTime",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._context.getServerTime()}}),Object.defineProperty(e.prototype,"getOSInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._context.getOSInfo()}}),Object.defineProperty(e.prototype,"getProcessInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._context.getProcessInfo()}}),Object.defineProperty(e.prototype,"getMainProcessInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._context.getMainProcessInfo()}}),Object.defineProperty(e.prototype,"setCallInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return this._context.setCallInfo(e,t,r)}}),Object.defineProperty(e.prototype,"createLogger",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return this._context.createLogger(e,t)}}),Object.defineProperty(e.prototype,"getStatsUrlList",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._context.getStatsUrlList()}}),e}(),Pu=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return t(r,e),Object.defineProperty(r.prototype,"joinRTCRoom",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i,a){return o(this,void 0,void 0,(function(){var o,u,l,c,d;return s(this,(function(s){switch(s.label){case 0:return o=mu(this._context.rtcCodec,t,r,n,i,a),[4,this.rtcSignaling(e,on,!0,o)];case 1:return u=s.sent(),l=u.code,c=u.buffer,l===exports.ErrorCode.SUCCESS&&c&&(d=Iu(this._context.rtcCodec,c)),[2,{code:l,data:d}]}}))}))}}),Object.defineProperty(r.prototype,"quitRTCRoom",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t;return s(this,(function(r){switch(r.label){case 0:return t=this._context.rtcCodec.encode(tu.SetUserStatusInput,{status:0}),[4,this.rtcSignaling(e,sn,!0,t)];case 1:return[2,r.sent().code]}}))}))}}),Object.defineProperty(r.prototype,"rtcPing",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){return s(this,(function(n){switch(n.label){case 0:return[4,this._context.rtcPing(e,t,r)];case 1:return[2,n.sent().code]}}))}))}}),Object.defineProperty(r.prototype,"rtcPingResVersion",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return this._context.rtcPing(e,t,r)}}),Object.defineProperty(r.prototype,"getRTCRoomInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,o;return s(this,(function(s){switch(s.label){case 0:return t=this._context.rtcCodec.encode(tu.RtcQueryListInput,{order:2}),[4,this.rtcSignaling(e,an,!0,t)];case 1:return r=s.sent(),n=r.code,i=r.buffer,n===exports.ErrorCode.SUCCESS&&i&&(o=this._context.rtcCodec.decode(tu.RtcRoomInfoOutput,i)),[2,{code:n,data:o}]}}))}))}}),Object.defineProperty(r.prototype,"getRTCUserInfoList",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,o,a;return s(this,(function(s){switch(s.label){case 0:return t=this._context.rtcCodec.encode(tu.RtcQueryListInput,{order:2}),[4,this.rtcSignaling(e,un,!0,t)];case 1:return r=s.sent(),n=r.code,i=r.buffer,n===exports.ErrorCode.SUCCESS&&i&&(a=Iu(this._context.rtcCodec,i),o={users:a.users}),[2,{code:n,data:o}]}}))}))}}),Object.defineProperty(r.prototype,"getRTCUserInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){throw new Error("Method not implemented.")}}),Object.defineProperty(r.prototype,"setRTCUserInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n;return s(this,(function(i){switch(i.label){case 0:return n=this._context.rtcCodec.encode(tu.RtcValueInfo,{key:t,value:r}),[4,this.rtcSignaling(e,ln,!0,n)];case 1:return[2,i.sent().code]}}))}))}}),Object.defineProperty(r.prototype,"removeRTCUserInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r;return s(this,(function(n){switch(n.label){case 0:return r=this._context.rtcCodec.encode(tu.RtcKeyDeleteInput,{key:t}),[4,this.rtcSignaling(e,cn,!1,r)];case 1:return[2,n.sent().code]}}))}))}}),Object.defineProperty(r.prototype,"setRTCData",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i,a){return o(this,void 0,void 0,(function(){var o;return s(this,(function(s){switch(s.label){case 0:return o=this._context.rtcCodec.encode(tu.RtcSetDataInput,{interior:n,target:i,key:t,value:r,objectName:null==a?void 0:a.name,content:null==a?void 0:a.content}),[4,this.rtcSignaling(e,dn,!1,o)];case 1:return[2,s.sent().code]}}))}))}}),Object.defineProperty(r.prototype,"setRTCTotalRes",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){return void 0===i&&(i=""),o(this,void 0,void 0,(function(){var o,a;return s(this,(function(s){switch(s.label){case 0:return o={objectName:n,content:this._context.rtcCodec.encode(tu.RtcValueInfo,{key:t.name,value:t.content},!0),valueInfo:[this._context.rtcCodec.encode(tu.RtcValueInfo,{key:"uris",value:r},!0),this._context.rtcCodec.encode(tu.RtcValueInfo,{key:"mcu_uris",value:i},!0)]},a=this._context.rtcCodec.encode(tu.RtcUserSetDataInput,o),[4,this.rtcSignaling(e,pn,!0,a)];case 1:return[2,s.sent().code]}}))}))}}),Object.defineProperty(r.prototype,"setRTCCDNUris",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n;return s(this,(function(i){switch(i.label){case 0:return n=this._context.rtcCodec.encode(tu.RtcUserSetDataInput,{objectName:t,valueInfo:this._context.rtcCodec.encode(tu.RtcValueInfo,{key:"cdn_uris",value:r},!0)}),[4,this.rtcSignaling(e,pn,!0,n)];case 1:return[2,i.sent().code]}}))}))}}),Object.defineProperty(r.prototype,"getRTCData",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return o(this,void 0,void 0,(function(){var i,o,a,u,l,c;return s(this,(function(s){switch(s.label){case 0:return i=this._context.rtcCodec.encode(tu.RtcDataInput,{interior:r,target:n,key:t}),[4,this.rtcSignaling(e,fn,!0,i)];case 1:return o=s.sent(),a=o.code,u=o.buffer,a===exports.ErrorCode.SUCCESS&&u?(l=this._context.rtcCodec.decode(tu.RtcQryOutput,u).outInfo,c={},l.forEach((function(e){c[e.key]=e.value})),[2,{code:a,data:c}]):[2,{code:a}]}}))}))}}),Object.defineProperty(r.prototype,"removeRTCData",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){return o(this,void 0,void 0,(function(){var o;return s(this,(function(s){switch(s.label){case 0:return o=this._context.rtcCodec.encode(tu.RtcDataInput,{interior:r,target:n,key:t,objectName:null==i?void 0:i.name,content:null==i?void 0:i.content}),[4,this.rtcSignaling(e,hn,!1,o)];case 1:return[2,s.sent().code]}}))}))}}),Object.defineProperty(r.prototype,"setRTCOutData",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return o(this,void 0,void 0,(function(){return s(this,(function(e){throw new Error("JSEngine's method not implemented.")}))}))}}),Object.defineProperty(r.prototype,"getRTCOutData",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){return s(this,(function(e){throw new Error("JSEngine's method not implemented.")}))}))}}),Object.defineProperty(r.prototype,"getRTCToken",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n,i,o,a,u;return s(this,(function(s){switch(s.label){case 0:return n=mu(this._context.rtcCodec,t,r),[4,this.rtcSignaling(e,gn,!0,n)];case 1:return i=s.sent(),o=i.code,a=i.buffer,o===exports.ErrorCode.SUCCESS&&a?(u=this._context.rtcCodec.decode(tu.RtcTokenOutput,a).rtcToken,[2,{code:o,data:{rtcToken:u}}]):[2,{code:o}]}}))}))}}),Object.defineProperty(r.prototype,"setRTCState",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r;return s(this,(function(n){switch(n.label){case 0:return r=this._context.rtcCodec.encode(tu.MCFollowInput,{state:t}),[4,this.rtcSignaling(e,_n,!0,r)];case 1:return[2,n.sent().code]}}))}))}}),Object.defineProperty(r.prototype,"getRTCUserList",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,o;return s(this,(function(s){switch(s.label){case 0:return t=this._context.rtcCodec.encode(tu.RtcQueryListInput,{order:2}),[4,this.rtcSignaling(e,bn,!0,t)];case 1:return r=s.sent(),n=r.code,i=r.buffer,n===exports.ErrorCode.SUCCESS&&i?(o=Iu(this._context.rtcCodec,i),[2,{code:n,data:o}]):[2,{code:n}]}}))}))}}),Object.defineProperty(r.prototype,"joinLivingRoomAsAudience",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n,i,o,a,u,l,c;return s(this,(function(s){switch(s.label){case 0:return n=mu(this._context.rtcCodec,t,r),[4,this.rtcSignaling(e,En,!0,n)];case 1:return i=s.sent(),o=i.code,a=i.buffer,o===exports.ErrorCode.SUCCESS&&a?(u=this._context.rtcCodec.decode(tu.RtcViewerJoinedOutput,a),l=u.rtcToken,c=u.entries,[2,{code:o,data:{token:l,kvEntries:c}}]):[2,{code:o}]}}))}))}}),Object.defineProperty(r.prototype,"quitLivingRoomAsAudience",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t;return s(this,(function(r){switch(r.label){case 0:return t=this._context.rtcCodec.encode(tu.SetUserStatusInput,{status:0}),[4,this.rtcSignaling(e,vn,!0,t)];case 1:return[2,r.sent().code]}}))}))}}),Object.defineProperty(r.prototype,"rtcIdentityChange",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n,i,o,a,u;return s(this,(function(s){switch(s.label){case 0:return n=this._context.rtcCodec.encode(tu.RtcInput,{roomType:exports.RTCMode.LIVE,broadcastType:r,identityChangeType:t,needSysChatroom:!1}),[4,this.rtcSignaling(e,mn,!0,n)];case 1:return i=s.sent(),o=i.code,a=i.buffer,o===exports.ErrorCode.SUCCESS&&a?(u=Iu(this._context.rtcCodec,a),[2,{code:o,data:u}]):[2,{code:o}]}}))}))}}),Object.defineProperty(r.prototype,"requestRoomPK",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,o,a,u;return s(this,(function(s){switch(s.label){case 0:return t=e.invitedRoomId,r=e.invitedUserId,n=e.inviteSessionId,i=e.inviteTimeout,o=e.inviteInfo,a=e.roomId,u=this._context.rtcCodec.encode(tu.RtcInviteInput,{invitedRoomId:t,invitedUserId:r,inviteSessionId:n,timeoutTime:i,inviteInfo:o}),[4,this.rtcSignaling(a,In,!0,u)];case 1:return[2,s.sent().code]}}))}))}}),Object.defineProperty(r.prototype,"cancelRoomPK",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,o,a;return s(this,(function(s){switch(s.label){case 0:return t=e.invitedRoomId,r=e.invitedUserId,n=e.inviteSessionId,i=e.inviteInfo,o=e.roomId,a=this._context.rtcCodec.encode(tu.RtcCancelInviteInput,{invitedRoomId:t,invitedUserId:r,inviteSessionId:n,inviteInfo:i}),[4,this.rtcSignaling(o,Tn,!0,a)];case 1:return[2,s.sent().code]}}))}))}}),Object.defineProperty(r.prototype,"responseRoomPK",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,o,a,u,l,c;return s(this,(function(s){switch(s.label){case 0:return t=e.inviteUserId,r=e.inviteRoomId,n=e.inviteSessionId,i=e.content,o=e.key,a=e.value,u=e.agree,l=e.roomId,c=this._context.rtcCodec.encode(tu.RtcInviteAnswerInput,{inviteUserId:t,inviteRoomId:r,inviteSessionId:n,content:i,key:o,value:a,answerCode:u?1:0}),[4,this.rtcSignaling(l,Rn,!0,c)];case 1:return[2,s.sent().code]}}))}))}}),Object.defineProperty(r.prototype,"endRoomPK",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,o,a;return s(this,(function(s){switch(s.label){case 0:return t=e.endRoomId,r=e.sessionId,n=e.content,i=e.keys,o=e.roomId,a=this._context.rtcCodec.encode(tu.RtcEndInviteInput,{inviteRoomId:t,inviteSessionId:r,inviteContent:n,inviteRoomKeys:i}),[4,this.rtcSignaling(o,Cn,!0,a)];case 1:return[2,s.sent().code]}}))}))}}),Object.defineProperty(r.prototype,"registerRTCSignalListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._context.registerRTCSignalingListener(e)}}),Object.defineProperty(r.prototype,"rtcSignaling",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return this._context.rtcSignaling(e,t,r,n)}}),Object.defineProperty(r.prototype,"getRTCJoinedUserInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,o;return s(this,(function(s){switch(s.label){case 0:return t=this._context.rtcCodec.encode(tu.RtcQueryUserJoinedInput,{userId:e}),[4,this.rtcSignaling("",On,!0,t)];case 1:return r=s.sent(),n=r.code,i=r.buffer,n===exports.ErrorCode.SUCCESS&&i?(o=this._context.rtcCodec.decode(tu.RtcQueryUserJoinedOutput,i).info||[],[2,{code:n,data:o.map((function(e){return{deviceId:e.deviceId,roomId:e.roomId,joinTime:e.joinTime}}))}]):[2,{code:n}]}}))}))}}),r}(Au),Nu={"set.proxy":exports.ErrorCode.INVALID_PARAMETER_PROXY,"test.proxy":exports.ErrorCode.INVALID_PARAMETER_TESTHOST,"test.proxy.socksHost":exports.ErrorCode.INVALID_PARAMETER_TESTHOST,"test.proxy.socksPort":exports.ErrorCode.INVALID_PARAMETER_TESTHOST,channelId:exports.ErrorCode.INVALID_PARAMETER_CHANNEL_ID,count:exports.ErrorCode.INVALID_PARAMETER_COUNT,startTime:exports.ErrorCode.INVALID_PARAMETER_START_TIME,endTime:exports.ErrorCode.INVALID_PARAMETER_END_TIME,offset:exports.ErrorCode.INVALID_PARAMETER_OFFSET,limit:exports.ErrorCode.INVALID_PARAMETER_LIMIT,keyword:exports.ErrorCode.INVALID_PARAMETER_KEYWORD,messageTypes:exports.ErrorCode.INVALID_PARAMETER_MESSAGE_TYPE,messageType:exports.ErrorCode.INVALID_PARAMETER_MESSAGE_TYPE,typingContentType:exports.ErrorCode.INVALID_PARAMETER_MESSAGE_TYPE,conversation:exports.ErrorCode.INVALID_PARAMETER_CONVERSATION,conversationType:exports.ErrorCode.INVALID_PARAMETER_CONVERSATION_TYPE,targetId:exports.ErrorCode.INVALID_PARAMETER_TARGET_ID,targetIds:exports.ErrorCode.INVALID_PARAMETER_TARGET_ID,userId:exports.ErrorCode.INVALID_PARAMETER_USER_ID,senderUserId:exports.ErrorCode.INVALID_PARAMETER_USER_ID,timestamp:exports.ErrorCode.INVALID_PARAMETER_TIMESTAMP,order:exports.ErrorCode.INVALID_PARAMETER_ORDER,messageId:exports.ErrorCode.INVALID_PARAMETER_MESSAGE_ID,receivedStatus:exports.ErrorCode.INVALID_PARAMETER_RECEIVED_STATUS,receivedStatusInfo:exports.ErrorCode.INVALID_PARAMETER_RECEIVED_STATUS,sentStatus:exports.ErrorCode.INVALID_PARAMETER_SENT_STATUS,content:exports.ErrorCode.INVALID_PARAMETER_MESSAGE_CONTENT,messageIds:exports.ErrorCode.INVALID_PARAMETER_MESSAGE_ARRAY,cleanSpace:exports.ErrorCode.INVALID_PARAMETER_CLEAN_SPACE,messageDirection:exports.ErrorCode.INVALID_MESSAGE_DIRECTION,canIncludeExpansion:exports.ErrorCode.INVALID_PARAMETER_CAN_INCLUDE_EXPANSION,expansion:exports.ErrorCode.INVALID_PARAMETER_MESSAGE_EXPANSION,disableNotification:exports.ErrorCode.INVALID_PARAMETER_DISABLE_NOTIFICATION,messages:exports.ErrorCode.MSG_LIMIT_ERROR,checkDuplicate:exports.ErrorCode.INVALID_PARAMETER_CHECK_DUPLICATE,messageUId:exports.ErrorCode.INVALID_PARAMETER_MESSAGE_UID,key:exports.ErrorCode.INVALID_PARAMETER_KEY,keys:exports.ErrorCode.INVALID_PARAMETER_KEYS,value:exports.ErrorCode.INVALID_PARAMETER_VALUE,isAutoDelete:exports.ErrorCode.INVALID_PARAMETER_IS_AUTO_DELETE,isSendNotification:exports.ErrorCode.INVALID_PARAMETER_IS_SEND_NOTIFICATION,notificationExtra:exports.ErrorCode.INVALID_PARAMETER_NOTIFICATION_EXTRA,entries:exports.ErrorCode.INVALID_PARAMETER_ENTRIES,isForce:exports.ErrorCode.INVALID_PARAMETER_IS_FORCE,rtcRoomId:exports.ErrorCode.INVALID_PARAMETER_RTCROOMID,token:exports.ErrorCode.RC_CONN_TOKEN_INCORRECT,conversations:exports.ErrorCode.INVALID_PARAMETER_CONVERSATIONS,draft:exports.ErrorCode.INVALID_PARAMETER_DRAFT,conversationTypes:exports.ErrorCode.INVALID_PARAMETER_CONVERSATION_TYPE_LIST,levels:exports.ErrorCode.INVALID_PARAMETER_NOTIFICATION_LEVEL,notificationLevel:exports.ErrorCode.INVALID_PARAMETER_NOTIFICATION_LEVEL,notificationLevels:exports.ErrorCode.INVALID_PARAMETER_NOTIFICATION_LEVEL,notificationStatus:exports.ErrorCode.INVALID_PARAMETER_NOTIFICATION_LEVEL,isTop:exports.ErrorCode.INVALID_PARAMETER_IS_TOP,isUpdateTime:exports.ErrorCode.INVALID_PARAMETER_IS_UPDATE_TIME,message:exports.ErrorCode.INVALID_PARAMETER_MESSAGE,mentionedUserIdList:exports.ErrorCode.INVALID_PARAMETER_USERIDLIST,directionalUserIdList:exports.ErrorCode.INVALID_PARAMETER_USERIDLIST,directedUserIds:exports.ErrorCode.INVALID_PARAMETER_USERIDLIST,isStatusMessage:exports.ErrorCode.INVALID_PARAMETER_IS_STATUS_MESSAGE,pushContent:exports.ErrorCode.INVALID_PARAMETER_PUSH_CONTENT,pushData:exports.ErrorCode.INVALID_PARAMETER_PUSH_DATA,isMentioned:exports.ErrorCode.INVALID_PARAMETER_IS_MENTIONED,mentionedType:exports.ErrorCode.INVALID_PARAMETER_MENTIONED_TYPE,isVoipPush:exports.ErrorCode.INVALID_PARAMETER_IS_VOIP_PUSH,pushConfig:exports.ErrorCode.INVALID_PARAMETER_PUSH_CONFIG,startMsgUId:exports.ErrorCode.INVALID_PARAMETER_START_MESSAGE_UID,endMsgUId:exports.ErrorCode.INVALID_PARAMETER_END_MESSAGE_UID,sentTime:exports.ErrorCode.INVALID_PARAMETER_TIMESTAMP,clearMessageOption:exports.ErrorCode.INVALID_PARAMETER_CLEAR_MESSAGE_OPTION_LIST,searchContent:exports.ErrorCode.SEARCH_PROPS_LIMIT_ERROR,tagId:exports.ErrorCode.INVALID_PARAMETER_TAG_ID,tagIds:exports.ErrorCode.INVALID_PARAMETER_TAG_ID,tagName:exports.ErrorCode.INVALID_PARAMETER_TAG_NAME,containMuted:exports.ErrorCode.INVALID_PARAMETER_CONTAIN_MUTED,channelType:exports.ErrorCode.INVALID_PARAMETER_CHANNEL_TYPE,file:exports.ErrorCode.MEDIA_EXCEPTION,fileType:exports.ErrorCode.INVALID_PARAMETER_MEDIA_TYPE,contentDisposition:exports.ErrorCode.INVALID_PARAMETER_CONTENT_DISPOSITION,mediaUrl:exports.ErrorCode.INVALID_PARAMETER_MEDIA_URL,filename:exports.ErrorCode.INVALID_PARAMETER_DOWNLOADMEDIAFILENAME,saveName:exports.ErrorCode.INVALID_PARAMETER_SAVE_NAME,serverType:exports.ErrorCode.INVALID_PARAMETER_SERVER_TYPE,subscribeType:exports.ErrorCode.INVALID_PARAMETER_SUBSCRIBE_TYPE,expiry:exports.ErrorCode.INVALID_PARAMETER_SUBSCRIBE_EXPIRY,subscribeUserIds:exports.ErrorCode.INVALID_PARAMETER_SUBSCRIBE_PUBLISHER_USERIDS,subscribePageSize:exports.ErrorCode.INVALID_PARAMETER_SUBSCRIBE_PAGESIZE,beforeCount:exports.ErrorCode.INVALID_PARAMETER_BEFORE,afterCount:exports.ErrorCode.INVALID_PARAMETER_AFTER,conversationList:exports.ErrorCode.INVALID_PARAMETER_CONVERSATION_LIST,conversationTypeNotSupport:exports.ErrorCode.CONVERSATION_TYPE_NOT_SUPPORT,profile:exports.ErrorCode.INVALID_PARAMETER_USER_PROFILE,userProfileVisibility:exports.ErrorCode.INVALID_PARAMETER_USER_PROFILE_VISIBILITY,uniqueId:exports.ErrorCode.INVALID_PARAMETER_UNIQUE_ID,extra:exports.ErrorCode.INVALID_PARAMETER_EXTRA,disableUpdateLastMessage:exports.ErrorCode.INVALID_DISABLE_UPDATE_LAST_MESSAGE};exports.AssertRules=void 0,(Su=exports.AssertRules||(exports.AssertRules={}))[Su.STRING=0]="STRING",Su[Su.ONLY_STRING=1]="ONLY_STRING",Su[Su.NUMBER=2]="NUMBER",Su[Su.BOOLEAN=3]="BOOLEAN",Su[Su.OBJECT=4]="OBJECT",Su[Su.ARRAY=5]="ARRAY",Su[Su.CALLBACK=6]="CALLBACK",Su[Su.CHANNEL_ID=7]="CHANNEL_ID",Su[Su.CONVERSATION=8]="CONVERSATION",Su[Su.CONVERSATION_TYPE=9]="CONVERSATION_TYPE";var wu,Mu=((Ou={})[exports.AssertRules.STRING]=At,Ou[exports.AssertRules.ONLY_STRING]=Tt,Ou[exports.AssertRules.NUMBER]=Rt,Ou[exports.AssertRules.BOOLEAN]=function(e){return"boolean"==typeof e},Ou[exports.AssertRules.OBJECT]=Pt,Ou[exports.AssertRules.ARRAY]=Ot,Ou[exports.AssertRules.CALLBACK]=function(e){var t=!0;return Pt(e)||(t=!1),(e=e||{}).onSuccess&&!Nt(e.onSuccess)&&(t=!1),e.onError&&!Nt(e.onError)&&(t=!1),t},Ou[exports.AssertRules.CHANNEL_ID]=Dt,Ou[exports.AssertRules.CONVERSATION]=function(e){var t=!0;return Pt(e)||(t=!1),Tt(e.targetId)||(t=!1),Ut(e.conversationType)||(t=!1),wt(e.channelId)||Dt(e.channelId)||(t=!1),t},Ou[exports.AssertRules.CONVERSATION_TYPE]=Ut,Ou),Lu=function(e){function r(t){var r=e.call(this,t)||this;return r.name="RCAssertError",r}return t(r,e),r}(Error),Uu=function(e,t,r,n){void 0===n&&(n=!1),r=Mu[r]||r;var i=n?r(t):wt(t)||null==t||r(t);return i||null===console||void 0===console||console.error("'".concat(e,"' is invalid: ").concat(JSON.stringify(t))),i},Du=function(){function e(e,t){var r,n;Object.defineProperty(this,"_logTagT",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"_logTagR",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"verificationFaileList",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"context",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"logger",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"option",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.context=eg.getContext(),this.logger=null===(r=this.context)||void 0===r?void 0:r.logger,this.option=null===(n=this.context)||void 0===n?void 0:n.getOptions()}return Object.defineProperty(e.prototype,"validate",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){if(void 0===n&&(n=!1),this.verificationFaileList.length>0)return this;r=Mu[r]||r;var o=n?r(t):wt(t)||null==t||r(t);if("object"==typeof o){var s=o.valid,a=o.errorKey;return!s&&a&&this.verificationFaileList.push({key:a,value:t,isValid:!1,message:i,code:Nu[a]}),this}return o||this.verificationFaileList.push({key:e,value:t,isValid:o,message:i,code:Nu[e]}),this}}),Object.defineProperty(e.prototype,"validateParameters",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i,o){if(void 0===i&&(i=!1),this.verificationFaileList.length>0)return this;r=Mu[r]||r;var s=i?r(t):wt(t)||null==t||r(t);if("object"==typeof s){var a=s.valid,u=s.errorKey,l=s.errorCode;return!a&&u&&this.verificationFaileList.push({key:u,value:t,code:l||n,message:o,isValid:!1}),this}return s||this.verificationFaileList.push({key:e,value:t,code:n,message:o,isValid:!1}),this}}),Object.defineProperty(e.prototype,"_getValidationResult",{enumerable:!1,configurable:!0,writable:!0,value:function(){if(this.verificationFaileList.length>0)return this.verificationFaileList[0]}}),Object.defineProperty(e.prototype,"ifReady",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t;if(!this.context)return Promise.resolve({code:exports.ErrorCode.BIZ_ERROR_CLIENT_NOT_INIT});var r=this._getValidationResult();if(r){var n=r.code,i=r.value,o=r.message,s=r.key;return null===(t=this.logger)||void 0===t||t.error(this._logTagR,JSON.stringify({code:n})),Promise.resolve({code:n,msg:"'".concat(s,"' is invalid: ").concat(o||JSON.stringify(i))})}var a=this.logger.createTraceId();return e(this.context,this.logger,this.option,a)}}),Object.defineProperty(e.prototype,"try2do",{enumerable:!1,configurable:!0,writable:!0,value:function(e){if(!this.context)throw new Error("Not initialized yet!");return e(this.context,this.logger,this.option)}}),Object.defineProperty(e.prototype,"ifReadySync",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t;if(!this.context)return{code:exports.ErrorCode.BIZ_ERROR_CLIENT_NOT_INIT};var r=this._getValidationResult();if(!r)return e(this.context,this.logger,this.option);var n=r.code,i=r.value,o=r.message,s=r.key;return null===(t=this.logger)||void 0===t||t.warn(this._logTagR,JSON.stringify({code:n})),{code:n,msg:"'".concat(s,"' is invalid: ").concat(o||i)}}}),e}(),xu=function(e,t){var r=Vr(e).searchProps;return r&&0!==r.length?r.every((function(e){return void 0!==t[e]}))?ht():gt(exports.ErrorCode.SEARCH_PROPS_LIMIT_ERROR):ht()},ju=function(){return wu||(wu={set:function(e,t){lo.localStorage.setItem(e,JSON.stringify(t))},get:function(e){var t;try{t=JSON.parse(lo.localStorage.getItem(e))}catch(e){t=null}return t},remove:function(e){return lo.localStorage.removeItem(e)},getKeys:function(){var e=[];for(var t in lo.localStorage)e.push(t);return e}}),wu},Vu=function(){function e(e){Object.defineProperty(this,"_caches",{enumerable:!0,configurable:!0,writable:!0,value:{}}),e&&(this._caches=e)}return Object.defineProperty(e.prototype,"set",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._caches[e]=t}}),Object.defineProperty(e.prototype,"remove",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this.get(e);return delete this._caches[e],t}}),Object.defineProperty(e.prototype,"get",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._caches[e]}}),Object.defineProperty(e.prototype,"getKeys",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=[];for(var t in this._caches)e.push(t);return e}}),e}(),Gu=function(){function e(e){var t;Object.defineProperty(this,"_cache",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_storageKey",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_rootStorage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._rootStorage=ju();var r=this._rootStorage.get(e)||{};this._cache=new Vu(((t={})[e]=r,t)),this._storageKey=e}return Object.defineProperty(e.prototype,"_get",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this._storageKey;return this._cache.get(e)||{}}}),Object.defineProperty(e.prototype,"_set",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this._storageKey;e=e||{},this._cache.set(t,e),this._rootStorage.set(t,e)}}),Object.defineProperty(e.prototype,"set",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this._get();r[e]=t,this._set(r)}}),Object.defineProperty(e.prototype,"remove",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this._get();delete t[e],this._set(t)}}),Object.defineProperty(e.prototype,"clear",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this._storageKey;this._rootStorage.remove(e),this._cache.remove(e)}}),Object.defineProperty(e.prototype,"get",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._get()[e]}}),Object.defineProperty(e.prototype,"getKeys",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this._get(),t=[];for(var r in e)t.push(r);return t}}),Object.defineProperty(e.prototype,"getValues",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._get()||{}}}),Object.defineProperty(e.prototype,"update",{enumerable:!1,configurable:!0,writable:!0,value:function(e){void 0===e&&(e={});var t=this._storageKey;this._cache.set(t,e),this._rootStorage.set(t,e)}}),e}(),ku="",Fu=function(){var e="";if(ku)return ku;if("browser"===lo.tag)return it;var t="RCDeviceId",r=ju(),n=r.get(t);return n?e=n:(e=nt.genWithLen(22),r.set(t,e)),e},Bu="",Hu=function(){return Bu},qu=function(e,t,r,n,i){var o=0;return e&&(o|=16),t&&(o|=32),r&&(o|=64),n&&(o|=512),i&&(o|=1024),o},Yu=function(e){var t;try{t=JSON.parse(e)}catch(r){t=e}if(t.user){var r=t.user,n=r.portrait,i=r.portraitUri,o=n||i;o&&(t.user.portrait=t.user.portraitUri=o)}return t},Ku=function(e){var t={};try{var r=JSON.parse(e);Object.entries(r).forEach((function(e){var r=u(e,2),n=r[0],i=r[1];t[n]=i.v}))}catch(t){console.error("parseMessageExpansion error: ".concat(e),t)}return t},Qu=function(e,t,r,n){var i,o,s=Za.decode(vo,e.pbData),a=rn(e.topic);if(a===Zr.recallMsg){var u=JSON.parse(s.content);i=u.conversationType,o=u.targetId}else i=function(e){var t;return((t={})[Zr.ppMsgP]=exports.ConversationType.PRIVATE,t[Zr.pgMsgP]=exports.ConversationType.GROUP,t[Zr.chatMsg]=exports.ConversationType.CHATROOM,t[Zr.ugMsg]=exports.ConversationType.ULTRA_GROUP,t[Zr.pcMsgP]=exports.ConversationType.CUSTOMER_SERVICE,t[Zr.pbMsgP]=exports.ConversationType.SYSTEM,t)[e]||exports.ConversationType.PRIVATE}(a),o=e.targetId;var l=![exports.ConversationType.GROUP,exports.ConversationType.CHATROOM,exports.ConversationType.RTC_ROOM,exports.ConversationType.ULTRA_GROUP].includes(i),c=l?o:t,d=l?"":o,p=Ju(s.sessionId),f=p.isPersited,h=p.isCounted,g=p.isMentioned,_=p.disableNotification,b=p.canIncludeExpansion;return{fromUserId:c,type:i,groupId:d,classname:s.classname,content:s.content,dataTime:r,status:qu(f,h,g,_,b),msgId:n,direction:exports.MessageDirection.SEND,clientUniqueId:s.clientUniqueId,extraContent:s.extraContent,pushContent:s.pushText,configFlag:s.configFlag,pushExt:s.pushExt,busChannel:s.busChannel,toUserIds:s.toUserIds,optionBits:s.optionBits}},Wu=function(e,t,r,n){var i,o,s,a=e.type,u=![exports.ConversationType.GROUP,exports.ConversationType.CHATROOM,exports.ConversationType.RTC_ROOM,exports.ConversationType.ULTRA_GROUP].includes(a)?n||e.fromUserId:e.groupId||n,l={isPersited:!!(16&(i=e.status)),isCounted:!!(32&i),isMentioned:!!(64&i),disableNotification:!!(512&i),receivedStatus:2&i?exports.ReceivedStatus.RETRIEVED:exports.ReceivedStatus.READ,canIncludeExpansion:!!(1024&i)},c=l.isMentioned,d=l.disableNotification,p=l.receivedStatus,f=l.canIncludeExpansion,h=e.direction===exports.MessageDirection.SEND?exports.MessageDirection.SEND:exports.MessageDirection.RECEIVE,g=or(e.configFlag||0,e.pushContent,e.pushExt),_=(o=e.extStatus,{isInterrupt:!!(2&(s=o||0)),isModifyMessage:!!(4&s),isPrivateChannel:!!(8&s),isStatusMessage:!!(64&s)}),b=_.isInterrupt,E=_.isModifyMessage,v=_.isPrivateChannel,y=_.isStatusMessage,m=Vr(e.classname),I=m.isCounted,T=m.isPersited,R=m.isStatusMessage;return{conversationType:a,targetId:u,senderUserId:h===exports.MessageDirection.SEND?t:e.fromUserId,messageType:e.classname,messageUId:e.msgId,isPersited:T,isCounted:I,isMentioned:c,sentTime:e.dataTime,messageDirection:h,receivedTime:Date.now(),disableNotification:d,receivedStatus:p,receivedStatusInfo:Bt(p),canIncludeExpansion:f,content:Yu(e.content),expansion:e.extraContent?Ku(e.extraContent):null,pushConfig:g,channelId:e.busChannel||"",isInterrupt:b,isModifyMessage:E,messageId:e.clientUniqueId||0,sentStatus:exports.SentStatus.SENT,isOffLineMessage:e.dataTime<r,channelType:v?exports.UltraGroupChannelType.PRIVATE:exports.UltraGroupChannelType.PUBLIC,isStatusMessage:y||!!R,readReceiptInfo:void 0,directedUserIds:e.toUserIds,disableUpdateLastMessage:!!(1&(e.optionBits||0)),needReceipt:!!(2&(e.optionBits||0)),sendReceipt:!!(4&(e.optionBits||0))||void 0}},Ju=function(e){return{isPersited:!!(1&e),isCounted:!!(2&e),disableNotification:!!(32&e),canIncludeExpansion:!!(64&e),isMentioned:!!(4&e)}};function zu(e){return 1&~((null==e?void 0:e.sessionMode)||0)?gt(exports.ErrorCode.RC_REAL_TIME_CONVERSATION_UNAVAILABLE):ht()}var Zu=function(){function e(){}return Object.defineProperty(e,"enable",{enumerable:!1,configurable:!0,writable:!0,value:function(){return!0}}),e}(),Xu=48,$u=64,el=80,tl=96,rl="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",nl=function(e){for(var t={},r=0;r<e.length-1;r++){var n=e.charAt(r)+e.charAt(r+1);t.hasOwnProperty(n)?t[n].push(r):t[n]=[r]}for(var i=[],o=[],s=function(){if(o.length>0){var e=o.join("");if(o=[],e.length>26){var t=ol(e.length),r=String.fromCharCode(el|t.length);i.push(r+t)}else{var n=String.fromCharCode(tl|e.length);i.push(n)}i.push(e)}},a=0;a<e.length;){var u=il(t,e,a);if(u.length<2)o.push(e.charAt(a++));else if(u.length<4)o.push(e.substr(a,u.length)),a+=u.length;else{var l=ol(a-u.offset),c=ol(u.length);if(l.length+c.length>=u.length)o.push(e.substr(a,u.length)),a+=u.length;else{s();var d=String.fromCharCode($u|l.length<<2|c.length);i.push(d+l+c),a+=u.length}}}s();var p=ol(e.length),f=String.fromCharCode(Xu|p.length);return i.push(f+p),i.join("")},il=function(e,t,r){var n={length:0,offset:-1};if(t.length,r>=t.length-1)return n;var i=e[t.charAt(r)+t.charAt(r+1)];if(i[0]===r)return n;for(var o=t.length-r,s=0,a=i.length;s<a;s++){var u=i[s],l=r-u;if(!(l>238327)){var c=Math.min(o,l);if(c<=n.length)break;if(!(n.length>2&&t.charAt(u+n.length-1)!==t.charAt(r+n.length-1))){for(var d=2,p=d;p<c&&t.charAt(u+p)===t.charAt(r+p);p++)d++;d>=n.length&&(n.length=d,n.offset=u)}}}return n},ol=function(e){var t=[],r=0;do{r=e%62,t.push(rl.charAt(r)),e=(e-r)/62}while(e>0);return t.join("")},sl={_caches:{},set:function(e,t){this._caches[e]=t},get:function(e){return this._caches[e]||0},clear:function(e){this._caches[e]=0}},al=function(){function e(e,t,r){Object.defineProperty(this,"logger",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"_chatroomId",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_currentUserId",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_kvCaches",{enumerable:!0,configurable:!0,writable:!0,value:{}}),this._chatroomId=t,this._currentUserId=r}return Object.defineProperty(e.prototype,"_add",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.key;e.isDeleted=!1,this._kvCaches[t]=e}}),Object.defineProperty(e.prototype,"_remove",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.key,r=this._kvCaches[t];r&&(r.isDeleted=!0,this._kvCaches[t]=r)}}),Object.defineProperty(e.prototype,"_setEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=e.key,n=e.type,i=e.isOverwrite,o=e.userId,s=this._getSetUserId(r),a=n===exports.ChatroomEntryType.DELETE,u=s===o,l=!this._isExisted(r),c=a?this._remove:this._add;(t||i||u||l)&&c.call(this,e)}}),Object.defineProperty(e.prototype,"getValue",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this._kvCaches[e]||{};return t.isDeleted?null:t.value}}),Object.defineProperty(e.prototype,"getVersion",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this._kvCaches[e]||{};return t.isDeleted?null:t.version}}),Object.defineProperty(e.prototype,"getAllValue",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e={};for(var t in this._kvCaches)this._kvCaches[t].isDeleted||(e[t]=this._kvCaches[t].value);return e}}),Object.defineProperty(e.prototype,"_getSetUserId",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return(this._kvCaches[e]||{}).userId}}),Object.defineProperty(e.prototype,"_isExisted",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this._kvCaches[e]||{},r=t.value,n=t.isDeleted;return r&&!n}}),Object.defineProperty(e.prototype,"setEntries",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this,r=e.kvEntries,n=e.isFullUpdate;r=r||[],(n=n||!1)&&this.clear(),r.forEach((function(e){t._setEntry(e,n)}))}}),Object.defineProperty(e.prototype,"clear",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._kvCaches={}}}),e}(),ul=function(){function e(e){Object.defineProperty(this,"_pullQueue",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_isPulling",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_engine",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_storeCaches",{enumerable:!0,configurable:!0,writable:!0,value:{}}),this._engine=e}return Object.defineProperty(e.prototype,"_startPull",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t,r,n,i,o,a;return s(this,(function(s){switch(s.label){case 0:return this._isPulling||0===this._pullQueue.length?[2]:(this._isPulling=!0,e=this._pullQueue.splice(0,1)[0],t=e.chrmId,r=e.timestamp,(n=sl.get(t))>r?(this._isPulling=!1,this._startPull(),[2]):[4,this._engine.pullChatroomEntry(t,n)]);case 1:return i=s.sent(),o=i.code,a=i.data,this._isPulling=!1,o===exports.ErrorCode.SUCCESS?(sl.set(t,a.syncTime||0),this._startPull()):this._startPull(),[2]}}))}))}}),Object.defineProperty(e.prototype,"reset",{enumerable:!1,configurable:!0,writable:!0,value:function(e){sl.clear(e);var t=this._storeCaches[e];null==t||t.clear()}}),Object.defineProperty(e.prototype,"pullEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._pullQueue.push({chrmId:e,timestamp:t}),this._startPull()}}),Object.defineProperty(e.prototype,"setLocal",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n=this._storeCaches[e];Lt(n)||(n=new al(this._engine.getInnerLogger(),e,r)),n.setEntries(t),this._storeCaches[e]=n}}),Object.defineProperty(e.prototype,"getValue",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this._storeCaches[e];return r?r.getValue(t):null}}),Object.defineProperty(e.prototype,"getVersion",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this._storeCaches[e];return r?r.getVersion(t):null}}),Object.defineProperty(e.prototype,"getAll",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this._storeCaches[e],r={};return t&&(r=t.getAllValue()),r}}),e}(),ll=function(){function e(e){Object.defineProperty(this,"_canJoinMulipleChrm",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"_joinedChrmsInfo",{enumerable:!0,configurable:!0,writable:!0,value:{}})}return Object.defineProperty(e.prototype,"set",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){void 0===t&&(t=10),void 0===r&&(r=""),this._canJoinMulipleChrm||(this._joinedChrmsInfo={}),this._joinedChrmsInfo[e]={count:t,extra:r}}}),Object.defineProperty(e.prototype,"get",{enumerable:!1,configurable:!0,writable:!0,value:function(){return JSON.parse(JSON.stringify(this._joinedChrmsInfo))}}),Object.defineProperty(e.prototype,"remove",{enumerable:!1,configurable:!0,writable:!0,value:function(e){delete this._joinedChrmsInfo[e]}}),Object.defineProperty(e.prototype,"clear",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._joinedChrmsInfo={}}}),e}(),cl=function(){function e(){Object.defineProperty(this,"_callerQueue",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_isCalling",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_retryCount",{enumerable:!0,configurable:!0,writable:!0,value:0})}return Object.defineProperty(e.prototype,"pushTask",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;return new Promise((function(r){t._callerQueue.push({task:e,resolve:r}),t._startCall()}))}}),Object.defineProperty(e.prototype,"_startCall",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t;return s(this,(function(r){switch(r.label){case 0:return this._isCalling||0===this._callerQueue.length?[2]:(this._isCalling=!0,e=this._callerQueue.shift(),[4,this._callHandler(e)]);case 1:return t=r.sent(),e.resolve(t),this._isCalling=!1,this._startCall(),[2]}}))}))}}),Object.defineProperty(e.prototype,"_callHandler",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n;return s(this,(function(i){switch(i.label){case 0:return t=e.task,r=this.getVersion(),[4,t(r)];case 1:return(n=i.sent()).code===exports.ErrorCode.USER_SETTING_SYNCED_ERROR&&this._retryCount<5?(this._retryCount++,[4,this._triggerPull(r)]):[3,3];case 2:return i.sent(),[2,this._callHandler(e)];case 3:return this._retryCount=0,[2,n]}}))}))}}),Object.defineProperty(e.prototype,"stopAllTask",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._callerQueue.forEach((function(e){e.resolve({code:exports.ErrorCode.RC_NET_UNAVAILABLE})})),this._callerQueue=[]}}),e}(),dl=function(e){function r(t,r,n,i){var o=e.call(this)||this;return Object.defineProperty(o,"_storage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(o,"_tagKey",{enumerable:!0,configurable:!0,writable:!0,value:"tags"}),Object.defineProperty(o,"_versionKey",{enumerable:!0,configurable:!0,writable:!0,value:"version"}),Object.defineProperty(o,"_storageKey",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(o,"_pullQueue",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(o,"_isPulling",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(o,"_engine",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(o,"_tagWatcherFunc",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(o,"_pullPromise",{enumerable:!0,configurable:!0,writable:!0,value:null}),o._storageKey=We(r,n),o._storage=new Gu(o._storageKey),o._engine=t,o._tagWatcherFunc=i,o}return t(r,e),Object.defineProperty(r.prototype,"_updateTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t={};e.forEach((function(e){t[e.tagId]={tagName:e.name,createdTime:e.createdTime}})),this._storage.set(this._tagKey,t),this._tagWatcherFunc()}}),Object.defineProperty(r.prototype,"addTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r,n=this._storage.get(this._tagKey)||{};e.forEach((function(e){var t,r=(null===(t=n[e.tagId])||void 0===t?void 0:t.createdTime)||e.createdTime||0;n[e.tagId]={tagName:e.tagName,createdTime:r}})),this._storage.update(((r={})[this._tagKey]=n,r[this._versionKey]=t,r))}}),Object.defineProperty(r.prototype,"deleteTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r,n=this._storage.get(this._tagKey)||{};e.forEach((function(e){delete n[e]})),this._storage.update(((r={})[this._tagKey]=n,r[this._versionKey]=t,r))}}),Object.defineProperty(r.prototype,"getTagsInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._storage.get(this._tagKey)||{}}}),Object.defineProperty(r.prototype,"getTags",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this._storage.get(this._tagKey)||{},t=[];for(var r in e)t.push({tagId:r,tagName:e[r].tagName,createdTime:e[r].createdTime,conversationCount:0});return t.sort((function(e,t){return(e.createdTime||0)-(t.createdTime||0)}))}}),Object.defineProperty(r.prototype,"getTagById",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this._storage.get(this._tagKey)||{};return t[e]?{tagId:e,tagName:t[e].tagName,createdTime:t[e].createdTime,conversationCount:0}:null}}),Object.defineProperty(r.prototype,"_startPull",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t,r,n,i;return s(this,(function(o){switch(o.label){case 0:return this._isPulling||0===this._pullQueue.length?[2,this._pullPromise]:(this._isPulling=!0,this._pullQueue.shift(),e=this.getVersion(),this._pullPromise=this._engine.pullUserSettings(e),[4,this._pullPromise]);case 1:return t=o.sent(),this._isPulling=!1,this._pullPromise=null,t.isOk&&(r=t.data,n=r.tags,i=r.version,r.changed&&(this._updateTag(n),this._storage.set(this._versionKey,i)),this._pullQueue=this._pullQueue.filter((function(e){return e>i}))),0===this._pullQueue.length?this._startCall():this._startPull(),[2]}}))}))}}),Object.defineProperty(r.prototype,"_startCall",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){return s(this,(function(t){return this._isPulling||e.prototype._startCall.call(this),[2]}))}))}}),Object.defineProperty(r.prototype,"pullUserSettings",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this.getVersion();(e>t||0===e)&&(this._pullQueue.push(t),this._startPull())}}),Object.defineProperty(r.prototype,"_triggerPull",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return this._pullQueue.push(e),[4,this._startPull()];case 1:return t.sent(),[2]}}))}))}}),Object.defineProperty(r.prototype,"getVersion",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._storage.get(this._versionKey)||0}}),Object.defineProperty(r.prototype,"updateVersion",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._storage.set(this._versionKey,e)}}),r}(cl),pl={};function fl(){return{code:200,protocol:"https",server:"",voipCallInfo:"",kvStorage:0,openHttpDNS:!1,historyMsg:!1,chatroomMsg:!1,location:"",monitor:0,joinMChrm:!1,openMp:0,openUS:0,grpMsgLimit:0,isFormatted:0,gifSize:2048,logSwitch:0,logPolicy:"",compDays:0,msgAck:"",activeServer:"",qnAddr:"",extkitSwitch:0,alone:!1,voipServer:"",offlinelogserver:"",backupServer:yr.getMiniCmpUrlList().join(",")}}var hl=function(e){function r(t,r,n,i,o){void 0===i&&(i="default");var s=e.call(this,t,r,n,!1,lo.useNavi,o)||this;return s._environment=i,s}return t(r,e),Object.defineProperty(r.prototype,"httpRequest",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){return o(this,void 0,void 0,(function(){var o,a,u,l;return s(this,(function(s){switch(s.label){case 0:return o="".concat(e,"/navi.js?appId=").concat(t,"&token=").concat(encodeURIComponent(r),"&callBack=x&v=").concat(je,"&r=").concat(Date.now(),"&env=").concat(this._environment,"&p=").concat(lo.tag),this.logger.debug(H.L_REQUEST_T,"req navi => ".concat(o),n),[4,lo.httpReq({url:o,timeout:1e4,dataType:"text"})];case 1:if(200!==(a=s.sent()).status)return this.logger.debug(H.L_REQUEST_R,"request navi failed: ".concat(a.status),n),!lo.useNavi&&i?[2,ht(fl())]:[2,gt(this.transHttpCode(a.status))];try{return 0===(u=a.data.match(/{[\d\D]+}/)[0]).indexOf('{\\"code\\":')&&(u=JSON.parse('"'.concat(u,'"'))),(l=JSON.parse(u)).protocol=/^https/.test(o)?"https":"http",l.code&&200!==l.code?[2,gt(this.transHttpCode(l.code))]:(lo.useNavi||(l.server="",l.backupServer=yr.getMiniCmpUrlList().join(","),l.logSwitch=0),[2,ht(l)])}catch(e){this.logger.error(H.L_PARSE_NAVI_E,a.data,n)}return[2,gt(exports.ErrorCode.RC_NAVI_REQ_FAILED)]}}))}))}}),Object.defineProperty(r.prototype,"httpRequestV2",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){return o(this,void 0,void 0,(function(){var o,a,u,l,c;return s(this,(function(s){switch(s.label){case 0:return o=this.getNaviV2RequestOption({appkey:t,token:r,uri:e,platform:lo.tag,protocol:(/^https/.test(e)?q.WSS:q.WS).toString()}),this.logger.debug(H.L_REQUEST_T,"req navi => ".concat(o.url),n),[4,lo.httpReq(o)];case 1:if(200!==(a=s.sent()).status)return this.logger.debug(H.L_REQUEST_R,"request navi failed: ".concat(a.status),n),!lo.useNavi&&i?[2,ht(fl())]:[2,gt(this.transHttpCode(a.status))];try{return u=a.data,(l="object"!=typeof u?JSON.parse(u):u).protocol=/^https/.test(o.url)?"https":"http",lo.useNavi||(l.logSwitch=0,c=yr.getMiniCmpUrlList(),l.serverAddr=c.map((function(e,t){return{addr:e,protocol:/^https/.test(o.url)?q.WSS:q.WS,weight:c.length-t}}))),[2,ht(l)]}catch(e){this.logger.error(H.L_PARSE_NAVI_E,a.data,n)}return[2,gt(exports.ErrorCode.RC_NAVI_REQ_FAILED)]}}))}))}}),Object.defineProperty(r.prototype,"getNaviCache",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this,r=this.getCatchKey(e);if(pl[r])return pl[r];var n,i=ke(this.appkey),o=lo.localStorage;try{var s=o.getItem(i);n=s?JSON.parse(s):[]}catch(e){n=[]}if(0===n.length)return null;var a=n.find((function(r){return r.token===e&&r.environment===t._environment}))||null;return pl[r]=a,a}}),Object.defineProperty(r.prototype,"setNaviCache",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r,n=this,i=ke(this.appkey),o=lo.localStorage;try{var s=o.getItem(i);r=s?JSON.parse(s):[]}catch(e){r=[]}var a=Date.now();r.length>0&&(r=r.filter((function(t){return a-t.timestamp<Ue&&(e!==t.token||n._environment!==t.environment)})));var u={timestamp:a,naviInfo:t,token:e,environment:this._environment};r.push(u),o.setItem(i,JSON.stringify(r)),pl[this.getCatchKey(e)]=u}}),r}(xr),gl=function(){function e(e){Object.defineProperty(this,"_appkey",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"_sendMessageMap",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_userId",{enumerable:!0,configurable:!0,writable:!0,value:""})}return Object.defineProperty(e.prototype,"init",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._userId=e;var t=Qe(this._appkey,e);this._sendMessageMap=this._getLocalInfo(t)}}),Object.defineProperty(e.prototype,"_getLocalInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=lo.localStorage.getItem(e);try{return t?JSON.parse(t):{}}catch(e){return{}}}}),Object.defineProperty(e.prototype,"setMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._sendMessageMap[e]=t;var r=Qe(this._appkey,this._userId),n=this._getLocalInfo(r);n[e]=t,lo.localStorage.setItem(r,JSON.stringify(n))}}),Object.defineProperty(e.prototype,"getSendMessageMap",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._sendMessageMap}}),Object.defineProperty(e.prototype,"removeByUID",{enumerable:!1,configurable:!0,writable:!0,value:function(e){delete this._sendMessageMap[e]}}),Object.defineProperty(e.prototype,"removeByTimestamp",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=Qe(this._appkey,this._userId),r=this._getLocalInfo(t);Object.keys(r).forEach((function(t){r[t]<e&&delete r[t]})),lo.localStorage.setItem(t,JSON.stringify(r))}}),e}(),_l=function(){function e(e){var t;Object.defineProperty(this,"_delayTime",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"subscribeData",{enumerable:!0,configurable:!0,writable:!0,value:(t={},t[exports.SubscribeType.ONLINE_STATUS]={},t[exports.SubscribeType.USER_PROFILE]={},t)}),Object.defineProperty(this,"_ownProfile",{enumerable:!0,configurable:!0,writable:!0,value:null})}return Object.defineProperty(e.prototype,"clearSubscribeRelation",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e;this.subscribeData=((e={})[exports.SubscribeType.ONLINE_STATUS]={},e[exports.SubscribeType.USER_PROFILE]={},e)}}),Object.defineProperty(e.prototype,"clearSubscribeStatusData",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;e===exports.SubscribeType.ONLINE_STATUS?Object.keys(this.subscribeData[e]).forEach((function(r){t.subscribeData[e][r].statusMap={}})):e===exports.SubscribeType.USER_PROFILE&&Object.keys(this.subscribeData[e]).forEach((function(r){t.subscribeData[e][r].profile=void 0}))}}),Object.defineProperty(e.prototype,"getSubscribeUserData",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this.subscribeData[e][t];return r?n({},r):void 0}}),Object.defineProperty(e.prototype,"removeSubscribeUserData",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){delete this.subscribeData[e][t]}}),Object.defineProperty(e.prototype,"updateSubscribeUserData",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){this.subscribeData[e][t]=r}}),Object.defineProperty(e.prototype,"clearExpiredData",{enumerable:!1,configurable:!0,writable:!0,value:function(e){for(var t in this.subscribeData[e]){var r=this.subscribeData[e][t];r.expiry<(Date.now()+this._delayTime-r.subscribeTime)/1e3&&delete this.subscribeData[e][t]}}}),Object.defineProperty(e.prototype,"getSubscribeUserList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return l([],u(Object.values(this.subscribeData[e])),!1).sort((function(e,t){return e.subscribeTime-t.subscribeTime})).slice(r,r+t)}}),Object.defineProperty(e.prototype,"updateOwnProfile",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r=n(n({},null===(t=this._ownProfile)||void 0===t?void 0:t.extraProfile),e.extraProfile);this._ownProfile=n(n(n({},this._ownProfile),e),{extraProfile:r})}}),Object.defineProperty(e.prototype,"getOwnProfile",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._ownProfile?n(n({},this._ownProfile),{extraProfile:n({},this._ownProfile.extraProfile)}):null}}),e}(),bl=function(){function e(e){Object.defineProperty(this,"_delayTime",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"_relationshipStatusVersion",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_subUserStatusVersion",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_ownProfileVersion",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_subStore",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._subStore=new _l(e)}return Object.defineProperty(e.prototype,"updateRelationshipStatusVersion",{enumerable:!1,configurable:!0,writable:!0,value:function(e){e>this._relationshipStatusVersion&&(this._relationshipStatusVersion=e)}}),Object.defineProperty(e.prototype,"getRelationshipStatusVersion",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._relationshipStatusVersion}}),Object.defineProperty(e.prototype,"updateSubscribeUserStatusVersion",{enumerable:!1,configurable:!0,writable:!0,value:function(e){e>this._subUserStatusVersion&&(this._subUserStatusVersion=e)}}),Object.defineProperty(e.prototype,"getSubscribeUserStatusVersion",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subUserStatusVersion}}),Object.defineProperty(e.prototype,"_filterSubscribeRelationData",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return e.reduce((function(e,t){return t.subUsers.forEach((function(r){var n=e.find((function(e){return e.subscribeType===t.subType&&e.userId===r.subUserId}));n?n.subscribeTime<t.subTime&&(n.expiry=t.expiry,n.operationType=t.opType,n.subscribeTime=t.subTime):e.push({userId:r.subUserId,subscribeTime:t.subTime,subscribeType:t.subType,expiry:t.expiry,operationType:t.opType})})),e}),[])}}),Object.defineProperty(e.prototype,"updateSubscribeRelation",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this;void 0===t&&(t=!1);var n=[],i=[],o=[];return t&&this._subStore.clearSubscribeRelation(),this._filterSubscribeRelationData(e).forEach((function(e){var t,s,a=e.userId,u=e.subscribeTime,l=e.subscribeType,c=e.expiry;if(e.operationType===exports.SubscribeOperationType.UNSUBSCRIBE)return r._subStore.removeSubscribeUserData(l,a),void o.push(e);var d=r._subStore.getSubscribeUserData(l,a);if(!(d&&d.subscribeTime>=u)){if(l===exports.SubscribeType.ONLINE_STATUS){n.push(a);var p=(null===(t=d)||void 0===t?void 0:t.statusMap)||{};r._subStore.updateSubscribeUserData(l,a,{subscribeTime:u,expiry:c,userId:a,subscribeType:l,statusMap:p})}else{i.push(a);var f=null===(s=d)||void 0===s?void 0:s.profile;r._subStore.updateSubscribeUserData(l,a,{subscribeTime:u,expiry:c,userId:a,subscribeType:l,profile:f,isSubscribed:!0})}o.push(e)}})),{newSubscribeOnlineStatusList:n,newSubscribeUserProfileList:i,subscribeUserChangeList:o}}}),Object.defineProperty(e.prototype,"clearSubscribeStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._subStore.clearSubscribeStatusData(exports.SubscribeType.ONLINE_STATUS),this._subStore.clearSubscribeStatusData(exports.SubscribeType.USER_PROFILE)}}),Object.defineProperty(e.prototype,"updateSubscribeUserOnlineStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this,r=[];return e.forEach((function(e){var i=e.subUserId,o=e.data,s=t._subStore.getSubscribeUserData(exports.SubscribeType.ONLINE_STATUS,i);if(s){var a=[],u=n({},s.statusMap);o.forEach((function(e){var t=u[e.platformInfo];if(!(t&&t.changeTime>e.versionTime)){var r={eventValue:e.value,changeTime:e.versionTime};u[e.platformInfo]=r,a.push(n(n({},r),{platform:e.platformInfo}))}})),t._subStore.updateSubscribeUserData(exports.SubscribeType.ONLINE_STATUS,i,{subscribeTime:s.subscribeTime,expiry:s.expiry,userId:i,subscribeType:exports.SubscribeType.ONLINE_STATUS,statusMap:u}),r.push({userId:i,subscribeType:exports.SubscribeType.ONLINE_STATUS,subscribeTime:s.subscribeTime,expiry:s.expiry,details:a})}})),r}}),Object.defineProperty(e.prototype,"updateSubscribeUserProfile",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this,r=[];return e.forEach((function(e){var i=e.userId,o=e.version,s=e.userProfile,a=e.userExtProfile,u=t._subStore.getSubscribeUserData(exports.SubscribeType.USER_PROFILE,i),l=qt(i,s,a);u?u.profile&&u.profile.version>=o||(t._subStore.updateSubscribeUserData(exports.SubscribeType.USER_PROFILE,i,{subscribeTime:u.subscribeTime,expiry:u.expiry,userId:i,subscribeType:exports.SubscribeType.USER_PROFILE,profile:{info:l,version:o},isSubscribed:u.isSubscribed}),u.isSubscribed&&r.push({userId:i,subscribeType:exports.SubscribeType.USER_PROFILE,subscribeTime:u.subscribeTime,expiry:u.expiry,userProfile:n({},l)})):t._subStore.updateSubscribeUserData(exports.SubscribeType.USER_PROFILE,i,{subscribeTime:0,expiry:0,userId:i,subscribeType:exports.SubscribeType.USER_PROFILE,profile:{info:l,version:o},isSubscribed:!1})})),r}}),Object.defineProperty(e.prototype,"getSubscribeUserStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this,i=[];return t.forEach((function(t){var o=r._subStore.getSubscribeUserData(e,t);if(!o||o.expiry<(Date.now()+r._delayTime-o.subscribeTime)/1e3)r._subStore.removeSubscribeUserData(e,t);else{var s={subscribeTime:o.subscribeTime,expiry:o.expiry,userId:o.userId,subscribeType:o.subscribeType};if(e===exports.SubscribeType.ONLINE_STATUS){var a=o.statusMap,u=Object.keys(a).map((function(e){return n({platform:~~e},a[~~e])}));s.details=Ht(u)}else if(e===exports.SubscribeType.USER_PROFILE&&!o.isSubscribed)return;i.push(s)}})),i}}),Object.defineProperty(e.prototype,"getUserProfiles",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this,r=[],i=[];return e.forEach((function(e){var o=t._subStore.getSubscribeUserData(exports.SubscribeType.USER_PROFILE,e);if(o&&o.profile){var s=o.profile,a=s.version,u=s.info;if(o.isSubscribed)return t._delayTime+Date.now()-a>6048e5?void i.push(e):void r.push(n(n({},u),{extraProfile:n({},u.extraProfile)}));t._delayTime+Date.now()-a>6e5?i.push(e):r.push(n(n({},u),{extraProfile:n({},u.extraProfile)}))}else i.push(e)})),{list:r,needQueryUserIds:i}}}),Object.defineProperty(e.prototype,"getSubscribeUserList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return this._subStore.clearExpiredData(e),this._subStore.getSubscribeUserList(e,t,r).map((function(t){var r={subscribeTime:t.subscribeTime,expiry:t.expiry,userId:t.userId,subscribeType:t.subscribeType};if(e===exports.SubscribeType.ONLINE_STATUS){var i=Object.keys(t.statusMap).map((function(e){return n({platform:~~e},t.statusMap[~~e])}));r.details=Ht(i)}return r}))}}),Object.defineProperty(e.prototype,"updateOwnProfile",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._ownProfileVersion>t||this._subStore.updateOwnProfile(e)}}),Object.defineProperty(e.prototype,"getOwnProfile",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subStore.getOwnProfile()}}),e}(),El=function(){function e(e,t,r,n,i,o,s){Object.defineProperty(this,"_connectManager",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"_event",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"_currentUserId",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"_delayTime",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(this,"_logger",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"_isOpenUserProfile",{enumerable:!0,configurable:!0,writable:!0,value:o}),Object.defineProperty(this,"_subDriven",{enumerable:!0,configurable:!0,writable:!0,value:s}),Object.defineProperty(this,"_isPullingRelationship",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_pullRelationshipQueue",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_pullRelationshipFailTime",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_isPullingSubUserStatus",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_pullSubUserStatusQueue",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_pullSubUserStatusFailTime",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_subscribeService",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._subscribeService=new bl(n)}return Object.defineProperty(e.prototype,"syncData",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return this._subDriven?[4,this._syncSubscribeRelationship(!1)]:[3,3];case 1:return e.sent(),[4,this._syncSubscribeUserStatus(!0)];case 2:e.sent(),e.label=3;case 3:return this._isOpenUserProfile?[4,this.syncOwnProfile()]:[3,5];case 4:e.sent(),e.label=5;case 5:return 1&this._subDriven&&this._event.syncSubscribeUserStatusFinished(exports.SubscribeType.ONLINE_STATUS),2&this._subDriven&&this._event.syncSubscribeUserStatusFinished(exports.SubscribeType.USER_PROFILE),3&this._subDriven&&this._event.syncSubscribeUserStatusFinished(exports.SubscribeType.FRIEND_ONLINE_STATUS),4&this._subDriven&&this._event.syncSubscribeUserStatusFinished(exports.SubscribeType.FRIEND_USER_PROFILE),[2]}}))}))}}),Object.defineProperty(e.prototype,"startSyncSubscribeRelationship",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){return s(this,(function(t){return this._pullRelationshipQueue.push(e),this._syncSubscribeRelationship(),[2]}))}))}}),Object.defineProperty(e.prototype,"_syncSubscribeRelationship",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return void 0===e&&(e=!0),o(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return this._isPullingRelationship?[2]:(this._isPullingRelationship=!0,[4,this._pullSubscribeRelationship(e)]);case 1:return t.sent(),this._isPullingRelationship=!1,this._pullRelationshipQueue.length>0?(this._pullRelationshipQueue.length=0,[4,this._syncSubscribeRelationship(e)]):[3,3];case 2:t.sent(),t.label=3;case 3:return[2]}}))}))}}),Object.defineProperty(e.prototype,"_pullSubscribeRelationship",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return void 0===t&&(t=""),o(this,void 0,void 0,(function(){var r,n,i,o,a,u,l,c,d,p,f,h,g,_,b;return s(this,(function(s){switch(s.label){case 0:return r=this._subscribeService.getRelationshipStatusVersion(),n=this._logger.createTraceId(),this._logger.info(H.L_PULL_SUBSCRIBED_USER_RELATION_T,JSON.stringify({version:r,_pageToken:t}),n),i=this._connectManager.codec.encodePullUserSubReq({version:r,pageToken:t}),o=new bi(Zr.pullUserSub,i,this._currentUserId),[4,this._connectManager.send(o,Zs)];case 1:return a=s.sent(),u=a.code,l=a.data,u===exports.ErrorCode.SUCCESS&&l?(this._pullRelationshipFailTime=0,c=l.list,d=l.version,p=l.hasNext,f=l.pageToken,d=kt(d),c.forEach((function(e){e.subTime=kt(e.subTime)})),this._logger.info(H.L_PULL_SUBSCRIBED_USER_RELATION_R,JSON.stringify({code:u,data:l}),n),e?(h=this._subscribeService.updateSubscribeRelation(c),g=h.newSubscribeOnlineStatusList,_=h.newSubscribeUserProfileList,(b=h.subscribeUserChangeList).length>0&&this._event.subscribeRelationChanged(b),g.length>0&&this._queryAndUpdateUserOnlineStatus(g),_.length>0&&this._queryAndUpdateUserProfile(_)):this._subscribeService.updateSubscribeRelation(c,!t),this._subscribeService.updateRelationshipStatusVersion(d),this._pullRelationshipQueue=this._pullRelationshipQueue.filter((function(e){return e>d})),p?[4,this._pullSubscribeRelationship(e,f)]:[3,3]):(this._logger.error(H.L_PULL_SUBSCRIBED_USER_RELATION_R,JSON.stringify({code:u,failTime:this._pullRelationshipFailTime}),n),this._pullRelationshipFailTime++,this._pullRelationshipFailTime>5?(this._pullRelationshipFailTime=0,[2]):[2,this._pullSubscribeRelationship(e,t)]);case 2:s.sent(),s.label=3;case 3:return[2]}}))}))}}),Object.defineProperty(e.prototype,"startsyncSubscribeUserStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){return s(this,(function(t){return this._pullSubUserStatusQueue.push(e),this._syncSubscribeUserStatus(),[2]}))}))}}),Object.defineProperty(e.prototype,"_syncSubscribeUserStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return void 0===e&&(e=!1),o(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return this._isPullingSubUserStatus?[2]:(this._isPullingSubUserStatus=!0,[4,this._pullSubscribeUserStatus(e)]);case 1:return t.sent(),this._isPullingSubUserStatus=!1,this._pullSubUserStatusQueue.length>0?(this._pullSubUserStatusQueue.length=0,[4,this._syncSubscribeUserStatus(e)]):[3,3];case 2:t.sent(),t.label=3;case 3:return[2]}}))}))}}),Object.defineProperty(e.prototype,"_pullSubscribeUserStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return void 0===e&&(e=!1),void 0===t&&(t=""),o(this,void 0,void 0,(function(){var r,n,i,o,a,u,l,c,d,p,f,h,g,_;return s(this,(function(s){switch(s.label){case 0:return r=this._subscribeService.getSubscribeUserStatusVersion(),n=this._logger.createTraceId(),this._logger.info(H.L_PULL_SUBSCRIBED_USER_STATUS_T,JSON.stringify({version:r,_pageToken:t,needAllData:e}),n),i=this._connectManager.codec.encodePullSubDataReq({version:r,needAllData:e,pageToken:t}),o=new bi(Zr.pullSubData,i,this._currentUserId),[4,this._connectManager.send(o,$s)];case 1:return a=s.sent(),u=a.code,l=a.data,u===exports.ErrorCode.SUCCESS&&l?(this._pullSubUserStatusFailTime=0,c=l.list,d=l.versionTime,p=l.hasNext,f=l.pageToken,h=l.isFull,d=kt(d),this._logger.info(H.L_PULL_SUBSCRIBED_USER_STATUS_R,JSON.stringify({code:u,data:l}),n),c.forEach((function(e){e.data.forEach((function(e){e.versionTime=kt(e.versionTime)}))})),this._pullSubUserStatusQueue=this._pullSubUserStatusQueue.filter((function(e){return e>d})),this._subscribeService.updateSubscribeUserStatusVersion(d),g=[],_=[],c.forEach((function(e){e.subType===exports.SubscribeType.ONLINE_STATUS?g.push(e):e.subType===exports.SubscribeType.USER_PROFILE&&_.push(e.subUserId)})),h&&""===t&&this._subscribeService.clearSubscribeStatus(),g.length>0&&this._updateUserOnlineStatus(g,!h),_.length>0?[4,this._queryAndUpdateUserProfile(_,!h)]:[3,3]):(this._logger.warn(H.L_PULL_SUBSCRIBED_USER_STATUS_R,JSON.stringify({code:u,failTime:this._pullSubUserStatusFailTime}),n),this._pullSubUserStatusFailTime++,this._pullSubUserStatusFailTime>5?(this._pullSubUserStatusFailTime=0,[2]):[2,this._pullSubscribeUserStatus(e,t)]);case 2:s.sent(),s.label=3;case 3:return p?[4,this._pullSubscribeUserStatus(e,f)]:[3,5];case 4:s.sent(),s.label=5;case 5:return[2]}}))}))}}),Object.defineProperty(e.prototype,"_queryAndUpdateUserOnlineStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,o,a;return s(this,(function(s){switch(s.label){case 0:return t=this._logger.createTraceId(),this._logger.info(H.L_QUERY_SUBSCRIBE_DATA_T,JSON.stringify(e),t),r=this._connectManager.codec.encodeQrySubDataReq(exports.SubscribeType.ONLINE_STATUS,e),n=new bi(Zr.qrySubData,r,this._currentUserId),[4,this._connectManager.send(n,$s)];case 1:return i=s.sent(),o=i.code,a=i.data,this._logger.info(H.L_QUERY_SUBSCRIBE_DATA_R,JSON.stringify({code:o,data:a}),t),o===exports.ErrorCode.SUCCESS&&a?(this._updateUserOnlineStatus(a.list),[2]):[2]}}))}))}}),Object.defineProperty(e.prototype,"_updateUserOnlineStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){void 0===t&&(t=!0),e.forEach((function(e){e.data.forEach((function(e){e.versionTime=kt(e.versionTime)}))}));var r=this._subscribeService.updateSubscribeUserOnlineStatus(e);r=r.filter((function(e){return e.details&&e.details.length>0})),t&&r.length>0&&this._event.subscribeUserStatusChanged(r)}}),Object.defineProperty(e.prototype,"_queryAndUpdateUserProfile",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return void 0===t&&(t=!0),o(this,void 0,void 0,(function(){var r,n,i,o,a,u,l;return s(this,(function(s){switch(s.label){case 0:return r=this._logger.createTraceId(),this._logger.info(H.L_PULL_USER_PROFILE_T,JSON.stringify(e),r),n=this._connectManager.codec.encodePullUserProfileReq(e),i=new bi(Zr.pullUserProfile,n,this._currentUserId),[4,this._connectManager.send(i,sa)];case 1:return o=s.sent(),a=o.code,u=o.data,this._logger.info(H.L_PULL_USER_PROFILE_R,JSON.stringify({code:a,data:u}),r),a===exports.ErrorCode.SUCCESS&&u?(u.UserProfile.forEach((function(e){e.version=kt(e.version)})),l=this._subscribeService.updateSubscribeUserProfile(u.UserProfile),t&&l.length>0&&this._event.subscribeUserStatusChanged(l),[2,{code:a,data:u.UserProfile}]):[2,{code:a}]}}))}))}}),Object.defineProperty(e.prototype,"updateUserStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i;return s(this,(function(o){switch(o.label){case 0:return(t=this._connectManager.codec.decodeByPBName(e.pbData,ea)).subType!==exports.SubscribeType.ONLINE_STATUS?[3,1]:(this._updateUserOnlineStatus([t]),[3,5]);case 1:return t.subType!==exports.SubscribeType.USER_PROFILE?[3,2]:(this._queryAndUpdateUserProfile([t.subUserId]),[3,5]);case 2:return t.subType!==exports.SubscribeType.FRIEND_ONLINE_STATUS?[3,3]:(r=t.data.map((function(e){return{changeTime:kt(e.versionTime),eventValue:e.value,platform:e.platformInfo}})),this._event.subscribeUserStatusChanged([{userId:t.subUserId,subscribeType:t.subType,subscribeTime:0,expiry:0,details:r}]),[3,5]);case 3:return t.subType!==exports.SubscribeType.FRIEND_USER_PROFILE?[3,5]:[4,this._queryAndUpdateUserProfile([t.subUserId])];case 4:n=o.sent(),(i=n.data)&&this._event.subscribeUserStatusChanged([{userId:t.subUserId,subscribeType:t.subType,subscribeTime:0,expiry:0,userProfile:qt(t.subUserId,i[0].userProfile,i[0].userExtProfile)}]),o.label=5;case 5:return[2]}}))}))}}),Object.defineProperty(e.prototype,"getSubscribeUserStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return this._subscribeService.getSubscribeUserStatus(e,t)}}),Object.defineProperty(e.prototype,"getSubscribeUserList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return this._subscribeService.getSubscribeUserList(e,t,r)}}),Object.defineProperty(e.prototype,"updateSubscribeRelation",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return void 0===n&&(n=0),o(this,void 0,void 0,(function(){var i,o,a,u,l,c;return s(this,(function(s){switch(s.label){case 0:return i=this._connectManager.codec.encodeUpdateUserSubReq(t,e,r,n),o=new bi(Zr.updUserSub,i,this._currentUserId),[4,this._connectManager.send(o,Js)];case 1:return a=s.sent(),u=a.code,l=a.data,u===exports.ErrorCode.RC_BESUBSCRIBED_USERIDS_COUNT_EXCEED_LIMIT&&l?[2,{code:u,data:l.subUsers.map((function(e){return e.subUserId}))}]:u===exports.ErrorCode.SUCCESS&&l?(c=l.subTime,this._subscribeService.updateSubscribeRelation([{subType:t,subTime:c,expiry:n,opType:r,subUsers:e.map((function(e){return{subUserId:e}}))}]),r===exports.SubscribeOperationType.SUBSCRIBE&&(t===exports.SubscribeType.ONLINE_STATUS?this._queryAndUpdateUserOnlineStatus(e):t===exports.SubscribeType.USER_PROFILE&&this._queryAndUpdateUserProfile(e,!1)),[2,{code:u}]):[2,{code:u}]}}))}))}}),Object.defineProperty(e.prototype,"getUserProfiles",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,o,a,c;return s(this,(function(s){switch(s.label){case 0:return t=this._subscribeService.getUserProfiles(e),r=t.needQueryUserIds,n=t.list,0===r.length?[2,Promise.resolve({code:exports.ErrorCode.SUCCESS,data:n})]:[4,this._queryAndUpdateUserProfile(r,!1)];case 1:return i=s.sent(),o=i.code,a=i.data,o===exports.ErrorCode.SUCCESS&&a?(c=a.map((function(e){return qt(e.userId,e.userProfile,e.userExtProfile)})),[2,{code:o,data:l(l([],u(n),!1),u(c),!1)}]):[2,{code:o,data:l([],u(n),!1)}]}}))}))}}),Object.defineProperty(e.prototype,"syncOwnProfile",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return void 0===e&&(e=!1),o(this,void 0,void 0,(function(){var t,r,n,i,o,a,u,l,c,d,p,f;return s(this,(function(s){switch(s.label){case 0:return this._isOpenUserProfile?(t=this._logger.createTraceId(),this._logger.info(H.L_PULL_OWN_PROFILE_T,"",t),r=this._connectManager.codec.encodeUserProfileInput(),n=new bi(Zr.pullOwnProfile,r,this._currentUserId),[4,this._connectManager.send(n,ra)]):[2,Promise.resolve({code:exports.ErrorCode.RC_USER_PROFILE_SERVICE_UNAVAILABLE})];case 1:return i=s.sent(),o=i.code,a=i.data,this._logger.info(H.L_PULL_OWN_PROFILE_R,JSON.stringify({code:o,data:a}),t),o===exports.ErrorCode.SUCCESS&&a?(u=a.userExtProfile,l=a.userProfile,c=a.version,d=a.userId,p=kt(c),f=qt(d,l,u),this._subscribeService.updateOwnProfile(f,p),e&&this._event.ownUserProfileChanged(f),[2,{code:o,data:f}]):[2,{code:o}]}}))}))}}),Object.defineProperty(e.prototype,"getOwnProfile",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e;return s(this,(function(t){return(e=this._subscribeService.getOwnProfile())?[2,{code:exports.ErrorCode.SUCCESS,data:e}]:[2,this.syncOwnProfile()]}))}))}}),Object.defineProperty(e.prototype,"updateOwnProfile",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){return s(this,(function(r){return this._subscribeService.updateOwnProfile(e,t),[2]}))}))}}),e}(),vl=function(){function e(e,t,r){Object.defineProperty(this,"_storage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_delayTime",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._storage=new Gu(Ze(e,t)),this._delayTime=r,this.clear()}return Object.defineProperty(e.prototype,"_getConversationKey",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return"".concat(e.targetId,"_").concat(e.channelId)}}),Object.defineProperty(e.prototype,"_removeExcessData",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r,n=Object.keys(e).map((function(t){return{key:t,value:e[t]}})).sort((function(e,t){return e.value.t-t.value.t})).slice(-30),i={};try{for(var o=a(n),s=o.next();!s.done;s=o.next()){var u=s.value;i[u.key]=u.value}}catch(e){t={error:e}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}return i}}),Object.defineProperty(e.prototype,"insert",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,i,o){var s;if(!(i<Date.now()-this._delayTime-Ge)){var a=this._getConversationKey(e),u=this._storage.get(a)||{};if(!u[t]){var l={t:i,d:r};o&&(l.sId=o);var c=n(n({},u),((s={})[t]=l,s));Object.keys(c).length>30&&(c=this._removeExcessData(c)),this._storage.set(a,c)}}}}),Object.defineProperty(e.prototype,"addReadedUser",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var i,o=this._getConversationKey(e),s=this._storage.get(o)||{},a=s[t];if(a){if(a.us){if(a.us.includes(r))return}else a.us=[];a.us.push(r),this._storage.set(o,n(n({},s),((i={})[t]=a,i)))}}}),Object.defineProperty(e.prototype,"getReadReceiptInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this._getConversationKey(e),n=(this._storage.get(r)||{})[t];return n?{time:n.t,direction:n.d,users:n.us||[],senderId:n.sId}:null}}),Object.defineProperty(e.prototype,"getReceiptMessageDic",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this._getConversationKey(e),r=this._storage.get(t)||{},n={};for(var i in r){var o=r[i];o.d===exports.MessageDirection.RECEIVE&&(n[o.sId]||(n[o.sId]=[]),n[o.sId].push(i))}return n}}),Object.defineProperty(e.prototype,"remove",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this._getConversationKey(e),n=this._storage.get(r)||{};n[t]&&(delete n[t],0===Object.keys(n).length?this._storage.remove(r):this._storage.set(r,n))}}),Object.defineProperty(e.prototype,"clear",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this._storage.getValues(),t={};for(var r in e){var n=e[r],i={};for(var o in n){var s=n[o];Date.now()-this._delayTime-s.t<Ge&&(i[o]=s)}Object.keys(i).length&&(t[r]=i)}this._storage.update(t)}}),e}(),yl=function(e){function r(t,r){var n=e.call(this,t,r)||this;return Object.defineProperty(n,"appkey",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(n,"logger",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(n,"_storageKey",{enumerable:!0,configurable:!0,writable:!0,value:""}),n._storageKey=Je(t),n}return t(r,e),Object.defineProperty(r.prototype,"getCache",{enumerable:!1,configurable:!0,writable:!0,value:function(){return lo.localStorage.getItem(this._storageKey)}}),Object.defineProperty(r.prototype,"setCache",{enumerable:!1,configurable:!0,writable:!0,value:function(e){lo.localStorage.setItem(this._storageKey,e)}}),Object.defineProperty(r.prototype,"clearCache",{enumerable:!1,configurable:!0,writable:!0,value:function(){lo.localStorage.removeItem(this._storageKey)}}),Object.defineProperty(r.prototype,"sendRequest",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n;return s(this,(function(i){switch(i.label){case 0:return[4,lo.httpReq({url:e})];case 1:return t=i.sent(),r=t.status,n=t.data,[2,{code:r,data:n}]}}))}))}}),Object.defineProperty(r.prototype,"decryptData",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r;return s(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,dr(e,"cd4936151214ce45dc1d12673a59d94c","51ad078e5eb17a91")];case 1:return t=n.sent(),[2,JSON.parse(t)];case 2:return r=n.sent(),this.logger.error(H.L_GET_STATIC_CONF_E,JSON.stringify({error:null==r?void 0:r.stack})),[3,3];case 3:return[2]}}))}))}}),r}(mr);function ml(e){let t=e.length;for(;--t>=0;)e[t]=0}const Il=256,Tl=286,Rl=30,Cl=15,Ol=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),Sl=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),Al=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),Pl=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Nl=new Array(576);ml(Nl);const wl=new Array(60);ml(wl);const Ml=new Array(512);ml(Ml);const Ll=new Array(256);ml(Ll);const Ul=new Array(29);ml(Ul);const Dl=new Array(Rl);function xl(e,t,r,n,i){this.static_tree=e,this.extra_bits=t,this.extra_base=r,this.elems=n,this.max_length=i,this.has_stree=e&&e.length}let jl,Vl,Gl;function kl(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}ml(Dl);const Fl=e=>e<256?Ml[e]:Ml[256+(e>>>7)],Bl=(e,t)=>{e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255},Hl=(e,t,r)=>{e.bi_valid>16-r?(e.bi_buf|=t<<e.bi_valid&65535,Bl(e,e.bi_buf),e.bi_buf=t>>16-e.bi_valid,e.bi_valid+=r-16):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=r)},ql=(e,t,r)=>{Hl(e,r[2*t],r[2*t+1])},Yl=(e,t)=>{let r=0;do{r|=1&e,e>>>=1,r<<=1}while(--t>0);return r>>>1},Kl=(e,t,r)=>{const n=new Array(16);let i,o,s=0;for(i=1;i<=Cl;i++)s=s+r[i-1]<<1,n[i]=s;for(o=0;o<=t;o++){let t=e[2*o+1];0!==t&&(e[2*o]=Yl(n[t]++,t))}},Ql=e=>{let t;for(t=0;t<Tl;t++)e.dyn_ltree[2*t]=0;for(t=0;t<Rl;t++)e.dyn_dtree[2*t]=0;for(t=0;t<19;t++)e.bl_tree[2*t]=0;e.dyn_ltree[512]=1,e.opt_len=e.static_len=0,e.sym_next=e.matches=0},Wl=e=>{e.bi_valid>8?Bl(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0},Jl=(e,t,r,n)=>{const i=2*t,o=2*r;return e[i]<e[o]||e[i]===e[o]&&n[t]<=n[r]},zl=(e,t,r)=>{const n=e.heap[r];let i=r<<1;for(;i<=e.heap_len&&(i<e.heap_len&&Jl(t,e.heap[i+1],e.heap[i],e.depth)&&i++,!Jl(t,n,e.heap[i],e.depth));)e.heap[r]=e.heap[i],r=i,i<<=1;e.heap[r]=n},Zl=(e,t,r)=>{let n,i,o,s,a=0;if(0!==e.sym_next)do{n=255&e.pending_buf[e.sym_buf+a++],n+=(255&e.pending_buf[e.sym_buf+a++])<<8,i=e.pending_buf[e.sym_buf+a++],0===n?ql(e,i,t):(o=Ll[i],ql(e,o+Il+1,t),s=Ol[o],0!==s&&(i-=Ul[o],Hl(e,i,s)),n--,o=Fl(n),ql(e,o,r),s=Sl[o],0!==s&&(n-=Dl[o],Hl(e,n,s)))}while(a<e.sym_next);ql(e,256,t)},Xl=(e,t)=>{const r=t.dyn_tree,n=t.stat_desc.static_tree,i=t.stat_desc.has_stree,o=t.stat_desc.elems;let s,a,u,l=-1;for(e.heap_len=0,e.heap_max=573,s=0;s<o;s++)0!==r[2*s]?(e.heap[++e.heap_len]=l=s,e.depth[s]=0):r[2*s+1]=0;for(;e.heap_len<2;)u=e.heap[++e.heap_len]=l<2?++l:0,r[2*u]=1,e.depth[u]=0,e.opt_len--,i&&(e.static_len-=n[2*u+1]);for(t.max_code=l,s=e.heap_len>>1;s>=1;s--)zl(e,r,s);u=o;do{s=e.heap[1],e.heap[1]=e.heap[e.heap_len--],zl(e,r,1),a=e.heap[1],e.heap[--e.heap_max]=s,e.heap[--e.heap_max]=a,r[2*u]=r[2*s]+r[2*a],e.depth[u]=(e.depth[s]>=e.depth[a]?e.depth[s]:e.depth[a])+1,r[2*s+1]=r[2*a+1]=u,e.heap[1]=u++,zl(e,r,1)}while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],((e,t)=>{const r=t.dyn_tree,n=t.max_code,i=t.stat_desc.static_tree,o=t.stat_desc.has_stree,s=t.stat_desc.extra_bits,a=t.stat_desc.extra_base,u=t.stat_desc.max_length;let l,c,d,p,f,h,g=0;for(p=0;p<=Cl;p++)e.bl_count[p]=0;for(r[2*e.heap[e.heap_max]+1]=0,l=e.heap_max+1;l<573;l++)c=e.heap[l],p=r[2*r[2*c+1]+1]+1,p>u&&(p=u,g++),r[2*c+1]=p,c>n||(e.bl_count[p]++,f=0,c>=a&&(f=s[c-a]),h=r[2*c],e.opt_len+=h*(p+f),o&&(e.static_len+=h*(i[2*c+1]+f)));if(0!==g){do{for(p=u-1;0===e.bl_count[p];)p--;e.bl_count[p]--,e.bl_count[p+1]+=2,e.bl_count[u]--,g-=2}while(g>0);for(p=u;0!==p;p--)for(c=e.bl_count[p];0!==c;)d=e.heap[--l],d>n||(r[2*d+1]!==p&&(e.opt_len+=(p-r[2*d+1])*r[2*d],r[2*d+1]=p),c--)}})(e,t),Kl(r,l,e.bl_count)},$l=(e,t,r)=>{let n,i,o=-1,s=t[1],a=0,u=7,l=4;for(0===s&&(u=138,l=3),t[2*(r+1)+1]=65535,n=0;n<=r;n++)i=s,s=t[2*(n+1)+1],++a<u&&i===s||(a<l?e.bl_tree[2*i]+=a:0!==i?(i!==o&&e.bl_tree[2*i]++,e.bl_tree[32]++):a<=10?e.bl_tree[34]++:e.bl_tree[36]++,a=0,o=i,0===s?(u=138,l=3):i===s?(u=6,l=3):(u=7,l=4))},ec=(e,t,r)=>{let n,i,o=-1,s=t[1],a=0,u=7,l=4;for(0===s&&(u=138,l=3),n=0;n<=r;n++)if(i=s,s=t[2*(n+1)+1],!(++a<u&&i===s)){if(a<l)do{ql(e,i,e.bl_tree)}while(0!=--a);else 0!==i?(i!==o&&(ql(e,i,e.bl_tree),a--),ql(e,16,e.bl_tree),Hl(e,a-3,2)):a<=10?(ql(e,17,e.bl_tree),Hl(e,a-3,3)):(ql(e,18,e.bl_tree),Hl(e,a-11,7));a=0,o=i,0===s?(u=138,l=3):i===s?(u=6,l=3):(u=7,l=4)}};let tc=!1;const rc=(e,t,r,n)=>{Hl(e,0+(n?1:0),3),Wl(e),Bl(e,r),Bl(e,~r),r&&e.pending_buf.set(e.window.subarray(t,t+r),e.pending),e.pending+=r};var nc=(e,t,r,n)=>{let i,o,s=0;e.level>0?(2===e.strm.data_type&&(e.strm.data_type=(e=>{let t,r=4093624447;for(t=0;t<=31;t++,r>>>=1)if(1&r&&0!==e.dyn_ltree[2*t])return 0;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return 1;for(t=32;t<Il;t++)if(0!==e.dyn_ltree[2*t])return 1;return 0})(e)),Xl(e,e.l_desc),Xl(e,e.d_desc),s=(e=>{let t;for($l(e,e.dyn_ltree,e.l_desc.max_code),$l(e,e.dyn_dtree,e.d_desc.max_code),Xl(e,e.bl_desc),t=18;t>=3&&0===e.bl_tree[2*Pl[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t})(e),i=e.opt_len+3+7>>>3,o=e.static_len+3+7>>>3,o<=i&&(i=o)):i=o=r+5,r+4<=i&&-1!==t?rc(e,t,r,n):4===e.strategy||o===i?(Hl(e,2+(n?1:0),3),Zl(e,Nl,wl)):(Hl(e,4+(n?1:0),3),((e,t,r,n)=>{let i;for(Hl(e,t-257,5),Hl(e,r-1,5),Hl(e,n-4,4),i=0;i<n;i++)Hl(e,e.bl_tree[2*Pl[i]+1],3);ec(e,e.dyn_ltree,t-1),ec(e,e.dyn_dtree,r-1)})(e,e.l_desc.max_code+1,e.d_desc.max_code+1,s+1),Zl(e,e.dyn_ltree,e.dyn_dtree)),Ql(e),n&&Wl(e)},ic={_tr_init:e=>{tc||((()=>{let e,t,r,n,i;const o=new Array(16);for(r=0,n=0;n<28;n++)for(Ul[n]=r,e=0;e<1<<Ol[n];e++)Ll[r++]=n;for(Ll[r-1]=n,i=0,n=0;n<16;n++)for(Dl[n]=i,e=0;e<1<<Sl[n];e++)Ml[i++]=n;for(i>>=7;n<Rl;n++)for(Dl[n]=i<<7,e=0;e<1<<Sl[n]-7;e++)Ml[256+i++]=n;for(t=0;t<=Cl;t++)o[t]=0;for(e=0;e<=143;)Nl[2*e+1]=8,e++,o[8]++;for(;e<=255;)Nl[2*e+1]=9,e++,o[9]++;for(;e<=279;)Nl[2*e+1]=7,e++,o[7]++;for(;e<=287;)Nl[2*e+1]=8,e++,o[8]++;for(Kl(Nl,287,o),e=0;e<Rl;e++)wl[2*e+1]=5,wl[2*e]=Yl(e,5);jl=new xl(Nl,Ol,257,Tl,Cl),Vl=new xl(wl,Sl,0,Rl,Cl),Gl=new xl(new Array(0),Al,0,19,7)})(),tc=!0),e.l_desc=new kl(e.dyn_ltree,jl),e.d_desc=new kl(e.dyn_dtree,Vl),e.bl_desc=new kl(e.bl_tree,Gl),e.bi_buf=0,e.bi_valid=0,Ql(e)},_tr_stored_block:rc,_tr_flush_block:nc,_tr_tally:(e,t,r)=>(e.pending_buf[e.sym_buf+e.sym_next++]=t,e.pending_buf[e.sym_buf+e.sym_next++]=t>>8,e.pending_buf[e.sym_buf+e.sym_next++]=r,0===t?e.dyn_ltree[2*r]++:(e.matches++,t--,e.dyn_ltree[2*(Ll[r]+Il+1)]++,e.dyn_dtree[2*Fl(t)]++),e.sym_next===e.sym_end),_tr_align:e=>{Hl(e,2,3),ql(e,256,Nl),(e=>{16===e.bi_valid?(Bl(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)})(e)}};var oc=(e,t,r,n)=>{let i=65535&e,o=e>>>16&65535,s=0;for(;0!==r;){s=r>2e3?2e3:r,r-=s;do{i=i+t[n++]|0,o=o+i|0}while(--s);i%=65521,o%=65521}return i|o<<16};const sc=new Uint32Array((()=>{let e,t=[];for(var r=0;r<256;r++){e=r;for(var n=0;n<8;n++)e=1&e?3988292384^e>>>1:e>>>1;t[r]=e}return t})());var ac=(e,t,r,n)=>{const i=sc,o=n+r;e^=-1;for(let r=n;r<o;r++)e=e>>>8^i[255&(e^t[r])];return~e},uc={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},lc={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8};const{_tr_init:cc,_tr_stored_block:dc,_tr_flush_block:pc,_tr_tally:fc,_tr_align:hc}=ic,{Z_NO_FLUSH:gc,Z_PARTIAL_FLUSH:_c,Z_FULL_FLUSH:bc,Z_FINISH:Ec,Z_BLOCK:vc,Z_OK:yc,Z_STREAM_END:mc,Z_STREAM_ERROR:Ic,Z_DATA_ERROR:Tc,Z_BUF_ERROR:Rc,Z_DEFAULT_COMPRESSION:Cc,Z_FILTERED:Oc,Z_HUFFMAN_ONLY:Sc,Z_RLE:Ac,Z_FIXED:Pc,Z_DEFAULT_STRATEGY:Nc,Z_UNKNOWN:wc,Z_DEFLATED:Mc}=lc,Lc=258,Uc=262,Dc=42,xc=113,jc=666,Vc=(e,t)=>(e.msg=uc[t],t),Gc=e=>2*e-(e>4?9:0),kc=e=>{let t=e.length;for(;--t>=0;)e[t]=0},Fc=e=>{let t,r,n,i=e.w_size;t=e.hash_size,n=t;do{r=e.head[--n],e.head[n]=r>=i?r-i:0}while(--t);t=i,n=t;do{r=e.prev[--n],e.prev[n]=r>=i?r-i:0}while(--t)};let Bc=(e,t,r)=>(t<<e.hash_shift^r)&e.hash_mask;const Hc=e=>{const t=e.state;let r=t.pending;r>e.avail_out&&(r=e.avail_out),0!==r&&(e.output.set(t.pending_buf.subarray(t.pending_out,t.pending_out+r),e.next_out),e.next_out+=r,t.pending_out+=r,e.total_out+=r,e.avail_out-=r,t.pending-=r,0===t.pending&&(t.pending_out=0))},qc=(e,t)=>{pc(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,Hc(e.strm)},Yc=(e,t)=>{e.pending_buf[e.pending++]=t},Kc=(e,t)=>{e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t},Qc=(e,t,r,n)=>{let i=e.avail_in;return i>n&&(i=n),0===i?0:(e.avail_in-=i,t.set(e.input.subarray(e.next_in,e.next_in+i),r),1===e.state.wrap?e.adler=oc(e.adler,t,i,r):2===e.state.wrap&&(e.adler=ac(e.adler,t,i,r)),e.next_in+=i,e.total_in+=i,i)},Wc=(e,t)=>{let r,n,i=e.max_chain_length,o=e.strstart,s=e.prev_length,a=e.nice_match;const u=e.strstart>e.w_size-Uc?e.strstart-(e.w_size-Uc):0,l=e.window,c=e.w_mask,d=e.prev,p=e.strstart+Lc;let f=l[o+s-1],h=l[o+s];e.prev_length>=e.good_match&&(i>>=2),a>e.lookahead&&(a=e.lookahead);do{if(r=t,l[r+s]===h&&l[r+s-1]===f&&l[r]===l[o]&&l[++r]===l[o+1]){o+=2,r++;do{}while(l[++o]===l[++r]&&l[++o]===l[++r]&&l[++o]===l[++r]&&l[++o]===l[++r]&&l[++o]===l[++r]&&l[++o]===l[++r]&&l[++o]===l[++r]&&l[++o]===l[++r]&&o<p);if(n=Lc-(p-o),o=p-Lc,n>s){if(e.match_start=t,s=n,n>=a)break;f=l[o+s-1],h=l[o+s]}}}while((t=d[t&c])>u&&0!=--i);return s<=e.lookahead?s:e.lookahead},Jc=e=>{const t=e.w_size;let r,n,i;do{if(n=e.window_size-e.lookahead-e.strstart,e.strstart>=t+(t-Uc)&&(e.window.set(e.window.subarray(t,t+t-n),0),e.match_start-=t,e.strstart-=t,e.block_start-=t,e.insert>e.strstart&&(e.insert=e.strstart),Fc(e),n+=t),0===e.strm.avail_in)break;if(r=Qc(e.strm,e.window,e.strstart+e.lookahead,n),e.lookahead+=r,e.lookahead+e.insert>=3)for(i=e.strstart-e.insert,e.ins_h=e.window[i],e.ins_h=Bc(e,e.ins_h,e.window[i+1]);e.insert&&(e.ins_h=Bc(e,e.ins_h,e.window[i+3-1]),e.prev[i&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=i,i++,e.insert--,!(e.lookahead+e.insert<3)););}while(e.lookahead<Uc&&0!==e.strm.avail_in)},zc=(e,t)=>{let r,n,i,o=e.pending_buf_size-5>e.w_size?e.w_size:e.pending_buf_size-5,s=0,a=e.strm.avail_in;do{if(r=65535,i=e.bi_valid+42>>3,e.strm.avail_out<i)break;if(i=e.strm.avail_out-i,n=e.strstart-e.block_start,r>n+e.strm.avail_in&&(r=n+e.strm.avail_in),r>i&&(r=i),r<o&&(0===r&&t!==Ec||t===gc||r!==n+e.strm.avail_in))break;s=t===Ec&&r===n+e.strm.avail_in?1:0,dc(e,0,0,s),e.pending_buf[e.pending-4]=r,e.pending_buf[e.pending-3]=r>>8,e.pending_buf[e.pending-2]=~r,e.pending_buf[e.pending-1]=~r>>8,Hc(e.strm),n&&(n>r&&(n=r),e.strm.output.set(e.window.subarray(e.block_start,e.block_start+n),e.strm.next_out),e.strm.next_out+=n,e.strm.avail_out-=n,e.strm.total_out+=n,e.block_start+=n,r-=n),r&&(Qc(e.strm,e.strm.output,e.strm.next_out,r),e.strm.next_out+=r,e.strm.avail_out-=r,e.strm.total_out+=r)}while(0===s);return a-=e.strm.avail_in,a&&(a>=e.w_size?(e.matches=2,e.window.set(e.strm.input.subarray(e.strm.next_in-e.w_size,e.strm.next_in),0),e.strstart=e.w_size,e.insert=e.strstart):(e.window_size-e.strstart<=a&&(e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,e.insert>e.strstart&&(e.insert=e.strstart)),e.window.set(e.strm.input.subarray(e.strm.next_in-a,e.strm.next_in),e.strstart),e.strstart+=a,e.insert+=a>e.w_size-e.insert?e.w_size-e.insert:a),e.block_start=e.strstart),e.high_water<e.strstart&&(e.high_water=e.strstart),s?4:t!==gc&&t!==Ec&&0===e.strm.avail_in&&e.strstart===e.block_start?2:(i=e.window_size-e.strstart,e.strm.avail_in>i&&e.block_start>=e.w_size&&(e.block_start-=e.w_size,e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,i+=e.w_size,e.insert>e.strstart&&(e.insert=e.strstart)),i>e.strm.avail_in&&(i=e.strm.avail_in),i&&(Qc(e.strm,e.window,e.strstart,i),e.strstart+=i,e.insert+=i>e.w_size-e.insert?e.w_size-e.insert:i),e.high_water<e.strstart&&(e.high_water=e.strstart),i=e.bi_valid+42>>3,i=e.pending_buf_size-i>65535?65535:e.pending_buf_size-i,o=i>e.w_size?e.w_size:i,n=e.strstart-e.block_start,(n>=o||(n||t===Ec)&&t!==gc&&0===e.strm.avail_in&&n<=i)&&(r=n>i?i:n,s=t===Ec&&0===e.strm.avail_in&&r===n?1:0,dc(e,e.block_start,r,s),e.block_start+=r,Hc(e.strm)),s?3:1)},Zc=(e,t)=>{let r,n;for(;;){if(e.lookahead<Uc){if(Jc(e),e.lookahead<Uc&&t===gc)return 1;if(0===e.lookahead)break}if(r=0,e.lookahead>=3&&(e.ins_h=Bc(e,e.ins_h,e.window[e.strstart+3-1]),r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),0!==r&&e.strstart-r<=e.w_size-Uc&&(e.match_length=Wc(e,r)),e.match_length>=3)if(n=fc(e,e.strstart-e.match_start,e.match_length-3),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=3){e.match_length--;do{e.strstart++,e.ins_h=Bc(e,e.ins_h,e.window[e.strstart+3-1]),r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart}while(0!=--e.match_length);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=Bc(e,e.ins_h,e.window[e.strstart+1]);else n=fc(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(n&&(qc(e,!1),0===e.strm.avail_out))return 1}return e.insert=e.strstart<2?e.strstart:2,t===Ec?(qc(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(qc(e,!1),0===e.strm.avail_out)?1:2},Xc=(e,t)=>{let r,n,i;for(;;){if(e.lookahead<Uc){if(Jc(e),e.lookahead<Uc&&t===gc)return 1;if(0===e.lookahead)break}if(r=0,e.lookahead>=3&&(e.ins_h=Bc(e,e.ins_h,e.window[e.strstart+3-1]),r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=2,0!==r&&e.prev_length<e.max_lazy_match&&e.strstart-r<=e.w_size-Uc&&(e.match_length=Wc(e,r),e.match_length<=5&&(e.strategy===Oc||3===e.match_length&&e.strstart-e.match_start>4096)&&(e.match_length=2)),e.prev_length>=3&&e.match_length<=e.prev_length){i=e.strstart+e.lookahead-3,n=fc(e,e.strstart-1-e.prev_match,e.prev_length-3),e.lookahead-=e.prev_length-1,e.prev_length-=2;do{++e.strstart<=i&&(e.ins_h=Bc(e,e.ins_h,e.window[e.strstart+3-1]),r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart)}while(0!=--e.prev_length);if(e.match_available=0,e.match_length=2,e.strstart++,n&&(qc(e,!1),0===e.strm.avail_out))return 1}else if(e.match_available){if(n=fc(e,0,e.window[e.strstart-1]),n&&qc(e,!1),e.strstart++,e.lookahead--,0===e.strm.avail_out)return 1}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(n=fc(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<2?e.strstart:2,t===Ec?(qc(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(qc(e,!1),0===e.strm.avail_out)?1:2};function $c(e,t,r,n,i){this.good_length=e,this.max_lazy=t,this.nice_length=r,this.max_chain=n,this.func=i}const ed=[new $c(0,0,0,0,zc),new $c(4,4,8,4,Zc),new $c(4,5,16,8,Zc),new $c(4,6,32,32,Zc),new $c(4,4,16,16,Xc),new $c(8,16,32,32,Xc),new $c(8,16,128,128,Xc),new $c(8,32,128,256,Xc),new $c(32,128,258,1024,Xc),new $c(32,258,258,4096,Xc)];function td(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=Mc,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(1146),this.dyn_dtree=new Uint16Array(122),this.bl_tree=new Uint16Array(78),kc(this.dyn_ltree),kc(this.dyn_dtree),kc(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(16),this.heap=new Uint16Array(573),kc(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),kc(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}const rd=e=>{if(!e)return 1;const t=e.state;return!t||t.strm!==e||t.status!==Dc&&57!==t.status&&69!==t.status&&73!==t.status&&91!==t.status&&103!==t.status&&t.status!==xc&&t.status!==jc?1:0},nd=e=>{if(rd(e))return Vc(e,Ic);e.total_in=e.total_out=0,e.data_type=wc;const t=e.state;return t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=2===t.wrap?57:t.wrap?Dc:xc,e.adler=2===t.wrap?0:1,t.last_flush=-2,cc(t),yc},id=e=>{const t=nd(e);var r;return t===yc&&((r=e.state).window_size=2*r.w_size,kc(r.head),r.max_lazy_match=ed[r.level].max_lazy,r.good_match=ed[r.level].good_length,r.nice_match=ed[r.level].nice_length,r.max_chain_length=ed[r.level].max_chain,r.strstart=0,r.block_start=0,r.lookahead=0,r.insert=0,r.match_length=r.prev_length=2,r.match_available=0,r.ins_h=0),t},od=(e,t,r,n,i,o)=>{if(!e)return Ic;let s=1;if(t===Cc&&(t=6),n<0?(s=0,n=-n):n>15&&(s=2,n-=16),i<1||i>9||r!==Mc||n<8||n>15||t<0||t>9||o<0||o>Pc||8===n&&1!==s)return Vc(e,Ic);8===n&&(n=9);const a=new td;return e.state=a,a.strm=e,a.status=Dc,a.wrap=s,a.gzhead=null,a.w_bits=n,a.w_size=1<<a.w_bits,a.w_mask=a.w_size-1,a.hash_bits=i+7,a.hash_size=1<<a.hash_bits,a.hash_mask=a.hash_size-1,a.hash_shift=~~((a.hash_bits+3-1)/3),a.window=new Uint8Array(2*a.w_size),a.head=new Uint16Array(a.hash_size),a.prev=new Uint16Array(a.w_size),a.lit_bufsize=1<<i+6,a.pending_buf_size=4*a.lit_bufsize,a.pending_buf=new Uint8Array(a.pending_buf_size),a.sym_buf=a.lit_bufsize,a.sym_end=3*(a.lit_bufsize-1),a.level=t,a.strategy=o,a.method=r,id(e)};var sd={deflateInit:(e,t)=>od(e,t,Mc,15,8,Nc),deflateInit2:od,deflateReset:id,deflateResetKeep:nd,deflateSetHeader:(e,t)=>rd(e)||2!==e.state.wrap?Ic:(e.state.gzhead=t,yc),deflate:(e,t)=>{if(rd(e)||t>vc||t<0)return e?Vc(e,Ic):Ic;const r=e.state;if(!e.output||0!==e.avail_in&&!e.input||r.status===jc&&t!==Ec)return Vc(e,0===e.avail_out?Rc:Ic);const n=r.last_flush;if(r.last_flush=t,0!==r.pending){if(Hc(e),0===e.avail_out)return r.last_flush=-1,yc}else if(0===e.avail_in&&Gc(t)<=Gc(n)&&t!==Ec)return Vc(e,Rc);if(r.status===jc&&0!==e.avail_in)return Vc(e,Rc);if(r.status===Dc&&0===r.wrap&&(r.status=xc),r.status===Dc){let t=Mc+(r.w_bits-8<<4)<<8,n=-1;if(n=r.strategy>=Sc||r.level<2?0:r.level<6?1:6===r.level?2:3,t|=n<<6,0!==r.strstart&&(t|=32),t+=31-t%31,Kc(r,t),0!==r.strstart&&(Kc(r,e.adler>>>16),Kc(r,65535&e.adler)),e.adler=1,r.status=xc,Hc(e),0!==r.pending)return r.last_flush=-1,yc}if(57===r.status)if(e.adler=0,Yc(r,31),Yc(r,139),Yc(r,8),r.gzhead)Yc(r,(r.gzhead.text?1:0)+(r.gzhead.hcrc?2:0)+(r.gzhead.extra?4:0)+(r.gzhead.name?8:0)+(r.gzhead.comment?16:0)),Yc(r,255&r.gzhead.time),Yc(r,r.gzhead.time>>8&255),Yc(r,r.gzhead.time>>16&255),Yc(r,r.gzhead.time>>24&255),Yc(r,9===r.level?2:r.strategy>=Sc||r.level<2?4:0),Yc(r,255&r.gzhead.os),r.gzhead.extra&&r.gzhead.extra.length&&(Yc(r,255&r.gzhead.extra.length),Yc(r,r.gzhead.extra.length>>8&255)),r.gzhead.hcrc&&(e.adler=ac(e.adler,r.pending_buf,r.pending,0)),r.gzindex=0,r.status=69;else if(Yc(r,0),Yc(r,0),Yc(r,0),Yc(r,0),Yc(r,0),Yc(r,9===r.level?2:r.strategy>=Sc||r.level<2?4:0),Yc(r,3),r.status=xc,Hc(e),0!==r.pending)return r.last_flush=-1,yc;if(69===r.status){if(r.gzhead.extra){let t=r.pending,n=(65535&r.gzhead.extra.length)-r.gzindex;for(;r.pending+n>r.pending_buf_size;){let i=r.pending_buf_size-r.pending;if(r.pending_buf.set(r.gzhead.extra.subarray(r.gzindex,r.gzindex+i),r.pending),r.pending=r.pending_buf_size,r.gzhead.hcrc&&r.pending>t&&(e.adler=ac(e.adler,r.pending_buf,r.pending-t,t)),r.gzindex+=i,Hc(e),0!==r.pending)return r.last_flush=-1,yc;t=0,n-=i}let i=new Uint8Array(r.gzhead.extra);r.pending_buf.set(i.subarray(r.gzindex,r.gzindex+n),r.pending),r.pending+=n,r.gzhead.hcrc&&r.pending>t&&(e.adler=ac(e.adler,r.pending_buf,r.pending-t,t)),r.gzindex=0}r.status=73}if(73===r.status){if(r.gzhead.name){let t,n=r.pending;do{if(r.pending===r.pending_buf_size){if(r.gzhead.hcrc&&r.pending>n&&(e.adler=ac(e.adler,r.pending_buf,r.pending-n,n)),Hc(e),0!==r.pending)return r.last_flush=-1,yc;n=0}t=r.gzindex<r.gzhead.name.length?255&r.gzhead.name.charCodeAt(r.gzindex++):0,Yc(r,t)}while(0!==t);r.gzhead.hcrc&&r.pending>n&&(e.adler=ac(e.adler,r.pending_buf,r.pending-n,n)),r.gzindex=0}r.status=91}if(91===r.status){if(r.gzhead.comment){let t,n=r.pending;do{if(r.pending===r.pending_buf_size){if(r.gzhead.hcrc&&r.pending>n&&(e.adler=ac(e.adler,r.pending_buf,r.pending-n,n)),Hc(e),0!==r.pending)return r.last_flush=-1,yc;n=0}t=r.gzindex<r.gzhead.comment.length?255&r.gzhead.comment.charCodeAt(r.gzindex++):0,Yc(r,t)}while(0!==t);r.gzhead.hcrc&&r.pending>n&&(e.adler=ac(e.adler,r.pending_buf,r.pending-n,n))}r.status=103}if(103===r.status){if(r.gzhead.hcrc){if(r.pending+2>r.pending_buf_size&&(Hc(e),0!==r.pending))return r.last_flush=-1,yc;Yc(r,255&e.adler),Yc(r,e.adler>>8&255),e.adler=0}if(r.status=xc,Hc(e),0!==r.pending)return r.last_flush=-1,yc}if(0!==e.avail_in||0!==r.lookahead||t!==gc&&r.status!==jc){let n=0===r.level?zc(r,t):r.strategy===Sc?((e,t)=>{let r;for(;;){if(0===e.lookahead&&(Jc(e),0===e.lookahead)){if(t===gc)return 1;break}if(e.match_length=0,r=fc(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,r&&(qc(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,t===Ec?(qc(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(qc(e,!1),0===e.strm.avail_out)?1:2})(r,t):r.strategy===Ac?((e,t)=>{let r,n,i,o;const s=e.window;for(;;){if(e.lookahead<=Lc){if(Jc(e),e.lookahead<=Lc&&t===gc)return 1;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=3&&e.strstart>0&&(i=e.strstart-1,n=s[i],n===s[++i]&&n===s[++i]&&n===s[++i])){o=e.strstart+Lc;do{}while(n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&i<o);e.match_length=Lc-(o-i),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=3?(r=fc(e,1,e.match_length-3),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(r=fc(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),r&&(qc(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,t===Ec?(qc(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(qc(e,!1),0===e.strm.avail_out)?1:2})(r,t):ed[r.level].func(r,t);if(3!==n&&4!==n||(r.status=jc),1===n||3===n)return 0===e.avail_out&&(r.last_flush=-1),yc;if(2===n&&(t===_c?hc(r):t!==vc&&(dc(r,0,0,!1),t===bc&&(kc(r.head),0===r.lookahead&&(r.strstart=0,r.block_start=0,r.insert=0))),Hc(e),0===e.avail_out))return r.last_flush=-1,yc}return t!==Ec?yc:r.wrap<=0?mc:(2===r.wrap?(Yc(r,255&e.adler),Yc(r,e.adler>>8&255),Yc(r,e.adler>>16&255),Yc(r,e.adler>>24&255),Yc(r,255&e.total_in),Yc(r,e.total_in>>8&255),Yc(r,e.total_in>>16&255),Yc(r,e.total_in>>24&255)):(Kc(r,e.adler>>>16),Kc(r,65535&e.adler)),Hc(e),r.wrap>0&&(r.wrap=-r.wrap),0!==r.pending?yc:mc)},deflateEnd:e=>{if(rd(e))return Ic;const t=e.state.status;return e.state=null,t===xc?Vc(e,Tc):yc},deflateSetDictionary:(e,t)=>{let r=t.length;if(rd(e))return Ic;const n=e.state,i=n.wrap;if(2===i||1===i&&n.status!==Dc||n.lookahead)return Ic;if(1===i&&(e.adler=oc(e.adler,t,r,0)),n.wrap=0,r>=n.w_size){0===i&&(kc(n.head),n.strstart=0,n.block_start=0,n.insert=0);let e=new Uint8Array(n.w_size);e.set(t.subarray(r-n.w_size,r),0),t=e,r=n.w_size}const o=e.avail_in,s=e.next_in,a=e.input;for(e.avail_in=r,e.next_in=0,e.input=t,Jc(n);n.lookahead>=3;){let e=n.strstart,t=n.lookahead-2;do{n.ins_h=Bc(n,n.ins_h,n.window[e+3-1]),n.prev[e&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=e,e++}while(--t);n.strstart=e,n.lookahead=2,Jc(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=2,n.match_available=0,e.next_in=s,e.input=a,e.avail_in=o,n.wrap=i,yc},deflateInfo:"pako deflate (from Nodeca project)"};const ad=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var ud={assign:function(e){const t=Array.prototype.slice.call(arguments,1);for(;t.length;){const r=t.shift();if(r){if("object"!=typeof r)throw new TypeError(r+"must be non-object");for(const t in r)ad(r,t)&&(e[t]=r[t])}}return e},flattenChunks:e=>{let t=0;for(let r=0,n=e.length;r<n;r++)t+=e[r].length;const r=new Uint8Array(t);for(let t=0,n=0,i=e.length;t<i;t++){let i=e[t];r.set(i,n),n+=i.length}return r}};let ld=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(e){ld=!1}const cd=new Uint8Array(256);for(let e=0;e<256;e++)cd[e]=e>=252?6:e>=248?5:e>=240?4:e>=224?3:e>=192?2:1;cd[254]=cd[254]=1;var dd={string2buf:e=>{if("function"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(e);let t,r,n,i,o,s=e.length,a=0;for(i=0;i<s;i++)r=e.charCodeAt(i),55296==(64512&r)&&i+1<s&&(n=e.charCodeAt(i+1),56320==(64512&n)&&(r=65536+(r-55296<<10)+(n-56320),i++)),a+=r<128?1:r<2048?2:r<65536?3:4;for(t=new Uint8Array(a),o=0,i=0;o<a;i++)r=e.charCodeAt(i),55296==(64512&r)&&i+1<s&&(n=e.charCodeAt(i+1),56320==(64512&n)&&(r=65536+(r-55296<<10)+(n-56320),i++)),r<128?t[o++]=r:r<2048?(t[o++]=192|r>>>6,t[o++]=128|63&r):r<65536?(t[o++]=224|r>>>12,t[o++]=128|r>>>6&63,t[o++]=128|63&r):(t[o++]=240|r>>>18,t[o++]=128|r>>>12&63,t[o++]=128|r>>>6&63,t[o++]=128|63&r);return t},buf2string:(e,t)=>{const r=t||e.length;if("function"==typeof TextDecoder&&TextDecoder.prototype.decode)return(new TextDecoder).decode(e.subarray(0,t));let n,i;const o=new Array(2*r);for(i=0,n=0;n<r;){let t=e[n++];if(t<128){o[i++]=t;continue}let s=cd[t];if(s>4)o[i++]=65533,n+=s-1;else{for(t&=2===s?31:3===s?15:7;s>1&&n<r;)t=t<<6|63&e[n++],s--;s>1?o[i++]=65533:t<65536?o[i++]=t:(t-=65536,o[i++]=55296|t>>10&1023,o[i++]=56320|1023&t)}}return((e,t)=>{if(t<65534&&e.subarray&&ld)return String.fromCharCode.apply(null,e.length===t?e:e.subarray(0,t));let r="";for(let n=0;n<t;n++)r+=String.fromCharCode(e[n]);return r})(o,i)},utf8border:(e,t)=>{(t=t||e.length)>e.length&&(t=e.length);let r=t-1;for(;r>=0&&128==(192&e[r]);)r--;return r<0||0===r?t:r+cd[e[r]]>t?r:t}};var pd=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0};const fd=Object.prototype.toString,{Z_NO_FLUSH:hd,Z_SYNC_FLUSH:gd,Z_FULL_FLUSH:_d,Z_FINISH:bd,Z_OK:Ed,Z_STREAM_END:vd,Z_DEFAULT_COMPRESSION:yd,Z_DEFAULT_STRATEGY:md,Z_DEFLATED:Id}=lc;function Td(e){this.options=ud.assign({level:yd,method:Id,chunkSize:16384,windowBits:15,memLevel:8,strategy:md},e||{});let t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new pd,this.strm.avail_out=0;let r=sd.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(r!==Ed)throw new Error(uc[r]);if(t.header&&sd.deflateSetHeader(this.strm,t.header),t.dictionary){let e;if(e="string"==typeof t.dictionary?dd.string2buf(t.dictionary):"[object ArrayBuffer]"===fd.call(t.dictionary)?new Uint8Array(t.dictionary):t.dictionary,r=sd.deflateSetDictionary(this.strm,e),r!==Ed)throw new Error(uc[r]);this._dict_set=!0}}Td.prototype.push=function(e,t){const r=this.strm,n=this.options.chunkSize;let i,o;if(this.ended)return!1;for(o=t===~~t?t:!0===t?bd:hd,"string"==typeof e?r.input=dd.string2buf(e):"[object ArrayBuffer]"===fd.call(e)?r.input=new Uint8Array(e):r.input=e,r.next_in=0,r.avail_in=r.input.length;;)if(0===r.avail_out&&(r.output=new Uint8Array(n),r.next_out=0,r.avail_out=n),(o===gd||o===_d)&&r.avail_out<=6)this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;else{if(i=sd.deflate(r,o),i===vd)return r.next_out>0&&this.onData(r.output.subarray(0,r.next_out)),i=sd.deflateEnd(this.strm),this.onEnd(i),this.ended=!0,i===Ed;if(0!==r.avail_out){if(o>0&&r.next_out>0)this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;else if(0===r.avail_in)break}else this.onData(r.output)}return!0},Td.prototype.onData=function(e){this.chunks.push(e)},Td.prototype.onEnd=function(e){e===Ed&&(this.result=ud.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};const Rd=16209;var Cd=function(e,t){let r,n,i,o,s,a,u,l,c,d,p,f,h,g,_,b,E,v,y,m,I,T,R,C;const O=e.state;r=e.next_in,R=e.input,n=r+(e.avail_in-5),i=e.next_out,C=e.output,o=i-(t-e.avail_out),s=i+(e.avail_out-257),a=O.dmax,u=O.wsize,l=O.whave,c=O.wnext,d=O.window,p=O.hold,f=O.bits,h=O.lencode,g=O.distcode,_=(1<<O.lenbits)-1,b=(1<<O.distbits)-1;e:do{f<15&&(p+=R[r++]<<f,f+=8,p+=R[r++]<<f,f+=8),E=h[p&_];t:for(;;){if(v=E>>>24,p>>>=v,f-=v,v=E>>>16&255,0===v)C[i++]=65535&E;else{if(!(16&v)){if(64&v){if(32&v){O.mode=16191;break e}e.msg="invalid literal/length code",O.mode=Rd;break e}E=h[(65535&E)+(p&(1<<v)-1)];continue t}for(y=65535&E,v&=15,v&&(f<v&&(p+=R[r++]<<f,f+=8),y+=p&(1<<v)-1,p>>>=v,f-=v),f<15&&(p+=R[r++]<<f,f+=8,p+=R[r++]<<f,f+=8),E=g[p&b];;){if(v=E>>>24,p>>>=v,f-=v,v=E>>>16&255,16&v){if(m=65535&E,v&=15,f<v&&(p+=R[r++]<<f,f+=8,f<v&&(p+=R[r++]<<f,f+=8)),m+=p&(1<<v)-1,m>a){e.msg="invalid distance too far back",O.mode=Rd;break e}if(p>>>=v,f-=v,v=i-o,m>v){if(v=m-v,v>l&&O.sane){e.msg="invalid distance too far back",O.mode=Rd;break e}if(I=0,T=d,0===c){if(I+=u-v,v<y){y-=v;do{C[i++]=d[I++]}while(--v);I=i-m,T=C}}else if(c<v){if(I+=u+c-v,v-=c,v<y){y-=v;do{C[i++]=d[I++]}while(--v);if(I=0,c<y){v=c,y-=v;do{C[i++]=d[I++]}while(--v);I=i-m,T=C}}}else if(I+=c-v,v<y){y-=v;do{C[i++]=d[I++]}while(--v);I=i-m,T=C}for(;y>2;)C[i++]=T[I++],C[i++]=T[I++],C[i++]=T[I++],y-=3;y&&(C[i++]=T[I++],y>1&&(C[i++]=T[I++]))}else{I=i-m;do{C[i++]=C[I++],C[i++]=C[I++],C[i++]=C[I++],y-=3}while(y>2);y&&(C[i++]=C[I++],y>1&&(C[i++]=C[I++]))}break}if(64&v){e.msg="invalid distance code",O.mode=Rd;break e}E=g[(65535&E)+(p&(1<<v)-1)]}}break}}while(r<n&&i<s);y=f>>3,r-=y,f-=y<<3,p&=(1<<f)-1,e.next_in=r,e.next_out=i,e.avail_in=r<n?n-r+5:5-(r-n),e.avail_out=i<s?s-i+257:257-(i-s),O.hold=p,O.bits=f};const Od=15,Sd=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),Ad=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),Pd=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),Nd=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]);var wd=(e,t,r,n,i,o,s,a)=>{const u=a.bits;let l,c,d,p,f,h,g=0,_=0,b=0,E=0,v=0,y=0,m=0,I=0,T=0,R=0,C=null;const O=new Uint16Array(16),S=new Uint16Array(16);let A,P,N,w=null;for(g=0;g<=Od;g++)O[g]=0;for(_=0;_<n;_++)O[t[r+_]]++;for(v=u,E=Od;E>=1&&0===O[E];E--);if(v>E&&(v=E),0===E)return i[o++]=20971520,i[o++]=20971520,a.bits=1,0;for(b=1;b<E&&0===O[b];b++);for(v<b&&(v=b),I=1,g=1;g<=Od;g++)if(I<<=1,I-=O[g],I<0)return-1;if(I>0&&(0===e||1!==E))return-1;for(S[1]=0,g=1;g<Od;g++)S[g+1]=S[g]+O[g];for(_=0;_<n;_++)0!==t[r+_]&&(s[S[t[r+_]]++]=_);if(0===e?(C=w=s,h=20):1===e?(C=Sd,w=Ad,h=257):(C=Pd,w=Nd,h=0),R=0,_=0,g=b,f=o,y=v,m=0,d=-1,T=1<<v,p=T-1,1===e&&T>852||2===e&&T>592)return 1;for(;;){A=g-m,s[_]+1<h?(P=0,N=s[_]):s[_]>=h?(P=w[s[_]-h],N=C[s[_]-h]):(P=96,N=0),l=1<<g-m,c=1<<y,b=c;do{c-=l,i[f+(R>>m)+c]=A<<24|P<<16|N}while(0!==c);for(l=1<<g-1;R&l;)l>>=1;if(0!==l?(R&=l-1,R+=l):R=0,_++,0==--O[g]){if(g===E)break;g=t[r+s[_]]}if(g>v&&(R&p)!==d){for(0===m&&(m=v),f+=b,y=g-m,I=1<<y;y+m<E&&(I-=O[y+m],!(I<=0));)y++,I<<=1;if(T+=1<<y,1===e&&T>852||2===e&&T>592)return 1;d=R&p,i[d]=v<<24|y<<16|f-o}}return 0!==R&&(i[f+R]=g-m<<24|64<<16),a.bits=v,0};const{Z_FINISH:Md,Z_BLOCK:Ld,Z_TREES:Ud,Z_OK:Dd,Z_STREAM_END:xd,Z_NEED_DICT:Vd,Z_STREAM_ERROR:Gd,Z_DATA_ERROR:kd,Z_MEM_ERROR:Fd,Z_BUF_ERROR:Bd,Z_DEFLATED:Hd}=lc,qd=16180,Yd=16190,Kd=16191,Qd=16192,Wd=16194,Jd=16199,zd=16200,Zd=16206,Xd=16209,$d=e=>(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24);function ep(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const tp=e=>{if(!e)return 1;const t=e.state;return!t||t.strm!==e||t.mode<qd||t.mode>16211?1:0},rp=e=>{if(tp(e))return Gd;const t=e.state;return e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=qd,t.last=0,t.havedict=0,t.flags=-1,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new Int32Array(852),t.distcode=t.distdyn=new Int32Array(592),t.sane=1,t.back=-1,Dd},np=e=>{if(tp(e))return Gd;const t=e.state;return t.wsize=0,t.whave=0,t.wnext=0,rp(e)},ip=(e,t)=>{let r;if(tp(e))return Gd;const n=e.state;return t<0?(r=0,t=-t):(r=5+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?Gd:(null!==n.window&&n.wbits!==t&&(n.window=null),n.wrap=r,n.wbits=t,np(e))},op=(e,t)=>{if(!e)return Gd;const r=new ep;e.state=r,r.strm=e,r.window=null,r.mode=qd;const n=ip(e,t);return n!==Dd&&(e.state=null),n};let sp,ap,up=!0;const lp=e=>{if(up){sp=new Int32Array(512),ap=new Int32Array(32);let t=0;for(;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(wd(1,e.lens,0,288,sp,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;wd(2,e.lens,0,32,ap,0,e.work,{bits:5}),up=!1}e.lencode=sp,e.lenbits=9,e.distcode=ap,e.distbits=5},cp=(e,t,r,n)=>{let i;const o=e.state;return null===o.window&&(o.wsize=1<<o.wbits,o.wnext=0,o.whave=0,o.window=new Uint8Array(o.wsize)),n>=o.wsize?(o.window.set(t.subarray(r-o.wsize,r),0),o.wnext=0,o.whave=o.wsize):(i=o.wsize-o.wnext,i>n&&(i=n),o.window.set(t.subarray(r-n,r-n+i),o.wnext),(n-=i)?(o.window.set(t.subarray(r-n,r),0),o.wnext=n,o.whave=o.wsize):(o.wnext+=i,o.wnext===o.wsize&&(o.wnext=0),o.whave<o.wsize&&(o.whave+=i))),0};var dp={inflateReset:np,inflateReset2:ip,inflateResetKeep:rp,inflateInit:e=>op(e,15),inflateInit2:op,inflate:(e,t)=>{let r,n,i,o,s,a,u,l,c,d,p,f,h,g,_,b,E,v,y,m,I,T,R=0;const C=new Uint8Array(4);let O,S;const A=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(tp(e)||!e.output||!e.input&&0!==e.avail_in)return Gd;r=e.state,r.mode===Kd&&(r.mode=Qd),s=e.next_out,i=e.output,u=e.avail_out,o=e.next_in,n=e.input,a=e.avail_in,l=r.hold,c=r.bits,d=a,p=u,T=Dd;e:for(;;)switch(r.mode){case qd:if(0===r.wrap){r.mode=Qd;break}for(;c<16;){if(0===a)break e;a--,l+=n[o++]<<c,c+=8}if(2&r.wrap&&35615===l){0===r.wbits&&(r.wbits=15),r.check=0,C[0]=255&l,C[1]=l>>>8&255,r.check=ac(r.check,C,2,0),l=0,c=0,r.mode=16181;break}if(r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&l)<<8)+(l>>8))%31){e.msg="incorrect header check",r.mode=Xd;break}if((15&l)!==Hd){e.msg="unknown compression method",r.mode=Xd;break}if(l>>>=4,c-=4,I=8+(15&l),0===r.wbits&&(r.wbits=I),I>15||I>r.wbits){e.msg="invalid window size",r.mode=Xd;break}r.dmax=1<<r.wbits,r.flags=0,e.adler=r.check=1,r.mode=512&l?16189:Kd,l=0,c=0;break;case 16181:for(;c<16;){if(0===a)break e;a--,l+=n[o++]<<c,c+=8}if(r.flags=l,(255&r.flags)!==Hd){e.msg="unknown compression method",r.mode=Xd;break}if(57344&r.flags){e.msg="unknown header flags set",r.mode=Xd;break}r.head&&(r.head.text=l>>8&1),512&r.flags&&4&r.wrap&&(C[0]=255&l,C[1]=l>>>8&255,r.check=ac(r.check,C,2,0)),l=0,c=0,r.mode=16182;case 16182:for(;c<32;){if(0===a)break e;a--,l+=n[o++]<<c,c+=8}r.head&&(r.head.time=l),512&r.flags&&4&r.wrap&&(C[0]=255&l,C[1]=l>>>8&255,C[2]=l>>>16&255,C[3]=l>>>24&255,r.check=ac(r.check,C,4,0)),l=0,c=0,r.mode=16183;case 16183:for(;c<16;){if(0===a)break e;a--,l+=n[o++]<<c,c+=8}r.head&&(r.head.xflags=255&l,r.head.os=l>>8),512&r.flags&&4&r.wrap&&(C[0]=255&l,C[1]=l>>>8&255,r.check=ac(r.check,C,2,0)),l=0,c=0,r.mode=16184;case 16184:if(1024&r.flags){for(;c<16;){if(0===a)break e;a--,l+=n[o++]<<c,c+=8}r.length=l,r.head&&(r.head.extra_len=l),512&r.flags&&4&r.wrap&&(C[0]=255&l,C[1]=l>>>8&255,r.check=ac(r.check,C,2,0)),l=0,c=0}else r.head&&(r.head.extra=null);r.mode=16185;case 16185:if(1024&r.flags&&(f=r.length,f>a&&(f=a),f&&(r.head&&(I=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Uint8Array(r.head.extra_len)),r.head.extra.set(n.subarray(o,o+f),I)),512&r.flags&&4&r.wrap&&(r.check=ac(r.check,n,f,o)),a-=f,o+=f,r.length-=f),r.length))break e;r.length=0,r.mode=16186;case 16186:if(2048&r.flags){if(0===a)break e;f=0;do{I=n[o+f++],r.head&&I&&r.length<65536&&(r.head.name+=String.fromCharCode(I))}while(I&&f<a);if(512&r.flags&&4&r.wrap&&(r.check=ac(r.check,n,f,o)),a-=f,o+=f,I)break e}else r.head&&(r.head.name=null);r.length=0,r.mode=16187;case 16187:if(4096&r.flags){if(0===a)break e;f=0;do{I=n[o+f++],r.head&&I&&r.length<65536&&(r.head.comment+=String.fromCharCode(I))}while(I&&f<a);if(512&r.flags&&4&r.wrap&&(r.check=ac(r.check,n,f,o)),a-=f,o+=f,I)break e}else r.head&&(r.head.comment=null);r.mode=16188;case 16188:if(512&r.flags){for(;c<16;){if(0===a)break e;a--,l+=n[o++]<<c,c+=8}if(4&r.wrap&&l!==(65535&r.check)){e.msg="header crc mismatch",r.mode=Xd;break}l=0,c=0}r.head&&(r.head.hcrc=r.flags>>9&1,r.head.done=!0),e.adler=r.check=0,r.mode=Kd;break;case 16189:for(;c<32;){if(0===a)break e;a--,l+=n[o++]<<c,c+=8}e.adler=r.check=$d(l),l=0,c=0,r.mode=Yd;case Yd:if(0===r.havedict)return e.next_out=s,e.avail_out=u,e.next_in=o,e.avail_in=a,r.hold=l,r.bits=c,Vd;e.adler=r.check=1,r.mode=Kd;case Kd:if(t===Ld||t===Ud)break e;case Qd:if(r.last){l>>>=7&c,c-=7&c,r.mode=Zd;break}for(;c<3;){if(0===a)break e;a--,l+=n[o++]<<c,c+=8}switch(r.last=1&l,l>>>=1,c-=1,3&l){case 0:r.mode=16193;break;case 1:if(lp(r),r.mode=Jd,t===Ud){l>>>=2,c-=2;break e}break;case 2:r.mode=16196;break;case 3:e.msg="invalid block type",r.mode=Xd}l>>>=2,c-=2;break;case 16193:for(l>>>=7&c,c-=7&c;c<32;){if(0===a)break e;a--,l+=n[o++]<<c,c+=8}if((65535&l)!=(l>>>16^65535)){e.msg="invalid stored block lengths",r.mode=Xd;break}if(r.length=65535&l,l=0,c=0,r.mode=Wd,t===Ud)break e;case Wd:r.mode=16195;case 16195:if(f=r.length,f){if(f>a&&(f=a),f>u&&(f=u),0===f)break e;i.set(n.subarray(o,o+f),s),a-=f,o+=f,u-=f,s+=f,r.length-=f;break}r.mode=Kd;break;case 16196:for(;c<14;){if(0===a)break e;a--,l+=n[o++]<<c,c+=8}if(r.nlen=257+(31&l),l>>>=5,c-=5,r.ndist=1+(31&l),l>>>=5,c-=5,r.ncode=4+(15&l),l>>>=4,c-=4,r.nlen>286||r.ndist>30){e.msg="too many length or distance symbols",r.mode=Xd;break}r.have=0,r.mode=16197;case 16197:for(;r.have<r.ncode;){for(;c<3;){if(0===a)break e;a--,l+=n[o++]<<c,c+=8}r.lens[A[r.have++]]=7&l,l>>>=3,c-=3}for(;r.have<19;)r.lens[A[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,O={bits:r.lenbits},T=wd(0,r.lens,0,19,r.lencode,0,r.work,O),r.lenbits=O.bits,T){e.msg="invalid code lengths set",r.mode=Xd;break}r.have=0,r.mode=16198;case 16198:for(;r.have<r.nlen+r.ndist;){for(;R=r.lencode[l&(1<<r.lenbits)-1],_=R>>>24,b=R>>>16&255,E=65535&R,!(_<=c);){if(0===a)break e;a--,l+=n[o++]<<c,c+=8}if(E<16)l>>>=_,c-=_,r.lens[r.have++]=E;else{if(16===E){for(S=_+2;c<S;){if(0===a)break e;a--,l+=n[o++]<<c,c+=8}if(l>>>=_,c-=_,0===r.have){e.msg="invalid bit length repeat",r.mode=Xd;break}I=r.lens[r.have-1],f=3+(3&l),l>>>=2,c-=2}else if(17===E){for(S=_+3;c<S;){if(0===a)break e;a--,l+=n[o++]<<c,c+=8}l>>>=_,c-=_,I=0,f=3+(7&l),l>>>=3,c-=3}else{for(S=_+7;c<S;){if(0===a)break e;a--,l+=n[o++]<<c,c+=8}l>>>=_,c-=_,I=0,f=11+(127&l),l>>>=7,c-=7}if(r.have+f>r.nlen+r.ndist){e.msg="invalid bit length repeat",r.mode=Xd;break}for(;f--;)r.lens[r.have++]=I}}if(r.mode===Xd)break;if(0===r.lens[256]){e.msg="invalid code -- missing end-of-block",r.mode=Xd;break}if(r.lenbits=9,O={bits:r.lenbits},T=wd(1,r.lens,0,r.nlen,r.lencode,0,r.work,O),r.lenbits=O.bits,T){e.msg="invalid literal/lengths set",r.mode=Xd;break}if(r.distbits=6,r.distcode=r.distdyn,O={bits:r.distbits},T=wd(2,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,O),r.distbits=O.bits,T){e.msg="invalid distances set",r.mode=Xd;break}if(r.mode=Jd,t===Ud)break e;case Jd:r.mode=zd;case zd:if(a>=6&&u>=258){e.next_out=s,e.avail_out=u,e.next_in=o,e.avail_in=a,r.hold=l,r.bits=c,Cd(e,p),s=e.next_out,i=e.output,u=e.avail_out,o=e.next_in,n=e.input,a=e.avail_in,l=r.hold,c=r.bits,r.mode===Kd&&(r.back=-1);break}for(r.back=0;R=r.lencode[l&(1<<r.lenbits)-1],_=R>>>24,b=R>>>16&255,E=65535&R,!(_<=c);){if(0===a)break e;a--,l+=n[o++]<<c,c+=8}if(b&&!(240&b)){for(v=_,y=b,m=E;R=r.lencode[m+((l&(1<<v+y)-1)>>v)],_=R>>>24,b=R>>>16&255,E=65535&R,!(v+_<=c);){if(0===a)break e;a--,l+=n[o++]<<c,c+=8}l>>>=v,c-=v,r.back+=v}if(l>>>=_,c-=_,r.back+=_,r.length=E,0===b){r.mode=16205;break}if(32&b){r.back=-1,r.mode=Kd;break}if(64&b){e.msg="invalid literal/length code",r.mode=Xd;break}r.extra=15&b,r.mode=16201;case 16201:if(r.extra){for(S=r.extra;c<S;){if(0===a)break e;a--,l+=n[o++]<<c,c+=8}r.length+=l&(1<<r.extra)-1,l>>>=r.extra,c-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=16202;case 16202:for(;R=r.distcode[l&(1<<r.distbits)-1],_=R>>>24,b=R>>>16&255,E=65535&R,!(_<=c);){if(0===a)break e;a--,l+=n[o++]<<c,c+=8}if(!(240&b)){for(v=_,y=b,m=E;R=r.distcode[m+((l&(1<<v+y)-1)>>v)],_=R>>>24,b=R>>>16&255,E=65535&R,!(v+_<=c);){if(0===a)break e;a--,l+=n[o++]<<c,c+=8}l>>>=v,c-=v,r.back+=v}if(l>>>=_,c-=_,r.back+=_,64&b){e.msg="invalid distance code",r.mode=Xd;break}r.offset=E,r.extra=15&b,r.mode=16203;case 16203:if(r.extra){for(S=r.extra;c<S;){if(0===a)break e;a--,l+=n[o++]<<c,c+=8}r.offset+=l&(1<<r.extra)-1,l>>>=r.extra,c-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){e.msg="invalid distance too far back",r.mode=Xd;break}r.mode=16204;case 16204:if(0===u)break e;if(f=p-u,r.offset>f){if(f=r.offset-f,f>r.whave&&r.sane){e.msg="invalid distance too far back",r.mode=Xd;break}f>r.wnext?(f-=r.wnext,h=r.wsize-f):h=r.wnext-f,f>r.length&&(f=r.length),g=r.window}else g=i,h=s-r.offset,f=r.length;f>u&&(f=u),u-=f,r.length-=f;do{i[s++]=g[h++]}while(--f);0===r.length&&(r.mode=zd);break;case 16205:if(0===u)break e;i[s++]=r.length,u--,r.mode=zd;break;case Zd:if(r.wrap){for(;c<32;){if(0===a)break e;a--,l|=n[o++]<<c,c+=8}if(p-=u,e.total_out+=p,r.total+=p,4&r.wrap&&p&&(e.adler=r.check=r.flags?ac(r.check,i,p,s-p):oc(r.check,i,p,s-p)),p=u,4&r.wrap&&(r.flags?l:$d(l))!==r.check){e.msg="incorrect data check",r.mode=Xd;break}l=0,c=0}r.mode=16207;case 16207:if(r.wrap&&r.flags){for(;c<32;){if(0===a)break e;a--,l+=n[o++]<<c,c+=8}if(4&r.wrap&&l!==(4294967295&r.total)){e.msg="incorrect length check",r.mode=Xd;break}l=0,c=0}r.mode=16208;case 16208:T=xd;break e;case Xd:T=kd;break e;case 16210:return Fd;default:return Gd}return e.next_out=s,e.avail_out=u,e.next_in=o,e.avail_in=a,r.hold=l,r.bits=c,(r.wsize||p!==e.avail_out&&r.mode<Xd&&(r.mode<Zd||t!==Md))&&cp(e,e.output,e.next_out,p-e.avail_out),d-=e.avail_in,p-=e.avail_out,e.total_in+=d,e.total_out+=p,r.total+=p,4&r.wrap&&p&&(e.adler=r.check=r.flags?ac(r.check,i,p,e.next_out-p):oc(r.check,i,p,e.next_out-p)),e.data_type=r.bits+(r.last?64:0)+(r.mode===Kd?128:0)+(r.mode===Jd||r.mode===Wd?256:0),(0===d&&0===p||t===Md)&&T===Dd&&(T=Bd),T},inflateEnd:e=>{if(tp(e))return Gd;let t=e.state;return t.window&&(t.window=null),e.state=null,Dd},inflateGetHeader:(e,t)=>{if(tp(e))return Gd;const r=e.state;return 2&r.wrap?(r.head=t,t.done=!1,Dd):Gd},inflateSetDictionary:(e,t)=>{const r=t.length;let n,i,o;return tp(e)?Gd:(n=e.state,0!==n.wrap&&n.mode!==Yd?Gd:n.mode===Yd&&(i=1,i=oc(i,t,r,0),i!==n.check)?kd:(o=cp(e,t,r,r),o?(n.mode=16210,Fd):(n.havedict=1,Dd)))},inflateInfo:"pako inflate (from Nodeca project)"};var pp=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1};const fp=Object.prototype.toString,{Z_NO_FLUSH:hp,Z_FINISH:gp,Z_OK:_p,Z_STREAM_END:bp,Z_NEED_DICT:Ep,Z_STREAM_ERROR:vp,Z_DATA_ERROR:yp,Z_MEM_ERROR:mp}=lc;function Ip(e){this.options=ud.assign({chunkSize:65536,windowBits:15,to:""},e||{});const t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits&&(t.windowBits=-15)),!(t.windowBits>=0&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&(15&t.windowBits||(t.windowBits|=15)),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new pd,this.strm.avail_out=0;let r=dp.inflateInit2(this.strm,t.windowBits);if(r!==_p)throw new Error(uc[r]);if(this.header=new pp,dp.inflateGetHeader(this.strm,this.header),t.dictionary&&("string"==typeof t.dictionary?t.dictionary=dd.string2buf(t.dictionary):"[object ArrayBuffer]"===fp.call(t.dictionary)&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(r=dp.inflateSetDictionary(this.strm,t.dictionary),r!==_p)))throw new Error(uc[r])}function Tp(e,t){const r=new Ip(t);if(r.push(e),r.err)throw r.msg||uc[r.err];return r.result}Ip.prototype.push=function(e,t){const r=this.strm,n=this.options.chunkSize,i=this.options.dictionary;let o,s,a;if(this.ended)return!1;for(s=t===~~t?t:!0===t?gp:hp,"[object ArrayBuffer]"===fp.call(e)?r.input=new Uint8Array(e):r.input=e,r.next_in=0,r.avail_in=r.input.length;;){for(0===r.avail_out&&(r.output=new Uint8Array(n),r.next_out=0,r.avail_out=n),o=dp.inflate(r,s),o===Ep&&i&&(o=dp.inflateSetDictionary(r,i),o===_p?o=dp.inflate(r,s):o===yp&&(o=Ep));r.avail_in>0&&o===bp&&r.state.wrap>0&&0!==e[r.next_in];)dp.inflateReset(r),o=dp.inflate(r,s);switch(o){case vp:case yp:case Ep:case mp:return this.onEnd(o),this.ended=!0,!1}if(a=r.avail_out,r.next_out&&(0===r.avail_out||o===bp))if("string"===this.options.to){let e=dd.utf8border(r.output,r.next_out),t=r.next_out-e,i=dd.buf2string(r.output,e);r.next_out=t,r.avail_out=n-t,t&&r.output.set(r.output.subarray(e,e+t),0),this.onData(i)}else this.onData(r.output.length===r.next_out?r.output:r.output.subarray(0,r.next_out));if(o!==_p||0!==a){if(o===bp)return o=dp.inflateEnd(this.strm),this.onEnd(o),this.ended=!0,!0;if(0===r.avail_in)break}}return!0},Ip.prototype.onData=function(e){this.chunks.push(e)},Ip.prototype.onEnd=function(e){e===_p&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=ud.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};var Rp={Inflate:Ip,inflate:Tp,inflateRaw:function(e,t){return(t=t||{}).raw=!0,Tp(e,t)},ungzip:Tp,constants:lc};const{Inflate:Cp,inflate:Op,inflateRaw:Sp,ungzip:Ap}=Rp;var Pp,Np,wp,Mp,Lp=Ap,Up=((Pp={})[Wn]=exports.ErrorCode.RC_DISCONN_KICK,Pp[Jn]=exports.ErrorCode.RC_DISCONN_EXCEPTION,Pp[Zn]=exports.ErrorCode.RC_DISCONN_EXCEPTION,Pp[Xn]=exports.ErrorCode.RC_CONN_REDIRECTED,Pp[$n]=exports.ErrorCode.RC_CONN_TOKEN_EXPIRED,Pp[ei]=exports.ErrorCode.RC_CONN_PROTO_VERSION_ERROR,Pp[ti]=exports.ErrorCode.RC_ACCOUNT_CANCELLATION,Pp),Dp=((Np={})[Sn]=exports.ErrorCode.SUCCESS,Np[An]=exports.ErrorCode.RC_CONN_PROTO_VERSION_ERROR,Np[Pn]=exports.ErrorCode.RC_CONN_IDENTIFIER_REJECTED,Np[Nn]=exports.ErrorCode.RC_CONN_SERVER_UNAVAILABLE,Np[wn]=exports.ErrorCode.RC_CONN_TOKEN_INCORRECT,Np[Mn]=exports.ErrorCode.RC_CONN_NOT_AUTHRORIZED,Np[Ln]=exports.ErrorCode.RC_CONN_REDIRECTED,Np[Un]=exports.ErrorCode.RC_CONN_PACKAGE_NAME_INVALID,Np[Dn]=exports.ErrorCode.RC_CONN_APP_BLOCKED_OR_DELETED,Np[xn]=exports.ErrorCode.RC_CONN_USER_BLOCKED,Np[jn]=exports.ErrorCode.RC_CONN_TOKEN_EXPIRED,Np[Vn]=exports.ErrorCode.RC_CONN_DEVICE_ERROR,Np[Gn]=exports.ErrorCode.RC_CONN_HOSTNAME_ERROR,Np[kn]=exports.ErrorCode.RC_DISCONN_SAME_CLIENT_ON_LINE,Np[Fn]=exports.ErrorCode.RC_LISCENSE_COUNT_OUT_OF_LIMIT,Np[Bn]=exports.ErrorCode.RC_CONN_WRONG_CLUSTER,Np[Hn]=exports.ErrorCode.RC_APP_AUTH_NOT_PASS,Np[qn]=exports.ErrorCode.RC_OTP_USED,Np[Yn]=exports.ErrorCode.RC_PLATFORM_ERROR,Np[Kn]=exports.ErrorCode.RC_ACCOUNT_CANCELLATION,Np[Qn]=exports.ErrorCode.RC_LICENSE_EXPIRED,Np),xp=function(e){return[Zr.ppMsgS,Zr.pgMsgS,Zr.chatMsgS,Zr.prMsgS].includes(e)},jp=function(e,t){var r=0;return e.isAutoDelete&&(r|=1),e.isOverwrite&&(r|=2),2===t&&(r|=4),r},Vp={1:"ChannelsUserInfos",2:"ChannelsInviteStatusInfos",3:"ChannelsJoinedInfos",11:"FriendUserInfos",12:"FriendInviteInfos"},Gp=((wp={})[M.GROUP_OPERATION]=function(e){return"ChannelEventData"},wp[M.GROUP_PROFILE_CHANGE]=function(e){return"ChannelEventData"},wp[v.FRIEND_APPLICATION]=function(e){return{0:"FriendApplyEvent",1:"FriendApplyEvent",2:"FriendUserInfo",3:"FriendsInput",5:"FriendTypeChangeEvent",6:"FriendUpdateEvent"}[e]},wp),kp=function(){function e(e){Object.defineProperty(this,"logger",{enumerable:!0,configurable:!0,writable:!0,value:e})}return Object.defineProperty(e.prototype,"decodeByPBName",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n,i=this,o=e,s=((n={})[Fo]=i._formatHistoryMessages,n[Lo]=i._formatConversationList,n[Go]=i._formatChatRoomInfos,n[es]=i._formatChatRoomKVList,n[ms]=i._formatGrpReadReceiptQryResp,n[qs]=i._formatQueryReceiptResp,n[xs]=i._formatUltraOperateStatusNotifyList,n[Us]=i._formatUltraMsgList,n[Do]=i._formatUltraGroupUnreadMentionedList,n[Po]=i._formatChrmKVVersion,n[ba]=i._formateChannelsListResult,n)[t];try{o=e.length>0&&Za.decode(t,e),Nt(s)&&(o=s.call(this,o,r))}catch(e){this.logger.error(H.L_PB_DECODE_E,t)}return o}}),Object.defineProperty(e.prototype,"_formatJSONContent",{enumerable:!1,configurable:!0,writable:!0,value:function(e){try{return JSON.parse(e)}catch(t){return this.logger.error(H.L_PARSE_JSON_E,e),e}}}),Object.defineProperty(e.prototype,"_getUtfContent",{enumerable:!1,configurable:!0,writable:!0,value:function(e){if(e.user){var t=e.user,r=t.portrait,n=t.portraitUri,i=r||n;i&&(e.user.portrait=e.user.portraitUri=i)}return e}}),Object.defineProperty(e.prototype,"_setExpansion",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t;return e&&(t=function(e){var t={},r=JSON.parse(e);return ou(r,(function(e,r){t[r]=e.v})),t}(e)),t}}),Object.defineProperty(e.prototype,"_formatReceivedMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){if(!e)return e;var r=this,n=t||{},i=n.currentUserId,o=n.connectedTime,s=n.afterDecode,a=e.content,u=e.fromUserId,l=e.type,c=e.groupId,d=e.status,p=e.dataTime,f=e.extraContent,h=e.extStatus,g=e.clientUniqueId,_=e.busChannel,b=e.msgId,E=e.classname,v=e.toUserIds,y=e.optionBits,m=e.direction||exports.MessageDirection.RECEIVE,I=function(e){var t=exports.ReceivedStatus.READ;return{isPersited:!!(16&e),isCounted:!!(32&e),isMentioned:!!(64&e),disableNotification:!!(512&e),receivedStatus:t=2&e?exports.ReceivedStatus.RETRIEVED:t,canIncludeExpansion:!!(1024&e)}}(d),T=I.isPersited,R=I.isCounted,C=I.isMentioned,O=I.disableNotification,S=I.receivedStatus,A=I.canIncludeExpansion,P=!!(2&(h||0)),N=!!(4&(h||0)),w=!!(64&(h||0)),M=!!(8&(h||0))?exports.UltraGroupChannelType.PRIVATE:exports.UltraGroupChannelType.PUBLIC,L=[exports.ConversationType.GROUP,exports.ConversationType.CHATROOM,exports.ConversationType.RTC_ROOM,exports.ConversationType.ULTRA_GROUP].indexOf(l)>-1?c:u,U=u,D=exports.MessageDirection.RECEIVE;m===exports.MessageDirection.SEND&&(U=i,D=exports.MessageDirection.SEND);var x=kt(p),j=x<o,V=l===exports.ConversationType.CHATROOM,G=r._setExpansion(f),k=r._formatJSONContent(a);k=r._getUtfContent(k);var F=or(e.configFlag,e.pushContent,e.pushExt);V&&u===i&&(D=exports.MessageDirection.SEND);var B={conversationType:l,targetId:L,senderUserId:U,messageType:E,messageUId:b,isPersited:T,isCounted:R,isMentioned:C,sentTime:x,messageDirection:D,receivedTime:Date.now(),disableNotification:O,receivedStatus:S,receivedStatusInfo:Bt(S),canIncludeExpansion:A,content:k,expansion:G,pushConfig:F,channelId:_||"",isInterrupt:P,isModifyMessage:N,messageId:kt(g)||0,sentStatus:exports.SentStatus.SENT,isOffLineMessage:j,channelType:M,isStatusMessage:w,readReceiptInfo:void 0,directedUserIds:v,disableUpdateLastMessage:!!(1&(y||0)),needReceipt:!!(2&(y||0)),sendReceipt:!!(4&(y||0))||void 0};return(null==s?void 0:s(B))||B}}),Object.defineProperty(e.prototype,"_formatHistoryMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this,n=e.list,i=e.hasMsg,o=e.compressedData;if(e.compressioEnabled){var s=Lp(o),a=Za.decode(Fo,s);return this._formatHistoryMessages(a,t)}var u=t.conversation||{},l=u.targetId,c=kt(e.syncTime),d=[];return ou(n,(function(e){var n=r._formatReceivedMessage(e,t);u.conversationType===exports.ConversationType.ULTRA_GROUP?n.targetId=e.groupId||u.targetId:n.targetId=l,d.push(n)}),{isReverse:!0}),{syncTime:c,list:d,hasMore:!!i}}}),Object.defineProperty(e.prototype,"formatEventChangeList",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;return e.map((function(e){var r,n=e.businessId,i=e.time,o=e.changeType,s=e.originalId,a=e.originalTime,u=e.secondaryId,l=e.isAdmin,c=e.additionalMark,d=e.operatorId,p=e.subChangeType,f=e.secondaryType,h=e.remindType,g=e.isRemindMe,_=e.extIds,b=e.eventData;return b&&(r=t._formatEventData(b,o,p)),{businessId:n,changeType:o,originalId:s,time:kt(i),originalTime:kt(a),secondaryId:u||"",isAdmin:l,additionalMark:c,operatorId:d,subChangeType:p,userGroupIds:_,secondaryType:f,remindType:h,isRemindMe:g,eventData:r}}))}}),Object.defineProperty(e.prototype,"_formatEventData",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n={};return e&&Gp[t]&&Gp[t](r)&&(n=Za.decode(Gp[t](r),e)||{}),n}}),Object.defineProperty(e.prototype,"_formatUltraOperateStatusNotifyList",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.type,r=e.notifyType,n=e.info,i=e.summary,o=[],s=[],a=!(2&~r),u=!(1&~r);return u&&Array.isArray(n)&&n.forEach((function(e){var t=e.targetId,r=e.busChannel,n=e.userId,i=e.opType,s=e.optime,a=kt(s);o.push({targetId:t,channelId:r,userId:n,operationType:i,operationTime:a})})),a&&Array.isArray(i)&&i.forEach((function(e){var t=e.targetId,r=e.busChannel,n=e.count,i=e.opType;s.push({targetId:t,channelId:r,count:n,operationType:i})})),{conversationType:t,info:o,summary:s,hasInfo:u,hasSummary:a}}}),Object.defineProperty(e.prototype,"_formatUltraMsgList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this,n=e.list;return{list:n&&n.map((function(e){return r._formatReceivedMessage(e,t)}))}}}),Object.defineProperty(e.prototype,"_formatUltraGroupUnreadMentionedList",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.msgInfo;return(void 0===t?[]:t).map((function(e){return{messageUId:e.msgId,sentTime:kt(e.msgTime),mentionedType:e.remindType,messageType:e.className||""}}))}}),Object.defineProperty(e.prototype,"_getUltraGroupConversationInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=t.versionTime,n=t.unreadCount,i=t.remindCount,o=t.busChannelType,s=t.msgInfo,a=t.remindMeCount;return e.versionTime=kt(r)||0,e.unreadMessageCount=this._getUnreadCount(kt(n)||0),e.unreadMentionedCount=this._getUnreadCount(kt(i)||0),e.unreadMentionedMeCount=this._getUnreadCount(kt(a)||0),e.channelType=o||exports.UltraGroupChannelType.PUBLIC,e.lastReadTime=0,s&&(e.firstUnreadMessage={sentTime:kt(s.msgTime)},e.lastReadTime=kt(s.msgTime)-1),e}}),Object.defineProperty(e.prototype,"_getUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return e>999?999:e}}),Object.defineProperty(e.prototype,"_formatConversationList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this,n=this,i=e.info,o=e.compressedData;if(e.compressioEnabled){var s=Lp(o),a=Za.decode(Lo,s);return this._formatConversationList(a,t)}var u=t.afterDecode,l={list:(i=su(i,(function(e){var i=e.msg,o=e.userId,s=e.type,a=e.unreadCount,l=e.busChannel,c=e.versionTime,d=null;i&&((d=n._formatReceivedMessage(i,t)).targetId=o);var p={targetId:o,conversationType:s,unreadMessageCount:kt(a)||0,latestMessage:d,channelId:l||"",operationTime:kt(c)||0};return s===exports.ConversationType.ULTRA_GROUP&&(p=r._getUltraGroupConversationInfo(p,e)),(null==u?void 0:u(p))||p})))||[]};return((null==t?void 0:t.conversationType)||exports.ConversationType.NONE)===exports.ConversationType.ULTRA_GROUP&&(l.isFinished=e.isFinished),l}}),Object.defineProperty(e.prototype,"_formatChatRoomInfos",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.userTotalNums,r=e.userInfos;return{userCount:t,userInfos:su(r,(function(e){var t=e.id,r=e.time;return{id:t,time:kt(r)}}))}}}),Object.defineProperty(e.prototype,"_formatChatRoomKVList",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.entries,r=e.bFullUpdate,n=e.syncTime,i=e.compressedData;if(e.compressioEnabled){var o=Lp(i),s=Za.decode(es,o);return this._formatChatRoomKVList(s)}return t=su(t=t||[],(function(e){var t=e.key,r=e.value,n=e.status,i=e.timestamp,o=e.uid,s=e.version,a=function(e){return{isAutoDelete:!!(1&e),isOverwrite:!!(2&e),type:4&e?exports.ChatroomEntryType.DELETE:exports.ChatroomEntryType.UPDATE}}(n);return{key:t,value:r,isAutoDelete:a.isAutoDelete,isOverwrite:a.isOverwrite,type:a.type,userId:o,timestamp:kt(i),version:kt(s)}})),{kvEntries:t,isFullUpdate:r,syncTime:n}}}),Object.defineProperty(e.prototype,"_formatGrpReadReceiptQryResp",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.totalMemberNum,r=e.list;return r.forEach((function(e){e.readTime=kt(e.readTime)})),{totalMemberCount:t,list:r}}}),Object.defineProperty(e.prototype,"_formatQueryReceiptResp",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.list,r=void 0===t?[]:t,n=e.num,i=e.readCnt;return{list:r.map((function(e){return{readTime:kt(e.receiptTime),userId:e.userId}})),totalCount:n,readCount:i}}}),Object.defineProperty(e.prototype,"_formatChrmKVVersion",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.joinTime,r=e.createTime,n=e.memberCount,i=e.chatroomBanState;return{joinTime:t,createTime:r||0,memberCount:n||0,isAllChatroomBanned:!!(1&i),isCurrentUserBanned:!!(2&i),isCurrentChatroomBanned:!!(4&i),isCurrentChatroomInWhitelist:!!(1&e.whiteListState)}}}),Object.defineProperty(e.prototype,"_formateChannelsListResult",{enumerable:!1,configurable:!0,writable:!0,value:function(e){if(!e)return{result:{list:[]}};var t=e.listType,r=e.result,n=e.page;return r?{listType:t,result:Za.decode(Vp[t],r)||[],page:n}:{listType:t,result:{list:[]},page:n}}}),Object.defineProperty(e.prototype,"_calculateFlag",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.isFilerWhiteBlacklist,r=e.isVoipPush,n=e.pushConfig||{},i=0;return i|=r?1:0,i|=t?2:0,i|=n.disablePushTitle?4:0,i|=n.forceShowDetailContent?8:0}}),Object.defineProperty(e.prototype,"_getPushExtraModule",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.pushTitle,r=e.iOSConfig,n=e.androidConfig,i=e.templateId,o=void 0===i?"":i,s=e.harmonyOSConfig,a=Za.getModule(yo);if(t&&a.setTitle(t),r||n||s){var u=function(e,t,r){void 0===e&&(e={}),void 0===t&&(t={}),void 0===r&&(r={});var n=t.channelIdMi,i=t.channelIdHW,o=t.channelIdOPPO,s=t.typeVivo,a=t.importanceHW,u=t.categoryHW,l=t.imageUrlHW,c=t.categoryVivo,d=t.importanceHonor,p=t.imageUrlHonor,f=function(e,t){void 0===e&&(e={}),void 0===t&&(t={});var r=e.threadId,n=e.apnsCollapseId,i=e.category,o=e.richMediaUri,s=e.interruptionLevel,a=t.googleConfig,u={};u["thread-id"]=r||"",u["apns-collapse-id"]=n||"",u.category=i||"",u.richMediaUri=o||"",u["interruption-level"]=s||"active";var l={};l.collapse_key=null==a?void 0:a.collapseKey,l.imageUrl=null==a?void 0:a.imageUrl;var c=null==a?void 0:a.priority;return c&&!["high","normal"].includes(c)&&(c="normal"),l.priority=c,{APNS:u,FCM:l}}(e,t),h=[{HW:{channelId:i||"",importance:a||"NORMAL",image:l||"",category:u||""}},{MI:{channelId:n||""}},{OPPO:{channelId:o||""}},{VIVO:{classification:s||"",category:c||""}},{APNS:f.APNS},{FCM:f.FCM},{HONOR:{importance:d||exports.PushImportanceHonor.NORMAL,image:p||""}},{OHOS:{category:r.category||null,image:r.image||""}}];return JSON.stringify(h)}(r,n,s);a.setPushConfigs(u)}return(null==n?void 0:n.notificationId)&&a.setPushId(null==n?void 0:n.notificationId),a.setTemplateId(o),a}}),Object.defineProperty(e.prototype,"_getUpMsgModule",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=t.messageType,n=t.content,i=t.directionalUserIdList,o=t.canIncludeExpansion,s=t.expansion,a=t.pushConfig,u=t.channelId,l=t.pushData,c=void 0===l?"":l,d=t.pushContent,p=void 0===d?"":d,f=t.messageId,h=void 0===f?0:f,g=t.disableUpdateLastMessage,_=void 0!==g&&g,b=t.isPersited,E=t.needReceipt,v=e.conversationType,y=e.targetId,m=Za.getModule(vo),I=function(e){var t=e.isStatusMessage,r=e.isPersited,n=e.isCounted;t&&(r=n=!1);var i=0;return r&&(i|=1),n&&(i|=2),e.isMentioned&&(i|=4),e.disableNotification&&(i|=32),e.canIncludeExpansion&&(i|=64),i}(t),T=a||{},R=T.pushContent,C=void 0===R?p:R,O=T.pushData,S=void 0===O?c:O;m.setSessionId(I),C&&m.setPushText(C),S&&m.setAppData(S),i&&m.setToUserIds(i);var A=this._calculateFlag(t);if(m.setConfigFlag(A),m.setClassname(r),n.user&&n.user.portraitUri&&(n.user.portrait=n.user.portraitUri),m.setContent(JSON.stringify(n)),o&&s){var P={};ou(s,(function(e,t){P[t]={v:e}})),m.setExtraContent(JSON.stringify(P))}if(a){var N=this._getPushExtraModule(a);m.setPushExt(N)}m.setClientUniqueId(h),m.setIsResend(h>0),wt(u)||m.setBusChannel(u),v===exports.ConversationType.SYSTEM&&m.setSystemId(y);var w=0;return b&&_&&(w|=1),E&&(w|=2),m.setOptionBits(w),m}}),Object.defineProperty(e.prototype,"encodeUpMsg",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return this._getUpMsgModule(e,t).toArrayBuffer()}}),Object.defineProperty(e.prototype,"encodeGetHistoryMsg",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=t.count,n=t.order,i=t.timestamp,o=t.channelId,s=Za.getModule(ko);return s.setTargetId(e),s.setTime(i),s.setCount(r),s.setOrder(n),s.setBusChannel(o||""),s.setCompressioEnabled(Zu.enable()),s.toArrayBuffer()}}),Object.defineProperty(e.prototype,"encodeOldConversationList",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=(e=e||{}).count,r=e.type,n=e.startTime,i=e.order;t=t||0,n=n||0,i=i||0;var o=Za.getModule(wo);return o.setType(r),o.setCount(t),o.setStartTime(n),o.setOrder(i),o.setCompressioEnabled(Zu.enable()),o.toArrayBuffer()}}),Object.defineProperty(e.prototype,"encodeBatchDeleteConversation",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=Za.getModule(Jo),r=[];return e.forEach((function(e){var t=e.conversationType,n=e.targetId,i=e.channelId,o=Za.getModule(zo);o.setConversationType(t),o.setConversationId(n),o.setBusChannel(i||""),r.push(o)})),t.setRelation(r),t.toArrayBuffer()}}),Object.defineProperty(e.prototype,"_encodeSessions",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return e.map((function(e){var t=e.conversationType,r=e.targetId,n=Za.getModule(Ko);return n.setType(t),n.setChannelId(r),n}))}}),Object.defineProperty(e.prototype,"encodeRemoveConversationList",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=Za.getModule(Yo);return t.setSessions(this._encodeSessions(e)),t.toArrayBuffer()}}),Object.defineProperty(e.prototype,"encodeBatchClearRemoteMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=Za.getModule(jo),r=e.map((function(e){var t=Za.getModule(xo);return t.setTargetId(e.targetId),t.setConversationType(e.conversationType),t.setBusChannel(e.channelId),t.setDataTime(e.timestamp),t}));return t.setInput(r),t.toArrayBuffer()}}),Object.defineProperty(e.prototype,"encodeExpandUltraMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=e.targetId,n=e.conversationType,i=e.channelId,o=e.messageUId,s=e.sendTime,a=e.keys,u={mid:o,put:e.expansion,del:a,clear:e.removeAll?1:0},l=Za.getModule(Ps);return l.setFromUserId(t),l.setTargetId(r),l.setType(n),l.setBusChannel(i||""),l.setMsgUID(o),l.setMsgTime(s),l.setContent(JSON.stringify(u)),l.toArrayBuffer()}}),Object.defineProperty(e.prototype,"encodemodifyMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=e.targetId,n=e.conversationType,i=e.channelId,o=e.messageUId,s=e.sendTime,a=e.content,u=Za.getModule(Ps);return u.setFromUserId(t),u.setTargetId(r),u.setType(n),u.setBusChannel(i||""),u.setMsgUID(o),u.setMsgTime(s),u.setContent(JSON.stringify(a)),u.toArrayBuffer()}}),Object.defineProperty(e.prototype,"encodeQueryMsgChange",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=Za.getModule(Ns);return t.setSyncTime(e),t.toArrayBuffer()}}),Object.defineProperty(e.prototype,"encodeMsgQuery",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.targetId,r=e.conversationType,n=e.messages,i=Za.getModule(Ls),o=n.map((function(e){return{msgTime:e.sendTime,msgUID:e.messageUId,busChannel:e.channelId}}));return i.setTargetId(t),i.setType(r),i.setQuery(o),i.toArrayBuffer()}}),Object.defineProperty(e.prototype,"encodeUnreadMentionedMsgQuery",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.targetId,r=e.channelId,n=e.sentTime,i=e.count,o=Za.getModule(Uo);return o.setGroupId(t),o.setBusChannel(r),o.setMsgTime(n),o.setSize(i),o.toArrayBuffer()}}),Object.defineProperty(e.prototype,"encodeOperateStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){var i=Za.getModule(Ds);return i.setTargetId(e),i.setType(t),i.setBusChannel(r),i.setOpType(n),i.toArrayBuffer()}}),Object.defineProperty(e.prototype,"encodeSetUltraGroupDefaultNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=Za.getModule(ps);return r.setUnpushLevel(e),r.setBusChannel(t),r.toArrayBuffer()}}),Object.defineProperty(e.prototype,"encodeGetUltraGroupDefaultNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=Za.getModule(ds);return t.setBusChannel(e),t.toArrayBuffer()}}),Object.defineProperty(e.prototype,"encodeModifyChatRoomKV",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n=Za.getModule(Xo),i=t.key,o=t.value,s=t.notificationExtra,a=t.isSendNotification,u=t.type,l=t.timestamp,c=u||exports.ChatroomEntryType.UPDATE,d=jp(t,c),p={key:i,value:o||"",uid:r,version:l};if(wt(d)||(p.status=d),n.setEntry(p),a){var f={conversationType:exports.ConversationType.CHATROOM,targetId:e},h={key:i,value:o,extra:s,type:c},g=this._getUpMsgModule(f,{messageType:exports.MessageType.CHRM_KV_NOTIFY,content:h,isPersited:!1,isCounted:!1});n.setNotification(g),n.setBNotify(!0),n.setType(exports.ConversationType.CHATROOM)}return n.toArrayBuffer()}}),Object.defineProperty(e.prototype,"encodeModifyChatRoomKVS",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n=Za.getModule($o),i=t.entries,o=t.type||exports.ChatroomEntryType.UPDATE,s=jp(t,o),a=[];return i.forEach((function(e){var t={key:e.key,value:e.value||"",uid:r,version:e.timestamp};wt(s)||(t.status=s),a.push(t)})),n.setEntry(a),n.toArrayBuffer()}}),Object.defineProperty(e.prototype,"encodePullChatRoomKV",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return Za.encode(rs,{timestamp:e,compressioEnabled:Zu.enable()})}}),Object.defineProperty(e.prototype,"encodeReadReceipt",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=Za.getModule(bs);return r.setMsgId(e),t&&r.setChannelId(t),r.toArrayBuffer()}}),Object.defineProperty(e.prototype,"encodeCreateTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=Za.getModule(Is),n=[];return e.forEach((function(e){var t=Za.getModule(Ts);t.setTagId(e.tagId),t.setName(e.tagName),n.push(t)})),r.setTags(n),r.setVersion(t),r.toArrayBuffer()}}),Object.defineProperty(e.prototype,"encodeMessageReader",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=Za.getModule(bs);return r.setMsgId(e),t&&r.setChannelId(t),r.toArrayBuffer()}}),Object.defineProperty(e.prototype,"encodeReadReceiptMsg",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n=Za.getModule(Bs),i=e.conversationType,o=e.targetId,s=e.channelId,a=void 0===s?"":s;return n.setType(i),n.setTargetId(o),n.setBusChannel(a),n.setStartMsgId(t),n.setEndMsgId(r),n.toArrayBuffer()}}),Object.defineProperty(e.prototype,"encodeReceiptQryReq",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=Za.getModule(Hs),n=e.targetId,i=e.channelId,o=void 0===i?"":i;return r.setTargetId(n),r.setBusChannel(o),r.setMsgId(t),r.toArrayBuffer()}}),Object.defineProperty(e.prototype,"encodeReceiptCntQryReq",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=Za.getModule(Ys),n=e.targetId,i=e.conversationType,o=e.channelId,s=void 0===o?"":o;return r.setChannelId(n),r.setBusChannel(s),r.setType(i),r.setMsgId(t),r.toArrayBuffer()}}),Object.defineProperty(e.prototype,"encodeRemoveTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=Za.getModule(Rs),n=[];return e.forEach((function(e){var t=Za.getModule(Ts);t.setTagId(e),n.push(t)})),r.setTags(n),r.setVersion(t),r.toArrayBuffer()}}),Object.defineProperty(e.prototype,"encodeUpdateConversationTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n=Za.getModule(cs),i=[];return t.forEach((function(t){var r=Za.getModule(us),n=Za.getModule(ls),o=[];e.forEach((function(e){var t=Za.getModule(Ts);t.setTagId(e.tagId),wt(e.isTop)||t.setIsTop(e.isTop),o.push(t)})),n.setSessionStateType(3),n.setValue(JSON.stringify(o)),n.setTags(o),r.setType(t.conversationType),r.setChannelId(t.targetId),r.setTime(Date.now()),r.setStateItem([n]),i.push(r)})),n.setState(i),n.setVersion(r),n.toArrayBuffer()}}),Object.defineProperty(e.prototype,"encodeUpdateUserSubReq",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){var i=Za.getModule(Qs);i.setSubType(e),i.setOpType(r),i.setExpiry(n);var o=[];return t.forEach((function(e){var t=Za.getModule(Ws);t.setSubUserId(e),o.push(t)})),i.setSubUsers(o),i.toArrayBuffer()}}),Object.defineProperty(e.prototype,"encodePullUserSubReq",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.version,r=e.pageToken,n=Za.getModule(zs);return n.setVersion(t),n.setPageToken(r),n.toArrayBuffer()}}),Object.defineProperty(e.prototype,"encodePullSubDataReq",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.version,r=e.needAllData,n=e.pageToken,i=Za.getModule(Xs);return i.setVersionTime(t),i.setNeedAllData(r),i.setPageToken(n),i.toArrayBuffer()}}),Object.defineProperty(e.prototype,"encodeQrySubDataReq",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=Za.getModule(ta);r.setSubType(e);var n=[];return t.forEach((function(e){var t=Za.getModule(Ws);t.setSubUserId(e),n.push(t)})),r.setSubUsers(n),r.toArrayBuffer()}}),Object.defineProperty(e.prototype,"encodePullUserProfileReq",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=Za.getModule(oa);return t.setUserId(e),t.toArrayBuffer()}}),Object.defineProperty(e.prototype,"encodeUserProfileInput",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=Za.getModule(aa);return e.setNothing(1),e.toArrayBuffer()}}),Object.defineProperty(e.prototype,"encodeUserProfilePermission",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=Za.getModule(ua);return t.setPermission(e),t.toArrayBuffer()}}),Object.defineProperty(e.prototype,"encodeSearchUserProfile",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=Za.getModule(la);return t.setUniqueId(e),t.toArrayBuffer()}}),Object.defineProperty(e.prototype,"encodeUserProfile",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=Za.getModule(ra),r=[],n=[];return Object.keys(e).forEach((function(t){if("extraProfile"!==t){var i=e[t],o=Za.getModule(na);o.setKey(t),o.setValue((null==i?void 0:i.toString())||""),r.push(o)}else if(e.extraProfile){var s=e.extraProfile;Object.keys(s).forEach((function(e){var t=s[e],r=Za.getModule(na);r.setKey(e),r.setValue(t.toString()||""),n.push(r)}))}})),t.setUserProfile(r),t.setUserExtProfile(n),t.toArrayBuffer()}}),Object.defineProperty(e.prototype,"encodeMultiChannels",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=Za.getModule(pa),r=[];return e.forEach((function(e){var t=Za.getModule(ca);t.setTargetId(e),r.push(t)})),t.setType(exports.ConversationType.GROUP),t.setList(r),t.toArrayBuffer()}}),Object.defineProperty(e.prototype,"encodeQuitGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){void 0===r&&(r=[]),void 0===n&&(n=!0);var o=Za.getModule(fa);if(o.setTargetId(t),o.setType(exports.ConversationType.GROUP),"dismiss"!==e&&i){var s=this.encodeQuitChannelsSetting(i,n);o.setSettingInfo(s)}return"quit"!==e&&"dismiss"!==e&&o.setUsers(r),o.toArrayBuffer()}}),Object.defineProperty(e.prototype,"encodeQuitChannelsSetting",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=Za.getModule(ha);return r.setIsQuit(t),r.setIsDelBan(!!(null==e?void 0:e.removeMuteStatus)),r.setIsDelWhite(!!(null==e?void 0:e.removeWhiteList)),r.setIsDelAttention(!!(null==e?void 0:e.removeFollow)),r}}),Object.defineProperty(e.prototype,"encodeModifyChannelsInput",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n=Za.getModule(fa);return n.setTargetId(t),n.setType(exports.ConversationType.GROUP),n.setUsers(r),n.setOperateType(e),n.toArrayBuffer()}}),Object.defineProperty(e.prototype,"encodeChannelsQueryInput",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.type,r=e.groupId,n=e.option,i=e.ids,o=Za.getModule(ga);if(r&&o.setTargetId(r),o.setType(exports.ConversationType.GROUP),["getGroupMembersByRole","getGroupApplications","getJoinedGroupsByRole"].includes(t)&&n){var s=this.encodePagingQuery(n);o.setPage(s)}return["getGroupMembers","getJoinedGroups"].includes(t)&&o.setIds(null!=i?i:[]),e.roleType&&o.setRoleType(e.roleType),o.toArrayBuffer()}}),Object.defineProperty(e.prototype,"encodePagingQuery",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=Za.getModule(_a),r=e.count,n=e.order,i=e.pageToken;return t.setSize(r),t.setOrder(n?0:1),t.setPageToken(i),t}}),Object.defineProperty(e.prototype,"encodeJoinGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){void 0===r&&(r=[]);var n=Za.getModule(Ta);return n.setTargetId(t),n.setType(exports.ConversationType.GROUP),"invite"===e&&n.setUserIds(r),n.toArrayBuffer()}}),Object.defineProperty(e.prototype,"encodeMemberResponseInput",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.groupId,r=e.inviterId,n=e.optType,i=e.optResult,o=e.joinUserId,s=e.reason,a=Za.getModule(Ia);return a.setTargetId(t),a.setType(exports.ConversationType.GROUP),a.setOptType(n),a.setOptResult(i),a.setInviterId(r),n===exports.GroupOperationRole.MANAGER&&a.setJoinUserId(o),i||a.setDetail(null!=s?s:""),a.toArrayBuffer()}}),Object.defineProperty(e.prototype,"encodeSetGroupRemark",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=Za.getModule(ma),n=exports.GroupOperationType.ADD;return r.setTargetId(e),r.setType(exports.ConversationType.GROUP),t||(n=exports.GroupOperationType.REMOVE),r.setOperateType(n),r.setChannelNickName(t),r.toArrayBuffer()}}),Object.defineProperty(e.prototype,"encodeSetGroupFollows",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n=Za.getModule(fa);return n.setTargetId(t),n.setType(exports.ConversationType.GROUP),n.setUsers(r),n.setOperateType(e),n.toArrayBuffer()}}),Object.defineProperty(e.prototype,"encodeFriendInput",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=Za.getModule(Ra);return t.setTargetId(e.targetId),e.type&&t.setType(e.type),e.info&&t.setInfo(e.info),t.toArrayBuffer()}}),Object.defineProperty(e.prototype,"encodeFriendsInput",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return Za.encode(Ca,{targetId:e,type:t})}}),Object.defineProperty(e.prototype,"encodeFriendQueryInput",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n=null!=t?t:{},i=n.count,o=void 0===i?200:i,s=n.pageToken,a=void 0===s?"":s,u=n.order,l=void 0!==u&&u,c=Za.getModule(Pa);c.setQueryType(e),11===e&&c.setFriendType(r);var d=Za.getModule(_a);return d.setSize(o),d.setOrder(l?0:1),d.setPageToken(a),c.setPage(d),c.toArrayBuffer()}}),Object.defineProperty(e.prototype,"encodeQuerySessionsInput",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=Za.getModule(Qo);return t.setSessions(this._encodeSessions(e)),t.toArrayBuffer()}}),e}(),Fp=function(e){function r(t,r,n){var i=e.call(this,t,r,n)||this;return Object.defineProperty(i,"_socket",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(i,"_connectedTime",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(i,"_socketIndex",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(i,"_serverSessionId",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(i,"_localConnectedTime",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(i,"codec",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(i,"_idCount",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(i,"_generateMessageId",{enumerable:!0,configurable:!0,writable:!0,value:function(){return i._idCount>=65535&&(i._idCount=0),++i._idCount}}),Object.defineProperty(i,"_pingResolve",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(i,"_messageIds",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(i,"_syncMessageIds",{enumerable:!0,configurable:!0,writable:!0,value:{}}),i.codec=new kp(i.logger),i}return t(r,e),Object.defineProperty(r.prototype,"getConnectedTime",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._connectedTime}}),Object.defineProperty(r.prototype,"getLocalConnectedTime",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._localConnectedTime}}),Object.defineProperty(r.prototype,"getCrtServerTime",{enumerable:!1,configurable:!0,writable:!0,value:function(){return Date.now()-this._localConnectedTime+this._connectedTime}}),Object.defineProperty(r.prototype,"getDelayTime",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._localConnectedTime-this._connectedTime}}),Object.defineProperty(r.prototype,"_connectWithToken",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return o(this,void 0,void 0,(function(){var r,i,o,a,u,l,c,d,p,f;return s(this,(function(h){switch(h.label){case 0:if(r=t.openAnti,i=t.type,o=t.baggageEnabled,a=this.getCmpList(t),this.logger.debug(H.L_NAVI_CMP_R,JSON.stringify(a),n),0===(u=a.filter((function(e,t){return a.findIndex((function(t){return t.addr===e.addr}))===t})).sort((function(e,t){return e.weight>t.weight?-1:1}))).length)return this.logger.error(H.L_NAVI_CONF_E,"no service available",n),[2,gt(exports.ErrorCode.SERVER_UNAVAILABLE)];l=1===r?tn.V4:tn.V3,c=function(t){var r,a,c,p,f,h,g,_,b,E,v;return s(this,(function(s){switch(s.label){case 0:return r=u[t],a=r.protocol,c=r.addr,p=r.weight,f=function(e,t,r,n,i,o,s,a){var u,l=s?"&protocolVer=".concat(s):"",c=Fu(),d=Hu();return"".concat(e,"://").concat(t,"/websocket?appId=").concat(r,"&token=").concat(encodeURIComponent(n),"&sdkVer=").concat(je,"&pid=").concat(o,"&deviceId=").concat(encodeURIComponent(c)).concat(1===a?"&baggage=".concat(encodeURIComponent("cid=".concat(i))):"","&apiVer=").concat(encodeURIComponent((null===(u=lo.getApiVer)||void 0===u?void 0:u.call(lo))||"||")).concat(lo.connectPlatform?"&platform=".concat(lo.connectPlatform):"").concat(l).concat(lo.isFromUniapp?"&appIdentifier=".concat(encodeURIComponent(d)):"")}(a===q.WS?"ws":"wss",c,d.appkey,e,d.cid,"",l,o),h=Date.now(),[4,d.connectWebSocket(f,l,n)];case 1:return g=s.sent(),_=g.code,b=g.data,E=d.cmpWeightCache.findIndex((function(e){return e.addr===c})),v={bid:cr(),ptc:Re.WS,cod:_,net:d.getNetwork().type,dur:Date.now()-h,spr:1,pr:i||0,hos:c,idx:E,rct:d.retryCount?Se.RECONNECT:Se.CONNECT,cid:d.cid,v:Oe.CURRENT,rsn:d._doConnectReason,count:d.retryCount,weight:p,ssid:d._serverSessionId},d.logger.record(pe.IM_WEBSOCKET,JSON.stringify(v),n),_===exports.ErrorCode.RC_SOCKET_DISCONNECTED||_===exports.ErrorCode.TIMEOUT?[2,"continue"]:_!==exports.ErrorCode.SUCCESS?[2,{value:gt(_)}]:(d._localConnectedTime=Math.floor((Date.now()+h)/2),d._socket=b.socket,d.updateCmpWeight(u[t].addr,!0),d.curCmpUrl=u[t].addr,[2,{value:ht(b.userId)}])}}))},d=this,p=0,h.label=1;case 1:return p<u.length?[5,c(p)]:[3,4];case 2:if("object"==typeof(f=h.sent()))return[2,f.value];h.label=3;case 3:return p+=1,[3,1];case 4:return[2,gt(exports.ErrorCode.SERVER_UNAVAILABLE)]}}))}))}}),Object.defineProperty(r.prototype,"connectWebSocket",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n,i,o,a,u,l,c=this;return s(this,(function(s){return this.logger.info(H.L_CONNECT_O,"connect start: ".concat(e),r),n=It(),i=n.resolve,o=n.promise,a=lo.createWebSocket(e),this._socketIndex=a.id,u=exports.ErrorCode.SUCCESS,l=setTimeout((function(){c.logger.warn(H.L_CONNECT_S,"timeout",r),u=exports.ErrorCode.TIMEOUT,a.close()}),5e3),a.onOpen((function(){c.logger.info(H.L_CONNECT_S,"socket opened",r),clearTimeout(l)})),a.onError((function(e){c.logger.info(H.L_CONNECT_S,"socket error",r),clearTimeout(l);var t=exports.ErrorCode.RC_SOCKET_DISCONNECTED;i(gt(t)),c.onSocketEnd(a,t)})),a.onClose((function(){c.logger.info(H.L_CONNECT_S,"socket close",r);var e=u===exports.ErrorCode.SUCCESS?exports.ErrorCode.RC_SOCKET_DISCONNECTED:u;i(gt(e)),c.onSocketEnd(a,e)})),a.onMessage((function(e){if(c._socketIndex===a.id){if("[object ArrayBuffer]"===Object.prototype.toString.call(e)){var n=Ti(e,t);if(n){if(n instanceof ui){var o=n.status;if(o!==Sn)return c.logger.warn(H.L_CONNECT_O,"connect failed: ".concat(o),r),u=Dp[o],a.close(),void i(gt(u));c.logger.info(H.L_CONNECT_O,"connect success",r);var s=n.timestamp,l=n.userId,d=n.messageId,p=n.sessionId;return c._serverSessionId=p,c._connectedTime=s,c._idCount=d,void i(ht({userId:l,socket:a}))}if(n instanceof ci){var f=n.status;return c.logger.info(H.T,"recv disconnect signal -> status: ".concat(f)),void c.onRecvDisconnect(f,a)}c._onReceiveSignal(n)}}}else c.logger.warn(H.L_WS_DISACCORD_E,JSON.stringify({socketIndex:c._socketIndex,curSocketId:a.id}))})),[2,o]}))}))}}),Object.defineProperty(r.prototype,"_qosNeedAck",{enumerable:!1,configurable:!0,writable:!0,value:function(e){if(e.header.qos!==$r.AT_MOST_ONCE)return e instanceof gi&&!e.syncMsg?(this.logger.debug(H.O,"send pubAck -> ".concat(e.messageId," ").concat(e.topic)),void this.sendOnly(new yi(e.messageId))):void(e instanceof Ii&&this._messageIds[e.messageId]&&(this.logger.debug(H.O,"send queryCon -> ".concat(e.messageId)),this.sendOnly(new mi(e.messageId))))}}),Object.defineProperty(r.prototype,"_publishReader",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,o=this;return s(this,(function(s){switch(s.label){case 0:return t=e.syncMsg,r=e.topic,n=e.messageId,this.logger.debug(H.O,"recv PublishReader -> messageId: ".concat(n," ").concat(r)),r===pn?[2]:!t||xp(rn(r))?(this.emit("signal",e),[2]):[4,new Promise((function(e){o._syncMessageIds[n]=e}))];case 1:return i=s.sent(),delete this._syncMessageIds[n],this.emit("signal",e,i),[2]}}))}))}}),Object.defineProperty(r.prototype,"_onReceiveSignal",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n;return s(this,(function(i){switch(i.label){case 0:return e instanceof pi&&this._pingResolve?(this._pingResolve(exports.ErrorCode.SUCCESS),this._pingResolve=void 0,[2]):(this._qosNeedAck(e),(e instanceof vi||e instanceof Ii)&&(t=e.messageId,this.logger.debug(H.O,"recv ack -> messageId: ".concat(t)),(r=this._messageIds[t])&&(r(e),delete this._messageIds[t]),(n=this._syncMessageIds[t])&&(delete this._syncMessageIds[t],n(e))),e instanceof gi?[4,this._publishReader(e)]:[3,2]);case 1:i.sent(),i.label=2;case 2:return[2]}}))}))}}),Object.defineProperty(r.prototype,"onRecvDisconnect",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._socket&&this._socket===t&&(this._socket=null,this.clearResolves(),this.onDisconnectByServer(function(e){return Up[e]}(e)))}}),Object.defineProperty(r.prototype,"onSocketEnd",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._socket&&this._socket===e&&(this._socket=null,this.clearResolves(),this.onDisconenctUnusual(t),this._pingResolve&&(this._pingResolve(t),this._pingResolve=void 0))}}),Object.defineProperty(r.prototype,"clearResolves",{enumerable:!1,configurable:!0,writable:!0,value:function(){for(var e in this._messageIds){var t=this._messageIds[e];delete this._messageIds[e],t(exports.ErrorCode.RC_SOCKET_DISCONNECTED)}}}),Object.defineProperty(r.prototype,"sendPing",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;return new Promise((function(r){t._pingResolve=r,setTimeout((function(){return r(exports.ErrorCode.TIMEOUT)}),e),t.sendOnly(new di)}))}}),Object.defineProperty(r.prototype,"sendOnly",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._socket&&((e instanceof Ei||e instanceof bi)&&(e.messageId=this._generateMessageId()),this._socket.send(e.getArrayBuffer()))}}),Object.defineProperty(r.prototype,"_sendHandler",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i=this;return s(this,(function(o){switch(o.label){case 0:return this._socket?(t=this._generateMessageId(),e.messageId=t,this._socket.send(e.getArrayBuffer()),[4,new Promise((function(e){i._messageIds[t]=e,setTimeout((function(){i._messageIds[t]&&delete i._messageIds[t],e(exports.ErrorCode.TIMEOUT)}),3e4)}))]):[2,gt(exports.ErrorCode.RC_NET_CHANNEL_INVALID)];case 1:return r=o.sent(),(n="number"==typeof r?r:r.status)!==exports.ErrorCode.SUCCESS&&this.logger.warn(H.O,"send rmtp fail -> messageId: ".concat(t,", code: ").concat(n,", topic: ").concat(e.topic)),"number"==typeof r?[2,gt(r)]:[2,n===exports.ErrorCode.SUCCESS?ht(r):gt(n,"",r)]}}))}))}}),Object.defineProperty(r.prototype,"query",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){return o(this,void 0,void 0,(function(){var o,a,u,l;return s(this,(function(s){switch(s.label){case 0:return o=this.logger.createTraceId(),nn(e),this.logger.debug(H.L_QUERY_CMP_T,JSON.stringify({topic:e,targetId:t}),o),a=new bi(e,r,t),i&&a.setHeaderQos(i),[4,this._sendHandler(a)];case 1:return u=s.sent(),this.logger.summary(H.L_QUERY_CMP_T,u,o,{topic:e,targetId:t}),l=u.data,u.isOk&&void 0!==n?[2,ht(Za.decode(n,l.pbData))]:[2,u]}}))}))}}),Object.defineProperty(r.prototype,"send",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n,i,o,a;return s(this,(function(s){switch(s.label){case 0:return[4,this._sendHandler(e)];case 1:return(n=s.sent()).data?n.data instanceof vi?[2,n]:(i=n.data,o=t&&i.pbData&&[exports.ErrorCode.SUCCESS,exports.ErrorCode.CHATROOM_KV_STORE_NOT_ALL_SUCCESS,exports.ErrorCode.RC_BESUBSCRIBED_USERIDS_COUNT_EXCEED_LIMIT,exports.ErrorCode.RC_USER_PROFILE_KEY_NOT_EXIST,exports.ErrorCode.RC_USER_PROFILE_EXT_KEY_NOT_EXIST,exports.ErrorCode.RC_USER_PROFILE_VALUE_CAN_ONLY_BE_NUMBERS,exports.ErrorCode.RC_USER_PROFILE_VALUE_EXCEED_RANGE,exports.ErrorCode.RC_GROUP_PARAMETER_FORMAT_ERROR].indexOf(i.status)>=0,a=o?this.codec.decodeByPBName(i.pbData,t,r):i,0!==i.status?(this.logger.warn(H.O,"send failed -> messageId: ".concat(i.messageId,", respPBName: ").concat(t,", status: ").concat(i.status)),[2,gt(i.status,void 0,t&&i.pbData?a:null)]):[2,ht(a)]):[2,n.wipe()]}}))}))}}),Object.defineProperty(r.prototype,"close",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return r?[4,this.sendOnly(new li(zn))]:[3,2];case 1:e.sent(),e.label=2;case 2:return this._socket&&(this._socket.close(),this._socket=null),this.clearResolves(),[2]}}))}))}}),r}(Ur),Bp=function(e){function r(t,r,n){var i=e.call(this,r,t,n)||this;Object.defineProperty(i,"deviceId",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(i,"model",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(i,"_mrtr",{enumerable:!0,configurable:!0,writable:!0,value:{chatroom:0,group:0,private:0,ultraGroup:0,temporary:!1}});var o=lo.runtimeInfo,s=o.type,a=o.version;return i.deviceId=Fu(),i.model="Web|".concat(s,"|").concat(a),i.init(),i}return t(r,e),Object.defineProperty(r.prototype,"httpRequest",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return o(this,void 0,void 0,(function(){var i,o,a,u,l,c,d,p;return s(this,(function(s){switch(s.label){case 0:return(i=n).deviceId=this.deviceId,i.model=this.model,o={url:e,method:t,headers:r,body:JSON.stringify(i)},this.logger.info(H.L_REQUEST_T,JSON.stringify(o)),[4,lo.httpReq(o)];case 1:a=s.sent(),u=a.status,l=a.data,c=void 0===l?"":l,this.logger.info(H.L_REQUEST_R,JSON.stringify({status:u,data:c}));try{return d=JSON.parse(c),p=d.data,[2,{code:parseInt(d.code,10),data:p}]}catch(e){return this.logger.warn(H.L_CLOUD_CONFIG_DATA_E,JSON.stringify({status:u,data:c,error:e})),[2,{code:u,msg:e}]}return[2]}}))}))}}),Object.defineProperty(r.prototype,"setCloudControllerCache",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=ze(this.appkey);lo.localStorage.setItem(t,JSON.stringify(e)),this.logger.info(H.L_CLOUD_SET_CACHE_O,JSON.stringify(e))}}),Object.defineProperty(r.prototype,"getLocalCloudControllerCache",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=ze(this.appkey),t=lo.localStorage.getItem(e);return this.logger.info(H.L_CLOUD_SET_CACHE_O,JSON.stringify({appkey:this.appkey,key:e,data:t})),t}}),Object.defineProperty(r.prototype,"setMRTRConfig",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this.logger.info(H.L_CLOUD_SET_MRTR_O,JSON.stringify(e)),this._mrtr=e}}),Object.defineProperty(r.prototype,"getMRTRConfig",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._mrtr}}),r}(Mr),Hp=null,qp="RC_LOGS",Yp="RC_STATISTICS",Kp="RC_CONF",Qp=((Mp={})[qp]=["level","time"],Mp[Kp]=["key"],Mp[Yp]=["level","time"],Mp),Wp=function(e,t,r){return new Promise((function(n){var i=e.transaction(t,"readwrite").objectStore(t).index("time"),o=IDBKeyRange.upperBound(Date.now()-r),s=i.openCursor(o);s.onsuccess=function(e){var t=e.target.result;t?(t.delete(),t.continue()):n()},s.onerror=function(){n()}}))},Jp=null,zp=function(e){return o(void 0,void 0,void 0,(function(){var t,r;return s(this,(function(n){switch(n.label){case 0:return[4,Hp];case 1:return(t=n.sent())?(r=t.db,[4,Wp(r,qp,e)]):[2];case 2:return n.sent(),[4,Wp(r,Yp,e)];case 3:return n.sent(),Jp=setTimeout((function(){return zp(e)}),6e5),[2]}}))}))},Zp=function(e,t,r){void 0===r&&(r=168),Hp||("undefined"!=typeof window&&window&&window.indexedDB&&"IE"!==lo.runtimeInfo.type?Hp=new Promise((function(n){var i=window.indexedDB;!function(e){var t=window.indexedDB;t.databases&&t.databases().then((function(r){r.forEach((function(r){r.name&&e.includes(r.name)&&t.deleteDatabase(r.name)}))}))}(["RC_ENGINE_DB","RC_STATISTIC_".concat(e)]);var o="RC_LOGS_".concat(e),s=i.open(o,2);s.onerror=function(e){t.error(H.L_LOGDB_OPEN_FAILED_E,e.target.error),n(null)},s.onsuccess=function(i){var o=i.target.result;o?(o.onclose=function(e){Hp=null,t.warn(H.L_LOGDB_CLOSED_S)},o.onerror=function(e){Hp=null,t.error(H.L_LOGDB_ERROR_E,e.target.error)},o.onabort=function(e){t.info(H.L_LOGDB_ABORT_S,e.target.error)},zp(3600*Math.max(24,Math.min(168,r))*1e3),n({appkey:e,db:o})):n(null)},s.onupgradeneeded=function(e){var t=e.target.result;Object.keys(Qp).forEach((function(e){t.objectStoreNames.contains(e)&&t.deleteObjectStore(e);var r=e===Kp?{keyPath:"key"}:{autoIncrement:!0},n=t.createObjectStore(e,r);Qp[e].forEach((function(e){return n.createIndex(e,e,{unique:!1})}))}))}})):t.warn(H.L_UNSUPPORT_INDEXDB_O))},Xp=[],$p=function(e,t,r){return new Promise((function(n){var i=e.transaction(t,"readwrite");i.oncomplete=n,i.onabort=n;var o=i.objectStore(t);r.forEach((function(e){try{o.add(e)}catch(t){null===console||void 0===console||console.error("write failed ->",e,t)}}))}))},ef=[],tf=!1,rf=function(e){return o(void 0,void 0,void 0,(function(){var t,r;return s(this,(function(n){switch(n.label){case 0:return tf||0===ef.length?[2]:(tf=!0,t=ef.filter((function(e){return e.level<exports.LogL.FATAL})),r=ef.filter((function(e){return e.level>=exports.LogL.FATAL})),ef.length=0,[4,$p(e,qp,r)]);case 1:return n.sent(),[4,$p(e,Yp,t)];case 2:return n.sent(),tf=!1,0===ef.length&&Xp.length>0&&(Xp.forEach((function(e){return e.close()})),Xp.length=0),setTimeout((function(){return rf(e)})),[2]}}))}))};function nf(e){return o(this,void 0,void 0,(function(){var t;return s(this,(function(r){switch(r.label){case 0:return[4,Hp];case 1:return(t=r.sent())?[2,new Promise((function(r){var n=t.db.transaction(Kp,"readonly").objectStore(Kp).get(e);n.onsuccess=function(e){var t;r({value:null===(t=n.result)||void 0===t?void 0:t.value,success:!0})},n.onerror=function(e){r({success:!1})}}))]:[2,{success:!1}]}}))}))}var of=ot,sf=function(){return{setTimestamp4RealtimeLog:function(e){of=e},getTimestamp4RealtimeLog:function(){return of},getLogs:function(e,t,r,n,i){return void 0===i&&(i=qp),o(this,void 0,void 0,(function(){var o;return s(this,(function(s){switch(s.label){case 0:return[4,Hp];case 1:return(o=s.sent())?[2,new Promise((function(s){var a=o.db.transaction(i,"readonly").objectStore(i),u=[],l=IDBKeyRange.bound(e,t),c=a.index("time").openCursor(l);c.onsuccess=function(e){var t=e.target.result;if(t){var i=t.value;i.level<=r&&(n?i.sessionId===it:i.level>=0)&&u.push(i),t.continue()}else s({dbReady:!0,logs:u})},c.onerror=function(e){s({dbReady:!1,logs:[]})}}))]:[2,{dbReady:!1,logs:[]}]}}))}))}}},af="REPORT_SESSION",uf=function(e,t){return o(void 0,void 0,void 0,(function(){var r,n,i,a;return s(this,(function(u){switch(u.label){case 0:return r="".concat(af,"_").concat(e),[4,nf("".concat(af,"_").concat(e))];case 1:return n=u.sent(),i=n.success,a=n.value,i?(t===(null==a?void 0:a.sessionId)||function(e,t){o(this,void 0,void 0,(function(){var r,n;return s(this,(function(i){switch(i.label){case 0:return[4,Hp];case 1:return(r=i.sent())?(n=r.db,n.transaction(Kp,"readwrite").objectStore(Kp).put({key:e,value:t}),[2,!0]):[2,!1]}}))}))}(r,{sessionId:t}),[2]):[2]}}))}))},lf=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return t(r,e),Object.defineProperty(r.prototype,"_handleWrite",{enumerable:!1,configurable:!0,writable:!0,value:function(e){!function(e){o(void 0,void 0,void 0,(function(){var t;return s(this,(function(r){switch(r.label){case 0:return[4,Hp];case 1:if(!(t=r.sent()))return[2];if(e.content&&Tt(e.content))try{e.content=JSON.parse(e.content)}catch(e){}return ef.push(e),rf(t.db),[2]}}))}))}(e)}}),r}(Tr),cf=144e5;if("undefined"!=typeof window){window.__rongcloud_devtools__={logger:{get:function(e,t,r){return void 0===t&&(t=Date.now()-cf),void 0===r&&(r=Date.now()),o(this,void 0,void 0,(function(){var n,i;return s(this,(function(o){switch(o.label){case 0:return t=t<0?Date.now()+t:t,(r=r<=0?Date.now():r)-t>cf&&(t=r-cf),(n=new lf(e,"RC-IM","IM")).debug(H.T,"get logs: startTime ".concat(t," endTime ").concat(r)),Zp(e,n),[4,sf().getLogs(t,r,exports.LogL.DEBUG,!1)];case 1:return i=o.sent().logs,n.debug(H.T,"get logs ".concat(i.length)),function(e,t){var r=t.map((function(e){var t=e.sessionId,r=e.time,n=e.type,i=e.level,o=e.tag,s=e.traceId,a=e.loggerId,u=e.content;return"".concat(t,",").concat(r,",").concat(n,",").concat(i,",").concat(o,",").concat(s,",").concat(a,',"').concat(u,'"\n')})),n=new Blob(r,{type:"text/csv"}),i=URL.createObjectURL(n),o=document.createElement("a");o.href=i,o.download="".concat(e,".csv"),document.body.appendChild(o),o.click(),document.body.removeChild(o),URL.revokeObjectURL(i)}("".concat(e,"-").concat(t,"-").concat(r),i),[2]}}))}))}}}}var df,pf,ff,hf=function(e){function r(t,r,n){var i,o=Fu(),s=lo.runtimeInfo,a=s.type,u=s.version,l="".concat(a,"|").concat(u,"|").concat(r.getSessionId());return i=e.call(this,t,o,l,sf(),r)||this,Object.defineProperty(i,"tableName",{enumerable:!0,configurable:!0,writable:!0,value:n}),i}return t(r,e),Object.defineProperty(r.prototype,"send",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return lo.httpReq(e)}}),Object.defineProperty(r.prototype,"checkStart",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return o(this,void 0,void 0,(function(){return s(this,(function(r){switch(r.label){case 0:return[4,uf(t.userId,this.logger.getSessionId())];case 1:return r.sent(),[2,e.prototype.checkStart.call(this,t,this.tableName)]}}))}))}}),Object.defineProperty(r.prototype,"compressLogs",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){return s(this,(function(t){return[2,{success:!0,data:nl(e.map(Cr).join(""))}]}))}))}}),Object.defineProperty(r.prototype,"realtimeReport",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r,n){return o(this,void 0,void 0,(function(){return s(this,(function(i){return[2,e.prototype.realtimeReport.call(this,t,r,n,this.tableName)]}))}))}}),r}(Rr),gf=function(e){function r(t,r){return e.call(this,t,r,qp)||this}return t(r,e),Object.defineProperty(r.prototype,"isReporter",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,(t=this.userId,r=this.logger.getSessionId(),o(void 0,void 0,void 0,(function(){var e,n,i;return s(this,(function(o){switch(o.label){case 0:return[4,nf("".concat(af,"_").concat(t))];case 1:return e=o.sent(),n=e.success,i=e.value,[2,n&&(null==i?void 0:i.sessionId)===r]}}))})))];case 1:return[2,e.sent()]}var t,r}))}))}}),Object.defineProperty(r.prototype,"report",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r,n,i,a,u,l){return void 0===l&&(l=!1),o(this,void 0,void 0,(function(){var o;return s(this,(function(s){switch(s.label){case 0:return[4,this.isReporter()];case 1:return o=s.sent(),this.userId&&!o?[2]:[2,e.prototype.report.call(this,t,r,n,i,a,u,l)]}}))}))}}),r}(hf),_f=function(e){function r(t,r){return e.call(this,t,r,Yp)||this}return t(r,e),r}(hf),bf=function(e){function r(t,r){var n=e.call(this)||this;return df.add(n),Object.defineProperty(n,"_ctx",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(n,"_storage",{enumerable:!0,configurable:!0,writable:!0,value:r}),n._ctx.on("sCmd",c(n,df,"m",pf),n),n}return t(r,e),Object.defineProperty(r.prototype,"_handleSyncData",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,c(this,df,"m",ff).call(this,e)];case 1:return[2,t.sent().trans((function(t){return{version:t.version||e+1}}))]}}))}))}}),Object.defineProperty(r.prototype,"syncDataFromServer",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e;return s(this,(function(t){switch(t.label){case 0:return e=this._storage.get("conversationStatusVersion"),[4,c(this,df,"m",ff).call(this,e)];case 1:return t.sent(),[2,this._storage.get("conversationStatusVersion")]}}))}))}}),Object.defineProperty(r.prototype,"pushTask",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return o(this,void 0,void 0,(function(){var r=this;return s(this,(function(n){return[2,e.prototype.pushTask.call(this,(function(e){return o(r,void 0,void 0,(function(){var r;return s(this,(function(n){switch(n.label){case 0:return[4,t(e)];case 1:return(r=n.sent()).isOk?(this._storage.set("conversationStatusVersion",r.data.version),[2,r]):[2,r.wipe()]}}))}))}),(function(e,t){return e.code===exports.ErrorCode.USER_SETTING_SYNCED_ERROR&&t<5}))]}))}))}}),r}(bt);df=new WeakSet,pf=function(e,t){var r=t.type,n=t.time;if(3===r)this.push(n),e.stopPropagation()},ff=function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,o;return s(this,(function(s){switch(s.label){case 0:return t=this._ctx.logger,r=t.createTraceId(),t.info(H.L_PULL_CONVERSATION_SETTINGS_T,JSON.stringify({version:e}),r),n=Za.encode(ss,{time:e}),[4,this._ctx.query(Zr.pullSeAtts,this._ctx.currentUserId,n,as)];case 1:return i=s.sent(),t.summary(H.L_PULL_CONVERSATION_SETTINGS_R,i,r,{version:e},(function(t){return{syncTime:t.version,version:e}})),i.isOk?((o=this._storage.updateBySessionStates(i.data)).length&&this._ctx.emit("conversationStatusChanged",o),[2,i]):[2,i.wipe()]}}))}))};var Ef,vf,yf,mf,If=function(){function e(){Object.defineProperty(this,"_memData",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}return Object.defineProperty(e.prototype,"syncDataFromLocalStorage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._memData=this._syncDataHandler(e)}}),Object.defineProperty(e.prototype,"get",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._memData[e].value}}),Object.defineProperty(e.prototype,"set",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this._memData[e],n=r.key,i=r.stringify;r.value=t;var o=i?JSON.stringify(t):t;lo.localStorage.setItem(n,o)}}),e}(),Tf=function(e,t,r){return"".concat(null!=r?r:"","_").concat(e,"_").concat(t)},Rf=function(e){var t=u(e.split("_")),r=t[0],n=t[1],i=t.slice(2);return{channelId:r,conversationType:parseInt(n,10),targetId:i.join("_")}};function Cf(e){if(e){if(Array.isArray(e))return e;var t=Object.entries(e).map((function(e){var t=u(e,2);return{tagId:t[0],isTop:t[1].isTop}}));return t}}var Of=function(){return{latestMessage:null,lastReadTime:0,firstUnreadMessageType:"",firstUnreadMessageUId:"",firstUnreadTime:0,unreadCount:0,unreadMentionedCount:0,unreadMentionedMeCount:0,hasMentioned:!1,mentionedInfo:void 0,isTop:!1,notificationLevel:exports.NotificationLevel.NOT_SET,tags:[],channelType:exports.UltraGroupChannelType.PUBLIC,operationTime:0,draft:"",hidden:!1}},Sf=function(){function e(e){Ef.set(this,void 0),vf.set(this,void 0),yf.set(this,void 0),mf.set(this,Of()),d(this,Ef,e.conversationType,"f"),d(this,vf,e.targetId,"f"),d(this,yf,e.channelId||"","f")}return Object.defineProperty(e.prototype,"conversationType",{get:function(){return c(this,Ef,"f")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"targetId",{get:function(){return c(this,vf,"f")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"channelId",{get:function(){return c(this,yf,"f")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"channelType",{get:function(){return c(this,mf,"f").channelType},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"hidden",{get:function(){return!!c(this,mf,"f").hidden},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isTop",{get:function(){return!!c(this,mf,"f").isTop},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"notificationLevel",{get:function(){return c(this,mf,"f").notificationLevel||exports.NotificationLevel.NOT_SET},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"tags",{get:function(){return(c(this,mf,"f").tags||[]).map((function(e){return{tagId:e.tagId,isTop:e.isTop}}))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"unreadCount",{get:function(){return c(this,mf,"f").unreadCount||0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"unreadMentionedCount",{get:function(){return c(this,mf,"f").unreadMentionedCount||0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"unreadMentionedMeCount",{get:function(){return c(this,mf,"f").unreadMentionedMeCount||0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"hasMentioned",{get:function(){return!!c(this,mf,"f").hasMentioned},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"mentionedInfo",{get:function(){return c(this,mf,"f").mentionedInfo},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"lastReadTime",{get:function(){return c(this,mf,"f").lastReadTime||0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"firstUnreadTime",{get:function(){return c(this,mf,"f").firstUnreadTime||0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"firstUnreadMessageUId",{get:function(){return c(this,mf,"f").firstUnreadMessageUId||""},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"firstUnreadMessageType",{get:function(){return c(this,mf,"f").firstUnreadMessageType||""},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"latestMessage",{get:function(){return c(this,mf,"f").latestMessage||null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"operationTime",{get:function(){return c(this,mf,"f").operationTime||0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"draft",{get:function(){return c(this,mf,"f").draft||""},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"firstUnreadMessage",{get:function(){return this.firstUnreadTime?{sentTime:this.firstUnreadTime,messageType:this.firstUnreadMessageType,messageUId:this.firstUnreadMessageUId}:null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"id",{get:function(){return{conversationType:c(this,Ef,"f"),targetId:c(this,vf,"f"),channelId:c(this,yf,"f")}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"key",{get:function(){return Tf(c(this,Ef,"f"),c(this,vf,"f"),c(this,yf,"f"))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"toIReceivedConversation",{enumerable:!1,configurable:!0,writable:!0,value:function(){return n(n({},this.id),{latestMessage:this.latestMessage,unreadMessageCount:this.unreadCount,unreadMentionedCount:this.unreadMentionedCount,unreadMentionedMeCount:this.unreadMentionedMeCount,hasMentioned:this.hasMentioned,mentionedInfo:this.mentionedInfo,lastUnreadTime:0,notificationLevel:this.notificationLevel,notificationStatus:Le(this.notificationLevel),isTop:this.isTop,operationTime:this.operationTime,firstUnreadMessage:this.firstUnreadMessage,versionTime:0,draft:this.draft})}}),Object.defineProperty(e.prototype,"toStoragItem",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e={};return this.isTop&&(e.to=!0),this.notificationLevel!==exports.NotificationLevel.NOT_SET&&(e.nl=this.notificationLevel),this.tags.length>0&&(e.tg=this.tags),this.hidden&&(e.h=!0),e}}),Object.defineProperty(e.prototype,"remove",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.updateAttrs(n(n({},Of()),{tags:this.tags,isTop:this.isTop,notificationLevel:this.notificationLevel,hidden:!0}))}}),Object.defineProperty(e.prototype,"updateAttrs",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this;void 0===t&&(t=0);var n={},i={latestMessage:"latestMessage",unreadCount:"unreadMessageCount",hasMentioned:"hasMentioned",mentionedInfo:"mentionedInfo",notificationLevel:"notificationLevel",tags:"tags",isTop:"isTop",lastReadTime:void 0,firstUnreadMessageType:void 0,firstUnreadMessageUId:void 0,firstUnreadTime:void 0,unreadMentionedCount:void 0,unreadMentionedMeCount:void 0,channelType:void 0,operationTime:void 0,draft:void 0,hidden:void 0};return Object.entries(i).forEach((function(i){var o=u(i,2),s=o[0],a=o[1],l=s;if(Object.prototype.hasOwnProperty.call(e,l)){var d=e[l];c(r,mf,"f")[l]!==d&&(c(r,mf,"f")[l]=d,a&&(n[a]={time:t,val:d}))}})),Object.keys(n).length>0?n:null}}),e}();Ef=new WeakMap,vf=new WeakMap,yf=new WeakMap,mf=new WeakMap;var Af,Pf,Nf,wf=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return t(r,e),Object.defineProperty(r.prototype,"toStoragItem",{enumerable:!1,configurable:!0,writable:!0,value:function(){var t=e.prototype.toStoragItem.call(this);return this.unreadCount>0&&(t.c=this.unreadCount),this.unreadMentionedCount>0&&(t.mc=this.unreadMentionedCount),this.unreadMentionedMeCount>0&&(t.mmc=this.unreadMentionedMeCount),this.hasMentioned&&(t.hm=!0),this.mentionedInfo&&(t.m=this.mentionedInfo),this.firstUnreadMessageUId&&(t.fuid=this.firstUnreadMessageUId),this.firstUnreadMessageType&&(t.fumt=this.firstUnreadMessageType),this.firstUnreadTime&&(t.fut=this.firstUnreadTime),this.lastReadTime&&(t.rt=this.lastReadTime),t}}),r}(Sf),Mf=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return t(r,e),Object.defineProperty(r.prototype,"toIReceivedConversation",{enumerable:!1,configurable:!0,writable:!0,value:function(){var t=e.prototype.toIReceivedConversation.call(this);return t.channelType=this.channelType,t}}),Object.defineProperty(r.prototype,"isDefaultChannel",{enumerable:!1,configurable:!0,writable:!0,value:function(){return!this.channelId||"RCDefault"===this.channelId}}),r}(Sf),Lf=function(e){function r(t){var r=e.call(this)||this;return Af.add(r),Object.defineProperty(r,"_ctx",{enumerable:!0,configurable:!0,writable:!0,value:t}),Pf.set(r,new Map),r}return t(r,e),Object.defineProperty(r.prototype,"_syncDataHandler",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=lo.localStorage,r=e.appkey,n=e.currentUserId,i=e.isDisableEmptyUGChannelId,o=Ye(r,n),s=qe(r,n),a=Ke(r,n),u=Be(r,n),l=Fe(r,n),c=He(r,n),d=t.getItem(o)||"0",p=t.getItem(s)||"0",f=t.getItem(a)||"1",h=t.getItem(u)||"{}",g=t.getItem(l)||"0",_=t.getItem(c)||"{}",b=JSON.parse(h);Object.keys(b).forEach((function(e){var t=Rf(e);me(t.conversationType,ge)||delete b[e]}));var E=JSON.parse(_);return Object.keys(E).forEach((function(e){var t=Rf(e);(t.conversationType!==exports.ConversationType.ULTRA_GROUP||i&&!t.channelId)&&delete E[e]})),{inboxTime:{value:parseInt(d,10)||0,key:o},outboxTime:{value:parseInt(p,10)||0,key:s},broadcastTime:{value:parseInt(f,10)||0,key:a},conversationStatus:{value:b,key:u,stringify:!0},ultraGroupStatus:{value:E,key:c,stringify:!0},conversationStatusVersion:{value:parseInt(g,10)||0,key:l}}}}),Object.defineProperty(r.prototype,"syncDataFromLocalStorage",{enumerable:!1,configurable:!0,writable:!0,value:function(t){e.prototype.syncDataFromLocalStorage.call(this,t),c(this,Pf,"f").clear(),c(this,Af,"m",Nf).call(this)}}),Object.defineProperty(r.prototype,"getOrCreateModel",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=Tf(e.conversationType,e.targetId,e.channelId),n=c(this,Pf,"f").get(r);return n||(n=e.conversationType===exports.ConversationType.ULTRA_GROUP?new Mf(e):new wf(e),t&&c(this,Pf,"f").set(r,n)),n}}),Object.defineProperty(r.prototype,"getUGFistUnreadMessageInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=Tf(exports.ConversationType.ULTRA_GROUP,e,t),n=c(this,Pf,"f").get(r);return(null==n?void 0:n.firstUnreadMessage)||null}}),Object.defineProperty(r.prototype,"updateConversationStorage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this.get("ultraGroupStatus"),r=this.get("conversationStatus");e.forEach((function(e){var n=e.conversationType,i=e.key,o=e.toStoragItem(),s=Object.keys(o),a=0===s.length||1===s.length&&"h"===s[0],u=n===exports.ConversationType.ULTRA_GROUP?t:r;a?delete u[i]:u[i]=o})),this.set("conversationStatus",r),this.set("ultraGroupStatus",t)}}),Object.defineProperty(r.prototype,"updateBySessionStates",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this,r=e.version,i=e.state;if(r&&this.set("conversationStatusVersion",r),!(null==i?void 0:i.length))return[];var o=new Map,s=new Set;return i.forEach((function(e){var n=e.channelId,i=e.busChannel,a=e.type,u=e.stateItem;if(e.time,n){var l=Tf(a,n,i),d=Rf(l),p=c(t,Pf,"f").get(l);p||(p=a===exports.ConversationType.ULTRA_GROUP?new Mf(d):new wf(d),c(t,Pf,"f").set(l,p)),s.add(p);var f={};null==u||u.forEach((function(e){var t=e.tags,r=e.sessionStateType,n=e.value;switch(r){case _o.IsSilent:f.notificationLevel=parseInt(n,10);break;case _o.IsTop:f.isTop="1"===n;break;case _o.Tags:f.tags=t}}));var h=p.updateAttrs(f,r);if(h)if(o.has(p)){var g=o.get(p);Object.assign(g,h)}else o.set(p,h)}})),this.updateConversationStorage(Array.from(s)),Array.from(o.entries()).map((function(e){var t=u(e,2),r=t[0],i=t[1];return n(n({},r.toIReceivedConversation()),{updatedItems:i})}))}}),Object.defineProperty(r.prototype,"addRelations",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n=this;e.forEach((function(e){var i=e.userId,o=e.type,s=e.busChannel,a=Tf(o,i,s),u=Rf(a),l=n.getOrCreateModel(u,!0),c=function(e,t,r){var n,i,o,s=e.msg;return{latestMessage:s?Wu(s,t,r,e.userId):void 0,lastReadTime:e.readMsgTime,unreadCount:e.unreadCount,operationTime:e.versionTime,unreadMentionedCount:e.remindCount,unreadMentionedMeCount:e.remindMeCount,firstUnreadMessageType:null===(n=e.msgInfo)||void 0===n?void 0:n.className,firstUnreadMessageUId:null===(i=e.msgInfo)||void 0===i?void 0:i.msgId,firstUnreadTime:null===(o=e.msgInfo)||void 0===o?void 0:o.msgTime}}(e,t,r);o===exports.ConversationType.ULTRA_GROUP?l.updateAttrs(c,e.versionTime||0):l.updateAttrs({latestMessage:c.latestMessage,operationTime:c.operationTime,hidden:!1},e.versionTime||0)}))}}),Object.defineProperty(r.prototype,"getDrafts",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r=Tf(e.conversationType,e.targetId,e.channelId);return(null===(t=c(this,Pf,"f").get(r))||void 0===t?void 0:t.draft)||""}}),Object.defineProperty(r.prototype,"setDrafts",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this.getOrCreateModel(e,!0).updateAttrs({draft:t})}}),Object.defineProperty(r.prototype,"deleteDrafts",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=Tf(e.conversationType,e.targetId,e.channelId),r=c(this,Pf,"f").get(t);r&&r.updateAttrs({draft:""})}}),Object.defineProperty(r.prototype,"getCachedUGConversation",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=Tf(exports.ConversationType.ULTRA_GROUP,e,t),n=c(this,Pf,"f").get(r);return(null==n?void 0:n.toIReceivedConversation())||null}}),Object.defineProperty(r.prototype,"getAllUGModels",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=c(this,Pf,"f").values();return Array.from(e).filter((function(e){return e.conversationType===exports.ConversationType.ULTRA_GROUP&&e.targetId})).map((function(e){return e}))}}),Object.defineProperty(r.prototype,"getAllSGModels",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=c(this,Pf,"f").values();return Array.from(e).filter((function(e){return e.conversationType!==exports.ConversationType.ULTRA_GROUP&&e.targetId})).map((function(e){return e}))}}),Object.defineProperty(r.prototype,"getAllModels",{enumerable:!1,configurable:!0,writable:!0,value:function(){return Array.from(c(this,Pf,"f").values()).filter((function(e){return e.targetId}))}}),Object.defineProperty(r.prototype,"getModel",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=Tf(e.conversationType,e.targetId,e.channelId);return c(this,Pf,"f").get(t)||null}}),Object.defineProperty(r.prototype,"removeConversation",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.conversationType,r=e.targetId,n=e.channelId,i=Tf(t,r,n),o=c(this,Pf,"f").get(i);o&&(o.remove(),this.updateConversationStorage([o]))}}),Object.defineProperty(r.prototype,"updateConversationCache",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this.getOrCreateModel(e,!0);r.updateAttrs(t,0),this.updateConversationStorage([r])}}),Object.defineProperty(r.prototype,"getUnreadCountByTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=0;return this.getAllSGModels().forEach((function(n){var i;if(n.tags.some((function(t){return t.tagId===e}))){if(n.notificationLevel>exports.NotificationLevel.NOT_SET&&!t)return;r+=null!==(i=n.unreadCount)&&void 0!==i?i:0}})),r}}),Object.defineProperty(r.prototype,"getAllUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=0;return this.getAllSGModels().forEach((function(n){var i,o=n.conversationType;e.includes(o)&&(n.notificationLevel>exports.NotificationLevel.NOT_SET&&!t||(r+=null!==(i=n.unreadCount)&&void 0!==i?i:0))})),r}}),Object.defineProperty(r.prototype,"getAllUnreadMentionedCount",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=0;return this.getAllSGModels().forEach((function(t){var r;e+=null!==(r=t.unreadMentionedCount)&&void 0!==r?r:0})),e}}),Object.defineProperty(r.prototype,"getTagConversationCountMap",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=new Map;return this.getAllModels().forEach((function(t){var r=t.tags;r.length>0&&r.forEach((function(r){e.set(r.tagId,(e.get(r.tagId)||[]).concat(t.id))}))})),e}}),Object.defineProperty(r.prototype,"getTotalUnreadCountByLevels",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n=0;return this.getAllModels().forEach((function(i){if(e.includes(i.conversationType)){var o=i.notificationLevel,s=i.unreadCount,a=i.unreadMentionedCount;(0===t.length||t.includes(o))&&(n+=r?a:s)}})),n}}),Object.defineProperty(r.prototype,"clearConversationUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,i){var o=Tf(e,t,r),s=c(this,Pf,"f").get(o);if(!s)return null;var a=s.updateAttrs({unreadCount:0,unreadMentionedCount:0,unreadMentionedMeCount:0,hasMentioned:!1,mentionedInfo:void 0,lastReadTime:i,firstUnreadTime:0,firstUnreadMessageType:void 0,firstUnreadMessageUId:void 0});return this.updateConversationStorage([s]),a?n(n({},s.toIReceivedConversation()),{updatedItems:a}):null}}),r}(If);function Uf(e){return Object.keys(e).map((function(t){var r=e[t];return"string"!=typeof r&&(r="".concat(r)),{key:t,value:r}}))}function Df(e,t,r,n){return Za.encode(ca,{targetId:e,type:exports.ConversationType.GROUP,users:n,extProfile:r?Uf(r):void 0,settingProfile:Uf(t)})}Pf=new WeakMap,Af=new WeakSet,Nf=function(){var e=this,t=Object.entries(this.get("conversationStatus")),r=Object.entries(this.get("ultraGroupStatus"));l(l([],u(t),!1),u(r),!1).forEach((function(t){var r,n,i,o,s,a,l,c,d,p,f,h,g,_,b=u(t,2),E=b[0],v=b[1],y=Rf(E);me(y.conversationType,be)&&e.getOrCreateModel(y,!0).updateAttrs((n=(r=v).c,i=r.mc,o=r.mmc,s=r.hm,a=r.m,l=r.fut,c=r.fuid,d=r.fumt,p=r.nl,f=r.to,h=r.tg,g=r.rt,_=r.h,{isTop:f,notificationLevel:p,tags:Cf(h),unreadCount:n,unreadMentionedCount:i,unreadMentionedMeCount:o,hasMentioned:s,mentionedInfo:a,firstUnreadTime:l,firstUnreadMessageUId:c,firstUnreadMessageType:d,lastReadTime:g,hidden:_}),0)}))};var xf,jf,Vf,Gf,kf,Ff,Bf,Hf,qf,Yf,Kf=function(e,t){return Za.encode(qo,{type:e.conversationType,msgTime:t,channelId:e.targetId,busChannel:e.channelId||""})},Qf=function(e,t,r){return Za.encode(wo,{startTime:e,order:t,count:r,compressioEnabled:Zu.enable()})},Wf=function(e){var t=Za.decode(Lo,e),r=t.compressioEnabled,n=t.compressedData,i=t.info,o=t.pullTime,s=t.isFinished;if(r){var a=Lp(n);return Wf(a)}return{info:i,pullTime:o,isFinished:s}},Jf=function(e){var t=Za.decode(mo,e);if(t.compressioEnabled){var r=Lp(t.compressedData);return Jf(r)}return t},zf=function(e){var t=Za.decode(Io,e);if(t.compressioEnabled){var r=Lp(t.compressedData);return zf(r)}return{syncTime:t.syncTime,list:t.list.map((function(e){return Za.decode(To,new Uint8Array(e))}))}},Zf=function(e){return Za.encode(vs,n(n({},e),{compress:Zu.enable()}))},Xf=function(e){var t=Za.decode(ys,e);if(t.compress){var r=Lp(t.compressData);return Xf(r)}return t},$f=function(e){function r(t,r){var n=e.call(this)||this;return xf.add(n),Object.defineProperty(n,"_ctx",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(n,"_storage",{enumerable:!0,configurable:!0,writable:!0,value:r}),n._ctx.on("sNtf",c(n,xf,"m",kf),n),n._ctx.on("signal",c(n,xf,"m",jf),n),n._ctx.on("syncMsg",c(n,xf,"m",Vf),n),n}return t(r,e),Object.defineProperty(r.prototype,"_handleSyncData",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var e,t,r,n,i,o,a,u,l,c,d,p,f,h,g,_,b,E,v;return s(this,(function(s){switch(s.label){case 0:return e=this._ctx,t=e.logger,r=e.currentUserId,n=e.connectedTime,i=this._storage.get("inboxTime"),o=this._storage.get("outboxTime"),a=this._storage.get("broadcastTime"),u=t.createTraceId(),t.info(H.L_PULL_MSG_T,JSON.stringify({inboxTime:i,outboxTime:o,broadcastTime:a}),u),l=Za.encode(Eo,{ispolling:!1,isPullSend:!0,syncTime:i,sendBoxSyncTime:o,broadcastSyncTime:a,compressioEnabled:Zu.enable()}),[4,this._ctx.query(Zr.pullMsg,this._ctx.currentUserId,l)];case 1:return c=s.sent(),t.summary(H.L_PULL_MSG_R,c,u),c.isOk?(d=Jf(c.data.pbData),f=(p=d).list,h=p.finished,g=p.syncTime,_=p.broadcastSyncTime,b=o,E=f.map((function(e){var t=Wu(e,r,n);return t.messageDirection===exports.MessageDirection.SEND&&(b=Math.max(b,t.sentTime)),t})),this._storage.set("inboxTime",g),this._storage.set("broadcastTime",_||1),this._storage.set("outboxTime",b),this._ctx.emit("messagesFromSG",E,!!h),v=Math.max(g,_||1,b),[2,ht({version:v,hasNext:!h})]):[2,c.wipe()]}}))}))}}),r}(bt);xf=new WeakSet,jf=function(e,t){rn(t.topic)===Zr.s_msg&&(e.stopPropagation(),c(this,xf,"m",Gf).call(this,t))},Vf=function(e,t,r){var n=t.conversationType,i=t.sentTime;n!==exports.ConversationType.ULTRA_GROUP&&n!==exports.ConversationType.CHATROOM&&(n===exports.ConversationType.RTC_ROOM||xp(r)||(e.stopPropagation(),this.push(i)))},Gf=function(e){var t=this._ctx,r=t.currentUserId,n=t.connectedTime,i=Za.decode(To,e.pbData),o=Wu(i,r,n),s=o.conversationType,a=o.sentTime,u=o.isStatusMessage;s===exports.ConversationType.RTC_ROOM||u?this._ctx.emit("smsgFromSignalGroup",o):this.push(a)},kf=function(e,t){1===t.type&&(e.stopPropagation(),this.push(t.time))};var eh,th,rh=function(e){function r(t){var r=e.call(this)||this;return Ff.add(r),Object.defineProperty(r,"_ctx",{enumerable:!0,configurable:!0,writable:!0,value:t}),r._ctx.on("syncMsg",c(r,Ff,"m",Hf),r),r._ctx.on("sCmd",c(r,Ff,"m",Bf),r),r}return t(r,e),Object.defineProperty(r.prototype,"markOnline",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t,r,n,i,o;return s(this,(function(s){switch(s.label){case 0:return[4,c(this,Ff,"m",Yf).call(this,0)];case 1:return(e=s.sent()).isOk?(this._ctx.logger.info(H.L_NOTIFY_ULTRA_ONLINE_S,"success"),t=e.data.syncTime,[4,c(this,Ff,"m",qf).call(this,0,[])]):(this._ctx.logger.warn(H.L_NOTIFY_ULTRA_ONLINE_S,"fail to pull ug msg, code: ".concat(e.code)),[2,e.wipe()]);case 2:return(r=s.sent()).isOk?(n=r.data,i=n.length>0?n[n.length-1].versionTime:0,o=Math.max(t,i),[2,ht({relations:n,msgVersion:o})]):[2,r.wipe()]}}))}))}}),Object.defineProperty(r.prototype,"_handleSyncData",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t=this;return s(this,(function(r){switch(r.label){case 0:return[4,c(this,Ff,"m",Yf).call(this,e)];case 1:return[2,r.sent().trans((function(e){var r=e,n=r.syncTime,i=r.finished,o=r.list;if(null==o?void 0:o.length){var s=t._ctx,a=s.currentUserId,u=s.connectedTime,l=o.map((function(e){return Wu(e,a,u)}));t._ctx.emit("messagesFromUG",l,n)}return{version:n,hasNext:!i}}))]}}))}))}}),r}(bt);Ff=new WeakSet,Bf=function(e,t){if(6===t.type)this.push(t.time),e.stopPropagation()},Hf=function(e,t){t.conversationType===exports.ConversationType.ULTRA_GROUP&&(this.push(t.sentTime),e.stopPropagation())},qf=function e(t,r){return o(this,void 0,void 0,(function(){var n,i,o,a,d,p,f,h,g;return s(this,(function(s){switch(s.label){case 0:return n=this._ctx,i=n.logger,o=i.createTraceId(),i.info(H.L_PULL_UG_RELATIONS_T,JSON.stringify({ver:t}),o),a=Za.encode(Ss,{syncTime:t,isEraseMsgContent:!1}),[4,this._ctx.query(Zr.pullUgSes,this._ctx.currentUserId,a,Lo)];case 1:return d=s.sent(),i.summary(H.L_PULL_UG_RELATIONS_R,d,o,{ver:t},(function(e){return{isFinished:e.isFinished}})),d.isOk?(p=d.data,f=p.info,h=p.isFinished,r.push.apply(r,l([],u(f),!1)),h?[2,ht(r)]:(g=f[f.length-1].versionTime,[2,c(this,Ff,"m",e).call(this,g,r)])):[2,d.wipe()]}}))}))},Yf=function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,o,a,u;return s(this,(function(s){switch(s.label){case 0:return t=this._ctx,r=t.currentUserId,n=t.logger,i=n.createTraceId(),n.info(H.L_PULL_ULTRA_MSG_T,JSON.stringify({version:e}),i),l=e,o=Za.encode(As,{syncTime:l,compressioEnabled:Zu.enable()}),[4,this._ctx.query(Zr.pullUgMsg,r,o)];case 1:return a=s.sent(),n.summary(H.L_PULL_ULTRA_MSG_R,a,i,{version:e}),a.isOk?(u=a.data,[2,ht(Jf(u.pbData))]):[2,a.wipe()]}var l}))}))};var nh=13,ih=36,oh=function(e){function r(t,r){var n=e.call(this)||this;return eh.add(n),Object.defineProperty(n,"_con",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(n,"_logger",{enumerable:!0,configurable:!0,writable:!0,value:r}),n}return t(r,e),Object.defineProperty(r.prototype,"_handleSyncData",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,o,a,l,d=this;return s(this,(function(s){switch(s.label){case 0:return t=this._logger.createTraceId(),this._logger.info(H.L_PULL_EVENT_CHANGE_T,JSON.stringify({version:e}),t),[4,c(this,eh,"m",th).call(this,e)];case 1:return r=s.sent(),this._logger.summary(H.L_PULL_EVENT_CHANGE_R,r,t,{version:e}),r.isOk?(n=r.data,i=n.list,o=n.syncTime,a=n.hasNext,i.length&&(l=new Map,i.forEach((function(e){var t=e.changeType;l.has(t)?l.get(t).push(e):l.set(t,[e])})),Array.from(l.entries()).forEach((function(e){var t=u(e,2),r=t[0],n=t[1];d.emit("serverEvent",r,n)}))),[2,ht({version:o,hasNext:a})]):[2,r.wipe()]}}))}))}}),Object.defineProperty(r.prototype,"noticeOnline",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t;return s(this,(function(r){switch(r.label){case 0:return e=this._logger.createTraceId(),this._logger.info(H.L_SERVER_EVENT_NOTIFY_ONLINE_T,JSON.stringify({version:0}),e),[4,c(this,eh,"m",th).call(this,0)];case 1:return t=r.sent(),this._logger.summary(H.L_SERVER_EVENT_NOTIFY_ONLINE_R,t,e,{version:0}),[2,t]}}))}))}}),r}(bt);eh=new WeakSet,th=function(e){var t=Za.encode(Ns,{syncTime:e});return this._con.query(Zr.pullEventChange,this._con.getCurrentUserId(),t,ws)};var sh,ah,uh,lh,ch,dh,ph,fh,hh,gh,_h,bh,Eh,vh,yh,mh,Ih,Th,Rh,Ch,Oh=function(e){function r(t){var r=e.call(this)||this;return Object.defineProperty(r,"_ctx",{enumerable:!0,configurable:!0,writable:!0,value:t}),r}return t(r,e),Object.defineProperty(r.prototype,"_handleSyncData",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,o,a;return s(this,(function(s){switch(s.label){case 0:return t=Za.encode(Ns,{syncTime:e}),[4,this._ctx.query(Zr.qryMsgChange,this._ctx.currentUserId,t,Ms)];case 1:return(r=s.sent()).isOk?(n=r.data,i=n.list,o=n.syncTime,a=n.hasNext,i&&i.length&&this._ctx.emit("ugChanged",i),[2,ht({version:o,hasNext:a})]):[2,r.wipe()]}}))}))}}),r}(bt),Sh=function(){return o(void 0,void 0,void 0,(function(){return s(this,(function(e){return[2,exports.ErrorCode.NOT_SUPPORT]}))}))},Ah=function(){return o(void 0,void 0,void 0,(function(){return s(this,(function(e){return[2,gt(exports.ErrorCode.NOT_SUPPORT,"Not support")]}))}))},Ph=18e4,Nh=function(){function e(e){ah.add(this),Object.defineProperty(this,"_ctx",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"storage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"settings",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),uh.set(this,void 0),lh.set(this,void 0),ch.set(this,void 0),gh.set(this,1),Object.defineProperty(this,"searchConversationByContent",{enumerable:!0,configurable:!0,writable:!0,value:Ah}),this.storage=new Lf(e),this.settings=new bf(this._ctx,this.storage),d(this,uh,new rh(this._ctx),"f"),d(this,lh,new $f(this._ctx,this.storage),"f"),d(this,ch,new Oh(this._ctx),"f"),this._ctx.on("onConnected",c(this,ah,"m",hh),this),this._ctx.on("onDisconnected",c(this,ah,"m",Eh),this),this._ctx.on("onSuspend",c(this,ah,"m",Eh),this),this._ctx.on("sCmd",c(this,ah,"m",vh),this),this._ctx.on("signal",c(this,ah,"m",yh),this),this._ctx.on("serverEvent",c(this,ah,"m",dh),this)}return Object.defineProperty(e.prototype,"getConversationListByFilter",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){return s(this,(function(t){switch(e.type){case Hr.TIMESTAMP:return[2,c(this,ah,"m",mh).call(this,e.params)];case Hr.BLOCKED:return[2,c(this,ah,"m",Th).call(this)];case Hr.TOP:return[2,c(this,ah,"m",Ih).call(this,e.params)];case Hr.UNREAD:return[2,c(this,ah,"m",Rh).call(this,e.params)];default:return[2,gt(exports.ErrorCode.NOT_SUPPORT)]}}))}))}}),Object.defineProperty(e.prototype,"getTotalUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n,i,o;return s(this,(function(s){return n=this._ctx.includeUg,i=0,o=t&&t.length?t:ye(n?be:ge),this.storage.getAllModels().forEach((function(t){t.unreadCount>0&&o.includes(t.conversationType)&&(t.conversationType!==exports.ConversationType.ULTRA_GROUP&&t.channelId===e||t.conversationType===exports.ConversationType.ULTRA_GROUP&&(""===t.channelId||"RCDefault"===t.channelId))&&(r||t.notificationLevel<=exports.NotificationLevel.NOT_SET)&&(i+=t.unreadCount)})),[2,ht(i)]}))}))}}),Object.defineProperty(e.prototype,"getConversation",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n;return s(this,(function(i){return n=this.storage.getOrCreateModel({conversationType:e,targetId:t,channelId:r},!1),[2,ht(n.toIReceivedConversation())]}))}))}}),Object.defineProperty(e.prototype,"batchSetConversationToTop",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return o(this,void 0,void 0,(function(){var r=this;return s(this,(function(i){return[2,this.settings.pushTask((function(i){return o(r,void 0,void 0,(function(){var r,o,a,u=this;return s(this,(function(s){switch(s.label){case 0:return[4,c(this,ah,"m",Ch).call(this,e,i,t)];case 1:return(r=s.sent()).isOk?(o=r.data.version,a=e.map((function(e){var r=u.storage.getOrCreateModel(e,!0);return r.updateAttrs({isTop:t,hidden:!n&&r.hidden,operationTime:r.hidden&&n?Date.now():r.operationTime}),r})),this.storage.updateConversationStorage(a),[2,ht({version:o})]):[2,r.wipe()]}}))}))}))]}))}))}}),Object.defineProperty(e.prototype,"batchSetConversationNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r=this;return s(this,(function(n){return[2,this.settings.pushTask((function(n){return o(r,void 0,void 0,(function(){var r,i,o,a=this;return s(this,(function(s){switch(s.label){case 0:return[4,c(this,ah,"m",Ch).call(this,e,n,void 0,t)];case 1:return(r=s.sent()).isOk?(i=r.data.version,o=e.map((function(e){var r=a.storage.getOrCreateModel(e,!0);return r.updateAttrs({notificationLevel:t}),r})),this.storage.updateConversationStorage(o),[2,ht({version:i})]):[2,r.wipe()]}}))}))}))]}))}))}}),Object.defineProperty(e.prototype,"getConversationNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t;return s(this,(function(r){return t=this.storage.getOrCreateModel(e,!1),[2,ht(t.notificationLevel)]}))}))}}),Object.defineProperty(e.prototype,"getConversationTypeNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t;return s(this,(function(r){return t=this.storage.getOrCreateModel({conversationType:e,targetId:""},!1),[2,ht(t.notificationLevel)]}))}))}}),Object.defineProperty(e.prototype,"setConversationTypeNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r=this;return s(this,(function(n){return[2,this.settings.pushTask((function(n){return o(r,void 0,void 0,(function(){var r,i,o;return s(this,(function(s){switch(s.label){case 0:return[4,this._ctx.query(Zr.setTypeUnpush,this._ctx.currentUserId,Za.encode(gs,{type:e,unpushLevel:t,version:n}),_s)];case 1:return(r=s.sent()).isOk?(i=r.data.version,(o=this.storage.getOrCreateModel({conversationType:e,targetId:""},!0)).updateAttrs({notificationLevel:t}),this.storage.updateConversationStorage([o]),[2,ht({version:i})]):[2,r.wipe()]}}))}))}))]}))}))}}),Object.defineProperty(e.prototype,"clearAllUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t;return s(this,(function(r){return e=this._ctx.includeUg,t=this.storage.getAllSGModels(),e&&t.push.apply(t,l([],u(this.storage.getAllUGModels().filter((function(e){return e.isDefaultChannel()}))),!1)),t.forEach((function(e){e.updateAttrs({unreadCount:0,unreadMentionedCount:0,unreadMentionedMeCount:0,hasMentioned:!1,mentionedInfo:void 0,lastReadTime:0,firstUnreadMessageType:void 0,firstUnreadMessageUId:void 0,firstUnreadTime:void 0})})),this.storage.updateConversationStorage(t),[2,ht()]}))}))}}),Object.defineProperty(e.prototype,"deleteRemoteMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i,o,a,u;return s(this,(function(s){switch(s.label){case 0:return r=t.map((function(e){return{msgDataTime:e.sentTime,msgId:e.messageUId,direct:e.messageDirection}})),n=Za.encode(Zo,{type:e.conversationType,busChannel:e.channelId,conversationId:e.targetId,msgs:r}),i=e.conversationType===exports.ConversationType.ULTRA_GROUP?Zr.delUgMsg:Zr.delMsg,[4,this._ctx.query(i,this._ctx.currentUserId,n)];case 1:return(o=s.sent()).isOk?this._ctx.includeUg?((a=this.storage.getModel(e))&&(u=a.latestMessage)&&t.some((function(e){return e.messageUId===u.messageUId}))&&a.updateAttrs({latestMessage:null}),[2,ht()]):[2,ht()]:[2,o.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"deleteRemoteMessageByTimestamp",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i,o,a;return s(this,(function(s){switch(s.label){case 0:return r=Za.encode(xo,{conversationType:e.conversationType,targetId:e.targetId,busChannel:e.channelId,dataTime:t}),n=xh[e.conversationType],[4,this._ctx.query(n,this._ctx.currentUserId,r)];case 1:return(i=s.sent()).isOk?this._ctx.includeUg?((o=this.storage.getModel(e))&&(a=o.latestMessage)&&(0===t||a.sentTime<=t)&&o.updateAttrs({latestMessage:null}),[2,ht()]):[2,ht()]:[2,i.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"batchClearRemoteHistoryMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var t,r,n=this;return s(this,(function(i){switch(i.label){case 0:return t=Za.encode(jo,{input:e.map((function(e){return{conversationType:e.conversationType,targetId:e.targetId,busChannel:e.channelId,dataTime:e.timestamp||0}}))}),[4,this._ctx.query(Zr.cleanMsgBatch,this._ctx.currentUserId,t)];case 1:return(r=i.sent()).isOk?(e.forEach((function(e){var t=n.storage.getModel(e);if(t){var r=t.latestMessage;r&&(!e.timestamp||r.sentTime<=e.timestamp)&&t.updateAttrs({latestMessage:null})}})),[2,ht()]):[2,r.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"sendReadReceiptResponseV5",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n;return s(this,(function(i){switch(i.label){case 0:return r=Za.encode(Es,{targetId:e.targetId,type:e.conversationType,channelId:e.channelId,readType:0,msgIds:t}),n=t[0],[4,this._ctx.query(Zr.readReceipt,n,r)];case 1:return[2,i.sent().wipe()]}}))}))}}),Object.defineProperty(e.prototype,"getMessageReadReceiptInfoV5",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i,o,a;return s(this,(function(s){switch(s.label){case 0:return r=Zf({targetId:e.targetId,type:e.conversationType,busChannel:e.channelId,msgIds:t,qryType:0}),[4,this._ctx.query(Zr.qryReceipt,t[0],r)];case 1:return(n=s.sent()).isOk?(i=n.data,o=Xf(i.pbData).resp,a=o.map((function(e){return{messageUId:e.msgId,unreadCount:e.unreadCnt,readCount:e.readCnt,totalCount:e.totalCnt}})),[2,ht(a)]):[2,n.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"getMessagesReadReceiptUsersByPageV5",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n,i,o,a,u,l,c,d;return s(this,(function(s){switch(s.label){case 0:return n=0===r.readStatus?1:2,i=Zf({targetId:e.targetId,type:e.conversationType,busChannel:e.channelId,msgIds:[t],qryType:1,pageType:1,pageToken:r.pageToken,pageSize:r.pageCount,readType:n,order:r.order?0:1}),[4,this._ctx.query(Zr.qryReceipt,t,i)];case 1:return(o=s.sent()).isOk?(a=o.data,u=Xf(a.pbData),l=u.resp,c=u.pageToken,d=l[0],[2,ht({pageToken:c||"",totalCount:1===n?d.readCnt:d.unreadCnt,users:(1===n?d.readUser:d.unreadUser).map((function(e){var t=e.userId,r=e.mentioned;return{userId:t,timestamp:e.receiptTime||0,isMentioned:!!r}}))})]):[2,o.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"getMessagesReadReceiptByUsersV5",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n,i,o,a,c;return s(this,(function(s){switch(s.label){case 0:return n=Zf({targetId:e.targetId,type:e.conversationType,busChannel:e.channelId,msgIds:[t],qryType:2,users:r}),[4,this._ctx.query(Zr.qryReceipt,t,n)];case 1:return(i=s.sent()).isOk?(o=i.data,a=Xf(o.pbData).resp,c=a[0],[2,ht({pageToken:"",totalCount:0,users:l(l([],u(c.readUser),!1),u(c.unreadUser),!1).map((function(e){var t=e.userId,r=e.mentioned;return{userId:t,timestamp:e.receiptTime||0,isMentioned:!!r}}))})]):[2,i.wipe()]}}))}))}}),e}();uh=new WeakMap,lh=new WeakMap,ch=new WeakMap,gh=new WeakMap,ah=new WeakSet,dh=function(e,t,r){if(t===ih){e.stopPropagation();var n=[];r.forEach((function(e){if(0===e.subChangeType){var t=Za.decode(ka,new Uint8Array(e.eventData)),r=t.msgId,i=t.unreadCnt,o=t.readCnt,s=t.readList,a=t.totalCnt;n.push({identifier:{conversationType:e.channelType,targetId:e.businessId,channelId:e.secondaryId},messageUId:r,users:s.map((function(e){return{userId:e.userId,timestamp:e.receiptTime,isMentioned:!!e.mentioned}})),readCount:o,unreadCount:i,totalCount:a})}})),this._ctx.emit("readReceiptResponseV5",n)}},ph=function(e){e||(c(this,lh,"f").setInitVersion(0),this._ctx.includeUg&&c(this,ah,"m",_h).call(this)),c(this,lh,"f").startInterval(Ph,!0)},fh=function(e){return o(this,void 0,void 0,(function(){var t;return s(this,(function(r){switch(r.label){case 0:return e?[3,2]:[4,this.settings.syncDataFromServer()];case 1:t=r.sent(),this.settings.setInitVersion(t),r.label=2;case 2:return this._ctx.isConnected&&this.settings.startInterval(Ph,!0),[2]}}))}))},hh=function(e,t){t||this.storage.syncDataFromLocalStorage(this._ctx),c(this,ah,"m",fh).call(this,t),c(this,ah,"m",ph).call(this,t),this._ctx.ugEnabel&&c(this,ah,"m",bh).call(this,t)},_h=function e(){return o(this,void 0,void 0,(function(){var t,r,n,i,o,a,u,l,p,f,h=this;return s(this,(function(s){switch(s.label){case 0:return this._ctx.isConnected?(t=this._ctx.logger,r=t.createTraceId(),n=c(this,gh,"f"),t.info(H.L_PULL_SG_RELATIONS_T,JSON.stringify({startTime:n}),r),i=Qf(n,1,1e3),[4,this._ctx.query(Zr.qryRelationR,this._ctx.currentUserId,i)]):[2];case 1:return(o=s.sent()).isOk?(a=o.data,u=Wf(a.pbData),l=u.info,p=u.isFinished,f=u.pullTime,d(this,gh,f,"f"),t.info(H.L_PULL_SG_RELATIONS_R,JSON.stringify({startTime:n,isFinished:p,pullTime:f}),r),this.storage.addRelations(l,this._ctx.currentUserId,this._ctx.connectedTime),p?(this._ctx.emit("sgRelationsSynced"),[2]):[2,c(this,ah,"m",e).call(this)]):(t.warn(H.L_PULL_SG_RELATIONS_R,o.errmsg(),r),setTimeout((function(){return c(h,ah,"m",e).call(h)}),1e3),[2])}}))}))},bh=function(e){return o(this,void 0,void 0,(function(){var e,t,r,n;return s(this,(function(i){switch(i.label){case 0:return[4,c(this,uh,"f").markOnline()];case 1:return(e=i.sent()).isOk?(t=e.data,r=t.relations,n=t.msgVersion,this.storage.addRelations(r,this._ctx.currentUserId,this._ctx.connectedTime),this._ctx.emit("ultraGroupEnable"),c(this,uh,"f").setInitVersion(n),c(this,uh,"f").startInterval(Ph,!0),c(this,ch,"f").setInitVersion(n),c(this,ch,"f").startInterval(Ph,!0),[2]):[2]}}))}))},Eh=function(){this.settings.stopInterval(),c(this,uh,"f").reset(),c(this,lh,"f").reset(),c(this,ch,"f").reset()},vh=function(e,t){if(3===t.type)return e.stopPropagation(),void this.settings.push(t.time);7===t.type&&(e.stopPropagation(),c(this,ch,"f").push(t.time))},yh=function(e,t,r){var n=t.syncMsg,i=rn(t.topic);if(n&&i===Zr.updUgRTime){e.stopPropagation();var o=Za.decode(qo,t.pbData),s=o.channelId,a=o.busChannel,u=o.msgTime,l=this.storage.clearConversationUnreadCount(exports.ConversationType.ULTRA_GROUP,s,a||"",u);l&&this._ctx.emit("conversationStatusChanged",[l])}},mh=function(e){return o(this,void 0,void 0,(function(){var t,r,i,o,a,u,l,c,d,p,f,h,g,_,b,E,v,y=this;return s(this,(function(s){switch(s.label){case 0:return t=e.count,r=e.startTime,i=e.order,o=this._ctx,a=o.currentUserId,u=o.connectedTime,this._ctx.includeUg?[3,2]:(l=Qf(r,i||0,t),[4,this._ctx.query(Zr.qryRelationR,this._ctx.currentUserId,l)]);case 1:return(c=s.sent()).isOk?(d=Wf(c.data.pbData),p=d.info,f=d.isFinished,h=p.map((function(e){var t=e.userId,r=e.type,i=e.busChannel,o=y.storage.getOrCreateModel({conversationType:r,targetId:t,channelId:i},!1);return n(n({},o.toIReceivedConversation()),{operationTime:e.versionTime,latestMessage:e.msg?Wu(e.msg,a,u,t):null})})),[2,ht({list:h,hasNext:"boolean"==typeof f?!f:void 0})]):[2,c.wipe()];case 2:return g=0!==r||i?r:Number.MAX_SAFE_INTEGER,_=this.storage.getAllModels().filter((function(e){return!e.hidden&&(e.conversationType!==exports.ConversationType.ULTRA_GROUP||!e.channelId||"RCDefault"===e.channelId)&&(i?e.operationTime>g:e.operationTime<g)})).sort((function(e,t){return e.operationTime-t.operationTime})),b=_.length>t,E=Math.min(_.length,t),v=i?_.slice(0,E):_.slice(_.length-E),i||v.reverse(),[2,ht({hasNext:b,list:v.map((function(e){return e.toIReceivedConversation()}))})]}}))}))},Ih=function(e){var t;return o(this,void 0,void 0,(function(){var r,n,i,o;return s(this,(function(s){return r=this._ctx.includeUg,n=null==e?void 0:e.channelId,i=((null===(t=null==e?void 0:e.conversationTypes)||void 0===t?void 0:t.length)||0)>0?e.conversationTypes:ye(r?be:ge),o=this.storage.getAllModels().filter((function(e){return e.isTop&&!e.hidden&&(e.conversationType!==exports.ConversationType.ULTRA_GROUP&&(!n||e.channelId===n)||r&&(!e.channelId||""===e.channelId||"RCDefault"===e.channelId))&&i.includes(e.conversationType)})).sort((function(e,t){return e.operationTime-t.operationTime})).map((function(e){return e.toIReceivedConversation()})),[2,ht({list:o,hasNext:!1})]}))}))},Th=function(){return o(this,void 0,void 0,(function(){var e,t;return s(this,(function(r){return e=this._ctx.includeUg,t=this.storage.getAllModels().filter((function(t){return!t.hidden&&t.notificationLevel>exports.NotificationLevel.NOT_SET&&(t.conversationType!==exports.ConversationType.ULTRA_GROUP||e&&(!t.channelId||""===t.channelId||"RCDefault"===t.channelId))})).sort((function(e,t){return e.operationTime-t.operationTime})).map((function(e){return e.toIReceivedConversation()})),[2,ht({list:t,hasNext:!1})]}))}))},Rh=function(e){var t;return o(this,void 0,void 0,(function(){var r,n,i;return s(this,(function(o){return r=this._ctx.includeUg,n=((null===(t=null==e?void 0:e.conversationTypes)||void 0===t?void 0:t.length)||0)>0?e.conversationTypes:ye(r?be:ge),i=this.storage.getAllModels().filter((function(e){return e.unreadCount>0&&(e.conversationType!==exports.ConversationType.ULTRA_GROUP||r&&(!e.channelId||""===e.channelId||"RCDefault"===e.channelId))&&n.includes(e.conversationType)})).sort((function(e,t){return e.operationTime-t.operationTime})).map((function(e){return e.toIReceivedConversation()})),[2,ht({list:i,hasNext:!1})]}))}))},Ch=function(e,t,r,n){return o(this,void 0,void 0,(function(){var i,o;return s(this,(function(s){return i=[],void 0!==r&&i.push({sessionStateType:_o.IsTop,value:r?"1":"0"}),void 0!==n&&i.push({sessionStateType:_o.IsSilent,value:n.toString()}),o=Za.encode(cs,{version:t,state:e.map((function(e){return{type:e.conversationType,channelId:e.targetId,busChannel:e.channelId,stateItem:i}}))}),[2,this._ctx.query(Zr.setSeAtt,this._ctx.currentUserId,o,hs)]}))}))};var wh,Mh,Lh,Uh,Dh,xh=((sh={})[exports.ConversationType.PRIVATE]=Zr.cleanPMsg,sh[exports.ConversationType.GROUP]=Zr.cleanGMsg,sh[exports.ConversationType.CUSTOMER_SERVICE]=Zr.cleanCMsg,sh[exports.ConversationType.SYSTEM]=Zr.cleanSMsg,sh[exports.ConversationType.APP_PUBLIC_SERVICE]=Zr.cleanMCMsg,sh[exports.ConversationType.PUBLIC_SERVICE]=Zr.cleanMPMsg,sh[exports.ConversationType.ULTRA_GROUP]=Zr.cleanGMsg,sh),jh=function(){Object.defineProperty(this,"recallMsgMap",{enumerable:!0,configurable:!0,writable:!0,value:new Set})};function Vh(e){var t=!(1&~(e.ugMsg||0)),r=!(1&~(e.sessionCfg||0));return t&&r}var Gh,kh=[Zr.chatMsg,Zr.ugMsg,Zr.recallMsg,Zr.ppMsgS,Zr.pgMsgS,Zr.ppMsgP,Zr.pgMsgP,Zr.pcMsgP,Zr.prMsgS,Zr.pbMsgP,Zr.chatMsgS],Fh=function(e){function r(t,r,n,i){var o=e.call(this)||this;return wh.add(o),Object.defineProperty(o,"appkey",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(o,"_connMgr",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(o,"_navi",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(o,"logger",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(o,"send",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(o,"query",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(o,"userStorage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Mh.set(o,void 0),o.userStorage=new jh,d(o,Mh,new oh(r,i),"f"),c(o,Mh,"f").pipe(o),o.on("onConnected",c(o,wh,"m",Lh),o,100),o.on("onDisconnected",c(o,wh,"m",Uh),o,100),o.on("onSuspend",c(o,wh,"m",Uh),o,100),o.send=o._connMgr.send.bind(o._connMgr),o.query=o._connMgr.query.bind(o._connMgr),o.on("signal",c(o,wh,"m",Dh),o),o}return t(r,e),Object.defineProperty(r.prototype,"isConnected",{get:function(){return this._connMgr.isConnected},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"currentUserId",{get:function(){return this._connMgr.getCurrentUserId()},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"currentToken",{get:function(){return this._connMgr.getToken()},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"serverTime",{get:function(){return this._connMgr.getCrtServerTime()},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"connectedTime",{get:function(){return this._connMgr.getConnectedTime()},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"ugEnabel",{get:function(){return!(1&~(this.getNaviInfoFromCache().ugMsg||0))},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"isDisableEmptyUGChannelId",{get:function(){return!(2&~(this.getNaviInfoFromCache().ugDriven||0))},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"includeUg",{get:function(){return Vh(this.getNaviInfoFromCache())},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"getNaviInfoFromCache",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._navi.getNaviInfoFromCache(this.currentToken)}}),r}(pt);Mh=new WeakMap,wh=new WeakSet,Lh=function(e,t){return o(this,void 0,void 0,(function(){var e,t,r,n,i,o,a;return s(this,(function(s){switch(s.label){case 0:return e=this.getNaviInfoFromCache(),t=e.eventDriven||0,r=e.grpRRVer||0,(3&t)>0||4===r?[4,c(this,Mh,"f").noticeOnline()]:[3,2];case 1:if(!(n=s.sent()).isOk)return[2];i=n.data,o=i.syncTime,a=i.hasNext,c(this,Mh,"f").setInitVersion(o),c(this,Mh,"f").startInterval(18e4,!!a),s.label=2;case 2:return[2]}}))}))},Uh=function(e){c(this,Mh,"f").reset()},Dh=function(e,t,r){var n=t.topic,i=t.syncMsg,o=rn(n);if(o||(this.logger.warn(H.L_RECV_RMTP_E,"unknown topic: ".concat(n)),e.stopPropagation()),this.logger.debug(H.L_RECV_RMTP_O,n),i&&kh.includes(o)){e.stopPropagation();var s=r||{},a=s.timestamp,u=void 0===a?this.serverTime:a,l=s.messageUId,d=void 0===l?"":l,p=Qu(t,this.currentUserId,u,d),f=Wu(p,this.currentUserId,this.connectedTime,t.targetId);this.emit("syncMsg",f,o)}else{if(o===Zr.s_ntf){e.stopPropagation();var h=(b=Za.decode(bo,t.pbData)).type,g=b.chrmId,_=b.time;return this.logger.info(H.L_RECV_S_NTF_O,"type: ".concat(h,", chrmId: ").concat(g,", time: ").concat(_)),void this.emit("sNtf",b)}if(o===Zr.s_cmd){e.stopPropagation();var b;h=(b=Za.decode(bo,t.pbData)).type,g=b.chrmId,_=b.time;if(this.logger.info(H.L_RECV_S_CMD_O,"type: ".concat(h,", chrmId: ").concat(g,", time: ").concat(_)),11===h)return void c(this,Mh,"f").push(_);this.emit("sCmd",b)}}};var Bh=((Gh={})[exports.ConversationType.PRIVATE]=Zr.qryPMsg,Gh[exports.ConversationType.GROUP]=Zr.qryGMsg,Gh[exports.ConversationType.CHATROOM]=Zr.qryCHMsg,Gh[exports.ConversationType.CUSTOMER_SERVICE]=Zr.qryCMsg,Gh[exports.ConversationType.SYSTEM]=Zr.qrySMsg,Gh[exports.ConversationType.APP_PUBLIC_SERVICE]=Zr.qryMCMsg,Gh[exports.ConversationType.PUBLIC_SERVICE]=Zr.qryMPMsg,Gh),Hh=function(e,t,r,n,i,o,s){return{conversationType:e,targetId:t,senderUserId:o,messageDirection:exports.MessageDirection.SEND,isCounted:!!r.isCounted,isMentioned:!!r.isMentioned,content:r.content,messageType:r.messageType,isOffLineMessage:!1,isPersited:!!r.isPersited,messageUId:n,sentTime:i,receivedTime:0,disableNotification:!!r.disableNotification,isStatusMessage:!!r.isStatusMessage,canIncludeExpansion:!!r.canIncludeExpansion,expansion:r.canIncludeExpansion?r.expansion:null,receivedStatus:exports.ReceivedStatus.UNREAD,receivedStatusInfo:Bt(exports.ReceivedStatus.UNREAD),pushConfig:r.pushConfig,channelId:r.channelId,isInterrupt:r.isInterrupt,messageId:s||0,sentStatus:exports.SentStatus.SENT,directedUserIds:r.directionalUserIdList,disableUpdateLastMessage:r.disableUpdateLastMessage,needReceipt:r.needReceipt}},qh=[M.GROUP_OPERATION,M.GROUP_PROFILE_CHANGE,M.GROUP_APPLICATION_INVITATION,M.GROUP_FOLLOW_USER_CHANGE],Yh=[v.FRIEND_APPLICATION];function Kh(){return function(e,t,r){var n=r.value;return r.value=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return o(this,void 0,void 0,(function(){return s(this,(function(t){return this._isConnected?[2,n.apply(this,e)]:[2,Promise.resolve({code:exports.ErrorCode.RC_NET_UNAVAILABLE})]}))}))},r}}function Qh(){return function(e,t,r){var n=r.value;return r.value=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return o(this,void 0,void 0,(function(){return s(this,(function(t){return this._isConnected?[2,n.apply(this,e)]:[2,Promise.resolve(gt(exports.ErrorCode.RC_NET_UNAVAILABLE))]}))}))},r}}function Wh(e){return e?e.map((function(e){var t;return{userId:e.userId,name:e.name,portraitUri:e.portraitUrl,remark:null!==(t=e.remarkName)&&void 0!==t?t:"",directionType:e.friendType,extProfile:e.extProfile,addTime:kt(e.relationTime),inBlackList:!!e.flag}})):[]}function Jh(e){return e&&e.list?e.list.map((function(e){return{userId:e.userId,name:e.name||"",portraitUri:e.portraitUrl||"",applicationType:e.type,applicationStatus:e.status,operationTime:kt(e.operateTime),extra:e.info||"",friendType:e.friendType}})):[]}var zh=function(e){function r(t,r,n){var i=e.call(this,t,r,n,new lf(n.appkey,"IMLib","IM"))||this;d.add(i),Object.defineProperty(i,"_connMgr",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(i,"_ctx",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(i,"_sendMessageStore",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(i,"_chrmEntryHandler",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(i,"_joinedChrmManager",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(i,"_userSettingManager",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(i,"_readReceiptManager",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(i,"_subscribeManager",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(i,"_reconnectTimer",{enumerable:!0,configurable:!0,writable:!0,value:-1}),Object.defineProperty(i,"_pullOfflineFinished",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(i,"reporter",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(i,"reporterStatistic",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(i,"navi",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(i,"_openCallPlus",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(i,"cloudController",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(i,"cloudControllerUri",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(i,"_environment",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(i,"_enableReadReceiptStorage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(i,"_chat",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(i,"_chrmsQueue",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(i,"_latestPullKVMsgTimestamp",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(i,"getFirstUnreadMessage",{enumerable:!0,configurable:!0,writable:!0,value:Ah}),Object.defineProperty(i,"_intervalTimerForChrmPull",{enumerable:!0,configurable:!0,writable:!0,value:-1}),Object.defineProperty(i,"_handleInnerMsgOptions",{enumerable:!0,configurable:!0,writable:!0,value:function(e,t,r){var n,o=r.messageType;if(o===exports.MessageType.SYNC_READ_STATUS&&function(e){return[exports.ConversationType.GROUP,exports.ConversationType.DISCUSSION,exports.ConversationType.ULTRA_GROUP,exports.ConversationType.PUBLIC_SERVICE,exports.ConversationType.APP_PUBLIC_SERVICE].includes(e)}(e)&&Object.assign(r,{directionalUserIdList:[i.currentUserId]}),o===exports.MessageType.READ_RECEIPT_RESPONSE){if(!r.content.receiptMessageDic||0===Object.keys(r.content.receiptMessageDic).length){var s=null===(n=i._readReceiptManager)||void 0===n?void 0:n.getReceiptMessageDic({conversationType:e,targetId:t,channelId:r.channelId});r.content.receiptMessageDic=s||{}}for(var a in r.directionalUserIdList=[],r.content.receiptMessageDic)r.directionalUserIdList.push(a)}return r}}),Object.defineProperty(i,"_isUltraGroupListExist",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(i,"_ultraMsgMap",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(i,"getContinuousMessages",{enumerable:!0,configurable:!0,writable:!0,value:Ah}),Object.defineProperty(i,"getHistoryMessagesByObjectNames",{enumerable:!0,configurable:!0,writable:!0,value:Ah}),Object.defineProperty(i,"clearConversations",{enumerable:!0,configurable:!0,writable:!0,value:Sh}),Object.defineProperty(i,"setUserStatusListener",{enumerable:!0,configurable:!0,writable:!0,value:Sh}),Object.defineProperty(i,"setUserStatus",{enumerable:!0,configurable:!0,writable:!0,value:Sh}),Object.defineProperty(i,"subscribeUserStatus",{enumerable:!0,configurable:!0,writable:!0,value:Sh}),Object.defineProperty(i,"getUserStatus",{enumerable:!0,configurable:!0,writable:!0,value:Ah}),Object.defineProperty(i,"addToBlacklist",{enumerable:!0,configurable:!0,writable:!0,value:Sh}),Object.defineProperty(i,"removeFromBlacklist",{enumerable:!0,configurable:!0,writable:!0,value:Sh}),Object.defineProperty(i,"getBlacklist",{enumerable:!0,configurable:!0,writable:!0,value:Ah}),Object.defineProperty(i,"getBlacklistStatus",{enumerable:!0,configurable:!0,writable:!0,value:Ah}),Object.defineProperty(i,"insertMessage",{enumerable:!0,configurable:!0,writable:!0,value:Ah}),Object.defineProperty(i,"batchInsertMessage",{enumerable:!0,configurable:!0,writable:!0,value:Ah}),Object.defineProperty(i,"getMessageCount",{enumerable:!0,configurable:!0,writable:!0,value:Ah}),Object.defineProperty(i,"deleteMessages",{enumerable:!0,configurable:!0,writable:!0,value:Sh}),Object.defineProperty(i,"deleteMessagesByTimestamp",{enumerable:!0,configurable:!0,writable:!0,value:Sh}),Object.defineProperty(i,"batchClearMessagesByTimestamp",{enumerable:!0,configurable:!0,writable:!0,value:Sh}),Object.defineProperty(i,"clearMessages",{enumerable:!0,configurable:!0,writable:!0,value:Sh}),Object.defineProperty(i,"getMessage",{enumerable:!0,configurable:!0,writable:!0,value:Ah}),Object.defineProperty(i,"setMessageContent",{enumerable:!0,configurable:!0,writable:!0,value:Sh}),Object.defineProperty(i,"setMessageSearchField",{enumerable:!0,configurable:!0,writable:!0,value:Sh}),Object.defineProperty(i,"searchConversationByContentWithAllChannel",{enumerable:!0,configurable:!0,writable:!0,value:Ah}),Object.defineProperty(i,"searchMessagesWithParams",{enumerable:!0,configurable:!0,writable:!0,value:Ah}),Object.defineProperty(i,"getMessagesByTimestamp",{enumerable:!0,configurable:!0,writable:!0,value:Ah}),Object.defineProperty(i,"setMessageSentStatus",{enumerable:!0,configurable:!0,writable:!0,value:Sh}),Object.defineProperty(i,"updateMessageReceiptStatus",{enumerable:!0,configurable:!0,writable:!0,value:Ah}),Object.defineProperty(i,"setMessageReceivedStatus",{enumerable:!0,configurable:!0,writable:!0,value:Sh}),Object.defineProperty(i,"clearLocalData",{enumerable:!0,configurable:!0,writable:!0,value:Ah}),Object.defineProperty(i,"clearUnreadCountByTimestamp",{enumerable:!0,configurable:!0,writable:!0,value:Sh}),Object.defineProperty(i,"setCheckDuplicateMessage",{enumerable:!0,configurable:!0,writable:!0,value:Ah}),Object.defineProperty(i,"setCheckChatRoomDuplicateMessage",{enumerable:!0,configurable:!0,writable:!0,value:Ah}),Object.defineProperty(i,"getConversations",{enumerable:!0,configurable:!0,writable:!0,value:Ah});var o=n.appkey,s=n.logOutputLevel,a=n.logExpireTime,u=n.navigators,l=n.areaCode,h=n.logServerUrl,g=n.miniCMPProxy,_=n.environment,b=n.useNaviV2,E=void 0!==b&&b,v=n.enableReadReceiptStorage;i._environment=_||"default",i._enableReadReceiptStorage=v,i.logger.setOutputLevel(s),yr.init({areaCode:l,navigators:u,logServerUrl:h,miniCMPProxy:g}),Zp(o,i.logger,a),i.reporter=new gf(o,i.logger),i.navi=new hl(o,i.logger,new yl(o,i.logger),i._environment,E),i.reporterStatistic=new _f(o,i.logger),i._sendMessageStore=new gl(o),i._chrmEntryHandler=new ul(i);var y=i._connMgr=new Fp(o,i.navi,i.logger),m=i._ctx=new Fh(i._appkey,y,i.navi,i.logger);return i._connMgr.pipe(m),i._chat=new Nh(m),m.on("conversationStatusChanged",i._conversationStatusChanged,i),m.on("sCmd",i._handleSCmdNotify,i),m.on("sNtf",i._handleMsgNotify,i),m.on("signal",i._handleSignal,i),m.on("onConnected",i.onConnected,i),m.on("onDisconnected",i.onDisconnected,i),m.on("onConnecting",i.onConnecting,i),m.on("onSuspend",i.onSuspend,i),m.on("ultraGroupEnable",i._handleUltraGroupEnable,i),m.on("messagesFromUG",i._handleMessagesFromUltraGroup,i),m.on("messagesFromSG",i._handleMessagesFromSignalGroup,i),m.on("smsgFromSignalGroup",i._handleSmsgFromSignalGroup,i),m.on("syncMsg",i._handleSyncMsg,i),m.on("sgRelationsSynced",i._handleSGRelationsSynced,i),m.on("serverEvent",c(i,d,"m",f),i),m.on("readReceiptResponseV5",c(i,d,"m",p),i),m.on("ugChanged",i._handleUGChangeList,i),i}var d,p,f,h;return t(r,e),Object.defineProperty(r.prototype,"chat",{get:function(){return this._chat},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"_initCloudController",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e;e=u(yr.getCloudControllerUrl(),1),this.cloudControllerUri=e[0],this.cloudController=new Bp(this._appkey,this.logger,this.reporter),this.cloudControllerUri&&this.cloudController.request(this.cloudControllerUri,Ir.init)}}),Object.defineProperty(r.prototype,"onConnected",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this.navi.getNaviInfoFromCache(this._connMgr.getToken());this._pullOfflineFinished=!1,this._joinedChrmManager||(this._joinedChrmManager=new ll(r.joinMChrm)),this._userSettingManager||(this._userSettingManager=new dl(this,this._appkey,this.currentUserId,this._watcher.tag)),this._readReceiptManager||(this._readReceiptManager=new vl(this._appkey,this.currentUserId,this._connMgr.getDelayTime())),this._initSubscribeManager(r),this._userSettingManager.pullUserSettings(0),this._sendMessageStore.init(this.currentUserId),this._rejoinChrm(),this._openCallPlus&&this._syncCallPullKVMsg(),this._watcher.onConnected(),this.reporter.checkStart(r),this.reporterStatistic.checkStart(r)}}),Object.defineProperty(r.prototype,"onDisconnected",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r;this._resetMemoryState(),null===(r=this._userSettingManager)||void 0===r||r.stopAllTask(),this._watcher.onDisconnected(t)}}),Object.defineProperty(r.prototype,"onSuspend",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r;null===(r=this._userSettingManager)||void 0===r||r.stopAllTask(),this._watcher.onSuspend(t)}}),Object.defineProperty(r.prototype,"onConnecting",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._watcher.onConnecting()}}),Object.defineProperty(r.prototype,"_conversationStatusChanged",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._watcher.conversation(t);var r=t.some((function(e){var t;return void 0!==(null===(t=e.updatedItems)||void 0===t?void 0:t.tags)}));r&&this._watcher.conversationTag()}}),Object.defineProperty(r.prototype,"_initSubscribeManager",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;(e.subDriven||e.userProfile)&&(this._subscribeManager||(this._subscribeManager=new El(this._connMgr,{syncSubscribeUserStatusFinished:function(e){var r,n;null===(n=(r=t._watcher).syncSubscribedUserStatusFinished)||void 0===n||n.call(r,e)},subscribeUserStatusChanged:function(e){var r,n;null===(n=(r=t._watcher).subscribedUserStatusChange)||void 0===n||n.call(r,e)},subscribeRelationChanged:function(e){var r,n;null===(n=(r=t._watcher).subscribedRelationChange)||void 0===n||n.call(r,e)},ownUserProfileChanged:function(e){var r,n;null===(n=(r=t._watcher).ownUserProfileChanged)||void 0===n||n.call(r,e)}},this.currentUserId,this._connMgr.getDelayTime(),this.logger,!!e.userProfile,e.subDriven||0)),this._subscribeManager.syncData())}}),Object.defineProperty(r.prototype,"createLogger",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return new lf(this._appkey,e,t)}}),Object.defineProperty(r.prototype,"refetchNaviInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.navi.request(this._connMgr.getToken(),!0,!0,this.logger.createTraceId())}}),Object.defineProperty(r.prototype,"getNaviInfoFromCache",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.navi.getNaviInfoFromCache(this._connMgr.getToken())}}),Object.defineProperty(r.prototype,"getConnectedTime",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._connMgr.getConnectedTime()}}),Object.defineProperty(r.prototype,"getConnectionStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._connMgr.getConnectionStatus()}}),Object.defineProperty(r.prototype,"connect",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return o(this,void 0,void 0,(function(){return s(this,(function(i){return this._openCallPlus=r,[2,this._connMgr.connect(e,t,r,n)]}))}))}}),Object.defineProperty(r.prototype,"_handleUltraGroupEnable",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._isUltraGroupListExist=!0,this._watcher.ultraGroupEnable()}}),Object.defineProperty(r.prototype,"_handleSGRelationsSynced",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._watcher.sgRelationsSynced()}}),Object.defineProperty(r.prototype,"_handleMessagesFromUltraGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var i=this,o=new Map,s=[];t.forEach((function(e){var t,r,n,a=e.targetId,u=e.content,l=e.messageUId,c=e.channelId,d=e.isMentioned,p=e.isCounted,f=e.senderUserId,h=e.messageType,g=e.sentTime,_=e.channelType,b=e.isPersited;if(i._ultraMsgMap[l])delete i._ultraMsgMap[l];else{var E={conversationType:exports.ConversationType.ULTRA_GROUP,targetId:a,channelId:c||""},v=i._chat.storage.getOrCreateModel(E,!0),y=o.get(v)||{channelType:_};o.set(v,y),b&&(y.hidden=!1,y.latestMessage=e,y.operationTime=g),p&&f!==i.currentUserId&&h!==exports.MessageType.RECALL_NOTIFICATION_MESSAGE&&(y.unreadCount=v.unreadCount+1,d&&((null===(t=null==u?void 0:u.mentionedInfo)||void 0===t?void 0:t.type)===exports.MentionedType.ALL||(null===(n=null===(r=null==u?void 0:u.mentionedInfo)||void 0===r?void 0:r.userIdList)||void 0===n?void 0:n.includes(i.currentUserId)))&&(y.unreadMentionedCount=v.unreadMentionedCount+1,y.hasMentioned=!0,y.mentionedInfo=null==u?void 0:u.mentionedInfo),v.firstUnreadMessage||(y.firstUnreadMessageType=h,y.firstUnreadMessageUId=l,y.firstUnreadTime=g)),s.push(e)}}));var a=[],l=[];Array.from(o.entries()).forEach((function(e){var t=u(e,2),r=t[0],i=t[1];a.push(r);var o=r.updateAttrs(i);o&&l.push(n(n({},r.toIReceivedConversation()),{updatedItems:o}))})),this._chat.storage.updateConversationStorage(a),l.length>0&&this._watcher.conversation(l),this._batchMessage(s)}}),Object.defineProperty(r.prototype,"_handleMessagesFromSignalGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n=this,i=this._messageProcessor(t),o=i.newOutboxTime;i.messageUIds;var s=i.messages,a=i.messageExpansionList,u=i.RSMsgList,l=i.msgUIds2Statistic;l.length>0&&this.logger.record(pe.IM_MSG_RECEIVE,JSON.stringify({client_ts:Date.now(),server_deltatime:Date.now()-this._connMgr.getCrtServerTime(),msg_ids:l.join(",")})),this._batchMessage(s),a.forEach((function(e){n._receiveMessageExpansion(e)})),u.forEach((function(e){n._processRSMsg(e)})),this._sendMessageStore.removeByTimestamp(o),r&&!this._pullOfflineFinished&&(this._pullOfflineFinished=!0,this.logger.info(H.L_PULL_OFFLINE_MESSAGE_FINISHED_S),this._watcher.pullFinished())}}),Object.defineProperty(r.prototype,"_handleSignal",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n,i=t.syncMsg,o=t.topic;if(i)this._receiveSyncMsg(t,r);else switch(rn(o)){case Zr.s_us:this._receiveSettingNotify(t);break;case Zr.rtc_ntf:this._receiveRtcKv(t.pbData);break;case Zr.s_opNtf:this._pullOperateStatusNotify(t);break;case Zr.s_pubCall:this._pubCallInfo(t);break;case Zr.s_stat:null===(n=this._subscribeManager)||void 0===n||n.updateUserStatus(t)}}}),Object.defineProperty(r.prototype,"_handleSCmdNotify",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r,n,i,o=t.time,s=t.type,a=t.chrmId;switch(s){case 2:if(!this._chrmsQueue[a])return;this._chrmEntryHandler.pullEntry(a,o);break;case 4:this._chrmEntryHandler.reset(a),this._watcher.chatroom({chatroomDestroyed:a});break;case 8:null===(r=this._subscribeManager)||void 0===r||r.startsyncSubscribeUserStatus(o);break;case 9:null===(n=this._subscribeManager)||void 0===n||n.startSyncSubscribeRelationship(o);break;case 10:null===(i=this._subscribeManager)||void 0===i||i.syncOwnProfile(!0)}}}),Object.defineProperty(r.prototype,"_receiveSettingNotify",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=Za.decode(Cs,e.pbData).version;this._userSettingManager.pullUserSettings(t)}}),Object.defineProperty(r.prototype,"_receiveMessageExpansion",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.content,r=e.channelId,n=void 0===r?"":r,i=e.conversationType,o=e.targetId,s=t.put,a=t.del,u=t.mid;s&&this._watcher.expansion({updatedExpansion:{messageUId:u,expansion:s,channelId:n,conversationType:i,targetId:o}}),a&&this._watcher.expansion({deletedExpansion:{messageUId:u,deletedKeys:a,channelId:n,conversationType:i,targetId:o}})}}),Object.defineProperty(r.prototype,"_clearConversationUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){var o=this._chat.storage.clearConversationUnreadCount(e,t,r,i);n&&o&&this._watcher.conversation([o])}}),Object.defineProperty(r.prototype,"_setConversationCacheByMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.conversationType,r=e.isPersited,i=e.targetId,o=e.channelId,s=e.sentTime,a=e.disableUpdateLastMessage;e.messageDirection;var u=e.senderUserId,l=e.messageType,c=e.isCounted,d=e.messageUId,p=e.content,f=e.isMentioned;if(me(t,ge)){var h=this.getNaviInfoFromCache(),g=this._chat.storage.getOrCreateModel({conversationType:t,targetId:i,channelId:o},!0),_={},b=u===this.currentUserId,E=l===exports.MessageType.RECALL,v=g.lastReadTime>s;if(c&&!zu(h).isOk&&!E&&!b&&!v&&(0===g.unreadCount&&(_.firstUnreadMessageUId=d,_.firstUnreadTime=s,_.firstUnreadMessageType=l),_.unreadCount=g.unreadCount+1,f&&Pt(p)&&p.mentionedInfo)){_.hasMentioned=!0,_.mentionedInfo=p.mentionedInfo;var y=p.mentionedInfo,m=y.type,I=y.userIdList;(m===exports.MentionedType.ALL||(I||[]).includes(this.currentUserId))&&(_.unreadMentionedCount=g.unreadMentionedCount+1)}if(E&&Pt(p)&&!b){var T=p,R=T.sentTime,C=T.messageUId;!this._ctx.userStorage.recallMsgMap.has(C)&&g.unreadCount>0&&R>g.lastReadTime&&(this._ctx.userStorage.recallMsgMap.add(C),_.unreadCount=g.unreadCount-1,0===g.unreadCount&&(_.firstUnreadMessageUId="",_.firstUnreadTime=0,_.firstUnreadMessageType=""))}r&&(_.hidden=!1,_.operationTime=s,a||g.latestMessage&&!(g.latestMessage.sentTime<s)||(_.latestMessage=e));var O=g.updateAttrs(_);this._chat.storage.updateConversationStorage([g]),O&&r&&!a&&this._watcher.conversation([n(n({},g.toIReceivedConversation()),{updatedItems:O})])}}}),Object.defineProperty(r.prototype,"_receiveSyncMsg",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r;switch(rn(e.topic)){case Zr.updRTime:this._receivesyncReadStatus(e);break;case Zr.updUserSub:null===(r=this._subscribeManager)||void 0===r||r.startSyncSubscribeRelationship(t.timestamp)}}}),Object.defineProperty(r.prototype,"_batchMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){for(var t=this,r=[],n=[],i=[],o=e.length-1;o>=0;o-=1){var s=e[o];s.messageType===exports.MessageType.LOG_COMMAND&&s.senderUserId===Ve?n.unshift(s):s.messageType===exports.MessageType.CLOUD_CONTROL&&s.senderUserId===Ve?i.push(s):r.unshift(s)}this._watcher.batchMessage(r),n.forEach((function(e){var r=e.content,n=r.startTime,i=r.endTime,o=r.platform,s=r.logId,a=r.uri;t.reporter.report(parseInt(n,10),parseInt(i,10),o,a,s,e.messageUId)})),i.length>0&&this._ccMsgHandler(i)}}),Object.defineProperty(r.prototype,"_ccMsgHandler",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t;return o(this,void 0,void 0,(function(){var r,n,i;return s(this,(function(o){switch(o.label){case 0:return e.shift()?(r=this._connMgr.getToken(),[4,null===(t=this.cloudController)||void 0===t?void 0:t.request(this.cloudControllerUri,Ir.other,r)]):[3,2];case 1:n=o.sent()||0,(i=e.filter((function(e){return e.sentTime>n}))).length>0&&this._ccMsgHandler(i),o.label=2;case 2:return[2]}}))}))}}),Object.defineProperty(r.prototype,"_pubCallInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=Za.decode(Gs,e.pbData),r=t.key,n=t.dataContent,i=t.maxTime;this._latestPullKVMsgTimestamp=i,this._watcher.callInfo(JSON.stringify({list:[{key:r,value:n}]}))}}),Object.defineProperty(r.prototype,"_handleMsgNotify",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=t.type,n=t.chrmId,i=t.time;if(2===r){var o=this._chrmsQueue[n];o&&(o.queue.push(i),this._pullChrmMsg(n))}}}),Object.defineProperty(r.prototype,"_receivesyncReadStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=Za.decode(qo,e.pbData),r=t.type,n=t.channelId,i=t.msgTime,o=t.busChannel;this._clearConversationUnreadCount(r,n,o||"",!0,i),this._watcher.syncReadStatus({conversationType:r,targetId:n,channelId:o,timestamp:i})}}),Object.defineProperty(r.prototype,"_syncCallPullKVMsg",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t,r,n;return s(this,(function(i){switch(i.label){case 0:return this._isConnected?(e=Za.encode(ks,{syncTime:this._latestPullKVMsgTimestamp}),[4,this._connMgr.query(Zr.pullKvMsg,this.currentUserId,e,Fs)]):[2];case 1:return t=i.sent(),r=t.isOk,n=t.data,r&&n?(this._latestPullKVMsgTimestamp=n.maxTime,this._watcher.callInfo(JSON.stringify({list:n.info})),[2]):[2]}}))}))}}),Object.defineProperty(r.prototype,"_isConnected",{get:function(){return this._connMgr.getConnectionStatus()===exports.RCConnectionStatus.CONNECTED},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"_filterMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.messageType;return t===exports.MessageType.DELIVERED||t===exports.MessageType.DELIVERED_MSG||t===exports.MessageType.SYNC_READ_STATUS&&!this._processSRSMsg(e)}}),Object.defineProperty(r.prototype,"_messageProcessor",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this,r=0,n=[],i=[],o=[],s=[],a=[];return e.forEach((function(e){var u=e.conversationType,l=e.targetId,c=e.channelId,d=e.messageDirection,p=e.messageUId,f=e.messageType,h=e.sentTime,g=e.senderUserId,_=e.content;if(n.push(p),d===exports.MessageDirection.SEND){r=Math.max(h,r);var b=t._sendMessageStore.getSendMessageMap(),E=f===exports.MessageType.RECALL?"Cmd:".concat(_.messageUId):p;if(b[E])return void t._sendMessageStore.removeByUID(E)}if(!t._filterMessage(e)){switch(h>=t._connMgr.getConnectedTime()&&t._writeMessagesLog(u,p)&&a.push(p),f){case exports.MessageType.EXPANSION_NOTIFY:return void o.push(e);case exports.MessageType.READ_RECEIPT:g===t.currentUserId&&t._clearConversationUnreadCount(u,l,c,!0,h);break;case exports.MessageType.READ_STATE:return void s.push(e);case exports.MessageType.READ_RECEIPT_REQUEST:t._enableReadReceiptStorage&&t._processRRReqMsg(e);break;case exports.MessageType.READ_RECEIPT_RESPONSE:t._enableReadReceiptStorage&&t._processRRRspMsg(e)}var v=t._handleMsgProperties(e);t._setConversationCacheByMessage(v),i.push(v)}})),{newOutboxTime:r,messageUIds:n,messages:i,messageExpansionList:o,RSMsgList:s,msgUIds2Statistic:a}}}),Object.defineProperty(r.prototype,"_processSRSMsg",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.conversationType,r=e.targetId,n=e.channelId,i=e.content,o=e.senderUserId,s=e.sentTime;if(o!==this.currentUserId)return!1;var a=this.getNaviInfoFromCache();return this._clearConversationUnreadCount(t,r,n,!0,s),1!==a.sesDriven||(s>this.getConnectedTime()||this._watcher.syncReadStatus({conversationType:t,targetId:r,channelId:n,timestamp:i.lastMessageSendTime}),!1)}}),Object.defineProperty(r.prototype,"_processRSMsg",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.conversationType,r=e.targetId,i=e.channelId,o=e.content,s={conversationType:t,targetId:r,channelId:i};this._watcher.messageReadReceipt(t===exports.ConversationType.PRIVATE?{privateReadReceipt:n(n({},s),{endMsgTime:o.endMsgTime})}:{groupReadReceipt:n(n({},s),{totalCount:o.tmn,readedCount:o.rrn,messageUId:o.msgId})})}}),Object.defineProperty(r.prototype,"_processRRReqMsg",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r=e.conversationType,n=e.channelId,i=e.targetId,o=e.content,s=e.sentTime,a=e.messageDirection,u=e.senderUserId;null===(t=this._readReceiptManager)||void 0===t||t.insert({conversationType:r,channelId:n,targetId:i},o.messageUId,a,s,u)}}),Object.defineProperty(r.prototype,"_processRRRspMsg",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r,n,i=this,o=e.conversationType,s=e.channelId,u=e.targetId,l=e.content,c=e.senderUserId,d=l.receiptMessageDic,p=void 0===d?{}:d;if(c===this.currentUserId)for(var f in p){var h=p[f];try{for(var g=(t=void 0,a(h)),_=g.next();!_.done;_=g.next()){var b=_.value;null===(n=this._readReceiptManager)||void 0===n||n.remove({conversationType:o,channelId:s,targetId:u},b)}}catch(e){t={error:e}}finally{try{_&&!_.done&&(r=g.return)&&r.call(g)}finally{if(t)throw t.error}}}else(p[this.currentUserId]||[]).forEach((function(e){var t;null===(t=i._readReceiptManager)||void 0===t||t.addReadedUser({conversationType:o,channelId:s,targetId:u},e,c)}))}}),Object.defineProperty(r.prototype,"_handleSmsgFromSignalGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=t.conversationType;t.messageType;var n=t.senderUserId,i=t.messageUId,o=t.sentTime;t.isStatusMessage,this._writeMessagesLog(r,i)&&this.logger.record(pe.IM_MSG_RECEIVE,JSON.stringify({client_ts:Date.now(),server_deltatime:Date.now()-this._connMgr.getCrtServerTime(),msg_ids:i})),n!==this.currentUserId||t.isStatusMessage||this._sendMessageStore.setMessage(i,o),this._handleNotNotifyMsg(t)||(this._handleReadReceiptStorage(t),this._setConversationCacheByMessage(t),this._batchMessage([t]))}}),Object.defineProperty(r.prototype,"_handleReadReceiptStorage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){if(this._enableReadReceiptStorage){var t=e.messageType;t===exports.MessageType.READ_RECEIPT_REQUEST&&this._processRRReqMsg(e),t===exports.MessageType.READ_RECEIPT_RESPONSE&&this._processRRRspMsg(e)}}}),Object.defineProperty(r.prototype,"_handleSyncMsg",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){(t.conversationType!==exports.ConversationType.CHATROOM||this._chrmsQueue[t.targetId])&&(this._sendMessageStore.setMessage(t.messageUId,t.sentTime),this.logger.info(H.L_RECV_MULTI_SYNC_MSG_O,JSON.stringify({messageUId:t.messageUId,messgeId:t.messageId,sentTime:t.sentTime})),t.messageType!==exports.MessageType.EXPANSION_NOTIFY?((t.messageType===exports.MessageType.SYNC_READ_STATUS||t.messageType===exports.MessageType.READ_RECEIPT&&t.senderUserId===this.currentUserId)&&this._clearConversationUnreadCount(t.conversationType,t.targetId,t.channelId,!0,t.sentTime),t.messageType===exports.MessageType.READ_RECEIPT_REQUEST&&this._processRRReqMsg(t),t.messageType===exports.MessageType.READ_RECEIPT_RESPONSE&&this._processRRRspMsg(t),this._setConversationCacheByMessage(t),this._batchMessage([t])):this._receiveMessageExpansion(t))}}),Object.defineProperty(r.prototype,"_handleNotNotifyMsg",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.messageType,r=e.senderUserId;return t===exports.MessageType.DELIVERED||(t===exports.MessageType.DELIVERED_MSG||(t===exports.MessageType.EXPANSION_NOTIFY?(this._receiveMessageExpansion(e),!0):t===exports.MessageType.SYNC_READ_STATUS&&r!==this.currentUserId||t===exports.MessageType.READ_STATE&&(this._processRSMsg(e),!0)))}}),Object.defineProperty(r.prototype,"_handleMsgProperties",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){void 0===t&&(t=!1);var r,n=e.messageType,i=e.isStatusMessage,o=e.isCounted,s=void 0!==o&&o,a=e.isPersited,u=void 0!==a&&a;if(r=Gr(n)?Vr(n):{isCounted:s,isPersited:u,isStatusMessage:!1},Object.assign(e,r),t&&!wt(i)&&(e.isStatusMessage=i),!t){var l=e.content.user;if(l){var c=l.portrait,d=l.portraitUri,p=c||d;p&&(l.portrait=l.portraitUri=p)}}return e}}),Object.defineProperty(r.prototype,"_fixDownstreamData",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return e&&2===t.list.length&&(t.hasMore=!0,0===r?t.list.shift():t.list.pop()),t}}),Object.defineProperty(r.prototype,"getHistoryMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i,a,u,l){var c;return void 0===a&&(a=""),o(this,void 0,void 0,(function(){var o,u,d,p,f,h,g,_,b,E,v,y=this;return s(this,(function(s){switch(s.label){case 0:return u=(o=this).currentUserId,d=o._connMgr,p=Bh[e]||Zr.qryPMsg,f=1===n&&0===r,d?(h=d.codec.encodeGetHistoryMsg(t,{timestamp:r,count:f?2:n,order:i,channelId:a}),this.logger.info(H.L_GET_HISTORY_MSG_T,JSON.stringify({targetId:t,conversationType:e,channelId:a,timestamp:r,count:n,order:i}),l),[4,d.send(new bi(p,h,u),Fo,{currentUserId:u,connectedTime:d.getConnectedTime(),conversation:{targetId:t},afterDecode:function(r){var n,i=null===(n=y._readReceiptManager)||void 0===n?void 0:n.getReadReceiptInfo({conversationType:e,channelId:a,targetId:t},r.messageUId);if(i){var o=i.users;r.readReceiptInfo={isReceiptRequestMessage:!0,readerList:o}}return r}})]):[3,2];case 1:return g=s.sent(),_=g.code,b=g.data,_===exports.ErrorCode.SUCCESS&&b?(E=this._fixDownstreamData(f,b,i),v=[],null===(c=E.list)||void 0===c||c.forEach((function(e){e&&v.push(e.messageUId)})),this.logger.info(H.L_GET_HISTORY_MSG_R,JSON.stringify({code:_,messageUIds:v.join(",")}),l),[2,{code:_,data:{list:E.list,hasMore:E.hasMore}}]):(this.logger.warn(H.L_GET_HISTORY_MSG_R,JSON.stringify({code:_,messageUIds:""}),l),[2,{code:_}]);case 2:return[2,{code:exports.ErrorCode.RC_NET_CHANNEL_INVALID}]}}))}))}}),Object.defineProperty(r.prototype,"getMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i,o,s){return this.getHistoryMessage(e,t,r,n,i,o,s)}}),Object.defineProperty(r.prototype,"reportSDKInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,o,a,u,l;return s(this,(function(s){switch(s.label){case 0:return this._isConnected?(r=(t=this).currentUserId,n=t._connMgr,i=this.logger.createTraceId(),o=JSON.stringify(e),this.logger.debug(H.L_VER_REPORT_T,o,i),a=Za.encode(Os,{sdkInfo:o}),u=new bi(Zr.reportsdk,a,r),[4,n.send(u)]):[2];case 1:return(l=s.sent().code)!==exports.ErrorCode.SUCCESS&&this.logger.warn(H.L_VER_REPORT_R,l,i),[2]}}))}))}}),Object.defineProperty(r.prototype,"removeConversation",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,o;return s(this,(function(s){switch(s.label){case 0:return t=e.conversationType,r=e.targetId,n=e.channelId,e.conversationType!==exports.ConversationType.ULTRA_GROUP?[3,2]:(o=Za.encode(Ga,{targetId:r,type:t,busChannel:[n],cleanMsg:!1}),[4,this._connMgr.query(Zr.delUgSe,this.currentUserId,o)]);case 1:return i=s.sent(),[3,4];case 2:return o=Za.encode(Mo,{type:t,busChannel:n?[n]:[]}),[4,this._connMgr.query(Zr.delRelation,r,o)];case 3:i=s.sent(),s.label=4;case 4:return i.isOk&&this._chat.storage.removeConversation(e),[2,i.wipe()]}}))}))}}),Object.defineProperty(r.prototype,"batchRemoveConversation",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n;return s(this,(function(i){switch(i.label){case 0:return this._isConnected?(t=this._connMgr,r=t.codec.encodeBatchDeleteConversation(e),n=new bi(Zr.delRelationBatch,r,this.getCurrentUserId()),[4,t.send(n)]):[2,exports.ErrorCode.RC_NET_UNAVAILABLE];case 1:return[2,i.sent().code]}}))}))}}),Object.defineProperty(r.prototype,"getTotalUnreadCountByLevels",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return void 0===r&&(r=!1),o(this,void 0,void 0,(function(){var n;return s(this,(function(i){return n=0,e.includes(exports.ConversationType.ULTRA_GROUP)&&!this._isUltraGroupListExist?[2,gt(exports.ErrorCode.METHOD_NOT_AVAILABLE)]:(n+=this._chat.storage.getTotalUnreadCountByLevels(e,t,r),[2,ht(n)])}))}))}}),Object.defineProperty(r.prototype,"getConversationUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n;return s(this,(function(i){return n=this._chat.storage.getOrCreateModel({conversationType:e,targetId:t,channelId:r},!1),[2,ht(n.unreadCount)]}))}))}}),Object.defineProperty(r.prototype,"clearConversationUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return this._clearConversationUnreadCount(e,t,r,!1,this.getServerTime()),Promise.resolve(exports.ErrorCode.SUCCESS)}}),Object.defineProperty(r.prototype,"getFirstUnreadMessageInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n,i;return s(this,(function(o){return(n=this._chat.storage.getModel({conversationType:e,targetId:t,channelId:r}))?(i=n.firstUnreadMessage,[2,ht(i?{messageUId:i.messageUId||"",sentTime:i.sentTime}:null)]):[2,ht(null)]}))}))}}),Object.defineProperty(r.prototype,"saveConversationMessageDraft",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return this._chat.storage.setDrafts({conversationType:e,targetId:t,channelId:n},r),Promise.resolve(exports.ErrorCode.SUCCESS)}}),Object.defineProperty(r.prototype,"getConversationMessageDraft",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n=this._chat.storage.getDrafts({conversationType:e,targetId:t,channelId:r});return Promise.resolve({code:exports.ErrorCode.SUCCESS,data:n})}}),Object.defineProperty(r.prototype,"clearConversationMessageDraft",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return this._chat.storage.deleteDrafts({conversationType:e,targetId:t,channelId:r}),Promise.resolve(exports.ErrorCode.SUCCESS)}}),Object.defineProperty(r.prototype,"_joinChrm",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){return o(this,void 0,void 0,(function(){var o,a,u,l,c,d,p,f,h,g,_,b,E,v,y,m;return s(this,(function(s){switch(s.label){case 0:return this._isConnected?(o=this._connMgr,a=Za.encode(Ao,{nothing:1,extra:n}),u=r?Zr.joinChrmR:Zr.joinChrm,l=new bi(u,a,e),this.logger.info(H.L_JOIN_CHATROOM_T,JSON.stringify({chatroomId:e,count:t,topic:Zr[u]}),i),[4,o.send(l,Po)]):[2,{code:exports.ErrorCode.RC_NET_UNAVAILABLE}];case 1:return c=s.sent(),d=c.code,p=c.data,f=d===exports.ErrorCode.SUCCESS?"info":"warn",this.logger[f](H.L_JOIN_CHATROOM_R,JSON.stringify({code:d,timestamp:(new Date).getTime()}),i),d===exports.ErrorCode.SUCCESS?(g=(h=p).joinTime,_=h.createTime,b=h.memberCount,E=h.isAllChatroomBanned,v=h.isCurrentUserBanned,y=h.isCurrentChatroomBanned,m=h.isCurrentChatroomInWhitelist,this._chrmsQueue[e]||(this._chrmsQueue[e]={pulling:!1,queue:[],timestamp:0}),this._pullChrmMsg(e,t,g),this.getNaviInfoFromCache().kvStorage&&this._chrmEntryHandler.pullEntry(e,0),this._joinedChrmManager.set(e,t,n),this._startSyncIntervalForChrmPull(),[2,{code:d,data:{joinTime:g,createTime:_,memberCount:b,isAllChatroomBanned:E,isCurrentUserBanned:v,isCurrentChatroomBanned:y,isCurrentChatroomInWhitelist:m}}]):[2,{code:d}]}}))}))}}),Object.defineProperty(r.prototype,"_rejoinChrm",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t,r,i,o,a,u,l,c,d,p,f,h,g;return s(this,(function(s){switch(s.label){case 0:for(r in e=this._joinedChrmManager.get(),t=[],e)t.push(r);i=0,s.label=1;case 1:return i<t.length?(o=t[i],a=e[o],u=a.count,l=void 0===u?10:u,c=a.extra,this.logger.info(H.L_REJOIN_CHATROOM_T,JSON.stringify({chatroomId:o,count:l,extra:c})),d=this.logger.createTraceId(),[4,this._joinChrm(o,l,!0,c,d)]):[3,4];case 2:if(p=s.sent(),f=p.code,h=p.data,g=f===exports.ErrorCode.SUCCESS?"info":"warn",this.logger[g](H.L_REJOIN_CHATROOM_R,JSON.stringify({code:f,timestamp:(new Date).getTime()}),d),f===exports.ErrorCode.SUCCESS)return this._watcher.chatroom({rejoinedRoom:n({chatroomId:o,count:l},h)}),[2];f===exports.ErrorCode.RC_CHATROOM_USER_KICKED&&(this._joinedChrmManager.remove(o),delete this._chrmsQueue[o]),this._watcher.chatroom({rejoinedRoom:{chatroomId:o,errorCode:f}}),s.label=3;case 3:return i++,[3,1];case 4:return[2]}}))}))}}),Object.defineProperty(r.prototype,"_pullChrmMsg",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return void 0===t&&(t=10),void 0===r&&(r=0),o(this,void 0,void 0,(function(){var n,i,o,a,u,l,c,d,p,f,h,g,_,b,E,v,y,m=this;return s(this,(function(s){switch(s.label){case 0:return this._isConnected?(n=this._chrmsQueue[e],i=n.pulling,o=n.timestamp,i?[2]:(n.pulling=!0,a=r?0:o,u=Za.encode(No,{count:t,syncTime:a,compressioEnabled:Zu.enable()}),l=this.logger.createTraceId(),this.logger.info(H.L_PULL_CHATROOM_MSG_T,JSON.stringify({chatroomId:e,syncTime:a})),[4,this._connMgr.query(Zr.chrmPull,e,u)])):[2];case 1:return c=s.sent(),this.logger.summary(H.L_PULL_CHATROOM_MSG_R,c,l,{chatroomId:e,syncTime:a,count:t}),n.pulling=!1,c.isOk?(d=zf(c.data.pbData),p=d.list,f=d.syncTime,n.timestamp=r?Math.max(f,r):f,n.queue=n.queue.filter((function(e){return e>f})),h=[],g=[],b=(_=this).currentUserId,E=_._connMgr,v=p.map((function(t){return Wu(t,b,E.getConnectedTime(),e)})),y=[],v.forEach((function(e){e.sentTime<o||(e.sentTime>=m._connMgr.getConnectedTime()&&m._writeMessagesLog(exports.ConversationType.CHATROOM,e.messageUId)&&g.push(e.messageUId),h.push(e.messageUId),y.push(e))})),this._batchMessage(y),g.length>0&&this.logger.record(pe.IM_MSG_RECEIVE,JSON.stringify({client_ts:Date.now(),server_deltatime:Date.now()-this._connMgr.getCrtServerTime(),msg_ids:g.join(",")})),n.queue.length>0&&(n.queue.length=0,this._pullChrmMsg(e)),[2]):[2]}}))}))}}),Object.defineProperty(r.prototype,"joinChatroom",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return o(this,void 0,void 0,(function(){return s(this,(function(i){switch(i.label){case 0:return[4,this._joinChrm(e,t,!1,r,n)];case 1:return[2,i.sent().code]}}))}))}}),Object.defineProperty(r.prototype,"joinExistChatroom",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return o(this,void 0,void 0,(function(){return s(this,(function(i){return[2,this._joinChrm(e,t,!0,r,n)]}))}))}}),Object.defineProperty(r.prototype,"quitChatroom",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r;return s(this,(function(n){switch(n.label){case 0:return this._isConnected?(t=this._connMgr,delete this._chrmsQueue[e],this._chrmEntryHandler.reset(e),this._joinedChrmManager.remove(e),r=Za.encode(Ao,{nothing:1}),[4,t.query(Zr.exitChrm,e,r)]):[2,exports.ErrorCode.RC_NET_UNAVAILABLE];case 1:return[2,n.sent().code]}}))}))}}),Object.defineProperty(r.prototype,"getChatroomInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n,i,o;return s(this,(function(s){switch(s.label){case 0:return this._isConnected?(n=this._connMgr,i=Za.encode(Vo,{count:t,order:r}),o=new bi(Zr.queryChrmI,i,e),[4,n.send(o,Go)]):[2,gt(exports.ErrorCode.RC_NET_UNAVAILABLE)];case 1:return[2,s.sent().trans((function(e){return e}))]}}))}))}}),Object.defineProperty(r.prototype,"getChatroomHistoryMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return o(this,void 0,void 0,(function(){var i,o,a,u,l,c;return s(this,(function(s){switch(s.label){case 0:return this._isConnected?(i=this._connMgr,o=i.codec.encodeGetHistoryMsg(e,{timestamp:t,count:r,order:n}),a=new bi(Zr.qryCHMsg,o,e),[4,i.send(a,Fo,{conversation:{targetId:e}})]):[2,{code:exports.ErrorCode.RC_NET_UNAVAILABLE}];case 1:return u=s.sent(),l=u.code,c=u.data,l!==exports.ErrorCode.SUCCESS?[2,{code:l}]:[2,{code:l,data:{list:c.list,hasMore:c.hasMore}}]}}))}))}}),Object.defineProperty(r.prototype,"_modifyChatroomKV",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i,o,a,u,l,c,d;return s(this,(function(s){switch(s.label){case 0:return this._isConnected?(n=(r=this)._connMgr,i=r.currentUserId,o=this._chrmEntryHandler.getVersion(e,t.key),t.version=null==o?this.getServerTime():o,a=n.codec.encodeModifyChatRoomKV(e,t,i),u=t.type===exports.ChatroomEntryType.UPDATE?Zr.setKV:Zr.delKV,l=new bi(u,a,e),[4,n.send(l,Po)]):[2,exports.ErrorCode.RC_NET_UNAVAILABLE];case 1:return c=s.sent(),(d=c.code)===exports.ErrorCode.SUCCESS?(this._chrmEntryHandler.setLocal(e,{kvEntries:[t],syncTime:this.getServerTime()},i),[2,d]):[2,d]}}))}))}}),Object.defineProperty(r.prototype,"_chatroomKVStoreNotAllSuccess",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=t.data,n=e;return r&&Array.isArray(r.errorKeys)&&r.errorKeys.forEach((function(e){var t=n.findIndex((function(t){return e.key===t.key}));-1!==t&&n.splice(t,1)})),n}}),Object.defineProperty(r.prototype,"_modifyChatroomKVS",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,i,o,a,u,l,c,d,p,f,h,g,_=this;return s(this,(function(s){switch(s.label){case 0:return this._isConnected?(i=(r=this)._connMgr,o=r.currentUserId,t.entries.forEach((function(t){var r=_._chrmEntryHandler.getVersion(e,t.key);t.version=null==r?_.getServerTime():r})),a=i.codec.encodeModifyChatRoomKVS(e,t,o),u=t.type===exports.ChatroomEntryType.UPDATE?Zr.setKVS:Zr.delKVS,l=new bi(u,a,e),[4,i.send(l,ts)]):[2,{code:exports.ErrorCode.RC_NET_UNAVAILABLE}];case 1:return c=s.sent(),d=c.code,-1!==[exports.ErrorCode.SUCCESS,exports.ErrorCode.CHATROOM_KV_STORE_NOT_ALL_SUCCESS].indexOf(d)&&(f=[],delete(h=n({},t)).entries,t.entries.forEach((function(e){f.push(n(n({},e),h))})),d===exports.ErrorCode.CHATROOM_KV_STORE_NOT_ALL_SUCCESS&&(g=c.data,p=g.errorKeys,f=this._chatroomKVStoreNotAllSuccess(f,c)),this._chrmEntryHandler.setLocal(e,{kvEntries:f,syncTime:(new Date).getTime()},o)),[2,{code:d,data:p}]}}))}))}}),Object.defineProperty(r.prototype,"setChatroomEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){return s(this,(function(r){return t.type=exports.ChatroomEntryType.UPDATE,t.userId=t.userId||this.currentUserId,[2,this._modifyChatroomKV(e,t)]}))}))}}),Object.defineProperty(r.prototype,"setChatroomEntries",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){return s(this,(function(r){return t.type=exports.ChatroomEntryType.UPDATE,t.userId=t.userId||this.currentUserId,[2,this._modifyChatroomKVS(e,t)]}))}))}}),Object.defineProperty(r.prototype,"forceSetChatroomEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){return s(this,(function(r){return t.type=exports.ChatroomEntryType.UPDATE,t.isOverwrite=!0,t.userId=t.userId||this.currentUserId,[2,this._modifyChatroomKV(e,t)]}))}))}}),Object.defineProperty(r.prototype,"removeChatroomEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){return s(this,(function(r){return t.type=exports.ChatroomEntryType.DELETE,t.userId=t.userId||this.currentUserId,[2,this._modifyChatroomKV(e,t)]}))}))}}),Object.defineProperty(r.prototype,"removeChatroomEntries",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){return s(this,(function(r){return t.type=exports.ChatroomEntryType.DELETE,t.userId=t.userId||this.currentUserId,[2,this._modifyChatroomKVS(e,t)]}))}))}}),Object.defineProperty(r.prototype,"forceRemoveChatroomEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){return s(this,(function(r){return t.type=exports.ChatroomEntryType.DELETE,t.isOverwrite=!0,t.userId=t.userId||this.currentUserId,[2,this._modifyChatroomKV(e,t)]}))}))}}),Object.defineProperty(r.prototype,"getChatroomEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i,o,a,u,l;return s(this,(function(s){switch(s.label){case 0:return(r=this._chrmEntryHandler.getValue(e,t))?[2,{code:exports.ErrorCode.SUCCESS,data:r}]:this._isConnected?(n=this._connMgr,i=n.codec.encodePullChatRoomKV(0),o=new bi(Zr[Zr.pullKV],i,e),[4,n.send(o,es)]):[2,{code:exports.ErrorCode.RC_NET_UNAVAILABLE}];case 1:return a=s.sent(),(u=a.data)&&u.kvEntries&&u.kvEntries.length&&(l=u.kvEntries.find((function(e){return e.key===t})),void 0!==l)?[2,{code:exports.ErrorCode.SUCCESS,data:null==l?void 0:l.value}]:[2,{code:exports.ErrorCode.CHATROOM_KEY_NOT_EXIST}]}}))}))}}),Object.defineProperty(r.prototype,"getAllChatroomEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,o,a;return s(this,(function(s){switch(s.label){case 0:return(t=this._chrmEntryHandler.getAll(e))&&Object.keys(t).length?[2,{code:exports.ErrorCode.SUCCESS,data:t}]:this._isConnected?(r=this._connMgr,t={},n=r.codec.encodePullChatRoomKV(0),i=new bi(Zr[Zr.pullKV],n,e),[4,r.send(i,es)]):[2,{code:exports.ErrorCode.RC_NET_UNAVAILABLE}];case 1:return o=s.sent(),(a=o.data)&&a.kvEntries&&a.kvEntries.length&&a.kvEntries.forEach((function(e){e.key&&(t[e.key]=e.value||"")})),[2,{code:exports.ErrorCode.SUCCESS,data:t}]}}))}))}}),Object.defineProperty(r.prototype,"pullChatroomEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i,o,a,u,l,c,d,p,f,h=this;return s(this,(function(s){switch(s.label){case 0:return this._isConnected?(n=(r=this)._connMgr,i=r.currentUserId,this._chrmsQueue[e]?(o=n.codec.encodePullChatRoomKV(t),a=new bi(Zr[Zr.pullKV],o,e),this.logger.info(H.L_PULL_CHATROOM_KV_T,JSON.stringify({chatroomId:e,timestamp:t})),[4,n.send(a,es)]):[2,{code:exports.ErrorCode.RC_CHATROOM_NOT_EXIST}]):[2,{code:exports.ErrorCode.RC_NET_UNAVAILABLE}];case 1:return u=s.sent(),l=u.code,c=u.data,this._chrmsQueue[e]?(d=l===exports.ErrorCode.SUCCESS?"info":"warn",this.logger[d](H.L_PULL_CHATROOM_KV_R,JSON.stringify({code:l,timestamp:t})),l===exports.ErrorCode.SUCCESS&&c?(p=c.kvEntries,f=[],p.length>0&&(p.forEach((function(t){var r=t.key,n=t.value,i=t.type,o=t.timestamp,s=t.userId;h._chrmEntryHandler.getValue(e,r)===n&&s===h.getCurrentUserId()||f.push({key:r,value:n,type:i,timestamp:o,chatroomId:e})})),this._chrmEntryHandler.setLocal(e,c,i),f.length>0&&this._watcher.chatroom({updatedEntries:f})),[2,{code:l,data:c}]):[2,{code:l}]):[2,{code:exports.ErrorCode.RC_CHATROOM_NOT_EXIST}]}}))}))}}),Object.defineProperty(r.prototype,"_startSyncIntervalForChrmPull",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this;this._stopSyncIntervalForChrmPull(),this._intervalTimerForChrmPull=setInterval((function(){var t=Object.keys(e._chrmsQueue);0!==t.length&&e._isConnected?t.forEach((function(t){e._pullChrmMsg(t),e.getNaviInfoFromCache().kvStorage&&e._chrmEntryHandler.pullEntry(t,0)})):e._stopSyncIntervalForChrmPull()}),18e4)}}),Object.defineProperty(r.prototype,"_stopSyncIntervalForChrmPull",{enumerable:!1,configurable:!0,writable:!0,value:function(){"number"!=typeof this._intervalTimerForChrmPull&&(clearInterval(this._intervalTimerForChrmPull),this._intervalTimerForChrmPull=-1)}}),Object.defineProperty(r.prototype,"removeChatroomFromCatch",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t;null===(t=this._joinedChrmManager)||void 0===t||t.remove(e)}}),Object.defineProperty(r.prototype,"_writeMessagesLog",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r,n=null===(r=this.cloudController)||void 0===r?void 0:r.getMRTRConfig();if(!n)return!1;var i=function(e){if(!e)return Math.floor(4294967296*Math.random());var t=0;if(0===e.length)return t;for(var r=0;r<e.length;r++)t=(t<<5)-t+e.charCodeAt(r),t|=0;return Math.abs(t)}(t),o=0;switch(e){case exports.ConversationType.PRIVATE:o=n.private;break;case exports.ConversationType.GROUP:o=n.group;break;case exports.ConversationType.CHATROOM:o=n.chatroom;break;case exports.ConversationType.ULTRA_GROUP:o=n.ultraGroup}return!!o&&i%(1/o)==0}}),Object.defineProperty(r.prototype,"sendMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,i,a){return o(this,void 0,void 0,(function(){var o,u,l,c,d,p,f,h,g,_,b,E,v,y;return s(this,(function(s){switch(s.label){case 0:return r=this._handleInnerMsgOptions(e,t,r),r=this._handleMsgProperties(r,!0),o=!1,[exports.ConversationType.PRIVATE,exports.ConversationType.GROUP].includes(e)&&(r.isStatusMessage||Vr(r.messageType).isStatusMessage)&&(o=!0),u=o?function(e){var t;return(t={},t[exports.ConversationType.PRIVATE]=Zr.ppMsgS,t[exports.ConversationType.GROUP]=Zr.pgMsgS,t)[e]}(e):function(e){var t;return(t={},t[exports.ConversationType.PRIVATE]=Zr.ppMsgP,t[exports.ConversationType.GROUP]=Zr.pgMsgP,t[exports.ConversationType.CHATROOM]=Zr.chatMsg,t[exports.ConversationType.CUSTOMER_SERVICE]=Zr.pcMsgP,t[exports.ConversationType.RTC_ROOM]=Zr.prMsgS,t[exports.ConversationType.SYSTEM]=Zr.pbMsgP,t)[e]}(e)||Zr.ppMsgP,o&&(r.isPersited=!1,r.isCounted=!1),l=r.messageId?r.messageId:lr(),r.messageId=l,c=this._connMgr.codec.encodeUpMsg({conversationType:e,targetId:t},r),(d=new Ei(Zr[u],c,e===exports.ConversationType.SYSTEM?this.currentUserId:t)).setHeaderQos($r.AT_LEAST_ONCE),o?(this._connMgr.sendOnly(d),[2,ht(Hh(e,t,n({},r),"",0,this.currentUserId,l))]):(p=this._connMgr.getCrtServerTime(),f=Hh(e,t,n(n({},r),{isStatusMessage:o}),"",p,this.currentUserId,l),null==i||i(l),this.logger.info(H.L_SEND_MSG_T,JSON.stringify({messageType:r.messageType,conversationType:e,targetId:t,channelId:r.channelId}),a),h=Date.now(),[4,this._connMgr.send(d)]);case 1:return g=s.sent(),_=g.code,b=g.isOk,E=g.msg,v=g.data,b?(this.logger.info(H.L_SEND_MSG_R,JSON.stringify({code:_,messageUId:null==v?void 0:v.messageUId,messageId:null==v?void 0:v.messageId}),a),y=v,this._sendMessageSuccessHandle(f,y),this._writeMessagesLog(e,y.messageUId)&&this.logger.record(pe.IM_MSG_SEND,JSON.stringify({msg_id:y.messageUId,channel:e,start_ts:h,client_ts:Date.now(),server_deltatime:Date.now()-this._connMgr.getCrtServerTime(),cod:_})),[2,ht(f)]):(this.logger.warn(H.L_SEND_MSG_R,JSON.stringify({code:_,messageUId:f.messageUId,messageId:f.messageId}),a),this._writeMessagesLog(e)&&this.logger.record(pe.IM_MSG_SEND,JSON.stringify({channel:e,start_ts:h,client_ts:Date.now(),server_deltatime:Date.now()-this._connMgr.getCrtServerTime(),cod:_})),f.sentStatus=exports.SentStatus.FAILED,[2,gt(_,E,f)])}}))}))}}),Object.defineProperty(r.prototype,"_sendMessageSuccessHandle",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r,n=this;this._sendMessageStore.setMessage(t.messageUId,t.timestamp),e.sentTime=t.timestamp,e.messageUId=t.messageUId,this._setConversationCacheByMessage(e);var i=e.messageType,o=e.conversationType,s=e.targetId,a=e.channelId,u=e.sentTime,l=e.content,c=e.messageDirection;if(this._enableReadReceiptStorage){if(i===exports.MessageType.READ_RECEIPT_REQUEST){var d=l.messageUId;null===(r=this._readReceiptManager)||void 0===r||r.insert({conversationType:o,targetId:s,channelId:a},d,c,u)}if(i===exports.MessageType.READ_RECEIPT_RESPONSE){var p=l.receiptMessageDic;if(!p)return;for(var f in p)p[f].forEach((function(e){var t;null===(t=n._readReceiptManager)||void 0===t||t.remove({conversationType:o,targetId:s,channelId:a},e)}))}}}}),Object.defineProperty(r.prototype,"recallMsg",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r;return o(this,void 0,void 0,(function(){var i,o,a,u,l,c,d,p,f,h,g,_,b,E,v,y,m,I;return s(this,(function(s){switch(s.label){case 0:return i=e.targetId,o=e.conversationType,a=e.channelId||"",u=t.user,l=t.extra,c=t.isDelete,d=t.directionalUserIdList,p=t.disableUpdateLastMessage,f=t.messageUId,h=t.sentTime,g={conversationType:o,targetId:i,messageUId:f,sentTime:h,channelId:a,isDelete:c||!1,isAdmin:t.isAdmin},u&&(g.user=u),l&&(g.extra=l),_={content:g,messageType:"RC:RcCmd",disableNotification:null==t?void 0:t.disableNotification,pushConfig:null==t?void 0:t.pushConfig,pushContent:(null===(r=t.pushConfig)||void 0===r?void 0:r.pushContent)||t.pushContent||"",channelId:a,disableUpdateLastMessage:p},[exports.ConversationType.GROUP,exports.ConversationType.ULTRA_GROUP].includes(o)&&d&&(_.directionalUserIdList=d),b=this._connMgr.codec.encodeUpMsg({conversationType:o,targetId:i},_),(E=new Ei(Zr.recallMsg,b,this.currentUserId)).setHeaderQos($r.AT_LEAST_ONCE),[4,this._connMgr.send(E)];case 1:return(v=s.sent()).isOk?(y=v.data,o!==exports.ConversationType.ULTRA_GROUP&&(m="Cmd:".concat(f),y.messageUId=m),I=Hh(o,i,n(n({},_),{isPersited:!0}),y.messageUId,y.timestamp,this.currentUserId),o===exports.ConversationType.ULTRA_GROUP?(this._ultraMsgMap[y.messageUId]=y.timestamp,this._updateUltraGroupWhenRecallMsg(i,a,f)):(this._sendMessageStore.setMessage(y.messageUId,y.timestamp),this._setConversationCacheByMessage(I)),[2,ht(I)]):[2,v.wipe()]}}))}))}}),Object.defineProperty(r.prototype,"sendReadReceiptMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n,i;return s(this,(function(o){return this._isConnected?(n=this._connMgr.codec.encodeReadReceipt(t,r),i=new bi(Zr[Zr.rrMsg],n,e),[2,this._connMgr.send(i)]):[2,{code:exports.ErrorCode.RC_NET_UNAVAILABLE}]}))}))}}),Object.defineProperty(r.prototype,"getMessageReader",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n,i;return s(this,(function(o){return this._isConnected?(n=this._connMgr.codec.encodeMessageReader(t,r),i=new bi(Zr[Zr.rrList],n,e),[2,this._connMgr.send(i,ms)]):[2,{code:exports.ErrorCode.RC_NET_UNAVAILABLE}]}))}))}}),Object.defineProperty(r.prototype,"sendReadReceiptMessageV4",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n,i;return s(this,(function(o){return n=this._connMgr.codec.encodeReadReceiptMsg(e,t,r),i=new Ei(Zr[Zr.sendMsgRead],n,e.targetId),[2,this._connMgr.send(i)]}))}))}}),Object.defineProperty(r.prototype,"getMessageReadReceiptV4",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n;return s(this,(function(i){return r=this._connMgr.codec.encodeReceiptQryReq(e,t),n=new bi(Zr[Zr.qryMsgRead],r,e.targetId),[2,this._connMgr.send(n,qs)]}))}))}}),Object.defineProperty(r.prototype,"batchGetMessageReadReceiptInfoV4",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,i,o,a,u,l;return s(this,(function(s){switch(s.label){case 0:return r=this._connMgr.codec.encodeReceiptCntQryReq(e,t),i=new bi(Zr[Zr.qryMsgReadCntBatch],r,e.targetId),[4,this._connMgr.send(i,Ks)];case 1:return o=s.sent(),a=o.code,u=o.data,l=(u||{result:[]}).result,a===exports.ErrorCode.SUCCESS&&l?[2,{code:a,data:l.map((function(t){return n({messageUId:t.msgId,readedCount:t.cnt,totalCount:t.tmn},e)}))}]:[2,{code:a}]}}))}))}}),Object.defineProperty(r.prototype,"updateConversationReadTime",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n;return s(this,(function(i){switch(i.label){case 0:return r=Kf(e,t),n=new Ei(Zr.updRTime,r,this.currentUserId),[4,this._connMgr.send(n)];case 1:return[2,i.sent().wipe()]}}))}))}}),Object.defineProperty(r.prototype,"pullUserSettings",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,o,a,c,d,p=this;return s(this,(function(s){switch(s.label){case 0:return this._isConnected?(t=this.getNaviInfoFromCache(),r=Za.encode(is,{version:e,ipType:t.ipType||0}),[4,this._connMgr.query(Zr.pullUS,this.currentUserId,r,os)]):[2,gt(exports.ErrorCode.RC_NET_UNAVAILABLE)];case 1:return(n=s.sent()).isOk?(i=n.data,o=i.version,a=i.items,c=[],d=!1,null==a||a.forEach((function(e){var t=e.key,r=e.value;"Tag"===t?(d=!0,c.push.apply(c,l([],u(e.tags||[]),!1))):"VoipInfo"===t&&p._naviChangeHandler(ri.readUTF(new Uint8Array(r)))})),[2,ht({version:o,changed:d,tags:c})]):[2,n.wipe()]}}))}))}}),Object.defineProperty(r.prototype,"_naviChangeHandler",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this._connMgr.getToken();this.navi.updateVoipCallInfo(t,e);var r=this.navi.getNaviInfoFromCache(t);this._watcher.onNaviDataChange(n({},r))}}),Object.defineProperty(r.prototype,"getFileToken",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,i,a,u){return o(this,void 0,void 0,(function(){var o,l,c,d,p;return s(this,(function(s){switch(s.label){case 0:return this._isConnected?(o=i&&"uploads"!==i?t||"":ir(e,t),l=this.getNaviInfoFromCache(),c=_r(l,this.logger),d="",c||(d=JSON.stringify({uploadDomain:c})),p=Za.encode(Ro,{type:e,key:o,httpMethod:r||"",queryString:i||"",url:a||"",ext:d,size:u?Math.ceil(u):0,ipType:l.ipType||0}),[4,this._connMgr.query(Zr.qnTkn,this.currentUserId,p,Oo)]):[2,{code:exports.ErrorCode.RC_NET_UNAVAILABLE}];case 1:return[2,s.sent().trans((function(e){return n(n({},e),{fileName:o,downloadAuthInfo:e.downloadAuthInfo?JSON.parse(e.downloadAuthInfo):null})}))]}}))}))}}),Object.defineProperty(r.prototype,"getFileUrl",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return o(this,void 0,void 0,(function(){var i,o,a,u,l;return s(this,(function(s){switch(s.label){case 0:return i=this.getNaviInfoFromCache(),a="",u="",t===exports.UploadMethod.QINIU?o=Zr.qnUrl:t===exports.UploadMethod.AWS?o=Zr.s3Url:t===exports.UploadMethod.STC?o=Zr.stcUrl:t===exports.UploadMethod.MINIO?(o=Zr.minioUrl,a=_r(i,this.logger),u=JSON.stringify({url:a})):o=Zr.aliUrl,l=Za.encode(Co,{type:e,key:r,fileName:n,ext:u,size:-1,ipType:i.ipType||0}),[4,this._connMgr.query(o,this.currentUserId,l,So)];case 1:return[2,s.sent().trans((function(e){return{downloadUrl:e.downloadUrl}}))]}}))}))}}),Object.defineProperty(r.prototype,"disconnect",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){return s(this,(function(r){switch(r.label){case 0:return this.reporter.stop(),this.reporterStatistic.stop(),[4,this._connMgr.disconnect(e,t)];case 1:return r.sent(),this._resetMemoryState(),[2]}}))}))}}),Object.defineProperty(r.prototype,"_resetMemoryState",{enumerable:!1,configurable:!0,writable:!0,value:function(){-1!==this._reconnectTimer&&(clearTimeout(this._reconnectTimer),this._reconnectTimer=-1),this._isUltraGroupListExist=!1,this._joinedChrmManager&&(this._joinedChrmManager.clear(),delete this._joinedChrmManager),this._userSettingManager&&delete this._userSettingManager,this._readReceiptManager&&delete this._readReceiptManager,this._subscribeManager&&delete this._subscribeManager,this._chrmsQueue={}}}),Object.defineProperty(r.prototype,"registerMessageType",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){}}),Object.defineProperty(r.prototype,"getServerTime",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._connMgr.getCrtServerTime()}}),Object.defineProperty(r.prototype,"getCurrentUserId",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._connMgr.getCurrentUserId()}}),Object.defineProperty(r.prototype,"currentUserId",{get:function(){return this._connMgr.getCurrentUserId()},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"createTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t=this;return s(this,(function(r){return this._isConnected?[2,this._userSettingManager.pushTask((function(r){return o(t,void 0,void 0,(function(){var t,i,o,a,u,l;return s(this,(function(s){switch(s.label){case 0:return t=this._connMgr.codec.encodeCreateTag([e],r),i=new bi(Zr[Zr.addSeTag],t,this.currentUserId),[4,this._connMgr.send(i,ns)];case 1:return o=s.sent(),a=o.code,u=o.data,a===exports.ErrorCode.SUCCESS&&u&&(l=u.version,this._userSettingManager.addTag([n(n({},e),{createdTime:l})],l)),[2,{code:a}]}}))}))}))]:[2,{code:exports.ErrorCode.RC_NET_UNAVAILABLE}]}))}))}}),Object.defineProperty(r.prototype,"removeTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t=this;return s(this,(function(r){return this._isConnected?[2,this._userSettingManager.pushTask((function(r){return o(t,void 0,void 0,(function(){var t,n,i,o,a,u;return s(this,(function(s){switch(s.label){case 0:return t=this._connMgr.codec.encodeRemoveTag([e],r),n=new bi(Zr[Zr.delSeTag],t,this.currentUserId),[4,this._connMgr.send(n,ns)];case 1:return i=s.sent(),o=i.code,a=i.data,o===exports.ErrorCode.SUCCESS&&a&&(u=a.version,this._userSettingManager.deleteTag([e],u)),[2,{code:o}]}}))}))}))]:[2,{code:exports.ErrorCode.RC_NET_UNAVAILABLE}]}))}))}}),Object.defineProperty(r.prototype,"updateTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t=this;return s(this,(function(r){return this._isConnected?[2,this._userSettingManager.pushTask((function(r){return o(t,void 0,void 0,(function(){var t,n,i,o,a,u;return s(this,(function(s){switch(s.label){case 0:return t=this._connMgr.codec.encodeCreateTag([e],r),n=new bi(Zr[Zr.addSeTag],t,this.currentUserId),[4,this._connMgr.send(n,ns)];case 1:return i=s.sent(),o=i.code,a=i.data,o===exports.ErrorCode.SUCCESS&&(u=a.version,this._userSettingManager.addTag([e],u)),[2,{code:o}]}}))}))}))]:[2,{code:exports.ErrorCode.RC_NET_UNAVAILABLE}]}))}))}}),Object.defineProperty(r.prototype,"getTagList",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t;return s(this,(function(r){return e=this._userSettingManager.getTags(),t=this._chat.storage.getTagConversationCountMap(),e.forEach((function(e){var r;e.conversationCount=(null===(r=t.get(e.tagId))||void 0===r?void 0:r.length)||0})),[2,ht(e)]}))}))}}),Object.defineProperty(r.prototype,"addTagForConversations",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r=this;return s(this,(function(i){return this._isConnected?[2,this._chat.settings.pushTask((function(i){return o(r,void 0,void 0,(function(){var r,o,a,l,c,d,p=this;return s(this,(function(s){switch(s.label){case 0:return this._userSettingManager.getTagById(e)?(r=this._connMgr.codec.encodeUpdateConversationTag([{tagId:e}],t,i),[4,this._connMgr.query(Zr.addTag,this.currentUserId,r,hs)]):[2,gt(exports.ErrorCode.TAG_NOT_EXIST)];case 1:return(o=s.sent()).isOk?(a=o.data.version,l=new Map,t.forEach((function(t){var r=p._chat.storage.getOrCreateModel(t,!0),n={},i=r.tags;i.find((function(t){return t.tagId===e}))||(n.tags=i.concat({tagId:e}),l.set(r,n))})),c=[],d=[],Array.from(l.entries()).forEach((function(e){var t=u(e,2),r=t[0],i=t[1];d.push(r);var o=r.updateAttrs(i,a);o&&c.push(n(n({},r.toIReceivedConversation()),{updatedItems:o}))})),this._chat.storage.updateConversationStorage(d),c.length>0&&this._watcher.conversation(c),[2,ht({version:a})]):[2,o.wipe()]}}))}))}))]:[2,{code:exports.ErrorCode.RC_NET_UNAVAILABLE}]}))}))}}),Object.defineProperty(r.prototype,"removeTagForConversations",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r=this;return s(this,(function(n){return this._isConnected?[2,this._chat.settings.pushTask((function(n){return o(r,void 0,void 0,(function(){var r,i,o,a,u=this;return s(this,(function(s){switch(s.label){case 0:return r=this._connMgr.codec.encodeUpdateConversationTag([{tagId:e}],t,n),[4,this._connMgr.query(Zr.delTag,this.currentUserId,r,hs)];case 1:return(i=s.sent()).isOk?(o=i.data.version,a=t.map((function(t){var r=u._chat.storage.getOrCreateModel(t,!0),n={tags:r.tags.filter((function(t){return t.tagId!==e}))};return r.updateAttrs(n,o),r})),this._chat.storage.updateConversationStorage(a),[2,ht({version:o})]):[2,i.wipe()]}}))}))}))]:[2,gt(exports.ErrorCode.RC_NET_UNAVAILABLE)]}))}))}}),Object.defineProperty(r.prototype,"removeTagsForConversation",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r=this;return s(this,(function(n){return this._isConnected?[2,this._chat.settings.pushTask((function(n){return o(r,void 0,void 0,(function(){var r,i,o,a,u,l,c;return s(this,(function(s){switch(s.label){case 0:return r=t.map((function(e){return{tagId:e}})),i=this._connMgr.codec.encodeUpdateConversationTag(r,[e],n),[4,this._connMgr.query(Zr.delTag,this.currentUserId,i,hs)];case 1:return(o=s.sent()).isOk?(a=o.data.version,u=this._chat.storage.getOrCreateModel(e,!0),l=u.tags,c={tags:l.filter((function(e){return!t.includes(e.tagId)}))},u.updateAttrs(c,a),this._chat.storage.updateConversationStorage([u]),[2,ht({version:a})]):[2,o.wipe()]}}))}))}))]:[2,gt(exports.ErrorCode.RC_NET_UNAVAILABLE)]}))}))}}),Object.defineProperty(r.prototype,"getConversationListByTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n,i,o,a,u,l,c;return s(this,(function(s){switch(s.label){case 0:return this._isConnected?(i=(n=this).currentUserId,o=n._connMgr,a=o.codec.encodeOldConversationList({count:r,type:exports.ConversationType.PRIVATE,startTime:t}),u=new bi(Zr.qryRelationR,a,i),[4,o.send(u,Lo,{currentUserId:i,connectedTime:o.getConnectedTime()})]):[2,gt(exports.ErrorCode.RC_NET_UNAVAILABLE)];case 1:return(l=s.sent()).isOk?(c=this._conversationHasTagFilter(e,l.data.list),[2,ht(c)]):[2,l.wipe()]}}))}))}}),Object.defineProperty(r.prototype,"_conversationHasTagFilter",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this,i=[],o=[];function s(e,t){return e.latestMessage&&t.latestMessage?e.latestMessage.sentTime-t.latestMessage.sentTime:0}return t.forEach((function(t){var s=r._chat.storage.getOrCreateModel(t,!0),a=s.tags,u=a&&a.find((function(t){return t.tagId===e}));if(u){var l=n(n({},s.toIReceivedConversation()),{isTopInTag:u.isTop||!1,latestMessage:t.latestMessage,operationTime:t.operationTime});u.isTop?i.push(n(n({},l),{isTopInTag:!0})):o.push(n(n({},l),{isTopInTag:!1}))}})),i.sort(s),o.sort(s),l(l([],u(i),!1),u(o),!1)}}),Object.defineProperty(r.prototype,"getUnreadCountByTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r;return s(this,(function(n){return this._isConnected?(r=this._chat.storage.getUnreadCountByTag(e,t),[2,ht(r)]):[2,gt(exports.ErrorCode.RC_NET_UNAVAILABLE)]}))}))}}),Object.defineProperty(r.prototype,"setConversationStatusInTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n=this;return s(this,(function(i){return this._isConnected?[2,this._chat.settings.pushTask((function(i){return o(n,void 0,void 0,(function(){var n,o,a,u,l,c,d;return s(this,(function(s){switch(s.label){case 0:return n=r.isTop,o=[{tagId:e,isTop:n}],a=this._chat.storage.getOrCreateModel(t,!1),(u=a.tags).find((function(t){return t.tagId===e}))?(l=this._connMgr.codec.encodeUpdateConversationTag(o,[t],i),[4,this._connMgr.query(Zr.addTag,this.currentUserId,l,hs)]):[2,gt(exports.ErrorCode.NO_TAG_IN_CONVER)];case 1:return(c=s.sent()).isOk?(d=c.data.version,u.find((function(t){return t.tagId===e})).isTop=n,this._chat.storage.updateConversationCache(t,{tags:u}),this._watcher.conversationTag(),[2,ht({version:d})]):[2,c.wipe()]}}))}))}))]:[2,gt(exports.ErrorCode.RC_NET_UNAVAILABLE)]}))}))}}),Object.defineProperty(r.prototype,"getTagsForConversation",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n;return s(this,(function(i){return this._isConnected?(t=this._chat.storage.getOrCreateModel(e,!1),r=this._userSettingManager.getTagsInfo(),n=t.tags.map((function(e){var t;return{tagId:e.tagId,tagName:null===(t=r[e.tagId])||void 0===t?void 0:t.tagName}})),[2,ht(n)]):[2,gt(exports.ErrorCode.RC_NET_UNAVAILABLE)]}))}))}}),Object.defineProperty(r.prototype,"getUnreadMentionedCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r;return s(this,(function(n){return t=this._chat.storage.getOrCreateModel(e,!1),r=this._getUnreadCount(t.unreadMentionedCount),[2,ht(r)]}))}))}}),Object.defineProperty(r.prototype,"getAllUnreadMentionedCount",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e;return s(this,(function(t){return e=this._chat.storage.getAllUnreadMentionedCount(),[2,ht(e)]}))}))}}),Object.defineProperty(r.prototype,"getRemoteHistoryMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i,o){return this.getHistoryMessage(e,t,r,n,i,o)}}),Object.defineProperty(r.prototype,"getUltraGroupList",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i=this;return s(this,(function(o){return t=e.targetId,r=e.channelType,this._isUltraGroupListExist?(n=this._chat.storage.getAllUGModels().filter((function(e){return!(void 0!==t&&t!==e.targetId||void 0!==r&&r!==e.channelType)})).map((function(e){var t=e.toIReceivedConversation();return t.unreadMentionedCount=i._getUnreadCount(t.unreadMentionedCount||0),t.unreadMessageCount=i._getUnreadCount(t.unreadMessageCount||0),t.unreadMentionedMeCount=i._getUnreadCount(t.unreadMentionedMeCount||0),t})),(s=n).sort((function(e,t){var r,n,i=(null===(r=e.latestMessage)||void 0===r?void 0:r.sentTime)||0;return((null===(n=t.latestMessage)||void 0===n?void 0:n.sentTime)||0)-i})),[2,ht(s)]):[2,gt(exports.ErrorCode.METHOD_NOT_AVAILABLE)];var s}))}))}}),Object.defineProperty(r.prototype,"_getUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return e>999?999:e}}),Object.defineProperty(r.prototype,"getBlockUltraGroupList",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e;return s(this,(function(t){return this._isUltraGroupListExist?(e=this._chat.storage.getAllUGModels().filter((function(e){return e.notificationLevel>exports.NotificationLevel.NOT_SET})).map((function(e){return{conversationType:exports.ConversationType.ULTRA_GROUP,targetId:e.targetId,channelId:e.channelId}})),[2,ht(e)]):[2,gt(exports.ErrorCode.METHOD_NOT_AVAILABLE)]}))}))}}),Object.defineProperty(r.prototype,"getUltraGroupUnreadMentionedCountByTargetId",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i;return s(this,(function(o){return this._isUltraGroupListExist?(r=this._chat.storage.getAllUGModels(),n=r.reduce((function(r,n){if(n.targetId!==e||!n.unreadMentionedCount)return r;var i=n.notificationLevel||exports.NotificationLevel.NOT_SET;return!t||t.includes(i)?r+n.unreadMentionedCount:r}),0),i=this._getUnreadCount(n),[2,ht(i)]):[2,gt(exports.ErrorCode.METHOD_NOT_AVAILABLE)]}))}))}}),Object.defineProperty(r.prototype,"getUltraGroupUnreadCountByTargetId",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i;return s(this,(function(o){return r=this._chat.storage.getAllUGModels(),n=r.reduce((function(r,n){if(n.targetId!==e||!n.unreadCount)return r;var i=n.notificationLevel||exports.NotificationLevel.NOT_SET;return!t||t.includes(i)?r+n.unreadCount:r}),0),i=this._getUnreadCount(n),[2,ht(i)]}))}))}}),Object.defineProperty(r.prototype,"getUltraGroupUnreadInfoList",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r=this;return s(this,(function(n){return this._isUltraGroupListExist?(t=this._chat.storage.getAllUGModels().filter((function(t){return e.includes(t.targetId)})).map((function(e){return{conversationType:e.conversationType,type:e.conversationType,targetId:e.targetId,channelId:e.channelId||"",unreadMessageCount:r._getUnreadCount(e.unreadCount||0),mentionedCount:r._getUnreadCount(e.unreadMentionedCount||0),mentionedMeCount:r._getUnreadCount(e.unreadMentionedMeCount||0),notificationLevel:e.notificationLevel||exports.NotificationLevel.NOT_SET}})),[2,ht(t)]):[2,gt(exports.ErrorCode.METHOD_NOT_AVAILABLE)]}))}))}}),Object.defineProperty(r.prototype,"getAllUltraGroupUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return void 0===e&&(e=!1),o(this,void 0,void 0,(function(){var t,r;return s(this,(function(n){return this._isUltraGroupListExist?(t=this._chat.storage.getAllUGModels().reduce((function(t,r){return e?t+(r.unreadMentionedCount||0):t+(r.unreadCount||0)}),0),r=this._getUnreadCount(t),[2,ht(r)]):[2,gt(exports.ErrorCode.METHOD_NOT_AVAILABLE)]}))}))}}),Object.defineProperty(r.prototype,"clearUltraUnreadcount",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return void 0===t&&(t=""),o(this,void 0,void 0,(function(){var r,n,i,o,a;return s(this,(function(s){switch(s.label){case 0:return this._isUltraGroupListExist?this._isConnected?(r=this.getServerTime(),n=Kf({conversationType:exports.ConversationType.ULTRA_GROUP,targetId:e,channelId:t},r),(i=new Ei(Zr[Zr.updUgRTime],n,this.currentUserId)).setHeaderQos($r.AT_LEAST_ONCE),[4,this._connMgr.send(i)]):[2,exports.ErrorCode.RC_NET_UNAVAILABLE]:[2,Promise.resolve(exports.ErrorCode.METHOD_NOT_AVAILABLE)];case 1:return o=s.sent(),a=o.code,o.isOk&&this._clearConversationUnreadCount(exports.ConversationType.ULTRA_GROUP,e,t,!1,r),[2,a]}}))}))}}),Object.defineProperty(r.prototype,"sendUltraMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,i){return o(this,void 0,void 0,(function(){var o,a,u,l,c,d,p,f,h,g,_,b,E;return s(this,(function(s){switch(s.label){case 0:return this._isConnected?(t=this._handleMsgProperties(t,!0),o=t.messageId?t.messageId:lr(),t.messageId=o,a=this._connMgr.codec.encodeUpMsg({conversationType:exports.ConversationType.ULTRA_GROUP,targetId:e},t),(u=new Ei(Zr[Zr.ugMsg],a,e)).setHeaderQos($r.AT_LEAST_ONCE),l=this._connMgr.getCrtServerTime(),c=Hh(exports.ConversationType.ULTRA_GROUP,e,n({},t),"",l,this.currentUserId,o),r&&r(o),this.logger.info(H.L_SEND_MSG_T,JSON.stringify({messageType:t.messageType,conversationType:exports.ConversationType.ULTRA_GROUP,targetId:e,channelId:t.channelId}),i),d=Date.now(),[4,this._connMgr.send(u)]):[2,{code:exports.ErrorCode.RC_NET_UNAVAILABLE}];case 1:return p=s.sent(),f=p.code,h=p.data,f!==exports.ErrorCode.SUCCESS?(this.logger.warn(H.L_SEND_MSG_R,JSON.stringify({code:f,messageUId:c.messageUId,messageId:c.messageId}),i),this._writeMessagesLog(exports.ConversationType.ULTRA_GROUP)&&this.logger.record(pe.IM_MSG_SEND,JSON.stringify({channel:exports.ConversationType.ULTRA_GROUP,start_ts:d,client_ts:Date.now(),server_deltatime:Date.now()-this._connMgr.getCrtServerTime(),cod:f})),c.sentStatus=exports.SentStatus.FAILED,[2,{code:f,data:c}]):(this.logger.info(H.L_SEND_MSG_R,JSON.stringify({code:f,messageUId:null==h?void 0:h.messageUId,messageId:null==h?void 0:h.messageId}),i),g=h,this._writeMessagesLog(exports.ConversationType.ULTRA_GROUP,g.messageUId)&&this.logger.record(pe.IM_MSG_SEND,JSON.stringify({msg_id:g.messageUId,channel:exports.ConversationType.ULTRA_GROUP,start_ts:d,client_ts:Date.now(),server_deltatime:Date.now()-this._connMgr.getCrtServerTime(),cod:f})),c.sentTime=g.timestamp,c.messageUId=g.messageUId,this._ultraMsgMap[g.messageUId]=g.timestamp,_=t.channelId||"",b=this._chat.storage.getOrCreateModel({conversationType:exports.ConversationType.ULTRA_GROUP,targetId:e,channelId:_},!0),(E=b.updateAttrs({operationTime:g.timestamp,latestMessage:n({},c)}))&&this._watcher.conversation([n(n({},b.toIReceivedConversation()),{updatedItems:E})]),[2,{code:f,data:c}])}}))}))}}),Object.defineProperty(r.prototype,"sendUltraGroupTypingStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i,o,a,u;return s(this,(function(s){switch(s.label){case 0:return this._isConnected?(r=e.conversationType,n=e.channelId,i=e.targetId,o=this._connMgr.codec.encodeOperateStatus(i,r,n||"",t||0),(a=new Ei(Zr.operate,o,i)).setHeaderQos($r.AT_LEAST_ONCE),[4,this._connMgr.send(a)]):[2,{code:exports.ErrorCode.RC_NET_UNAVAILABLE}];case 1:return(u=s.sent().code)!==exports.ErrorCode.SUCCESS?[2,{code:u,msg:exports.ErrorCode[u]}]:[2,{code:u}]}}))}))}}),Object.defineProperty(r.prototype,"getUltraGroupMessageListByMessageUId",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,o,a,u;return s(this,(function(s){switch(s.label){case 0:return this._isConnected?e.messages&&e.messages.length<1||e.messages&&e.messages.length>20?[2,{code:exports.ErrorCode.MSG_LIMIT_ERROR}]:(t={},e.messages.forEach((function(e){t[e.messageUId]=void 0})),r=this._connMgr.codec.encodeMsgQuery(e),(n=new bi(Zr[Zr.qryMsg],r,this.currentUserId)).setHeaderQos($r.AT_LEAST_ONCE),[4,this._connMgr.send(n,Us,{connectedTime:this._connMgr.getConnectedTime(),currentUserId:this.currentUserId})]):[2,{code:exports.ErrorCode.RC_NET_UNAVAILABLE}];case 1:return i=s.sent(),o=i.code,a=i.data,o!==exports.ErrorCode.SUCCESS?[2,{code:o,msg:exports.ErrorCode[o]}]:(u=(a||{}).list,Array.isArray(u)&&u.forEach((function(e){var r=e.messageUId;t[r]=e})),[2,{code:0,data:t}])}}))}))}}),Object.defineProperty(r.prototype,"_pullOperateStatusNotify",{enumerable:!1,configurable:!0,writable:!0,value:function(e){if(this._isConnected){var t=this._connMgr.codec.decodeByPBName(e.pbData,xs),r=t.conversationType,n=t.info,i=t.summary;this.logger.debug(H.O,"s_opNtf -> type: ".concat(r,", info: ").concat(n,", summary: ").concat(i)),this._watcher.operateStatus(t)}}}),Object.defineProperty(r.prototype,"expandUltraMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n;return s(this,(function(i){switch(i.label){case 0:return this._isConnected?(t=this._connMgr.codec.encodeExpandUltraMessage(e,this.currentUserId),(r=new bi(Zr[Zr.upMsgEx],t,e.targetId)).setHeaderQos($r.AT_LEAST_ONCE),[4,this._connMgr.send(r)]):[2,{code:exports.ErrorCode.RC_NET_UNAVAILABLE}];case 1:return(n=i.sent().code)!==exports.ErrorCode.SUCCESS?[2,{code:n,msg:exports.ErrorCode[n]}]:[2,{code:n}]}}))}))}}),Object.defineProperty(r.prototype,"modifyMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,o,a;return s(this,(function(s){switch(s.label){case 0:return this._isConnected?(t=this._connMgr.codec.encodemodifyMessage(e,this.currentUserId),(r=new bi(Zr[Zr.modifyMsg],t,e.targetId)).setHeaderQos($r.AT_LEAST_ONCE),[4,this._connMgr.send(r)]):[2,{code:exports.ErrorCode.RC_NET_UNAVAILABLE}];case 1:return n=s.sent(),i=n.code,o=n.data,i!==exports.ErrorCode.SUCCESS?[2,{code:i,msg:exports.ErrorCode[i]}]:(a=o,this._ultraMsgMap[a.messageUId]=a.timestamp,[2,{code:i}])}}))}))}}),Object.defineProperty(r.prototype,"_handleEventChangeList",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t={Group:{map:{},types:qh},Friend:{map:{},types:Yh}},r=function(e,t,r){e[t]||(e[t]=[]),e[t].push(r)};e.forEach((function(e){var n=e.changeType;for(var i in t)if(t[i].types.includes(n)){r(t[i].map,n,e);break}}));var n={Group:this._processChangeMapGroup.bind(this),Friend:this._processChangeMapFriend.bind(this)};for(var i in t)Object.keys(t[i].map).length>0&&n[i](t[i].map)}}),Object.defineProperty(r.prototype,"_handleUGChangeList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r={};t.forEach((function(e){var t=e.changeType;r[t]||(r[t]=[]),r[t].push(e)}));var n=z.CHANNEL_CHANGE,i=z.MSG_RECALL,o=z.MSG_EXPANSION,s=z.MSG_MODIFY,a=z.USER_GROUP_CHANGE;r[n]&&this._handleUltraChannelChange(r[n]),r[i]&&this._handleMsgRecall(r[i]),r[o]&&this._handleMsgUpdate(r[o]),r[s]&&this._handleMsgUpdate(r[s]),r[a]&&this._handleUserGroupStatus(r[a])}}),Object.defineProperty(r.prototype,"_processChangeMapGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=M.GROUP_OPERATION,r=M.GROUP_PROFILE_CHANGE,n=M.GROUP_FOLLOW_USER_CHANGE;e[t]&&this._handleGroupOperation(e[t]),e[r]&&this._handleGroupProfileChange(e[r]),e[n]&&this._handleFollowUserChange(e[n])}}),Object.defineProperty(r.prototype,"_processChangeMapFriend",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;(e[v.FRIEND_APPLICATION]||[]).forEach((function(e){var r,n,i,o,s,a,u,l,c,d,p=e.subChangeType,f=e.businessId,h=e.time,g=e.eventData,_=y.FRIEND_APPLY,b=y.FRIEND_REFUSE,E=y.FRIEND_USER_INFO,v=y.FRIENDS_INPUT,m=y.FRIEND_CLEAR,I=y.FRIEND_INFO_CHANGE,T=y.FRIEND_INFO_CHANGE_SYNC;switch(p){case _:case b:var R=p===_?exports.FriendApplicationStatus.UNHANDLED:exports.FriendApplicationStatus.REFUSED;null===(n=(r=t._watcher).friendApplicationStatusChanged)||void 0===n||n.call(r,{userId:f,applicationType:g.applyType,applicationStatus:R,directionType:g.friendType,operationTime:h,extra:g.info||""});break;case E:null===(o=(i=t._watcher).friendAdd)||void 0===o||o.call(i,{userId:f,name:g.name,portraitUri:g.portraitUrl,directionType:g.friendType,operationTime:h});break;case v:null===(a=(s=t._watcher).friendDelete)||void 0===a||a.call(s,{userIds:g.targetId,directionType:g.type,operationTime:h});break;case m:null===(l=(u=t._watcher).friendCleared)||void 0===l||l.call(u,h);break;case I:break;case T:null===(d=(c=t._watcher).friendInfoChangedSync)||void 0===d||d.call(c,{userId:f,remark:g.remarkname,extProfile:g.extProfile,operationTime:h})}}))}}),Object.defineProperty(r.prototype,"_handleGroupOperation",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;e.forEach((function(e){var r,n,i,o,s=e.subChangeType,a=e.businessId,l=e.time,c=e.eventData,d=c.optUserInfo,p=c.channelInfo,f=c.userInfos,h={groupId:a,operation:s,operationTime:l};d&&(r=u(Zt([d]),1),h.operatorInfo=r[0]),s===exports.GroupOperation.CREATE&&(n=u(Qt([p]),1),h.groupInfo=n[0]),[exports.GroupOperation.CREATE,exports.GroupOperation.DISMISS].includes(s)||(h.memberInfos=Zt(f)),null===(o=(i=t._watcher).groupOperation)||void 0===o||o.call(i,h)}))}}),Object.defineProperty(r.prototype,"_handleGroupProfileChange",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;e.forEach((function(e){var r,n,i,o,s,a,l=e.businessId,c=e.time,d=e.eventData,p=e.subChangeType,f=e.secondaryId;switch(p){case S.GROUP_INFO_CHANGE:var h=u(Zt([d.optUserInfo]),1)[0],g=u(Wt([d.channelInfo]),1)[0],_=u(d.channelFullInfo?Wt([d.channelFullInfo]):[void 0],1)[0];null===(n=(r=t._watcher).groupInfoChanged)||void 0===n||n.call(r,{operatorInfo:h,groupInfo:g,changedGroupInfo:g,operationTime:c,fullGroupInfo:_});break;case S.MEMBER_PROFILE_CHANGE:h=u(Zt([d.optUserInfo]),1)[0];var b=Zt(d.userInfos)[0];null===(o=(i=t._watcher).groupMemberInfoChanged)||void 0===o||o.call(i,{groupId:l,operatorInfo:h,memberInfo:b,operationTime:c});break;case S.GROUP_REMARK_DELETE:case S.GROUP_REMARK_SET:var E=p===S.GROUP_REMARK_SET?exports.GroupOperationType.ADD:exports.GroupOperationType.REMOVE;null===(a=(s=t._watcher).groupRemarkChangedSync)||void 0===a||a.call(s,{groupId:l,operationType:E,operationTime:c,groupRemark:f})}}))}}),Object.defineProperty(r.prototype,"_handleFollowUserChange",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;e.forEach((function(e){var r,n,i=e.subChangeType,o=e.businessId,s=e.time,a=e.userGroupIds,u=1===i?exports.GroupOperationType.ADD:exports.GroupOperationType.REMOVE;null===(n=(r=t._watcher).groupFollowsChangedSync)||void 0===n||n.call(r,{groupId:o,operationType:u,operationTime:s,userIds:a})}))}}),Object.defineProperty(r.prototype,"_handleUltraChannelChange",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this,r=[],n=[],i=[];e.forEach((function(e){var o=e.subChangeType,s=e.targetId,a=e.msgTime,u=e.operatorId,l=e.busChannel||"",c=t._chat.storage.getCachedUGConversation(s,l);if(c){var d=Z.PUBLIC_TO_PRIVATE,p=Z.PRIVATE_TO_PUBLIC,f=Z.PUBLIC_TO_PRIVATE_USER_NOT_IN,h=Z.CHANNEL_DELETE,g=Z.CHANNEL_USER_KICKED;switch(o){case p:t._chat.storage.updateConversationCache(c,{channelType:exports.UltraGroupChannelType.PUBLIC}),r.push({targetId:s,channelId:l,changeType:exports.UltraGroupChannelChangeType.PRIVATE_TO_PUBLIC,channelType:exports.UltraGroupChannelType.PUBLIC});break;case d:t._chat.storage.updateConversationCache(c,{channelType:exports.UltraGroupChannelType.PRIVATE}),r.push({targetId:s,channelId:l,changeType:exports.UltraGroupChannelChangeType.PUBLIC_TO_PRIVATE,channelType:exports.UltraGroupChannelType.PRIVATE});break;case f:t._chat.storage.removeConversation(c),r.push({targetId:s,channelId:l,changeType:exports.UltraGroupChannelChangeType.PUBLIC_TO_PRIVATE_USER_NOT_IN,channelType:c.channelType});break;case h:t._chat.storage.removeConversation(c),n.push({targetId:s,channelId:l,channelType:c.channelType,deleteTime:a});break;case g:i.push({targetId:s,channelId:l,userId:u,channelType:exports.UltraGroupChannelType.PRIVATE}),u===t.currentUserId&&t._chat.storage.removeConversation(c)}}})),r.length>0&&this._watcher.ultraGroupChannelChangeType(r),n.length>0&&this._watcher.ultraGroupChannelDelete(n),i.length>0&&this._watcher.ultraGroupChannelUserKicked(i)}}),Object.defineProperty(r.prototype,"_handleMsgRecall",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this,r=[];e.forEach((function(e){var n=e.targetId,i=e.busChannel,o=e.msgUID,s=e.msgTime,a=e.type,u=e.operatorId,l=e.remindType;t._updateUltraGroupWhenRecallMsg(n,i||"",o,s,l),r.push({targetId:n,conversationType:a,sentTime:s,messageUId:o,senderUserId:u,channelId:i||"",content:{conversationType:a,targetId:n,messageUId:o,channelId:i||""},messageDirection:1,messageType:exports.MessageType.RECALL,isOffLineMessage:!1,receivedTime:Date.now(),isPersited:!1,isCounted:!1,isMentioned:!1,disableNotification:!1,isStatusMessage:!1,canIncludeExpansion:!1,expansion:null,receivedStatus:exports.ReceivedStatus.UNREAD,receivedStatusInfo:Bt(exports.ReceivedStatus.UNREAD)})})),this._watcher.ultraGroupMessageRecalled(r)}}),Object.defineProperty(r.prototype,"_handleMsgUpdate",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t={};for(var r in e.forEach((function(e){var r=e.targetId,n=e.type,i=e.msgTime,o=e.msgUID,s=e.busChannel,a="".concat(n,"_").concat(r);t[a]||(t[a]=[]),t[a].push({messageUId:o,channelId:s||"",sendTime:i})})),t){var n=r.split("_"),i=n.shift(),o=n.join("_");this._pullUltraMessageList(e[0].changeType,{targetId:o,conversationType:Number(i),messages:l([],u(t[r]),!1)})}}}),Object.defineProperty(r.prototype,"_pullUltraMessageList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i,o,a,u,l,c=this;return s(this,(function(s){switch(s.label){case 0:return this._isConnected?(r=this._connMgr.codec.encodeMsgQuery(t),(n=new bi(Zr.qryMsg,r,this.currentUserId)).setHeaderQos($r.AT_LEAST_ONCE),[4,this._connMgr.send(n,Us,{connectedTime:this._connMgr.getConnectedTime(),currentUserId:this.currentUserId})]):[2,{code:exports.ErrorCode.RC_NET_UNAVAILABLE}];case 1:return i=s.sent(),o=i.code,a=i.data,o!==exports.ErrorCode.SUCCESS?[2,{code:o,msg:exports.ErrorCode[o]}]:(u=(a||{}).list,l=[],Array.isArray(u)&&u.forEach((function(e){var t,r=e.targetId,n=e.channelId,i=e.messageUId,o=c._chat.storage.getCachedUGConversation(r,n||"");o&&(null===(t=o.latestMessage)||void 0===t?void 0:t.messageUId)===i&&c._chat.storage.updateConversationCache(o,{latestMessage:e}),l.push(e)})),e===z.MSG_EXPANSION&&this._watcher.ultraGroupMessageExpansionUpdated(l),e===z.MSG_MODIFY&&this._watcher.ultraGroupMessageModified(l),[2])}}))}))}}),Object.defineProperty(r.prototype,"_handleUserGroupStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,o,a,u,l,c,d,p;return s(this,(function(s){return t=X.REMOVE_USER_GROUP,r=X.JOIN_USER_GROUP,n=X.EXIT_USER_GROUP,i=X.CHANNEL_BIND_USER_GROUP,o=X.CHANNEL_UNBIND_USER_GROUP,a=[],u=[],l=[],c=[],d=[],e.forEach((function(e){var s=e.type,p=e.targetId,f=e.busChannelType,h=e.busChannel,g=e.userGroupIds;switch(e.subChangeType){case t:a.push({conversation:{conversationType:s,targetId:p},userGroupIds:g});break;case r:u.push({conversation:{conversationType:s,targetId:p},userGroupIds:g});break;case n:l.push({conversation:{conversationType:s,targetId:p},userGroupIds:g});break;case i:c.push({conversation:{conversationType:s,targetId:p,channelId:h},channelType:f,userGroupIds:g});break;case o:d.push({conversation:{conversationType:s,targetId:p,channelId:h},channelType:f,userGroupIds:g})}})),p={},a.length>0&&(p.userGroupDisband=a),u.length>0&&(p.userAdded=u),l.length>0&&(p.userRemoved=l),c.length>0&&(p.userGroupBindChannel=c),d.length>0&&(p.userGroupUnBindChannel=d),this._watcher.userGroupStatus(p),[2]}))}))}}),Object.defineProperty(r.prototype,"getUltraHistoryMsg",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n;return o(this,void 0,void 0,(function(){var i,o,a,u,l,c;return s(this,(function(s){switch(s.label){case 0:return this._isConnected?(i=this._connMgr.codec.encodeGetHistoryMsg(e,t),o=new bi(Zr[Zr.qryUgMsg],i,this.currentUserId),this.logger.info(H.L_GET_HISTORY_MSG_T,JSON.stringify({targetId:e,conversationType:exports.ConversationType.ULTRA_GROUP,channelId:t.channelId,timestamp:null==t?void 0:t.timestamp,count:null==t?void 0:t.count}),r),[4,this._connMgr.send(o,Fo,{currentUserId:this.currentUserId,conversation:{conversationType:exports.ConversationType.ULTRA_GROUP,targetId:e}})]):[2,{code:exports.ErrorCode.RC_NET_UNAVAILABLE}];case 1:return a=s.sent(),u=a.code,l=a.data,u===exports.ErrorCode.SUCCESS&&l?(c=[],null===(n=l.list)||void 0===n||n.forEach((function(e){e&&c.push(e.messageUId)})),this.logger.info(H.L_GET_HISTORY_MSG_R,JSON.stringify({code:u,messageUIds:c.join(",")}),r),[2,{code:u,data:l}]):(this.logger.warn(H.L_GET_HISTORY_MSG_R,JSON.stringify({code:u,messageUIds:""}),r),[2,{code:u}])}}))}))}}),Object.defineProperty(r.prototype,"setUltraGroupDefaultNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n,i,o,a;return s(this,(function(s){switch(s.label){case 0:return this._isUltraGroupListExist?this._isConnected?(n=this._connMgr.codec.encodeSetUltraGroupDefaultNotificationLevel(t,r),i=new bi(Zr.ugUnpushSet,n,e),[4,this._connMgr.send(i)]):[2,{code:exports.ErrorCode.RC_NET_UNAVAILABLE}]:[2,Promise.resolve({code:exports.ErrorCode.METHOD_NOT_AVAILABLE})];case 1:return o=s.sent(),a=o.code,exports.ErrorCode.SUCCESS,[2,{code:a}]}}))}))}}),Object.defineProperty(r.prototype,"getUltraGroupDefaultNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i,o,a,u,l;return s(this,(function(s){switch(s.label){case 0:return this._isUltraGroupListExist?this._isConnected?(r=this._connMgr,n=r.codec.encodeGetUltraGroupDefaultNotificationLevel(t),i=new bi(Zr[Zr.ugUnpushQuery],n,e),[4,r.send(i,fs)]):[2,{code:exports.ErrorCode.RC_NET_UNAVAILABLE}]:[2,Promise.resolve({code:exports.ErrorCode.METHOD_NOT_AVAILABLE})];case 1:return o=s.sent(),a=o.code,u=o.data,a===exports.ErrorCode.SUCCESS&&u?(l=u.unpushLevel,[2,{code:a,data:l}]):[2,{code:a}]}}))}))}}),Object.defineProperty(r.prototype,"_updateUltraGroupWhenRecallMsg",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,i,o){var s=this._chat.storage.getModel({conversationType:exports.ConversationType.ULTRA_GROUP,targetId:e,channelId:t});if(s){var a={},u=s.latestMessage;u&&u.messageUId===r&&(a.latestMessage=null),i&&s.lastReadTime<i&&s.unreadCount&&(a.unreadCount=s.unreadCount-1,o!==$.ALL&&o!==$.ME||!s.unreadMentionedCount||(a.unreadMentionedCount=s.unreadMentionedCount-1),o===$.ME&&s.unreadMentionedCount&&(a.unreadMentionedMeCount=s.unreadMentionedMeCount-1));var l=s.updateAttrs(a,i);this._chat.storage.updateConversationStorage([s]),l&&this._watcher.conversation([n(n({},s.toIReceivedConversation()),{updatedItems:l})])}}}),Object.defineProperty(r.prototype,"getUltraGroupUnreadMentionedMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,o;return s(this,(function(s){switch(s.label){case 0:return this._isConnected?this._isUltraGroupListExist?(t=this._connMgr.codec.encodeUnreadMentionedMsgQuery(e),r=new bi(Zr[Zr.qryUgUal],t,this.currentUserId),[4,this._connMgr.send(r,Do)]):[2,Promise.resolve({code:exports.ErrorCode.METHOD_NOT_AVAILABLE})]:[2,{code:exports.ErrorCode.RC_NET_UNAVAILABLE}];case 1:return n=s.sent(),i=n.code,o=n.data,i===exports.ErrorCode.SUCCESS&&o?[2,{code:i,data:o}]:[2,{code:i}]}}))}))}}),Object.defineProperty(r.prototype,"getUltraGroupFirstUnreadMessageTimestamp",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t;return s(this,(function(r){return this._isConnected?this._isUltraGroupListExist?(t=this._chat.storage.getUGFistUnreadMessageInfo(e.targetId,e.channelId||""))?[2,ht(t)]:[2,gt(exports.ErrorCode.RC_DB_DATA_NOT_FOUND)]:[2,gt(exports.ErrorCode.METHOD_NOT_AVAILABLE)]:[2,gt(exports.ErrorCode.RC_NET_UNAVAILABLE)]}))}))}}),Object.defineProperty(r.prototype,"subscribeUser",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){return s(this,(function(n){return this._isConnected?[2,this._subscribeManager.updateSubscribeRelation(e,t,exports.SubscribeOperationType.SUBSCRIBE,r)]:[2,{code:exports.ErrorCode.RC_NET_UNAVAILABLE}]}))}))}}),Object.defineProperty(r.prototype,"unSubscribeUser",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){return s(this,(function(r){switch(r.label){case 0:return this._isConnected?[4,this._subscribeManager.updateSubscribeRelation(e,t,exports.SubscribeOperationType.UNSUBSCRIBE)]:[2,{code:exports.ErrorCode.RC_NET_UNAVAILABLE}];case 1:return[2,{code:r.sent().code}]}}))}))}}),Object.defineProperty(r.prototype,"getSubscribeUserList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n;return o(this,void 0,void 0,(function(){var i;return s(this,(function(o){return this._isConnected?(i=null===(n=this._subscribeManager)||void 0===n?void 0:n.getSubscribeUserList(e,t,r),[2,Promise.resolve({code:exports.ErrorCode.SUCCESS,data:i})]):[2,{code:exports.ErrorCode.RC_NET_UNAVAILABLE}]}))}))}}),Object.defineProperty(r.prototype,"getSubscribeUserStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r;return o(this,void 0,void 0,(function(){var n;return s(this,(function(i){return this._isConnected?(n=null===(r=this._subscribeManager)||void 0===r?void 0:r.getSubscribeUserStatus(e,t),[2,Promise.resolve({code:exports.ErrorCode.SUCCESS,data:n})]):[2,{code:exports.ErrorCode.RC_NET_UNAVAILABLE}]}))}))}}),Object.defineProperty(r.prototype,"updateMyUserProfile",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t;return o(this,void 0,void 0,(function(){var r,n,i,o,a;return s(this,(function(s){switch(s.label){case 0:return this._isConnected?(r=Za.encode(ra,c(this,d,"m",h).call(this,e)),[4,this._connMgr.query(Zr.updUserProfile,this.currentUserId,r,void 0)]):[2,{code:exports.ErrorCode.RC_NET_UNAVAILABLE}];case 1:return(n=s.sent()).data?(i=Za.decode(ia,n.data.pbData),n.isOk?(o=i.version,null===(t=this._subscribeManager)||void 0===t||t.updateOwnProfile(e,o),[2,n.wipe()]):(a=i.censorFailedFields,[2,gt(n.code,"",a&&0!==a.length?{errorKeys:a,errorKey:a[0]}:void 0)])):[2,n.wipe()]}}))}))}}),Object.defineProperty(r.prototype,"getMyUserProfile",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._isConnected?this._subscribeManager.getOwnProfile():Promise.resolve({code:exports.ErrorCode.RC_NET_UNAVAILABLE})}}),Object.defineProperty(r.prototype,"getUserProfiles",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){return s(this,(function(t){return this._isConnected?[2,this._subscribeManager.getUserProfiles(e)]:[2,{code:exports.ErrorCode.RC_NET_UNAVAILABLE}]}))}))}}),Object.defineProperty(r.prototype,"updateMyUserProfileVisibility",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r;return s(this,(function(n){switch(n.label){case 0:return this._isConnected?(t=this._connMgr.codec.encodeUserProfilePermission(e),r=new bi(Zr[Zr.updProfilePermiss],t,this.currentUserId),[4,this._connMgr.send(r)]):[2,{code:exports.ErrorCode.RC_NET_UNAVAILABLE}];case 1:return[2,{code:n.sent().code}]}}))}))}}),Object.defineProperty(r.prototype,"getMyUserProfileVisibility",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t,r,n,i;return s(this,(function(o){switch(o.label){case 0:return this._isConnected?(e=this._connMgr.codec.encodeUserProfileInput(),t=new bi(Zr[Zr.qProfilePermiss],e,this.currentUserId),[4,this._connMgr.send(t,ua)]):[2,{code:exports.ErrorCode.RC_NET_UNAVAILABLE}];case 1:return r=o.sent(),n=r.code,i=r.data,n!==exports.ErrorCode.SUCCESS?[2,{code:n}]:[2,{code:n,data:null==i?void 0:i.permission}]}}))}))}}),Object.defineProperty(r.prototype,"searchUserProfileByUniqueId",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,o,a;return s(this,(function(s){switch(s.label){case 0:return this._isConnected?(t=this._connMgr.codec.encodeSearchUserProfile(e),r=new bi(Zr[Zr.searchUserProfile],t,this.currentUserId),[4,this._connMgr.send(r,ra)]):[2,{code:exports.ErrorCode.RC_NET_UNAVAILABLE}];case 1:return n=s.sent(),i=n.code,o=n.data,i===exports.ErrorCode.SUCCESS&&o?(a=qt(o.userId,o.userProfile,o.userExtProfile),[2,{code:i,data:a}]):[2,{code:i}]}}))}))}}),Object.defineProperty(r.prototype,"bindRTCRoomForChatroom",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i;return s(this,(function(o){switch(o.label){case 0:return this._isConnected?(t=e.chatRoomId,r=Za.encode(js,{rtcRoomId:t}),n=new bi(Zr.setRtcRoomId,r,t),[4,this._connMgr.send(n)]):[2,exports.ErrorCode.RC_NET_UNAVAILABLE];case 1:return i=o.sent(),[2,i.code]}}))}))}}),Object.defineProperty(r.prototype,"rtcSignaling",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return o(this,void 0,void 0,(function(){var i,o,a,u;return s(this,(function(s){switch(s.label){case 0:return this._isConnected?(i=r?new bi(t,n,e):new Ei(t,n,e),[4,this._connMgr.send(i)]):[2,{code:exports.ErrorCode.RC_NET_UNAVAILABLE}];case 1:return o=s.sent(),a=o.code,u=o.data,[2,{code:a,buffer:u instanceof vi||null==u?void 0:u.pbData}]}}))}))}}),Object.defineProperty(r.prototype,"rtcPing",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n,i,o,a,u;return s(this,(function(s){switch(s.label){case 0:return n=mu(this.rtcCodec,t,r),[4,this.rtcSignaling(e,Zr[Zr.rtcPing],!0,n)];case 1:return i=s.sent(),o=i.code,a=i.buffer,o!==exports.ErrorCode.SUCCESS?[2,{code:o}]:((u=this.rtcCodec.decode(tu.RtcOutput,a)).version=kt(u.version),[2,{code:o,data:u}])}}))}))}}),Object.defineProperty(r.prototype,"getDeviceId",{enumerable:!1,configurable:!0,writable:!0,value:function(){return Fu()}}),Object.defineProperty(r.prototype,"setPushConfig",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;(t=e.deviceId)&&(ku=t),r=e.packageName,Bu=r}}),Object.defineProperty(r.prototype,"getOSInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){return s(this,(function(e){return[2,{code:exports.ErrorCode.NOT_SUPPORT}]}))}))}}),Object.defineProperty(r.prototype,"getProcessInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){return s(this,(function(e){return[2,{code:exports.ErrorCode.NOT_SUPPORT}]}))}))}}),Object.defineProperty(r.prototype,"getMainProcessInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){return s(this,(function(e){return[2,{code:exports.ErrorCode.NOT_SUPPORT}]}))}))}}),Object.defineProperty(r.prototype,"destroy",{enumerable:!1,configurable:!0,writable:!0,value:function(){o(void 0,void 0,void 0,(function(){var e,t;return s(this,(function(r){switch(r.label){case 0:return Hp?(Jp&&(clearTimeout(Jp),Jp=null),[4,Hp]):[2];case 1:return(e=r.sent())&&(t=e.db,Xp.push(t)),Hp=null,[2]}}))}))}}),Object.defineProperty(r.prototype,"setProxy",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return Promise.resolve({code:exports.ErrorCode.NOT_SUPPORT})}}),Object.defineProperty(r.prototype,"getProxy",{enumerable:!1,configurable:!0,writable:!0,value:function(){return Promise.resolve({code:exports.ErrorCode.NOT_SUPPORT})}}),Object.defineProperty(r.prototype,"testProxy",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return Promise.resolve({status:exports.ErrorCode.NOT_SUPPORT})}}),Object.defineProperty(r.prototype,"setNetwork",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._connMgr.setNetwork(e,t),e.status}}),Object.defineProperty(r.prototype,"createGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return o(this,void 0,void 0,(function(){var i,o,a,u;return s(this,(function(s){switch(s.label){case 0:return i=Df(e,t,r,n),[4,this._connMgr.query(Zr.channelCreate,e,i,void 0)];case 1:return(o=s.sent()).isOk||!o.data?[2,ht()]:(a=Za.decode(da,o.data.pbData),u={errorKeys:a.censorFailedFields,processCode:a.processCode||0},[2,gt(o.code,o.msg,u)])}}))}))}}),Object.defineProperty(r.prototype,"updateGroupInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n,i,o;return s(this,(function(s){switch(s.label){case 0:return n=Df(e,t,r),[4,this._connMgr.query(Zr.upChannelInfo,e,n,void 0)];case 1:return(i=s.sent()).isOk||!i.data?[2,ht()]:(o=Za.decode(da,i.data.pbData),[2,gt(i.code,i.msg,{errorKeys:o.censorFailedFields})])}}))}))}}),Object.defineProperty(r.prototype,"getGroupsInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,o,a,u;return s(this,(function(s){switch(s.label){case 0:return t=this._connMgr.codec.encodeMultiChannels(e),r=new bi(Zr[Zr.qChannelInfo],t,e[0]),[4,this._connMgr.send(r,ba)];case 1:return n=s.sent(),i=n.code,o=n.data,i===exports.ErrorCode.SUCCESS&&o?(a=o.result.list,u=Qt(void 0===a?[]:a),[2,{code:i,data:u}]):[2,{code:i}]}}))}))}}),Object.defineProperty(r.prototype,"kickGroupMembers",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n;return o(this,void 0,void 0,(function(){var i,o,a,u,l;return s(this,(function(s){switch(s.label){case 0:return i=this._connMgr.codec.encodeQuitGroup("kick",e,t,!0,r),o=new bi(Zr[Zr.channelMemKick],i,e),[4,this._connMgr.send(o,da)];case 1:return a=s.sent(),u=a.code,l=a.data,u!==exports.ErrorCode.SUCCESS?[2,{code:u,msg:null!==(n=null==l?void 0:l.msg)&&void 0!==n?n:""}]:[2,{code:u}]}}))}))}}),Object.defineProperty(r.prototype,"quitGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r;return o(this,void 0,void 0,(function(){var n,i,o,a,u;return s(this,(function(s){switch(s.label){case 0:return n=this._connMgr.codec.encodeQuitGroup("quit",e,[],!0,t),i=new bi(Zr[Zr.channelMemQuit],n,e),[4,this._connMgr.send(i,da)];case 1:return o=s.sent(),a=o.code,u=o.data,a!==exports.ErrorCode.SUCCESS?[2,{code:a,msg:null!==(r=null==u?void 0:u.msg)&&void 0!==r?r:""}]:[2,{code:a}]}}))}))}}),Object.defineProperty(r.prototype,"dismissGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t;return o(this,void 0,void 0,(function(){var r,n,i,o,a;return s(this,(function(s){switch(s.label){case 0:return r=this._connMgr.codec.encodeQuitGroup("dismiss",e),n=new bi(Zr[Zr.channelDismiss],r,e),[4,this._connMgr.send(n,da)];case 1:return i=s.sent(),o=i.code,a=i.data,o!==exports.ErrorCode.SUCCESS?[2,{code:o,msg:null!==(t=null==a?void 0:a.msg)&&void 0!==t?t:""}]:[2,{code:o}]}}))}))}}),Object.defineProperty(r.prototype,"transferGroupOwner",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){var i;return o(this,void 0,void 0,(function(){var o,a,u,l,c;return s(this,(function(s){switch(s.label){case 0:return o=this._connMgr.codec.encodeQuitGroup("transfer",e,[t],r,n),a=new bi(Zr[Zr.channelTransfer],o,e),[4,this._connMgr.send(a,da)];case 1:return u=s.sent(),l=u.code,c=u.data,l!==exports.ErrorCode.SUCCESS?[2,{code:l,msg:null!==(i=null==c?void 0:c.msg)&&void 0!==i?i:""}]:[2,{code:l}]}}))}))}}),Object.defineProperty(r.prototype,"setGroupManagers",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n;return o(this,void 0,void 0,(function(){var i,o,a,u,l;return s(this,(function(s){switch(s.label){case 0:return i=this._connMgr.codec.encodeModifyChannelsInput(e,t,r),o=new bi(Zr[Zr.upChannelManager],i,t),[4,this._connMgr.send(o,da)];case 1:return a=s.sent(),u=a.code,l=a.data,u!==exports.ErrorCode.SUCCESS?[2,{code:u,msg:null!==(n=null==l?void 0:l.msg)&&void 0!==n?n:""}]:[2,{code:u}]}}))}))}}),Object.defineProperty(r.prototype,"getGroupMembersByRole",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n,i,o,a,u,l,c,d,p,f,h;return s(this,(function(s){switch(s.label){case 0:return n=this._connMgr.codec.encodeChannelsQueryInput({type:"getGroupMembersByRole",groupId:e,option:r,roleType:t}),i=new bi(Zr[Zr.qChannelMem],n,e),[4,this._connMgr.send(i,ba)];case 1:return o=s.sent(),a=o.code,u=o.data,a===exports.ErrorCode.SUCCESS&&u?(l=u.result,c=u.page,p=(d=c||{}).pageToken,f=d.hasNext,[],h=Zt(l.list),[2,{code:a,data:{data:h,pageToken:f&&p?p:""}}]):[2,{code:a}]}}))}))}}),Object.defineProperty(r.prototype,"getGroupMembers",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i,o,a,u,l;return s(this,(function(s){switch(s.label){case 0:return r=this._connMgr.codec.encodeChannelsQueryInput({type:"getGroupMembers",groupId:e,ids:t}),n=new bi(Zr[Zr.qChannelSpeMem],r,e),[4,this._connMgr.send(n,ba)];case 1:return i=s.sent(),o=i.code,a=i.data,o!==exports.ErrorCode.SUCCESS?[2,{code:o}]:a?(u=a.result,[],l=Zt(u.list),[2,{code:o,data:l}]):[2,{code:o,data:[]}]}}))}))}}),Object.defineProperty(r.prototype,"setGroupMemberInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return o(this,void 0,void 0,(function(){var i,o,a;return s(this,(function(s){switch(s.label){case 0:return i=Za.encode(ma,{targetId:e,type:exports.ConversationType.GROUP,userId:t,channelNickName:r,additional:n}),[4,this._connMgr.query(Zr.upChannelMem,e,i,void 0)];case 1:return(o=s.sent()).isOk||!o.data?[2,ht()]:(a=Za.decode(da,o.data.pbData),[2,gt(o.code,o.msg,{errorKeys:a.censorFailedFields})])}}))}))}}),Object.defineProperty(r.prototype,"searchGroupMembers",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return Promise.resolve({code:exports.ErrorCode.NOT_SUPPORT})}}),Object.defineProperty(r.prototype,"joinGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t;return o(this,void 0,void 0,(function(){var r,n,i,o,a;return s(this,(function(s){switch(s.label){case 0:return r=this._connMgr.codec.encodeJoinGroup("join",e),n=new bi(Zr[Zr.channelMemJoin],r,e),[4,this._connMgr.send(n,da)];case 1:return i=s.sent(),o=i.code,a=i.data,[2,{code:o,data:{processCode:null!==(t=null==a?void 0:a.processCode)&&void 0!==t?t:0}}]}}))}))}}),Object.defineProperty(r.prototype,"inviteUsersToGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r,n;return o(this,void 0,void 0,(function(){var i,o,a,u,l;return s(this,(function(s){switch(s.label){case 0:return i=this._connMgr.codec.encodeJoinGroup("invite",e,t),o=new bi(Zr[Zr.channelMemInvite],i,e),[4,this._connMgr.send(o,da)];case 1:return a=s.sent(),u=a.code,l=a.data,u!==exports.ErrorCode.SUCCESS?[2,{code:u,msg:null!==(r=null==l?void 0:l.msg)&&void 0!==r?r:""}]:[2,{code:u,data:{processCode:null!==(n=null==l?void 0:l.processCode)&&void 0!==n?n:0}}]}}))}))}}),Object.defineProperty(r.prototype,"memberInviteResponse",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;return o(this,void 0,void 0,(function(){var n,i,o,a,u;return s(this,(function(s){switch(s.label){case 0:return n=this._connMgr.codec.encodeMemberResponseInput(e),i=new bi(Zr[Zr.channelApplyResp],n,e.groupId),[4,this._connMgr.send(i,da)];case 1:return o=s.sent(),a=o.code,u=o.data,a!==exports.ErrorCode.SUCCESS?[2,{code:a,msg:null!==(t=null==u?void 0:u.msg)&&void 0!==t?t:""}]:[2,{code:a,data:{processCode:null!==(r=null==u?void 0:u.processCode)&&void 0!==r?r:0}}]}}))}))}}),Object.defineProperty(r.prototype,"getGroupApplications",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var t,r,i,o,a,u,l;return s(this,(function(s){switch(s.label){case 0:return t=Za.encode(ga,{type:exports.ConversationType.GROUP,page:{size:e.count,pageToken:e.pageToken,order:e.order?0:1}}),[4,this._connMgr.query(Zr.qChannelApplyList,this.currentUserId,t,ba)];case 1:return(r=s.sent()).isOk?(i=function(e){var t=e.listType,r=e.result,i=e.page,o=new Uint8Array(r),s=[];switch(t){case 1:s=Za.decode(va,o).list;break;case 2:s=Za.decode(Ea,o).list;break;case 3:s=Za.decode(ya,o).list;break;case 11:s=Za.decode(Ma,o).list;break;case 13:s=Za.decode(La,o).list}return n(n({},i),{list:s})}(r.data),o=i.pageToken,a=i.hasNext,u=i.list,l=u.map(er),[2,ht({data:l,pageToken:a&&o?o:""})]):[2,r.wipe()]}}))}))}}),Object.defineProperty(r.prototype,"getJoinedGroupsByRole",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i,o,a,u,l,c,d,p,f;return s(this,(function(s){switch(s.label){case 0:return r=this._connMgr.codec.encodeChannelsQueryInput({type:"getJoinedGroupsByRole",option:t,roleType:e}),n=new bi(Zr[Zr.qChannelMemJoin],r,this.currentUserId),[4,this._connMgr.send(n,ba)];case 1:return i=s.sent(),o=i.code,a=i.data,o===exports.ErrorCode.SUCCESS&&a?(u=a.result,l=a.page,d=(c=l||{}).pageToken,p=c.hasNext,f=Qt(u.list),[2,{code:o,data:{data:f,pageToken:p&&d?d:""}}]):[2,{code:o}]}}))}))}}),Object.defineProperty(r.prototype,"searchJoinedGroups",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return Promise.resolve({code:exports.ErrorCode.NOT_SUPPORT})}}),Object.defineProperty(r.prototype,"getJoinedGroups",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,o,a,u;return s(this,(function(s){switch(s.label){case 0:return t=this._connMgr.codec.encodeChannelsQueryInput({type:"getJoinedGroups",ids:e}),r=new bi(Zr[Zr.qChannelMemSpeJoin],t,this.currentUserId),[4,this._connMgr.send(r,ba)];case 1:return n=s.sent(),i=n.code,o=n.data,i===exports.ErrorCode.SUCCESS&&o?(a=o.result.list,u=Qt(a),[2,{code:i,data:u}]):[2,{code:i}]}}))}))}}),Object.defineProperty(r.prototype,"setGroupRemark",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n;return s(this,(function(i){switch(i.label){case 0:return r=this._connMgr.codec.encodeSetGroupRemark(e,t),n=new bi(Zr[Zr.upChannelRemark],r,e),[4,this._connMgr.send(n)];case 1:return[2,{code:i.sent().code}]}}))}))}}),Object.defineProperty(r.prototype,"setGroupFollows",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n,i;return s(this,(function(o){switch(o.label){case 0:return n=this._connMgr.codec.encodeSetGroupFollows(e,t,r),i=new bi(Zr[Zr.upChannelFollow],n,t),[4,this._connMgr.send(i)];case 1:return[2,{code:o.sent().code}]}}))}))}}),Object.defineProperty(r.prototype,"getGroupFollows",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,o,a,u;return s(this,(function(s){switch(s.label){case 0:return t=this._connMgr.codec.encodeChannelsQueryInput({type:"getGroupFollows",groupId:e}),r=new bi(Zr[Zr.qChannelFollow],t,this.currentUserId),[4,this._connMgr.send(r,ba)];case 1:return n=s.sent(),i=n.code,o=n.data,i===exports.ErrorCode.SUCCESS&&o?(a=o.result,l=a.list,u=l.map((function(e){var t=e.userId,r=e.opTime;return{userId:t,time:kt(r)}})),[2,{code:i,data:u}]):[2,{code:i}]}var l}))}))}}),Object.defineProperty(r.prototype,"addFriend",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n;return o(this,void 0,void 0,(function(){var i,o,a,u,l;return s(this,(function(s){switch(s.label){case 0:return i=this._connMgr.codec.encodeFriendInput({targetId:e,type:t,info:r}),o=new bi(Zr[Zr.friendAdd],i,this.currentUserId),[4,this._connMgr.send(o,da)];case 1:return a=s.sent(),u=a.code,l=a.data,u===exports.ErrorCode.SUCCESS&&l?[2,{code:u,data:{processCode:null!==(n=null==l?void 0:l.processCode)&&void 0!==n?n:0}}]:[2,{code:u}]}}))}))}}),Object.defineProperty(r.prototype,"deleteFriends",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n;return s(this,(function(i){switch(i.label){case 0:return r=this._connMgr.codec.encodeFriendsInput(e,t),n=new bi(Zr[Zr.friendDel],r,this.currentUserId),[4,this._connMgr.send(n)];case 1:return[2,{code:i.sent().code}]}}))}))}}),Object.defineProperty(r.prototype,"acceptFriendApplication",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r;return s(this,(function(n){switch(n.label){case 0:return t=this._connMgr.codec.encodeFriendInput({targetId:e,type:1}),r=new bi(Zr[Zr.friendHandle],t,this.currentUserId),[4,this._connMgr.send(r)];case 1:return[2,{code:n.sent().code}]}}))}))}}),Object.defineProperty(r.prototype,"refuseFriendApplication",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n;return s(this,(function(i){switch(i.label){case 0:return r=this._connMgr.codec.encodeFriendInput({targetId:e,type:2,info:t}),n=new bi(Zr[Zr.friendHandle],r,this.currentUserId),[4,this._connMgr.send(n)];case 1:return[2,{code:i.sent().code}]}}))}))}}),Object.defineProperty(r.prototype,"setFriendInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n,i,o;return s(this,(function(s){switch(s.label){case 0:return n=Za.encode(Sa,{targetId:e,remarkName:t,extProfile:Uf(r)}),[4,this._connMgr.query(Zr.friendSetPf,this.currentUserId,n,void 0)];case 1:return(i=s.sent()).isOk||!i.data?[2,i.wipe()]:(o=Za.decode(Aa,i.data.pbData),[2,gt(i.code,"",{errorKeys:o.censorFailedFields})])}}))}))}}),Object.defineProperty(r.prototype,"checkFriends",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i,o,a,u;return s(this,(function(s){switch(s.label){case 0:return r=this._connMgr.codec.encodeFriendsInput(e,t),n=new bi(Zr[Zr.friendCheck],r,this.currentUserId),[4,this._connMgr.send(n,Oa)];case 1:return i=s.sent(),o=i.code,a=i.data,o!==exports.ErrorCode.SUCCESS?[2,{code:o}]:a?(u=a.list.map((function(e){return{userId:e.targetId,relationType:e.status}})),[2,{code:o,data:u}]):[2,{code:o,data:[]}]}}))}))}}),Object.defineProperty(r.prototype,"getFriends",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i,o,a,u,l,c,d,p;return s(this,(function(s){switch(s.label){case 0:return r=this._connMgr.codec.encodeFriendQueryInput(11,t,e),n=new bi(Zr[Zr.friendsQuery],r,this.currentUserId),[4,this._connMgr.send(n,ba)];case 1:return i=s.sent(),o=i.code,a=i.data,o===exports.ErrorCode.SUCCESS&&a?(u=a.result,l=a.page,d=(c=l||{}).pageToken,p=c.hasNext,u&&u.list?[2,{code:o,data:{data:Wh(u.list),pageToken:p&&d?d:""}}]:[2,{code:o,data:{data:[],pageToken:p&&d?d:""}}]):[2,{code:o}]}}))}))}}),Object.defineProperty(r.prototype,"getFriendApplications",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var t,r,n,i,o,a,u,l,c,d;return s(this,(function(s){switch(s.label){case 0:return t=this._connMgr.codec.encodeFriendQueryInput(12,e),r=new bi(Zr[Zr.friendsQuery],t,this.currentUserId),[4,this._connMgr.send(r,ba)];case 1:return n=s.sent(),i=n.code,o=n.data,i!==exports.ErrorCode.SUCCESS?[2,{code:i}]:o?(a=o.result,u=o.page,c=(l=u||{}).pageToken,d=l.hasNext,[2,{code:i,data:{data:Jh(a),pageToken:d&&c?c:""}}]):[2,{code:i,data:{data:[],pageToken:""}}]}}))}))}}),Object.defineProperty(r.prototype,"deleteFriendApplication",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){return s(this,(function(e){return[2,{code:exports.ErrorCode.NOT_SUPPORT}]}))}))}}),Object.defineProperty(r.prototype,"getFriendsInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,o;return s(this,(function(s){switch(s.label){case 0:return t=Za.encode(Na,{targetId:e}),r=new bi(Zr[Zr.friendsInfoQry],t,this.currentUserId),[4,this._connMgr.send(r,Ma)];case 1:return n=s.sent(),i=n.code,o=n.data,i!==exports.ErrorCode.SUCCESS?[2,{code:i}]:o?[2,{code:i,data:Wh(o.list)}]:[2,{code:i,data:[]}]}}))}))}}),Object.defineProperty(r.prototype,"searchFriendsInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){return s(this,(function(e){return[2,Promise.resolve({code:exports.ErrorCode.NOT_SUPPORT})]}))}))}}),Object.defineProperty(r.prototype,"setFriendAddPermission",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r;return s(this,(function(n){switch(n.label){case 0:return t=Za.encode(wa,{level:e}),r=new bi(Zr.friendAuthSet,t,this.currentUserId),[4,this._connMgr.send(r)];case 1:return[2,n.sent().wipe()]}}))}))}}),Object.defineProperty(r.prototype,"getFriendAddPermission",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t,r,n,i;return s(this,(function(o){switch(o.label){case 0:return e=this._connMgr.codec.encodeFriendInput({targetId:this.currentUserId}),t=new bi(Zr.friendAuthGet,e,this.currentUserId),[4,this._connMgr.send(t,wa)];case 1:return r=o.sent(),n=r.code,i=r.data,n===exports.ErrorCode.SUCCESS&&i?[2,{code:n,data:i}]:[2,{code:n}]}}))}))}}),Object.defineProperty(r.prototype,"getUnreadMentionedMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){throw new Error("Method not implemented.")}}),Object.defineProperty(r.prototype,"setCallInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n,i,o,a,u;return s(this,(function(s){switch(s.label){case 0:return(n=this._connMgr)?(i=Za.encode(Vs,{key:t,dataContent:r}),[4,n.send(new bi(Zr.reqCall,i,e),Vs)]):[3,2];case 1:return o=s.sent(),a=o.code,u=o.data,a===exports.ErrorCode.SUCCESS&&u?[2,Promise.resolve({code:a,data:{key:u.key,value:u.dataContent}})]:[2,Promise.resolve({code:a})];case 2:return[2,Promise.resolve({code:exports.ErrorCode.RC_NET_CHANNEL_INVALID})]}}))}))}}),Object.defineProperty(r.prototype,"getRealtimeConversations",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n,i,o,a,u,l,c,d,p,f=this;return s(this,(function(s){switch(s.label){case 0:return i=(n=this).currentUserId,o=n._connMgr,a=exports.ConversationType.PRIVATE,u=o.codec.encodeOldConversationList({count:e,type:a,startTime:t,order:r}),l=new bi(Zr.qrySessions,u,i),[4,o.send(l,Lo,{currentUserId:i,connectedTime:o.getConnectedTime(),afterDecode:function(e){var t=e.conversationType,r=e.targetId,n=e.channelId,i=e.unreadMessageCount,o=f._chat.storage.getOrCreateModel({conversationType:t,targetId:r,channelId:n},!1).toIReceivedConversation();return Object.assign(e,o,{unreadMessageCount:i}),e}})];case 1:return c=s.sent(),d=c.code,p=c.data,d!==exports.ErrorCode.SUCCESS?[2,{code:d}]:[2,{code:d,data:null==p?void 0:p.list.sort((function(e,t){var n,i,o=(null===(n=e.latestMessage)||void 0===n?void 0:n.sentTime)||0,s=(null===(i=t.latestMessage)||void 0===i?void 0:i.sentTime)||0;return 0===r?s-o:o-s}))}]}}))}))}}),Object.defineProperty(r.prototype,"getRealtimeConTotalUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e;return s(this,(function(t){switch(t.label){case 0:return e=Za.encode(Bo,{nothing:1}),[4,this._connMgr.query(Zr.qrySessionsAtt,this.currentUserId,e,Ho)];case 1:return[2,t.sent().trans((function(e){return e.totalUnreadCount}))]}}))}))}}),Object.defineProperty(r.prototype,"clearRealtimeConUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,o;return s(this,(function(s){switch(s.label){case 0:return t=e.conversationType,r=e.targetId,n=this.getServerTime(),this._clearConversationUnreadCount(t,r,"",!1,n),i=Kf(e,n),o=new Ei(Zr.updRRTime,i,this.currentUserId),[4,this._connMgr.send(o)];case 1:return[2,s.sent().wipe()]}}))}))}}),Object.defineProperty(r.prototype,"removeRealtimeConversations",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r;return s(this,(function(n){switch(n.label){case 0:return t=this._connMgr,r=new bi(Zr.delSessions,t.codec.encodeRemoveConversationList(e),this.getCurrentUserId()),[4,t.send(r)];case 1:return[2,{code:n.sent().code}]}}))}))}}),Object.defineProperty(r.prototype,"getRealtimeConUnreadCounts",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;return o(this,void 0,void 0,(function(){var n,i,o;return s(this,(function(s){switch(s.label){case 0:return n=this._connMgr.codec.encodeQuerySessionsInput(e),i=new bi(Zr[Zr.qrySessionsUnread],n,this.currentUserId),[4,this._connMgr.send(i,Wo)];case 1:return(o=s.sent()).code===exports.ErrorCode.SUCCESS&&o.data?[2,{code:o.code,data:null===(r=null===(t=o.data)||void 0===t?void 0:t.sessions)||void 0===r?void 0:r.map((function(e){return{conversationType:e.type,targetId:e.channelId,channelId:e.busChannel||"",unreadCount:kt(e.unreadCount)}}))}]:[2,{code:o.code}]}}))}))}}),Object.defineProperty(r.prototype,"setNotificationQuietHoursWithSetting",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t;return s(this,(function(r){switch(r.label){case 0:return t=Za.encode(Da,e),[4,this._connMgr.query(Zr.addUnpush,this.currentUserId,t)];case 1:return[2,r.sent().wipe()]}}))}))}}),Object.defineProperty(r.prototype,"removeNotificationQuietHoursSetting",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e;return s(this,(function(t){switch(t.label){case 0:return e=Za.encode(xa,{nothing:0}),[4,this._connMgr.query(Zr.delUnpush,this.currentUserId,e)];case 1:return[2,t.sent().wipe()]}}))}))}}),Object.defineProperty(r.prototype,"getNotificationQuietHoursSetting",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e;return s(this,(function(t){switch(t.label){case 0:return e=Za.encode(ja,{nothing:0}),[4,this._connMgr.query(Zr.qryUnpush,this.currentUserId,e,Va)];case 1:return[2,t.sent().trans((function(e){var t=e.isUnpush,r=e.spanMinutes,n=e.startTime,i=e.level,o=e.timezone;return t?{spanMinutes:r,startTime:n,level:i,timezone:o}:{spanMinutes:0,startTime:"",level:exports.PushNotificationQuietHoursLevel.PUSH_NOTIFICATION_QUIET_HOURS_LEVEL_DEFAULT}}))]}}))}))}}),Object.defineProperty(r.prototype,"getStatsUrlList",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){return s(this,(function(e){return[2,ht(yr.getStatsUrlList(this.getNaviInfoFromCache()))]}))}))}}),d=new WeakSet,p=function(e,t){var r,n;null===(n=(r=this._watcher).readReceiptResponseV5)||void 0===n||n.call(r,t)},f=function(e,t,r){var n=this;t!==nh?this._handleEventChangeList(this._connMgr.codec.formatEventChangeList(r)):r.forEach((function(e){Za.decode(Ua,new Uint8Array(e.eventData)).statusInfo.forEach((function(e){var t,r,i=er(e);null===(r=(t=n._watcher).groupApplicationEvent)||void 0===r||r.call(t,i)}))}))},h=function(e){var t={},r=e.extraProfile;return r&&(delete e.extraProfile,t.userExtProfile=Uf(r)),t.userProfile=Uf(e),t},i([Kh()],r.prototype,"createGroup",null),i([Kh()],r.prototype,"updateGroupInfo",null),i([Kh()],r.prototype,"getGroupsInfo",null),i([Kh()],r.prototype,"kickGroupMembers",null),i([Kh()],r.prototype,"quitGroup",null),i([Kh()],r.prototype,"dismissGroup",null),i([Kh()],r.prototype,"transferGroupOwner",null),i([Kh()],r.prototype,"setGroupManagers",null),i([Kh()],r.prototype,"getGroupMembersByRole",null),i([Kh()],r.prototype,"getGroupMembers",null),i([Kh()],r.prototype,"setGroupMemberInfo",null),i([Kh()],r.prototype,"joinGroup",null),i([Kh()],r.prototype,"inviteUsersToGroup",null),i([Kh()],r.prototype,"memberInviteResponse",null),i([Kh()],r.prototype,"getGroupApplications",null),i([Kh()],r.prototype,"getJoinedGroupsByRole",null),i([Kh()],r.prototype,"getJoinedGroups",null),i([Kh()],r.prototype,"setGroupRemark",null),i([Kh()],r.prototype,"setGroupFollows",null),i([Kh()],r.prototype,"getGroupFollows",null),i([Kh()],r.prototype,"addFriend",null),i([Kh()],r.prototype,"deleteFriends",null),i([Kh()],r.prototype,"acceptFriendApplication",null),i([Kh()],r.prototype,"refuseFriendApplication",null),i([Kh()],r.prototype,"setFriendInfo",null),i([Kh()],r.prototype,"checkFriends",null),i([Kh()],r.prototype,"getFriends",null),i([Kh()],r.prototype,"getFriendApplications",null),i([Kh()],r.prototype,"deleteFriendApplication",null),i([Kh()],r.prototype,"getFriendsInfo",null),i([Kh()],r.prototype,"searchFriendsInfo",null),i([Kh()],r.prototype,"setFriendAddPermission",null),i([Kh()],r.prototype,"getFriendAddPermission",null),i([Kh()],r.prototype,"getRealtimeConversations",null),i([Kh()],r.prototype,"getRealtimeConTotalUnreadCount",null),i([Kh()],r.prototype,"clearRealtimeConUnreadCount",null),i([Kh()],r.prototype,"removeRealtimeConversations",null),i([Kh()],r.prototype,"getRealtimeConUnreadCounts",null),i([Qh()],r.prototype,"setNotificationQuietHoursWithSetting",null),i([Qh()],r.prototype,"removeNotificationQuietHoursSetting",null),i([Qh()],r.prototype,"getNotificationQuietHoursSetting",null),r}(Ru);function Zh(e){return n({},e)}function Xh(e,t,r){var n=r.value;r.value=function(){for(var e,t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return 1!==(null===(e=this.getNaviInfoFromCache())||void 0===e?void 0:e.userProfile)?Promise.resolve({code:exports.ErrorCode.RC_USER_PROFILE_SERVICE_UNAVAILABLE}):n.call.apply(n,l([this],u(t),!1))}}function $h(e,t,r){var n=r.value;r.value=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return zu(this.getNaviInfoFromCache()).isOk?n.call.apply(n,l([this],u(e),!1)):Promise.resolve({code:exports.ErrorCode.RC_REAL_TIME_CONVERSATION_UNAVAILABLE})}}var eg=function(){function e(e){var r,i,o=this;t.add(this),Object.defineProperty(this,"_token",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(this,"_pluginContextQueue",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_pluginInstanseMap",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_engine",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"appkey",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_options",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"sse",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_versionInfo",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_typingInfo",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"rtcCodec",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"logger",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_compatibleMessageProccessor",{enumerable:!0,configurable:!0,writable:!0,value:(r={},r[exports.MessageType.CHATROOM_MERGE_CHANGE]=this._processChrmMemChangeMessage.bind(this),r[exports.MessageType.TYPING_STATUS]=this._processTypingStatusMessage.bind(this),r[exports.MessageType.INTERCEPT]=this._processInterceptMessage.bind(this),r[exports.MessageType.CHATROOM_SYNC_MSG]=this._processChrmSyncMessage.bind(this),r[exports.MessageType.CHATROOM_MERGE_BLOCK]=this._processChrmMemBlockMessage.bind(this),r[exports.MessageType.CHATROOM_MERGE_BAN]=this._processChrmMemBanMessage.bind(this),r)}),Object.defineProperty(this,"_messageProccessor",{enumerable:!0,configurable:!0,writable:!0,value:(i={},i[exports.MessageType.READ_RECEIPT]=this._processReadReceiptMessage.bind(this),i[exports.MessageType.READ_RECEIPT_REQUEST]=this._processReadReceiptRequestMessage.bind(this),i[exports.MessageType.READ_RECEIPT_RESPONSE]=this._processReadReceiptResponseMessage.bind(this),i)}),Object.defineProperty(this,"_watcher",{enumerable:!0,configurable:!0,writable:!0,value:{message:void 0,batchMessage:void 0,conversationState:void 0,chatroomState:void 0,connection:void 0,expansion:void 0,tag:void 0,conversationTagChanged:void 0,pullFinished:void 0,readReceiptReceived:void 0,messageReceiptRequest:void 0,messageReceiptResponse:void 0,typingState:void 0,messageBlocked:void 0,ultraGroupEnable:void 0,sgRelationsSynced:void 0,operateStatus:void 0,ultraGroupMessageExpansionUpdated:void 0,ultraGroupMessageModified:void 0,ultraGroupMessageRecalled:void 0,ultraGroupChannelChangeType:void 0,ultraGroupChannelUserKicked:void 0,ultraGroupChannelDelete:void 0,userGroupStatus:void 0,messageReadReceipt:void 0,syncReadStatus:void 0,subscribedUserStatusChange:void 0,subscribedRelationChange:void 0,syncSubscribedUserStatusFinished:void 0,ownUserProfileChanged:void 0,groupOperation:void 0,groupInfoChanged:void 0,groupMemberInfoChanged:void 0,groupApplicationEvent:void 0,groupRemarkChangedSync:void 0,groupFollowsChangedSync:void 0,friendAdd:void 0,friendDelete:void 0,friendApplicationStatusChanged:void 0,friendCleared:void 0,friendInfoChangedSync:void 0,databaseUpgradeWillStart:void 0,databaseUpgrading:void 0,databaseUpgradeDidComplete:void 0,readReceiptResponseV5:void 0}}),Object.defineProperty(this,"_typingInternalTimer",{enumerable:!0,configurable:!0,writable:!0,value:-1}),Object.defineProperty(this,"_typingExpireTime",{enumerable:!0,configurable:!0,writable:!0,value:2e3}),Object.defineProperty(this,"_typingChangedList",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"getChatRoomHistoryMessages",{enumerable:!0,configurable:!0,writable:!0,value:this.getChatroomHistoryMessages}),this._options=n({},e),this.appkey=this._options.appkey,this._options.typingExpireTime&&(this._options.typingExpireTime<2e3?this._typingExpireTime=2e3:this._options.typingExpireTime>6e3?this._typingExpireTime=6e3:this._typingExpireTime=this._options.typingExpireTime),this._options.navigators=this._options.navigators.map((function(e){return e.replace(/\/$/g,"")}));var s={onConnected:function(){return o._onConnectionStatusChange(exports.RCConnectionStatus.CONNECTED)},onConnecting:this._onConnectionStatusChange.bind(this,exports.RCConnectionStatus.CONNECTING),onSuspend:this._onConnectionStatusChange.bind(this,exports.RCConnectionStatus.SUSPENDED),onDisconnected:this._onConnectionStatusChange.bind(this,exports.RCConnectionStatus.DISCONNECTED),batchMessage:this._batchMessageReceiver.bind(this),chatroom:this._chatroomInfoListener.bind(this),conversation:this._conversationInfoListener.bind(this),conversationTag:this._conversationTagListener.bind(this),expansion:this._expansionInfoListener.bind(this),tag:this._tagListener.bind(this),onRTCDataChange:this._rtcDataChange.bind(this),pullFinished:this._pullFinishedListener.bind(this),ultraGroupEnable:this._ultraGroupEnableListener.bind(this),sgRelationsSynced:this._sgRelationsSyncedListener.bind(this),operateStatus:this._operateStatusListener.bind(this),ultraGroupMessageExpansionUpdated:this._ultraGroupMessageExpansionUpdatedListener.bind(this),ultraGroupMessageModified:this._ultraGroupMessageModifiedListener.bind(this),ultraGroupMessageRecalled:this._ultraGroupMessageRecalledListener.bind(this),callInfo:this._callInfoListener.bind(this),ultraGroupChannelChangeType:this._ultraGroupChannelChangeTypeListener.bind(this),ultraGroupChannelUserKicked:this._ultraGroupChannelUserKickedListener.bind(this),ultraGroupChannelDelete:this._ultraGroupChannelDeleteListener.bind(this),onNaviDataChange:this._naviDataChange.bind(this),userGroupStatus:this._userGroupStatusListener.bind(this),messageReadReceipt:this._messageReadReceipt.bind(this),syncReadStatus:this._syncReadStatus.bind(this),subscribedUserStatusChange:this._subscribedUserStatusChange.bind(this),subscribedRelationChange:this._subscribedRelationChange.bind(this),syncSubscribedUserStatusFinished:this._syncSubscribedUserStatusFinished.bind(this),ownUserProfileChanged:this._ownUserProfileChanged.bind(this),groupOperation:this._groupOperation.bind(this),groupInfoChanged:this._groupInfoChanged.bind(this),groupMemberInfoChanged:this._groupMemberInfoChanged.bind(this),groupApplicationEvent:this._groupApplicationEvent.bind(this),groupRemarkChangedSync:this._groupRemarkChangedSync.bind(this),groupFollowsChangedSync:this._groupFollowsChangedSync.bind(this),friendAdd:this._friendAdd.bind(this),friendDelete:this._friendDelete.bind(this),friendApplicationStatusChanged:this._friendApplicationStatusChanged.bind(this),friendCleared:this._friendCleared.bind(this),friendInfoChangedSync:this._friendInfoChangedSync.bind(this),databaseUpgradeWillStart:this._databaseUpgradeWillStart.bind(this),databaseUpgrading:this._databaseUpgrading.bind(this),databaseUpgradeDidComplete:this._databaseUpgradeDidComplete.bind(this),readReceiptResponseV5:this._readReceiptResponseV5.bind(this)};this.rtcCodec=new au(vu,yu);var a=Ft();this._engine=a?new RCCppEngine(this.rtcCodec,s,this._options):new zh(this.rtcCodec,s,this._options),this.logger=this._engine.getInnerLogger(),this._options.eventLoopBlockingCheck&&Or.start(this.logger),this.sse=new Cu(this,a)}var t,r,a;return Object.defineProperty(e,"init",{enumerable:!1,configurable:!0,writable:!0,value:function(t){if(this._context)return this._context.logger.warn(H.A_INIT_REPEAT_O),this._context;this._context=new e(t),this._context.logger.info(H.L_INIT_O,JSON.stringify({appkey:t.appkey,navigators:t.navigators,typingExpireTime:t.typingExpireTime})),this._context.logger.warn(H.L_IMSDK_VER_O,JSON.stringify({commitId:"28888c602f9085d1f586cbdfb6caae7d74eaf849",version:"5.20.2-enterprise.12"}));var r=this._context._engine;return lo.setNetworkStatusListener(r.setNetwork.bind(r)),this._context}}),Object.defineProperty(e,"getContext",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._context}}),Object.defineProperty(e.prototype,"getOptions",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._options}}),Object.defineProperty(e,"destroy",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return this._context?(this._context.logger.info(H.A_DESTROY_O),[4,this._context._destroy()]):[2];case 1:return e.sent(),this._context=void 0,[2]}}))}))}}),Object.defineProperty(e.prototype,"install",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this.logger.createTraceId();if(this.logger.info(H.L_INSTALL_PLUGIN_T,JSON.stringify({tag:e.tag}),r),this._pluginInstanseMap[e.tag])return this.logger.warn(H.L_INSTALL_PLUGIN_R,"repeat install",r),this._pluginInstanseMap[e.tag];var n="RCRTC"===e.tag?new Pu(this):new Au(this),i=null;try{if(!e.verify(lo))return null;i=e.setup(n,lo,t)}catch(e){this.logger.error(H.L_INSTALL_PLUGIN_R,null==e?void 0:e.stack,r)}return["RCRTC","RCCall"].includes(e.tag)&&e.version&&e.name&&(this._versionInfo[e.name]=e.version),i&&(this._pluginContextQueue.push(n),this._pluginInstanseMap[e.tag]=i),i}}),Object.defineProperty(e.prototype,"_onConnectionStatusChange",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r,n;this.logger.warn(H.A_CONNECT_S,"status: ".concat(e,", code: ").concat(t)),null===(n=(r=this._watcher).connection)||void 0===n||n.call(r,e,t),this._pluginContextQueue.forEach((function(r){var n;null===(n=r.onconnectionstatechange)||void 0===n||n.call(r,e,t)}))}}),Object.defineProperty(e.prototype,"_processChrmMemChangeMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){if("function"==typeof this._watcher.chatroomState){var t={},r=[],n=e.content.memberCount,i=void 0===n?0:n;Array.isArray(e.content.userList)&&e.content.userList.forEach((function(e){t[e.userId]=e.status,r.push({userId:e.userId,action:e.status,extra:e.extra})})),this._watcher.chatroomState({userChange:{users:t,chatroomId:e.targetId,memberCount:i,userList:r}})}return!0}}),Object.defineProperty(e.prototype,"_processTypingStatusMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){if(this._addTypingInfo(Zh(e)),this._watcher.typingState)return!0}}),Object.defineProperty(e.prototype,"_processInterceptMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t={conversationType:e.conversationType,targetId:e.targetId,channelId:e.channelId||"",blockType:e.content.interceptType,blockedMessageUId:e.content.msgUId,extra:e.content.extra};if(e.conversationType===exports.ConversationType.ULTRA_GROUP){var r=e.content.sourceType;if(t.sourceType=r,(r===exports.MessageBlockSourceType.MSG_EXPANSION||r===exports.MessageBlockSourceType.MSG_MODIFY)&&e.content.sourceContent)try{t.sourceContent=JSON.parse(e.content.sourceContent)}catch(e){this.logger.warn(H.L_CALLBACK_E,JSON.stringify({source:"message.content.sourceContent",msg:e.message}))}}return this._MessageBlockedListener(t),!0}}),Object.defineProperty(e.prototype,"_processChrmSyncMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return"function"==typeof this._watcher.chatroomState&&this._watcher.chatroomState({chatroomNotifyMultiLoginSync:{chatroomId:e.content.chatroomId,status:e.content.status,reason:e.content.reason,time:e.content.time,extra:e.content.extra||null}}),!0}}),Object.defineProperty(e.prototype,"_processChrmMemBlockMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r=e.content;return r.operateType===exports.ChrmMemOperateType.Blocked&&(null===(t=r.userList)||void 0===t?void 0:t.includes(this.getCurrentUserId()))&&this._engine.removeChatroomFromCatch(r.chatroomId),"function"==typeof this._watcher.chatroomState&&this._watcher.chatroomState({chatroomNotifyBlock:{chatroomId:r.chatroomId,operateType:r.operateType,durationTime:r.durationTime,operateTime:r.operateTime,userIdList:r.userList,extra:r.extra||null}}),!0}}),Object.defineProperty(e.prototype,"_processChrmMemBanMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return"function"==typeof this._watcher.chatroomState&&this._watcher.chatroomState({chatroomNotifyBan:{chatroomId:e.content.chatroomId,banType:e.content.operateType,durationTime:e.content.durationTime,operateTime:e.content.operateTime,userIdList:e.content.userList,extra:e.content.extra||null}}),!0}}),Object.defineProperty(e.prototype,"_processReadReceiptMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){"function"==typeof this._watcher.readReceiptReceived&&this._watcher.readReceiptReceived({conversationType:e.conversationType,targetId:e.targetId,channelId:e.channelId},e.content.messageUId,e.content.lastMessageSendTime,e.senderUserId)}}),Object.defineProperty(e.prototype,"_processReadReceiptRequestMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){"function"==typeof this._watcher.messageReceiptRequest&&this._watcher.messageReceiptRequest({conversationType:e.conversationType,targetId:e.targetId,channelId:e.channelId},e.content.messageUId,e.senderUserId)}}),Object.defineProperty(e.prototype,"_processReadReceiptResponseMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r=null===(t=e.content)||void 0===t?void 0:t.receiptMessageDic,n=this._engine.getCurrentUserId();r&&Array.isArray(r[n])&&"function"==typeof this._watcher.messageReceiptResponse&&this._watcher.messageReceiptResponse({conversationType:e.conversationType,targetId:e.targetId,channelId:e.channelId},e.senderUserId,r[n])}}),Object.defineProperty(e.prototype,"_messageReceiver",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n,i,o,s,a=this;if(!(null===(i=(n=this._compatibleMessageProccessor)[e.messageType])||void 0===i?void 0:i.call(n,e))&&!this._pluginContextQueue.some((function(t){if(!t.onmessage)return!1;try{return t.onmessage(Zh(e))}catch(e){return a.logger.error(H.A_MSG_LISTENER_E,null==e?void 0:e.stack),!1}})))return null===(s=(o=this._watcher).message)||void 0===s||s.call(o,Zh(e),t,r),e}}),Object.defineProperty(e.prototype,"_batchMessageReceiver",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n=this,i=[],o=[],s=[exports.MessageType.READ_RECEIPT,exports.MessageType.READ_RECEIPT_REQUEST,exports.MessageType.READ_RECEIPT_RESPONSE];e.forEach((function(e){var a=n._messageReceiver(e,t,r);a&&s.includes(a.messageType)?o.push(a):a&&i.push(a)})),i.length&&this._watcher.batchMessage&&(this.logger.debug(H.L_BATCH_MESSAGE_O,i.map((function(e){return e.messageUId})).join(",")),this._watcher.batchMessage(i)),o.length&&o.forEach((function(e){n._messageProccessor[e.messageType]&&n._messageProccessor[e.messageType](e)}))}}),Object.defineProperty(e.prototype,"_chatroomInfoListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).chatroomState)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_conversationInfoListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).conversationState)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_expansionInfoListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).expansion)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_tagListener",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e,t;null===(t=(e=this._watcher).tag)||void 0===t||t.call(e)}}),Object.defineProperty(e.prototype,"_conversationTagListener",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e,t;null===(t=(e=this._watcher).conversationTagChanged)||void 0===t||t.call(e)}}),Object.defineProperty(e.prototype,"_typingStatusListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).typingState)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_pullFinishedListener",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e,t;null===(t=(e=this._watcher).pullFinished)||void 0===t||t.call(e)}}),Object.defineProperty(e.prototype,"_MessageBlockedListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).messageBlocked)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_callInfoListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;this._pluginContextQueue.forEach((function(r){try{r.onCallInfo&&r.onCallInfo(e)}catch(e){t.logger.warn(H.L_CALLBACK_E,null==e?void 0:e.stack)}}))}}),Object.defineProperty(e.prototype,"_ultraGroupEnableListener",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e,t;null===(t=(e=this._watcher).ultraGroupEnable)||void 0===t||t.call(e)}}),Object.defineProperty(e.prototype,"_sgRelationsSyncedListener",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e,t;null===(t=(e=this._watcher).sgRelationsSynced)||void 0===t||t.call(e)}}),Object.defineProperty(e.prototype,"_operateStatusListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).operateStatus)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_ultraGroupMessageExpansionUpdatedListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).ultraGroupMessageExpansionUpdated)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_ultraGroupMessageModifiedListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).ultraGroupMessageModified)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_ultraGroupMessageRecalledListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).ultraGroupMessageRecalled)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_ultraGroupChannelChangeTypeListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).ultraGroupChannelChangeType)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_ultraGroupChannelUserKickedListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).ultraGroupChannelUserKicked)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_ultraGroupChannelDeleteListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).ultraGroupChannelDelete)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_userGroupStatusListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).userGroupStatus)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_messageReadReceipt",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).messageReadReceipt)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_syncReadStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).syncReadStatus)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_subscribedUserStatusChange",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).subscribedUserStatusChange)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_subscribedRelationChange",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).subscribedRelationChange)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_syncSubscribedUserStatusFinished",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;this.logger.info(H.L_SYNC_SUBSCRIBED_USER_STATUS_FINISHED_S),null===(r=(t=this._watcher).syncSubscribedUserStatusFinished)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_ownUserProfileChanged",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;this.logger.info(H.L_OWN_USER_PROFILE_CHANGED_S),null===(r=(t=this._watcher).ownUserProfileChanged)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_groupOperation",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).groupOperation)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_groupInfoChanged",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).groupInfoChanged)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_groupMemberInfoChanged",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).groupMemberInfoChanged)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_groupApplicationEvent",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).groupApplicationEvent)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_groupRemarkChangedSync",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).groupRemarkChangedSync)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_groupFollowsChangedSync",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).groupFollowsChangedSync)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_friendAdd",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).friendAdd)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_friendDelete",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).friendDelete)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_friendApplicationStatusChanged",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).friendApplicationStatusChanged)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_friendCleared",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).friendCleared)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_friendInfoChangedSync",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).friendInfoChangedSync)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_rtcDataChange",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._pluginContextQueue.forEach((function(r){var n;null===(n=r.onrtcdatachange)||void 0===n||n.call(r,e,t)}))}}),Object.defineProperty(e.prototype,"_naviDataChange",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._pluginContextQueue.forEach((function(t){var r;null===(r=t.onnavidatachange)||void 0===r||r.call(t,e)}))}}),Object.defineProperty(e.prototype,"_databaseUpgradeWillStart",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e,t;this.logger.info(H.L_DB_UPGRATE_START_S),null===(t=(e=this._watcher).databaseUpgradeWillStart)||void 0===t||t.call(e)}}),Object.defineProperty(e.prototype,"_databaseUpgrading",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;this.logger.info(H.L_DB_UPGRATING_S,e),null===(r=(t=this._watcher).databaseUpgrading)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_databaseUpgradeDidComplete",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;this.logger.info(H.L_DB_UPGRATE_COMPLETE_S),null===(r=(t=this._watcher).databaseUpgradeDidComplete)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_readReceiptResponseV5",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).readReceiptResponseV5)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"assignWatcher",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;Object.keys(this._watcher).forEach((function(r){if(Object.prototype.hasOwnProperty.call(e,r)){var n=e[r];t._watcher[r]=Nt(n)||Pt(n)?n:void 0}}))}}),Object.defineProperty(e.prototype,"_resetWatcher",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this;Object.keys(this._watcher).forEach((function(t){e._watcher[t]=void 0}))}}),Object.defineProperty(e.prototype,"_addTypingInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.senderUserId,r=e.conversationType,n=e.targetId,i=e.content,o=e.channelId,s=i.typingContentType,a=o||"",u="".concat(r,"#").concat(n,"#").concat(a);this._typingInfo[u]||(this._typingInfo[u]=[]);var l=this._typingInfo[u].findIndex((function(e){return e.userId===t}));l>=0&&this._typingInfo[u][l].messageType===s?this._typingInfo[u][l].timestamp=Date.now():(l>=0&&this._typingInfo[u].splice(l,1),this._typingInfo[u].push({userId:t,messageType:s,timestamp:Date.now()}),this._typingChangedList.includes(u)||this._typingChangedList.push(u),this._startCheckTypingInfo())}}),Object.defineProperty(e.prototype,"_startCheckTypingInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this;-1===this._typingInternalTimer&&0!==Object.keys(this._typingInfo).length&&(this._typingInternalTimer=setInterval((function(){for(var t in e._typingInfo){var r=e._typingInfo[t].length;e._typingInfo[t]=e._typingInfo[t].filter((function(t){return Date.now()-t.timestamp<e._typingExpireTime})),e._typingInfo[t].length===r||e._typingChangedList.includes(t)||e._typingChangedList.push(t),0===e._typingInfo[t].length&&delete e._typingInfo[t]}e._notifyTypingChanged()}),500))}}),Object.defineProperty(e.prototype,"_notifyTypingChanged",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this;if(this._typingChangedList.length>0){var t=this._typingChangedList.map((function(t){return{conversationType:Number(t.split("#")[0]),targetId:t.split("#")[1],channelId:t.split("#")[2],list:e._typingInfo[t]||[]}}));this._typingStatusListener(t),this._typingChangedList=[]}0===Object.keys(this._typingInfo).length&&(clearInterval(this._typingInternalTimer),this._typingInternalTimer=-1)}}),Object.defineProperty(e.prototype,"getConnectedTime",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._engine.getConnectedTime()}}),Object.defineProperty(e.prototype,"getServerTime",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._engine.getServerTime()}}),Object.defineProperty(e.prototype,"getDeviceId",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._engine.getDeviceId()}}),Object.defineProperty(e.prototype,"setPushConfig",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._engine.setPushConfig(e)}}),Object.defineProperty(e.prototype,"getCurrentUserId",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._engine.getCurrentUserId()}}),Object.defineProperty(e.prototype,"getConnectionStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._engine.getConnectionStatus()}}),Object.defineProperty(e.prototype,"validateConnected",{get:function(){var e=this;return function(){return e._engine.getConnectionStatus()===exports.RCConnectionStatus.CONNECTED?ht(e._engine.getNaviInfoFromCache()):gt(exports.ErrorCode.RC_NET_UNAVAILABLE)}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"validateLogin",{get:function(){var e=this;return function(){return e._engine.getCurrentUserId()?ht(e._engine.getNaviInfoFromCache()):gt(exports.ErrorCode.RC_NET_UNAVAILABLE)}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"token",{get:function(){return this._token},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"refetchNaviInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){return s(this,(function(e){return[2,this._engine.refetchNaviInfo()]}))}))}}),Object.defineProperty(e.prototype,"connect",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n,i;return o(this,void 0,void 0,(function(){var o,a,u,l,c,d;return s(this,(function(s){switch(s.label){case 0:return this._token=e,[4,lo.getNetworkType()];case 1:return o=s.sent(),this._engine.setNetwork({status:!0,type:o},!0),a=!!this._pluginInstanseMap.RCCallPlus,[4,this._engine.connect(e,t,a,r)];case 2:return u=s.sent(),l=u.code,c=u.data,l!==exports.ErrorCode.SUCCESS?[2,{code:l}]:(1!==this._engine.getNaviInfoFromCache().type&&(d=et.getInfo(),null===(i=(n=this._engine).reportSDKInfo)||void 0===i||i.call(n,d)),[2,{code:l,userId:c}])}}))}))}}),Object.defineProperty(e.prototype,"disconnect",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r=this;return s(this,(function(n){switch(n.label){case 0:return clearInterval(this._typingInternalTimer),this._typingInternalTimer=-1,this._typingInfo={},[4,this._engine.disconnect(e,t)];case 1:return n.sent(),this._pluginContextQueue.forEach((function(e){if(e.ondisconnect)try{e.ondisconnect()}catch(e){r.logger.error(H.L_CALLBACK_E,null==e?void 0:e.stack)}})),[2,Promise.resolve()]}}))}))}}),Object.defineProperty(e.prototype,"reconnect",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this.connect(this.token,!!e,this.logger.createTraceId())}}),Object.defineProperty(e.prototype,"_channelIdConvert",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){if(e!==exports.ConversationType.ULTRA_GROUP)return t;var r=this.getNaviInfoFromCache();return!!(2&((null==r?void 0:r.ugDriven)||0))&&!t?"RCDefault":t}}),Object.defineProperty(e.prototype,"getNaviInfoFromCache",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._engine.getNaviInfoFromCache()}}),Object.defineProperty(e.prototype,"registerMessageType",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,i,o){void 0===i&&(i=[]),void 0===o&&(o=!1);var s,a,u,l={isPersited:t,isCounted:r,searchProps:i,isStatusMessage:o};s=e,a=l,(u=jr.get(s))&&!u.isCustom&&console.warn("Builtin message type '".concat(s,"' cannot be registered")),a.isStatusMessage&&(a.isCounted=a.isPersited=!1),jr.set(s,n(n({},a),{isCustom:!0})),this._engine.registerMessageType(e,l)}}),Object.defineProperty(e.prototype,"registerRTCSignalingListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._engine.registerRTCSignalingListener(e)}}),Object.defineProperty(e.prototype,"_handleExpansioResult",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){if(t){var r=jt(e),n=r.isIllgalEx,i=r.isExKeyOrValLengthExceedLimit;return r.isExceedLimit||i?exports.ErrorCode.EXPANSION_LIMIT_EXCEET:n?exports.ErrorCode.INVALID_PARAMETER_MESSAGE_EXPANSION:void 0}}}),Object.defineProperty(e.prototype,"sendMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){var o;if(r.needReceipt){if(4!==(null===(o=this.getNaviInfoFromCache())||void 0===o?void 0:o.grpRRVer))return Promise.resolve({code:exports.ErrorCode.READ_RECEIPT_ERROR});if(e!==exports.ConversationType.GROUP&&e!==exports.ConversationType.PRIVATE||r.isStatusMessage||!r.isPersited||e===exports.ConversationType.GROUP&&r.directionalUserIdList&&r.directionalUserIdList.length>0)return Promise.resolve({code:exports.ErrorCode.SEND_READ_RECEIPT_CONF_ERROR})}var s=xu(r.messageType,r.content),a=s.code,u=s.msg;if(a!==exports.ErrorCode.SUCCESS)return Promise.resolve({code:a,msg:u});if(e===exports.ConversationType.SYSTEM&&r.messageType!==exports.MessageType.SYNC_READ_STATUS)return Promise.resolve({code:exports.ErrorCode.SYS_CONVERSATION_NOT_SUPPORT_MESSAGE});if(r.messageType===exports.MessageType.STREAM_MESSAGE)return Promise.resolve({code:exports.ErrorCode.MESSAGE_NOT_SUPPORT_SENDING});var l=r.canIncludeExpansion,c=void 0!==l&&l,d=r.expansion,p=this._handleExpansioResult(d,c);if(p)return Promise.resolve({code:p});var f=r.isMentioned,h=r.mentionedUserIdList,g=r.mentionedType;f&&[exports.ConversationType.GROUP,exports.ConversationType.ULTRA_GROUP].includes(e)?r.content.mentionedInfo=function(e,t,r){var n,i,o;return{userIdList:(null===(n=e.mentionedInfo)||void 0===n?void 0:n.userIdList)||t,type:(null===(i=e.mentionedInfo)||void 0===i?void 0:i.type)||r||exports.MentionedType.ALL,mentionedContent:(null===(o=e.mentionedInfo)||void 0===o?void 0:o.mentionedContent)||""}}(r.content,h,g):delete r.content.mentionedInfo;var _=JSON.stringify(r.content);if(function(e){for(var t,r=0,n=0,i=e.length;n<i;n++)r+=(t=e.charCodeAt(n))<127?1:t<=2047?2:t<=65535?3:4;return r}(_)>xe)return Promise.resolve({code:exports.ErrorCode.RC_MSG_CONTENT_EXCEED_LIMIT});if(e===exports.ConversationType.ULTRA_GROUP)return r.channelId=this._channelIdConvert(e,r.channelId),this._engine.sendUltraMessage(t,r,n,i);var b=this.getNaviInfoFromCache();return(null==b?void 0:b.grpRRVer)&&r.messageType===exports.MessageType.READ_RECEIPT_RESPONSE?Promise.resolve({code:exports.ErrorCode.READ_RECEIPT_ERROR}):this._engine.sendMessage(e,t,r,n,i)}}),Object.defineProperty(e.prototype,"sendExpansionMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,o,a,u,l,c,d,p;return s(this,(function(s){switch(s.label){case 0:return t=e.channelId,r=e.conversationType,n=e.targetId,i=e.messageUId,o=e.keys,a=e.expansion,u=e.canIncludeExpansion,e.messageType===exports.MessageType.STREAM_MESSAGE&&((null==o?void 0:o.includes("RC_Ext_StreamMsgSummary"))||(null==a?void 0:a.RC_Ext_StreamMsgSummary))?[2,{code:exports.ErrorCode.STREAM_MESSAGE_EXPANSION_KEY_ERROR}]:u?(l=jt(a),c=l.isIllgalEx,d=l.isExKeyOrValLengthExceedLimit,l.isExceedLimit||d?[2,Promise.resolve({code:exports.ErrorCode.EXPANSION_LIMIT_EXCEET})]:c?[2,Promise.resolve({code:exports.ErrorCode.INVALID_PARAMETER_MESSAGE_EXPANSION})]:(p={mid:i},a&&(p.put=a),o&&(p.del=o),[4,this._engine.sendMessage(r,n,{content:p,messageType:exports.MessageType.EXPANSION_NOTIFY,channelId:t})])):[2,{code:exports.ErrorCode.MESSAGE_KV_NOT_SUPPORT}];case 1:return[2,{code:s.sent().code}]}}))}))}}),Object.defineProperty(e.prototype,"sendReadReceiptMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n;return s(this,(function(i){return n=this.getNaviInfoFromCache(),1!==((null==n?void 0:n.grpRRVer)||0)?[2,{code:exports.ErrorCode.READ_RECEIPT_ERROR,msg:"The read receipt switch is not on, please call the sendMessage method!"}]:[2,this._engine.sendReadReceiptMessage(e,t,r)]}))}))}}),Object.defineProperty(e.prototype,"getMessageReader",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n;return s(this,(function(i){return n=this.getNaviInfoFromCache(),1!==((null==n?void 0:n.grpRRVer)||0)?[2,{code:exports.ErrorCode.READ_RECEIPT_ERROR}]:[2,this._engine.getMessageReader(e,t,r||"")]}))}))}}),Object.defineProperty(e.prototype,"sendReadReceiptMessageV4",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){return s(this,(function(n){return[2,this._engine.sendReadReceiptMessageV4(e,t,r)]}))}))}}),Object.defineProperty(e.prototype,"getMessageReadReceiptV4",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){return s(this,(function(r){return[2,this._engine.getMessageReadReceiptV4(e,t)]}))}))}}),Object.defineProperty(e.prototype,"batchGetMessageReadReceiptInfoV4",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){return s(this,(function(r){return[2,this._engine.batchGetMessageReadReceiptInfoV4(e,t)]}))}))}}),Object.defineProperty(e.prototype,"updateConversationReadTime",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){return s(this,(function(r){return[2,this._engine.updateConversationReadTime(e,t)]}))}))}}),Object.defineProperty(e.prototype,"_destroy",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e=this;return s(this,(function(t){switch(t.label){case 0:return Or.stop(),this._resetWatcher(),this._engine.destroy(),lo.removeNetworkStatusListener(),[4,this.disconnect()];case 1:return t.sent(),this._pluginContextQueue.forEach((function(t){if(t.ondestroy)try{t.ondestroy()}catch(t){e.logger.error(H.L_CALLBACK_E,null==t?void 0:t.stack)}})),this._pluginContextQueue.length=0,this._pluginInstanseMap={},[2]}}))}))}}),Object.defineProperty(e.prototype,"getHistoryMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i,o,s,a){var u={timestamp:r||0,count:n||20,order:i||0,channelId:o||""};if(e===exports.ConversationType.ULTRA_GROUP){var l=this._channelIdConvert(e,u.channelId);return u.channelId=l,this._engine.getUltraHistoryMsg(t,u,a)}return this._engine.getHistoryMessage(e,t,u.timestamp,u.count,u.order,u.channelId,s||"",a)}}),Object.defineProperty(e.prototype,"getMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i,o,s){var a={timestamp:r||0,count:n||20,order:i||0,channelId:o||""};if(e===exports.ConversationType.ULTRA_GROUP){var u=this._channelIdConvert(e,a.channelId);return a.channelId=u,this._engine.getUltraHistoryMsg(t,a,s)}return this._engine.getMessages(e,t,a.timestamp,a.count,a.order,a.channelId,s)}}),Object.defineProperty(e.prototype,"getContinuousMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i,o){return void 0===r&&(r=0),void 0===n&&(n=20),void 0===i&&(i=0),void 0===o&&(o=""),this._engine.getContinuousMessages(e,t,r,n,i,o)}}),Object.defineProperty(e.prototype,"getHistoryMessagesByObjectNames",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i,o,s){return this._engine.getHistoryMessagesByObjectNames(e,t,r,n,i,o,s)}}),Object.defineProperty(e.prototype,"getConversationListByFilter",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i=this;return s(this,(function(o){switch(o.label){case 0:return(t=qr("getConversationListByFilter",e).tryTrans((function(){e.type;var t=i._engine.getNaviInfoFromCache();return Ft()||t&&Vh(t)?i.validateLogin():i.validateConnected()}))).isOk?(r=this.logger.createTraceId(),this.logger.info(H.A_GET_CONVERSATION_LIST_BY_FILTER_T,JSON.stringify(e),r),[4,this._engine.chat.getConversationListByFilter(e)]):[2,t.wipe()];case 1:return n=o.sent(),this.logger.summary(H.A_GET_CONVERSATION_LIST_BY_FILTER_R,n,r),[2,n.trans((function(e){return e.list}))]}}))}))}}),Object.defineProperty(e.prototype,"getConversation",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i;return s(this,(function(o){switch(o.label){case 0:return(t=Vt("getLocalConversation",e,Ee).result()).isOk?(r=this.logger.createTraceId(),this.logger.info(H.A_GET_CONVERSATION_T,JSON.stringify(e),r),n=this._channelIdConvert(e.conversationType,e.channelId)||"",[4,this._engine.chat.getConversation(e.conversationType,e.targetId,n)]):[2,t.wipe()];case 1:return i=o.sent(),this.logger.summary(H.A_GET_CONVERSATION_R,i,r,e),[2,i]}}))}))}}),Object.defineProperty(e.prototype,"removeConversation",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n;return s(this,(function(i){switch(i.label){case 0:return(t=Vt("removeConversation",e,be).result().tryTrans(this.validateConnected)).isOk?(e.channelId=this._channelIdConvert(e.conversationType,e.channelId)||"",r=this.logger.createTraceId(),this.logger.info(H.A_REMOVE_CONVERSATION_T,JSON.stringify(e),r),[4,this._engine.removeConversation(e)]):[2,t.wipe()];case 1:return n=i.sent(),this.logger.summary(H.A_REMOVE_CONVERSATION_R,n,r),[2,n]}}))}))}}),Object.defineProperty(e.prototype,"batchRemoveConversation",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._engine.batchRemoveConversation(e)}}),Object.defineProperty(e.prototype,"getUltraGroupList",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._engine.getUltraGroupList(e)}}),Object.defineProperty(e.prototype,"getBlockUltraGroupList",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._engine.getBlockUltraGroupList()}}),Object.defineProperty(e.prototype,"clearUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){if(e===exports.ConversationType.ULTRA_GROUP){var n=this._channelIdConvert(e,r);return this._engine.clearUltraUnreadcount(t,n||"")}return this._engine.clearConversationUnreadCount(e,t,r||"")}}),Object.defineProperty(e.prototype,"clearAllUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.logger.info(H.A_CLEAR_ALL_UNREAD_COUNT_O),this._engine.chat.clearAllUnreadCount()}}),Object.defineProperty(e.prototype,"getUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n=this._channelIdConvert(e,r);return this._engine.getConversationUnreadCount(e,t,n||"")}}),Object.defineProperty(e.prototype,"getTotalUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n;return s(this,(function(i){return(n=vt.create("getTotalUnreadCount").validate("channelId",e,Dt,!0).fail(exports.ErrorCode.INVALID_PARAMETER_CHANNEL_ID).isTypedArray("conversationTypes",t,Ut).fail(exports.ErrorCode.INVALID_PARAMETER_CONVERSATION_TYPE_LIST).result().tryTrans(this.validateConnected).tryTrans((function(e){var r=Vh(e);return!r&&t&&t.includes(exports.ConversationType.ULTRA_GROUP)?gt(exports.ErrorCode.METHOD_NOT_SUPPORT):ht(r)}))).isOk?[2,this._engine.chat.getTotalUnreadCount(e,t||[],!!r)]:[2,n.wipe()]}))}))}}),Object.defineProperty(e.prototype,"getTotalUnreadCountByLevels",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return this._engine.getTotalUnreadCountByLevels(e,t,r)}}),Object.defineProperty(e.prototype,"getFirstUnreadMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return this._engine.getFirstUnreadMessage(e,t,r||"")}}),Object.defineProperty(e.prototype,"getFirstUnreadMessageInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return this._engine.getFirstUnreadMessageInfo(e,t,r)}}),Object.defineProperty(e.prototype,"batchSetConversationNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e,n){return o(this,void 0,void 0,(function(){var i,o,a,u,l,d=this;return s(this,(function(s){switch(s.label){case 0:return i=vt.create("batchSetConversationNotificationLevel"),(o=i.isLimitedTypedArray("conversations",e,20,(function(e){return Vt("batchSetConversationNotificationLevel",e,be).result().isOk}),!0,1).fail(exports.ErrorCode.INVALID_PARAMETER_CONVERSATION_LIST).result().tryTrans(this.validateConnected)).isOk?(a=this.logger.createTraceId(),this.logger.info(H.A_BATCH_SET_CONVERSATION_NOTIFICATION_LEVEL_T,JSON.stringify({conversations:e,notificationLevel:n}),a),u=e.map((function(e){return c(d,t,"m",r).call(d,e)})),[4,this._engine.chat.batchSetConversationNotificationLevel(u,n)]):[2,o.wipe()];case 1:return l=s.sent(),this.logger.summary(H.A_BATCH_SET_CONVERSATION_NOTIFICATION_LEVEL_R,l,a),[2,l]}}))}))}}),Object.defineProperty(e.prototype,"batchSetConversationToTop",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,i){return o(this,void 0,void 0,(function(){var o,a,u,l,c,d=this;return s(this,(function(s){switch(s.label){case 0:return o=vt.create("batchSetConversationToTop"),(a=o.isLimitedTypedArray("conversations",e,20,(function(e){return Vt("batchSetConversationToTop",e,be).result().isOk}),!0,1).fail(exports.ErrorCode.INVALID_PARAMETER_CONVERSATION_LIST).result().tryTrans((function(){return e.every((function(e){return e.conversationType!==exports.ConversationType.ULTRA_GROUP||!e.channelId||"RCDefault"===e.channelId}))?ht():gt(exports.ErrorCode.ONLY_DEFAULT_CHANNEL_SUPPORTS_PINNING)})).tryTrans(this.validateConnected)).isOk?(u=this.logger.createTraceId(),this.logger.info(H.A_BATCH_SET_CONVERSATION_TO_TOP_T,JSON.stringify({conversations:e,isTop:t,isUpdateTime:r,isCreateConversation:i}),u),l=e.map((function(e){return n(n({},e),{channelId:d._channelIdConvert(e.conversationType,e.channelId)||""})})),[4,this._engine.chat.batchSetConversationToTop(l,t,r,i)]):[2,a.wipe()];case 1:return c=s.sent(),this.logger.summary(H.A_BATCH_SET_CONVERSATION_TO_TOP_R,c,u),[2,c]}}))}))}}),Object.defineProperty(e.prototype,"saveConversationMessageDraft",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){var i=this._channelIdConvert(e,n);return this._engine.saveConversationMessageDraft(e,t,r,i||"")}}),Object.defineProperty(e.prototype,"getConversationMessageDraft",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n=this._channelIdConvert(e,r);return this._engine.getConversationMessageDraft(e,t,n||"")}}),Object.defineProperty(e.prototype,"clearConversationMessageDraft",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n=this._channelIdConvert(e,r);return this._engine.clearConversationMessageDraft(e,t,n||"")}}),Object.defineProperty(e.prototype,"recallMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i,o,a,u;return s(this,(function(s){switch(s.label){case 0:return(r=Vt("recallMessage",e,Ee).isString("messageUId",t.messageUId,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_UID).isInteger("sentTime",t.sentTime,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TIMESTAMP).isBoolean("disableNotification",t.disableNotification).fail(exports.ErrorCode.INVALID_PARAMETER_DISABLE_NOTIFICATION).isObject("pushConfig",t.pushConfig).fail(exports.ErrorCode.INVALID_PARAMETER_PUSH_CONFIG).isBoolean("disableUpdateLastMessage",t.disableUpdateLastMessage).fail(exports.ErrorCode.INVALID_DISABLE_UPDATE_LAST_MESSAGE).isLimitedTypedArray("directionalUserIdList",t.directionalUserIdList,300,xt,!1,1).fail(exports.ErrorCode.INVALID_PARAMETER_USERIDLIST).result().tryTrans(this.validateConnected)).isOk?(n=t.messageUId,i=this.logger.createTraceId(),this.logger.info(H.A_RECALL_MESSAGE_T,JSON.stringify({messageUId:n}),i),o=e.conversationType,a=e.channelId,e.channelId=this._channelIdConvert(o,a)||"",[4,this._engine.recallMsg(e,t)]):(this.logger.warn(H.A_RECALL_MESSAGE_E,r.errmsg()),[2,r.wipe()]);case 1:return u=s.sent(),this.logger.summary(H.A_RECALL_MESSAGE_R,u,i,{messageUId:n}),[2,u]}}))}))}}),Object.defineProperty(e.prototype,"deleteRemoteMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,n){return o(this,void 0,void 0,(function(){var i,o,a,u,l,d;return s(this,(function(s){switch(s.label){case 0:return i=Vt("deleteRemoteMessage",e,be),(o=i.isLimitedTypedArray("messages",n,100,(function(e){if(!e||"object"!=typeof e)return!1;var t=e.messageUId,r=e.sentTime,n=e.messageDirection;return At(t)&&(n===exports.MessageDirection.SEND||n===exports.MessageDirection.RECEIVE)&&Ct({min:0})(r)}),!0).fail(exports.ErrorCode.MSG_LIMIT_ERROR).result().tryTrans(this.validateConnected).tryTrans((function(){return e.conversationType===exports.ConversationType.ULTRA_GROUP&&Ft()?gt(exports.ErrorCode.METHOD_NOT_SUPPORT):ht()}))).isOk?(a=c(this,t,"m",r).call(this,e),u=n.map((function(e){return e.messageUId})).join(","),l=this.logger.createTraceId(),this.logger.info(H.A_DELETE_REMOTE_MESSAGE_T,JSON.stringify({conversation:a,msgIds:u}),l),[4,this._engine.chat.deleteRemoteMessage(a,n)]):[2,o.wipe()];case 1:return d=s.sent(),this.logger.summary(H.A_DELETE_REMOTE_MESSAGE_R,d,l),[2,d]}}))}))}}),Object.defineProperty(e.prototype,"deleteRemoteMessageByTimestamp",{enumerable:!1,configurable:!0,writable:!0,value:function(e,i){return o(this,void 0,void 0,(function(){var o,a,u,l;return s(this,(function(s){switch(s.label){case 0:return(o=Vt("deleteRemoteMessageByTimestamp",e,Ee).isInteger("timestamp",i,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TIMESTAMP).result().tryTrans(this.validateConnected)).isOk?(a=c(this,t,"m",r).call(this,e),u=this.logger.createTraceId(),this.logger.info(H.A_DELETE_REMOTE_MESSAGE_BY_TIMESTAMP_T,JSON.stringify(n(n({},a),{timestamp:i})),u),[4,this._engine.chat.deleteRemoteMessageByTimestamp(a,i)]):[2,o.wipe()];case 1:return l=s.sent(),this.logger.summary(H.A_DELETE_REMOTE_MESSAGE_BY_TIMESTAMP_R,l,u),[2,l]}}))}))}}),Object.defineProperty(e.prototype,"joinChatroom",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return void 0===t&&(t=10),this._engine.joinChatroom(e,t,n,r)}}),Object.defineProperty(e.prototype,"joinExistChatroom",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return void 0===t&&(t=10),this._engine.joinExistChatroom(e,t,n,r)}}),Object.defineProperty(e.prototype,"quitChatroom",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._engine.quitChatroom(e)}}),Object.defineProperty(e.prototype,"getChatroomInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return this._engine.getChatroomInfo(e,t||0,r||0)}}),Object.defineProperty(e.prototype,"setChatroomEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=t.key,n=t.value;return ar(r)?ur(n)?this._engine.setChatroomEntry(e,t):Promise.resolve(exports.ErrorCode.INVALID_PARAMETER_VALUE):Promise.resolve(exports.ErrorCode.INVALID_PARAMETER_KEY)}}),Object.defineProperty(e.prototype,"setChatroomEntries",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){for(var r=0;r<t.entries.length;r++){var i=t.entries[r],o=i.key,s=i.value;if(!ar(o))return Promise.resolve({code:exports.ErrorCode.INVALID_PARAMETER_KEY});if(!ur(s))return Promise.resolve({code:exports.ErrorCode.INVALID_PARAMETER_VALUE})}var a=n(n({},t),{isOverwrite:t.isForce});return this._engine.setChatroomEntries(e,a)}}),Object.defineProperty(e.prototype,"forceSetChatroomEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=t.key,n=t.value;return ar(r)?ur(n)?this._engine.forceSetChatroomEntry(e,t):Promise.resolve(exports.ErrorCode.INVALID_PARAMETER_VALUE):Promise.resolve(exports.ErrorCode.INVALID_PARAMETER_KEY)}}),Object.defineProperty(e.prototype,"removeChatroomEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=t.key;return ar(r)?this._engine.removeChatroomEntry(e,t):Promise.resolve(exports.ErrorCode.INVALID_PARAMETER_KEY)}}),Object.defineProperty(e.prototype,"removeChatroomEntries",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){for(var r=0;r<t.entries.length;r++){var n=t.entries[r].key;if(!ar(n))return Promise.resolve({code:exports.ErrorCode.INVALID_PARAMETER_KEY})}return this._engine.removeChatroomEntries(e,t)}}),Object.defineProperty(e.prototype,"forceRemoveChatroomEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=t.key;return ar(r)?this._engine.forceRemoveChatroomEntry(e,t):Promise.resolve(exports.ErrorCode.INVALID_PARAMETER_KEY)}}),Object.defineProperty(e.prototype,"getChatroomEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return this._engine.getChatroomEntry(e,t)}}),Object.defineProperty(e.prototype,"getAllChatroomEntries",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._engine.getAllChatroomEntry(e)}}),Object.defineProperty(e.prototype,"getChatroomHistoryMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return this._engine.getChatroomHistoryMessages(e,n||0,t||20,r||0)}}),Object.defineProperty(e.prototype,"getFileToken",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i,a){return o(this,void 0,void 0,(function(){var o,u,l,c,d,p;return s(this,(function(s){switch(s.label){case 0:return o=this.getNaviInfoFromCache(),u=(null==o?void 0:o.uploadServer)||"",l=(null==o?void 0:o.ossConfig)||"",[4,this._engine.getFileToken(e,t,r,n,i,a)];case 1:return c=s.sent(),d=c.code,p=c.data,d===exports.ErrorCode.SUCCESS&&p?[2,Promise.resolve(Object.assign(p,{qiniu:u,ossConfig:p.ossConfig||l}))]:[2,Promise.reject(d)]}}))}))}}),Object.defineProperty(e.prototype,"getFileUrl",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return o(this,void 0,void 0,(function(){var i=this;return s(this,(function(o){return[2,this.validateConnected().next((function(){return i._engine.getFileUrl(e,r,t,n||"")}))]}))}))}}),Object.defineProperty(e.prototype,"createTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){return s(this,(function(t){return[2,this._engine.createTag(e)]}))}))}}),Object.defineProperty(e.prototype,"removeTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){return s(this,(function(t){return[2,this._engine.removeTag(e)]}))}))}}),Object.defineProperty(e.prototype,"updateTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){return s(this,(function(t){return[2,this._engine.updateTag(e)]}))}))}}),Object.defineProperty(e.prototype,"getTagList",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){return s(this,(function(e){return[2,this._engine.getTagList()]}))}))}}),Object.defineProperty(e.prototype,"addTagForConversations",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n=this;return s(this,(function(i){return t.length>1e3?[2,Promise.resolve({code:exports.ErrorCode.CONVER_OUT_LIMIT_ERROR})]:(r=t.map((function(e){var t=e.conversationType,r=e.targetId,i=e.channelId;return{conversationType:t,targetId:r,channelId:n._channelIdConvert(t,i)}})),[2,this._engine.addTagForConversations(e,r)])}))}))}}),Object.defineProperty(e.prototype,"removeTagForConversations",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n=this;return s(this,(function(i){return r=t.map((function(e){var t=e.conversationType,r=e.targetId,i=e.channelId;return{conversationType:t,targetId:r,channelId:n._channelIdConvert(t,i)}})),[2,this._engine.removeTagForConversations(e,r)]}))}))}}),Object.defineProperty(e.prototype,"removeTagsForConversation",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r;return s(this,(function(n){return r=this._channelIdConvert(e.conversationType,e.channelId),e.channelId=r,[2,this._engine.removeTagsForConversation(e,t)]}))}))}}),Object.defineProperty(e.prototype,"getConversationListByTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return o(this,void 0,void 0,(function(){return s(this,(function(i){return[2,this._engine.getConversationListByTag(e,t,r,n)]}))}))}}),Object.defineProperty(e.prototype,"getUnreadCountByTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){return s(this,(function(r){return[2,this._engine.getUnreadCountByTag(e,t)]}))}))}}),Object.defineProperty(e.prototype,"setConversationStatusInTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n;return s(this,(function(i){return n=this._channelIdConvert(t.conversationType,t.channelId),t.channelId=n,[2,this._engine.setConversationStatusInTag(e,t,r)]}))}))}}),Object.defineProperty(e.prototype,"getTagsForConversation",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t;return s(this,(function(r){return t=this._channelIdConvert(e.conversationType,e.channelId),e.channelId=t,[2,this._engine.getTagsForConversation(e)]}))}))}}),Object.defineProperty(e.prototype,"getUnreadMentionedCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this._channelIdConvert(e.conversationType,e.channelId);return e.channelId=t,this._engine.getUnreadMentionedCount(e)}}),Object.defineProperty(e.prototype,"getAllUnreadMentionedCount",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._engine.getAllUnreadMentionedCount()}}),Object.defineProperty(e.prototype,"sendUltraGroupTypingStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){if(e.conversationType!==exports.ConversationType.ULTRA_GROUP){var t=exports.ErrorCode.CONVERSATION_TYPE_NOT_SUPPORT;return Promise.resolve({code:t,msg:exports.ErrorCode[t]})}var r=this._channelIdConvert(e.conversationType,e.channelId);return e.channelId=r,this._engine.sendUltraGroupTypingStatus(e)}}),Object.defineProperty(e.prototype,"getUltraGroupMessageListByMessageUId",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this,r=e.messages.map((function(r){var n=r.sendTime,i=r.messageUId,o=r.channelId;return{sendTime:n,messageUId:i,channelId:t._channelIdConvert(e.conversationType,o)}}));return e.messages=r,this._engine.getUltraGroupMessageListByMessageUId(e)}}),Object.defineProperty(e.prototype,"expandUltraMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,o,a,u;return s(this,(function(s){switch(s.label){case 0:return t=e.conversationType,r=e.expansion,n=e.canIncludeExpansion,t!==exports.ConversationType.ULTRA_GROUP?[2,{code:i=exports.ErrorCode.CONVERSATION_TYPE_NOT_SUPPORT,msg:exports.ErrorCode[i]}]:n?(o=jt(r),a=o.isIllgalEx,u=o.isExKeyOrValLengthExceedLimit,o.isExceedLimit||u?[2,{code:exports.ErrorCode.EXPANSION_LIMIT_EXCEET}]:a?[2,{code:exports.ErrorCode.INVALID_PARAMETER_MESSAGE_EXPANSION}]:[4,this._engine.expandUltraMessage(e)]):[2,{code:exports.ErrorCode.MESSAGE_KV_NOT_SUPPORT}];case 1:return[2,{code:s.sent().code}]}}))}))}}),Object.defineProperty(e.prototype,"modifyMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t;return s(this,(function(r){switch(r.label){case 0:return e.conversationType!==exports.ConversationType.ULTRA_GROUP?[2,{code:t=exports.ErrorCode.CONVERSATION_TYPE_NOT_SUPPORT,msg:exports.ErrorCode[t]}]:[4,this._engine.modifyMessage(e)];case 1:return[2,{code:r.sent().code}]}}))}))}}),Object.defineProperty(e.prototype,"getUltraGroupUnreadMentionedCountByTargetId",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return this._engine.getUltraGroupUnreadMentionedCountByTargetId(e,t)}}),Object.defineProperty(e.prototype,"getUltraGroupUnreadCountByTargetId",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return this._engine.getUltraGroupUnreadCountByTargetId(e,t)}}),Object.defineProperty(e.prototype,"getAllUltraGroupUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return void 0===e&&(e=!1),this._engine.getAllUltraGroupUnreadCount(e)}}),Object.defineProperty(e.prototype,"getUltraGroupUnreadMentionedMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this._channelIdConvert(exports.ConversationType.ULTRA_GROUP,e.channelId);return e.channelId=t,this._engine.getUltraGroupUnreadMentionedMessages(e)}}),Object.defineProperty(e.prototype,"getUltraGroupFirstUnreadMessageTimestamp",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this._channelIdConvert(exports.ConversationType.ULTRA_GROUP,e.channelId);return e.channelId=t,this._engine.getUltraGroupFirstUnreadMessageTimestamp(e)}}),Object.defineProperty(e.prototype,"getUltraGroupUnreadInfoList",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._engine.getUltraGroupUnreadInfoList(e)}}),Object.defineProperty(e.prototype,"getOSInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._engine.getOSInfo()}}),Object.defineProperty(e.prototype,"getProcessInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._engine.getProcessInfo()}}),Object.defineProperty(e.prototype,"getMainProcessInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._engine.getMainProcessInfo()}}),Object.defineProperty(e.prototype,"setCallInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return this._engine.setCallInfo(e,t,r)}}),Object.defineProperty(e.prototype,"_isEnableSubDriven",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=(this.getNaviInfoFromCache()||{}).subDriven,r=void 0===t?0:t;switch(e){case exports.SubscribeType.ONLINE_STATUS:return 1&r;case exports.SubscribeType.USER_PROFILE:return 2&r;default:return!1}}}),Object.defineProperty(e.prototype,"subscribeUser",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return this._isEnableSubDriven(t)?this._engine.subscribeUser(e,t,r):Promise.resolve({code:exports.ErrorCode.RC_SUBSCRIBE_ONLINE_SERVICE_UNAVAILABLE})}}),Object.defineProperty(e.prototype,"unSubscribeUser",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return this._isEnableSubDriven(t)?this._engine.unSubscribeUser(e,t):Promise.resolve({code:exports.ErrorCode.RC_SUBSCRIBE_ONLINE_SERVICE_UNAVAILABLE})}}),Object.defineProperty(e.prototype,"getSubscribeUserList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return this._isEnableSubDriven(e)?this._engine.getSubscribeUserList(e,t,r):Promise.resolve({code:exports.ErrorCode.RC_SUBSCRIBE_ONLINE_SERVICE_UNAVAILABLE})}}),Object.defineProperty(e.prototype,"getSubscribeUserStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return this._isEnableSubDriven(e)?this._engine.getSubscribeUserStatus(e,t):Promise.resolve({code:exports.ErrorCode.RC_SUBSCRIBE_ONLINE_SERVICE_UNAVAILABLE})}}),Object.defineProperty(e.prototype,"updateMyUserProfile",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._engine.updateMyUserProfile(e)}}),Object.defineProperty(e.prototype,"getUserProfiles",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._engine.getUserProfiles(e)}}),Object.defineProperty(e.prototype,"getMyUserProfile",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._engine.getMyUserProfile()}}),Object.defineProperty(e.prototype,"updateMyUserProfileVisibility",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._engine.updateMyUserProfileVisibility(e)}}),Object.defineProperty(e.prototype,"getMyUserProfileVisibility",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._engine.getMyUserProfileVisibility()}}),Object.defineProperty(e.prototype,"searchUserProfileByUniqueId",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._engine.searchUserProfileByUniqueId(e)}}),Object.defineProperty(e.prototype,"clearConversations",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){return s(this,(function(r){return[2,this._engine.clearConversations(e,t)]}))}))}}),Object.defineProperty(e.prototype,"setUserStatusListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this;return this._engine.setUserStatusListener(e,(function(e){try{t(e)}catch(e){r.logger.error(H.L_CALLBACK_E,null==e?void 0:e.stack)}}))}}),Object.defineProperty(e.prototype,"addToBlacklist",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){return s(this,(function(t){return[2,this._engine.addToBlacklist(e)]}))}))}}),Object.defineProperty(e.prototype,"removeFromBlacklist",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){return s(this,(function(t){return[2,this._engine.removeFromBlacklist(e)]}))}))}}),Object.defineProperty(e.prototype,"getBlacklist",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){return s(this,(function(e){return[2,this._engine.getBlacklist()]}))}))}}),Object.defineProperty(e.prototype,"getBlacklistStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){return s(this,(function(t){return[2,this._engine.getBlacklistStatus(e)]}))}))}}),Object.defineProperty(e.prototype,"insertMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n,i,o;return s(this,(function(s){return n=xu(r.messageType,r.content),i=n.code,o=n.msg,i!==exports.ErrorCode.SUCCESS?[2,Promise.resolve({code:i,msg:o})]:[2,this._engine.insertMessage(e,t,r)]}))}))}}),Object.defineProperty(e.prototype,"batchInsertMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return this._engine.batchInsertMessage(e,t)}}),Object.defineProperty(e.prototype,"getMessageCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return void 0===r&&(r=""),o(this,void 0,void 0,(function(){return s(this,(function(n){return[2,this._engine.getMessageCount(e,t,r)]}))}))}}),Object.defineProperty(e.prototype,"deleteMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){return s(this,(function(t){return[2,this._engine.deleteMessages(e)]}))}))}}),Object.defineProperty(e.prototype,"deleteMessagesByTimestamp",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){return void 0===i&&(i=""),o(this,void 0,void 0,(function(){return s(this,(function(o){return[2,this._engine.deleteMessagesByTimestamp(e,t,r,!!n,i)]}))}))}}),Object.defineProperty(e.prototype,"batchClearMessagesByTimestamp",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){return s(this,(function(t){return[2,this._engine.batchClearMessagesByTimestamp(e)]}))}))}}),Object.defineProperty(e.prototype,"batchClearRemoteHistoryMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i;return s(this,(function(o){switch(o.label){case 0:return(r=vt.create("batchClearRemoteHistoryMessages").isTypedArray("options",e,(function(e){return Vt("",e,be).result().isOk&&Ct({min:0})(e.timestamp)}),!0).fail(exports.ErrorCode.MSG_LIMIT_ERROR).result().tryTrans(this.validateConnected)).isOk?(n=this.logger.createTraceId(),this.logger.info(H.A_BATCH_CLEAR_REMOTE_MSG_T,JSON.stringify({options:e,isDeleteLocal:t}),n),[4,this._engine.chat.batchClearRemoteHistoryMessages(e,t)]):[2,r.wipe()];case 1:return i=o.sent(),this.logger.summary(H.A_BATCH_CLEAR_REMOTE_MSG_R,r,n),[2,i]}}))}))}}),Object.defineProperty(e.prototype,"clearMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return void 0===r&&(r=""),o(this,void 0,void 0,(function(){return s(this,(function(n){return[2,this._engine.clearMessages(e,t,r)]}))}))}}),Object.defineProperty(e.prototype,"getLocalMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i=this;return s(this,(function(o){switch(o.label){case 0:return t=vt.create("getLocalMessage").validate("messageId",e,(function(){return Tt(e)||Rt(e)}),!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_ID).result(),r=this.logger.createTraceId(),this.logger.info(H.A_GET_LOCAL_MESSAGE_T,JSON.stringify({messageId:e}),r),[4,t.next((function(){return i._engine.getMessage(e)}))];case 1:return n=o.sent(),this.logger.summary(H.A_GET_LOCAL_MESSAGE_R,n,r,{messageId:e}),[2,n]}}))}))}}),Object.defineProperty(e.prototype,"setMessageContent",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){return s(this,(function(n){return[2,this._engine.setMessageContent(e,t,r)]}))}))}}),Object.defineProperty(e.prototype,"setMessageSearchField",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){return s(this,(function(n){return[2,this._engine.setMessageSearchField(e,t,r)]}))}))}}),Object.defineProperty(e.prototype,"setMessageSentStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){return s(this,(function(r){return[2,this._engine.setMessageSentStatus(e,t)]}))}))}}),Object.defineProperty(e.prototype,"setMessageReceivedStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){return s(this,(function(r){return[2,this._engine.setMessageReceivedStatus(e,t)]}))}))}}),Object.defineProperty(e.prototype,"setMessageStatusToRead",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i,o,a,u;return s(this,(function(s){switch(s.label){case 0:return(r=Vt("setMessageStatusToRead",e,ge).isNumber("timestamp",t,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TIMESTAMP).result().tryTrans(this.validateLogin)).isOk?(n=this.logger.createTraceId(),i=e.conversationType,o=e.targetId,a=e.channelId,this.logger.info(H.A_E_SET_MESSAGE_STATUS_TO_READ_T,JSON.stringify({conversation:e,timestamp:t}),n),[4,this._engine.updateMessageReceiptStatus(i,o,t,a)]):[2,r.wipe()];case 1:return u=s.sent(),this.logger.summary(H.A_E_SET_MESSAGE_STATUS_TO_READ_R,u,n),[2,u]}}))}))}}),Object.defineProperty(e.prototype,"setUserStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){return s(this,(function(t){return[2,this._engine.setUserStatus(e)]}))}))}}),Object.defineProperty(e.prototype,"subscribeUserStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){return s(this,(function(t){return[2,this._engine.subscribeUserStatus(e)]}))}))}}),Object.defineProperty(e.prototype,"getUserStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){return s(this,(function(t){return[2,this._engine.getUserStatus(e)]}))}))}}),Object.defineProperty(e.prototype,"searchConversationByContent",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return o(this,void 0,void 0,(function(){var i,o,a;return s(this,(function(s){switch(s.label){case 0:return(i=vt.create("searchConversationByContent").isNotEmptyString("keyword",e,!0).fail(exports.ErrorCode.INVALID_PARAMETER_KEYWORD).isTypedArray("messageTypes",t,(function(e){return At(e)})).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_TYPE).validate("channelId",r,Dt).fail(exports.ErrorCode.INVALID_PARAMETER_CHANNEL_ID).isTypedArray("conversationTypes",n,(function(e){return me(e,be)})).fail(exports.ErrorCode.INVALID_PARAMETER_CONVERSATION_TYPE_LIST).result().tryTrans(this.validateLogin)).isOk?(o=this.logger.createTraceId(),this.logger.info(H.A_E_SEARCH_CONVERSATION_BY_CONTENT_T,JSON.stringify({keyword:e,messageTypes:t,channelId:r,conversationTypes:n}),o),[4,this._engine.chat.searchConversationByContent(e,t&&0!==t.length?t:[exports.MessageType.TextMessage,exports.MessageType.FILE],r||"",n&&0!==n.length?n:ye(be))]):[2,i.wipe()];case 1:return a=s.sent(),this.logger.summary(H.A_E_SEARCH_CONVERSATION_BY_CONTENT_R,i,o),[2,a]}}))}))}}),Object.defineProperty(e.prototype,"searchConversationByContentWithAllChannel",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){return s(this,(function(n){return[2,this._engine.searchConversationByContentWithAllChannel(e,t&&0!==t.length?t:[exports.MessageType.TextMessage,exports.MessageType.FILE],r&&0!==r.length?r:ye(be))]}))}))}}),Object.defineProperty(e.prototype,"searchMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e,r){var i,u;return o(this,void 0,void 0,(function(){var o;return s(this,(function(s){switch(s.label){case 0:return(o=Vt("searchMessages",e,ge).isLimitedString("keyword",null==r?void 0:r.keyword,0,1e3,!0).fail(exports.ErrorCode.INVALID_PARAMETER_KEYWORD).isLimitedInteger("limit",null==r?void 0:r.limit,1,Xe,!0).fail(exports.ErrorCode.INVALID_PARAMETER_LIMIT).isLimitedInteger("offset",null==r?void 0:r.offset,0,Xe).fail(exports.ErrorCode.INVALID_PARAMETER_OFFSET).isLimitedInteger("order",null==r?void 0:r.order,0,1,!0).fail(exports.ErrorCode.INVALID_PARAMETER_ORDER).isObject("timeRange",r.timeRange).validate("timeRange",r.timeRange,(function(e){var t=e.startTime,r=e.endTime;return!t&&!r||!(t&&!Rt(t)||r&&!Rt(r))&&(t=null!=t?t:0,r=null!=r?r:Date.now(),t>=0&&t<=r)})).fail(exports.ErrorCode.INVALID_PARAMETER_TIMESTAMP).isTypedArray("objectNames",null===(i=null==r?void 0:r.messageFilter)||void 0===i?void 0:i.objectNames,(function(e){return"string"==typeof e&&e.length>0&&e.length<=128})).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_OBJECT_NAME_LIST).isTypedArray("senderIds",null===(u=null==r?void 0:r.messageFilter)||void 0===u?void 0:u.senderIds,xt).fail(exports.ErrorCode.INVALID_PARAMETER_USER_ID).result().tryTrans(this.validateLogin)).isOk?[4,c(this,t,"m",a).call(this,n(n({},r),{conversationFilter:{conversationTypes:[e.conversationType],targetIds:[e.targetId],channelIds:"string"==typeof e.channelId?[e.channelId]:[]}}))]:[2,o.wipe()];case 1:return[2,s.sent().orSync((function(){return ht({messages:[],totalMatched:0,conditionsMatched:0})}))]}}))}))}}),Object.defineProperty(e.prototype,"searchMessagesWithParams",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var r,n,i,u,l,d;return o(this,void 0,void 0,(function(){var o;return s(this,(function(s){return(o=vt.create("searchMessagesWithParams").isObject("params",e,!0).fail(exports.ErrorCode.BIZ_ERROR_INVALID_PARAMETER).isLimitedString("keyword",null==e?void 0:e.keyword,0,1e3).fail(exports.ErrorCode.INVALID_PARAMETER_KEYWORD).isLimitedInteger("limit",null==e?void 0:e.limit,1,Xe,!0).fail(exports.ErrorCode.INVALID_PARAMETER_LIMIT).isLimitedInteger("offset",null==e?void 0:e.offset,0,Xe).fail(exports.ErrorCode.INVALID_PARAMETER_OFFSET).isLimitedInteger("order",null==e?void 0:e.order,0,1,!0).fail(exports.ErrorCode.INVALID_PARAMETER_ORDER).isObject("timeRange",null==e?void 0:e.timeRange).validate("timeRange",null==e?void 0:e.timeRange,(function(e){var t=e.startTime,r=e.endTime;return!t&&!r||!(t&&!Rt(t)||r&&!Rt(r))&&(t=null!=t?t:0,r=null!=r?r:Date.now(),t>=0&&t<=r)})).fail(exports.ErrorCode.INVALID_PARAMETER_TIMESTAMP).isTypedArray("conversationTypes",null===(r=null==e?void 0:e.conversationFilter)||void 0===r?void 0:r.conversationTypes,(function(e){return me(e,be)})).fail(exports.ErrorCode.INVALID_PARAMETER_CONVERSATION_TYPE_LIST).isLimitedTypedArray("targetIds",null===(n=null==e?void 0:e.conversationFilter)||void 0===n?void 0:n.targetIds,20,xt,!1,0).fail(exports.ErrorCode.INVALID_PARAMETER_TARGETID_LIST).isLimitedTypedArray("channelIds",null===(i=null==e?void 0:e.conversationFilter)||void 0===i?void 0:i.channelIds,10,Dt,!1,0).fail(exports.ErrorCode.INVALID_PARAMETER_CHANNEL_ID).isLimitedTypedArray("senderIds",null===(u=null==e?void 0:e.messageFilter)||void 0===u?void 0:u.senderIds,20,xt,!1,0).fail(exports.ErrorCode.INVALID_PARAMETER_USERIDLIST).isTypedArray("objectNames",null===(l=null==e?void 0:e.messageFilter)||void 0===l?void 0:l.objectNames,(function(e){return"string"==typeof e&&e.length>0&&e.length<=128})).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_OBJECT_NAME_LIST).result().tryTrans(this.validateLogin)).isOk?(e.limit=Math.min(e.limit,100),(null===(d=e.messageFilter)||void 0===d?void 0:d.objectNames)&&e.messageFilter.objectNames.length>300&&(e.messageFilter.objectNames=e.messageFilter.objectNames.slice(0,300)),[2,c(this,t,"m",a).call(this,e)]):[2,o.wipe()]}))}))}}),Object.defineProperty(e.prototype,"getMessagesByTimestamp",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return o(this,void 0,void 0,(function(){return s(this,(function(i){return[2,this._engine.getMessagesByTimestamp(e,t,r,n)]}))}))}}),Object.defineProperty(e.prototype,"getUnreadMentionedMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return void 0===r&&(r=""),this._engine.getUnreadMentionedMessages(e,t,r)}}),Object.defineProperty(e.prototype,"clearUnreadCountByTimestamp",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return void 0===n&&(n=""),this._engine.clearUnreadCountByTimestamp(e,t,r,n)}}),Object.defineProperty(e.prototype,"getUltraGroupDefaultNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this._channelIdConvert(exports.ConversationType.ULTRA_GROUP,t);return this._engine.getUltraGroupDefaultNotificationLevel(e,r||"")}}),Object.defineProperty(e.prototype,"setUltraGroupDefaultNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n=this._channelIdConvert(exports.ConversationType.ULTRA_GROUP,r);return this._engine.setUltraGroupDefaultNotificationLevel(e,t,n||"")}}),Object.defineProperty(e.prototype,"getConversationNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var n;return s(this,(function(i){return(n=Vt("getConversationNotificationLevel",e,be).result()).isOk?[2,this._engine.chat.getConversationNotificationLevel(c(this,t,"m",r).call(this,e))]:[2,n.wipe()]}))}))}}),Object.defineProperty(e.prototype,"setConversationTypeNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r;return s(this,(function(n){return(r=vt.create("setConversationTypeNotificationLevel").validate("conversationType",e,(function(){return me(e,be)}),!0).fail(exports.ErrorCode.INVALID_PARAMETER_CONVERSATION_TYPE).isValueOf("level",t,exports.NotificationLevel,!0).fail(exports.ErrorCode.INVALID_PARAMETER_NOTIFICATION_LEVEL).result().tryTrans(this.validateConnected)).isOk?[2,this._engine.chat.setConversationTypeNotificationLevel(e,t)]:[2,r.wipe()]}))}))}}),Object.defineProperty(e.prototype,"getConversationTypeNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t;return s(this,(function(r){return(t=vt.create("getConversationTypeNotificationLevel").validate("conversationType",e,(function(){return me(e,be)}),!0).fail(exports.ErrorCode.INVALID_PARAMETER_CONVERSATION_TYPE).result().tryTrans(this.validateConnected)).isOk?[2,this._engine.chat.getConversationTypeNotificationLevel(e)]:[2,t.wipe()]}))}))}}),Object.defineProperty(e.prototype,"getRemoteHistoryMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i,o){return this._engine.getRemoteHistoryMessages(e,t,r,n,i,o)}}),Object.defineProperty(e.prototype,"clearLocalData",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.logger.info(H.A_CLEAR_LOCAL_CACHE_O),this._engine.clearLocalData()}}),Object.defineProperty(e.prototype,"createLogger",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return this._engine.createLogger(e,t)}}),Object.defineProperty(e.prototype,"getConversations",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._engine.getConversations(e)}}),Object.defineProperty(e.prototype,"setCheckDuplicateMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._engine.setCheckDuplicateMessage(e)}}),Object.defineProperty(e.prototype,"setCheckChatRoomDuplicateMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._engine.setCheckChatRoomDuplicateMessage(e)}}),Object.defineProperty(e.prototype,"rtcSignaling",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return this._engine.rtcSignaling(e,t,r,n)}}),Object.defineProperty(e.prototype,"rtcPing",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return this._engine.rtcPing(e,t,r)}}),Object.defineProperty(e.prototype,"bindRTCRoomForChatroom",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._engine.bindRTCRoomForChatroom(e)}}),Object.defineProperty(e.prototype,"setProxy",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._engine.setProxy(e)}}),Object.defineProperty(e.prototype,"getProxy",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._engine.getProxy()}}),Object.defineProperty(e.prototype,"testProxy",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return this._engine.testProxy(e,t)}}),Object.defineProperty(e.prototype,"createGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return void 0===n&&(n=[]),this._engine.createGroup(e,t,r,n)}}),Object.defineProperty(e.prototype,"updateGroupInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return this._engine.updateGroupInfo(e,t,r)}}),Object.defineProperty(e.prototype,"getGroupsInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._engine.getGroupsInfo(e)}}),Object.defineProperty(e.prototype,"kickGroupMembers",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return this._engine.kickGroupMembers(e,t,r)}}),Object.defineProperty(e.prototype,"quitGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return this._engine.quitGroup(e,t)}}),Object.defineProperty(e.prototype,"dismissGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._engine.dismissGroup(e)}}),Object.defineProperty(e.prototype,"transferGroupOwner",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return void 0===n&&(n=!1),this._engine.transferGroupOwner(e,t,n,r)}}),Object.defineProperty(e.prototype,"setGroupManagers",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return this._engine.setGroupManagers(e,t,r)}}),Object.defineProperty(e.prototype,"getGroupMembersByRole",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return this._engine.getGroupMembersByRole(e,t,r)}}),Object.defineProperty(e.prototype,"getGroupMembers",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return this._engine.getGroupMembers(e,t)}}),Object.defineProperty(e.prototype,"setGroupMemberInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return this._engine.setGroupMemberInfo(e,t,r,n)}}),Object.defineProperty(e.prototype,"searchGroupMembers",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return this._engine.searchGroupMembers(e,t,r)}}),Object.defineProperty(e.prototype,"joinGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._engine.joinGroup(e)}}),Object.defineProperty(e.prototype,"inviteUsersToGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return this._engine.inviteUsersToGroup(e,t)}}),Object.defineProperty(e.prototype,"acceptGroupInvite",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return this._engine.memberInviteResponse({groupId:e,inviterId:t,optType:0,optResult:exports.GroupOperationStatus.ACCEPT})}}),Object.defineProperty(e.prototype,"refuseGroupInvite",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return this._engine.memberInviteResponse({groupId:e,inviterId:t,optType:0,optResult:exports.GroupOperationStatus.REFUSE,reason:r})}}),Object.defineProperty(e.prototype,"acceptGroupApplication",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return this._engine.memberInviteResponse({groupId:e,joinUserId:t,inviterId:r,optType:1,optResult:exports.GroupOperationStatus.ACCEPT})}}),Object.defineProperty(e.prototype,"refuseGroupApplication",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return this._engine.memberInviteResponse({groupId:e,joinUserId:t,inviterId:r,optType:1,optResult:exports.GroupOperationStatus.REFUSE,reason:n})}}),Object.defineProperty(e.prototype,"getGroupApplications",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return this._engine.getGroupApplications(e,t,r)}}),Object.defineProperty(e.prototype,"getJoinedGroupsByRole",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return this._engine.getJoinedGroupsByRole(e,t)}}),Object.defineProperty(e.prototype,"searchJoinedGroups",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return this._engine.searchJoinedGroups(e,t)}}),Object.defineProperty(e.prototype,"getJoinedGroups",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._engine.getJoinedGroups(e)}}),Object.defineProperty(e.prototype,"setGroupRemark",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return this._engine.setGroupRemark(e,t)}}),Object.defineProperty(e.prototype,"addGroupFollows",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return this._engine.setGroupFollows(exports.GroupOperationType.ADD,e,t)}}),Object.defineProperty(e.prototype,"removeGroupFollows",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return this._engine.setGroupFollows(exports.GroupOperationType.REMOVE,e,t)}}),Object.defineProperty(e.prototype,"getGroupFollows",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._engine.getGroupFollows(e)}}),Object.defineProperty(e.prototype,"addFriend",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return this._engine.addFriend(e,t,r)}}),Object.defineProperty(e.prototype,"deleteFriends",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return this._engine.deleteFriends(e,t)}}),Object.defineProperty(e.prototype,"acceptFriendApplication",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._engine.acceptFriendApplication(e)}}),Object.defineProperty(e.prototype,"refuseFriendApplication",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return this._engine.refuseFriendApplication(e,t)}}),Object.defineProperty(e.prototype,"setFriendInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return this._engine.setFriendInfo(e,t,r)}}),Object.defineProperty(e.prototype,"checkFriends",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return this._engine.checkFriends(e,t)}}),Object.defineProperty(e.prototype,"getFriends",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return this._engine.getFriends(e,t)}}),Object.defineProperty(e.prototype,"getFriendApplications",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return this._engine.getFriendApplications(e,t,r)}}),Object.defineProperty(e.prototype,"getFriendsInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._engine.getFriendsInfo(e)}}),Object.defineProperty(e.prototype,"searchFriendsInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._engine.searchFriendsInfo(e)}}),Object.defineProperty(e.prototype,"setFriendAddPermission",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._engine.setFriendAddPermission(e)}}),Object.defineProperty(e.prototype,"getFriendAddPermission",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._engine.getFriendAddPermission()}}),Object.defineProperty(e.prototype,"getRealtimeConversations",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return this._engine.getRealtimeConversations(e,t,r)}}),Object.defineProperty(e.prototype,"getRealtimeConTotalUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._engine.getRealtimeConTotalUnreadCount()}}),Object.defineProperty(e.prototype,"clearRealtimeConUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._engine.clearRealtimeConUnreadCount(e)}}),Object.defineProperty(e.prototype,"removeRealtimeConversations",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._engine.removeRealtimeConversations(e)}}),Object.defineProperty(e.prototype,"getRealtimeConUnreadCounts",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._engine.getRealtimeConUnreadCounts(e)}}),Object.defineProperty(e.prototype,"setNotificationQuietHoursWithSetting",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;return vt.create("setNotificationQuietHoursWithSetting").isObject("opts",e,!0).isString("timezone",e.timezone).fail(exports.ErrorCode.BIZ_ERROR_INVALID_PARAMETER).validate("startTime",e.startTime,(function(e){return/^\d{2}(:\d{2}){2}$/.test(e)}),!0).fail(exports.ErrorCode.INVALID_PARAMETER_TIMESTRING).isLimitedNumber("spanMinutes",e.spanMinutes,1,1439,!0).fail(exports.ErrorCode.INVALID_PARAMETER_SPAN_MINUTES).isValueOf("level",e.level,exports.PushNotificationQuietHoursLevel,!0).fail(exports.ErrorCode.INVALID_PARAMETER_NOTIFICATION_LEVEL).result().next((function(){return t._engine.setNotificationQuietHoursWithSetting(e)}))}}),Object.defineProperty(e.prototype,"removeNotificationQuietHoursSetting",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._engine.removeNotificationQuietHoursSetting()}}),Object.defineProperty(e.prototype,"getNotificationQuietHoursSetting",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._engine.getNotificationQuietHoursSetting()}}),Object.defineProperty(e.prototype,"getStatsUrlList",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._engine.getStatsUrlList()}}),Object.defineProperty(e.prototype,"sendReadReceiptResponseV5",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r;return s(this,(function(n){return(r=Vt("sendReadReceiptResponseV5",e,_e).isTypedArray("messageUIdArray",t,(function(e){return xt(e)}),!0).fail(exports.ErrorCode.MSG_LIMIT_ERROR).isLimitedInteger("messageUIdArray",t.length,1,100,!0).fail(exports.ErrorCode.INVALID_PARAMETER_COUNT).result().tryTrans(this.validateConnected).tryTrans((function(e){return 4===e.grpRRVer?ht():gt(exports.ErrorCode.READ_RECEIPT_ERROR)}))).isOk?[2,this._engine.chat.sendReadReceiptResponseV5(e,t)]:[2,r.wipe()]}))}))}}),Object.defineProperty(e.prototype,"getMessageReadReceiptInfoV5",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r;return s(this,(function(n){return(r=Vt("getMessageReadReceiptInfoV5",e,_e).isTypedArray("messageUIdArray",t,(function(e){return xt(e)}),!0).fail(exports.ErrorCode.MSG_LIMIT_ERROR).isLimitedInteger("messageUIdArray",t.length,1,100,!0).fail(exports.ErrorCode.INVALID_PARAMETER_COUNT).result().tryTrans(this.validateConnected).tryTrans((function(e){return 4===e.grpRRVer?ht():gt(exports.ErrorCode.READ_RECEIPT_ERROR)}))).isOk?[2,this._engine.chat.getMessageReadReceiptInfoV5(e,t)]:[2,r.wipe()]}))}))}}),Object.defineProperty(e.prototype,"getMessagesReadReceiptUsersByPageV5",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n;return s(this,(function(i){return(n=Vt("getMessageReadReceiptInfoV5",e,_e).isNotEmptyString("messageUId",t,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_UID).isObject("option",r,!0).fail(exports.ErrorCode.BIZ_ERROR_INVALID_PARAMETER,"option type error").isString("pageToken",r.pageToken).fail(exports.ErrorCode.INVALID_PARAMETER_PAGING_QUERY_OPTION).isLimitedInteger("pageCount",r.pageCount,1,100,!0).fail(exports.ErrorCode.INVALID_PARAMETER_COUNT).result().tryTrans(this.validateConnected).tryTrans((function(e){return 4===e.grpRRVer?ht():gt(exports.ErrorCode.READ_RECEIPT_ERROR)}))).isOk?(r.order=1!==r.order?0:1,r.readStatus=1!==r.readStatus?0:1,[2,this._engine.chat.getMessagesReadReceiptUsersByPageV5(e,t,r)]):[2,n.wipe()]}))}))}}),Object.defineProperty(e.prototype,"getMessagesReadReceiptByUsersV5",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n;return s(this,(function(i){return(n=Vt("getMessagesReadReceiptByUsersV5",e,_e).isNotEmptyString("messageUId",t,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_UID).isTypedArray("userList",r,(function(e){return xt(e)}),!0).fail(exports.ErrorCode.INVALID_PARAMETER_USER_ID).isLimitedInteger("userList",r.length,1,100,!0).fail(exports.ErrorCode.INVALID_PARAMETER_COUNT).result().tryTrans(this.validateConnected).tryTrans((function(e){return 4===e.grpRRVer?ht():gt(exports.ErrorCode.READ_RECEIPT_ERROR)}))).isOk?[2,this._engine.chat.getMessagesReadReceiptByUsersV5(e,t,r)]:[2,n.wipe()]}))}))}}),t=new WeakSet,r=function(e){return{conversationType:e.conversationType,targetId:e.targetId,channelId:this._channelIdConvert(e.conversationType,e.channelId)}},a=function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,o,a;return s(this,(function(s){switch(s.label){case 0:return t=e.timeRange||{},r=t.startTime,n=t.endTime,i={startTime:null!=r?r:0,endTime:null!=n?n:Date.now()},e.timeRange=i,o=this.logger.createTraceId(),this.logger.info(H.A_SEARCH_MSGS_BY_PARAMS_T,JSON.stringify(e),o),[4,this._engine.searchMessagesWithParams(e)];case 1:return a=s.sent(),this.logger.summary(H.A_SEARCH_MSGS_BY_PARAMS_R,a,o),[2,a]}}))}))},i([Xh],e.prototype,"updateMyUserProfile",null),i([Xh],e.prototype,"getUserProfiles",null),i([Xh],e.prototype,"getMyUserProfile",null),i([Xh],e.prototype,"updateMyUserProfileVisibility",null),i([Xh],e.prototype,"getMyUserProfileVisibility",null),i([Xh],e.prototype,"searchUserProfileByUniqueId",null),i([Xh],e.prototype,"createGroup",null),i([Xh],e.prototype,"updateGroupInfo",null),i([Xh],e.prototype,"getGroupsInfo",null),i([Xh],e.prototype,"kickGroupMembers",null),i([Xh],e.prototype,"quitGroup",null),i([Xh],e.prototype,"dismissGroup",null),i([Xh],e.prototype,"transferGroupOwner",null),i([Xh],e.prototype,"setGroupManagers",null),i([Xh],e.prototype,"getGroupMembersByRole",null),i([Xh],e.prototype,"getGroupMembers",null),i([Xh],e.prototype,"setGroupMemberInfo",null),i([Xh],e.prototype,"searchGroupMembers",null),i([Xh],e.prototype,"joinGroup",null),i([Xh],e.prototype,"inviteUsersToGroup",null),i([Xh],e.prototype,"acceptGroupInvite",null),i([Xh],e.prototype,"refuseGroupInvite",null),i([Xh],e.prototype,"acceptGroupApplication",null),i([Xh],e.prototype,"refuseGroupApplication",null),i([Xh],e.prototype,"getGroupApplications",null),i([Xh],e.prototype,"getJoinedGroupsByRole",null),i([Xh],e.prototype,"searchJoinedGroups",null),i([Xh],e.prototype,"getJoinedGroups",null),i([Xh],e.prototype,"setGroupRemark",null),i([Xh],e.prototype,"addGroupFollows",null),i([Xh],e.prototype,"removeGroupFollows",null),i([Xh],e.prototype,"getGroupFollows",null),i([Xh],e.prototype,"addFriend",null),i([Xh],e.prototype,"deleteFriends",null),i([Xh],e.prototype,"acceptFriendApplication",null),i([Xh],e.prototype,"refuseFriendApplication",null),i([Xh],e.prototype,"setFriendInfo",null),i([Xh],e.prototype,"checkFriends",null),i([Xh],e.prototype,"getFriends",null),i([Xh],e.prototype,"getFriendApplications",null),i([Xh],e.prototype,"getFriendsInfo",null),i([Xh],e.prototype,"searchFriendsInfo",null),i([Xh],e.prototype,"setFriendAddPermission",null),i([Xh],e.prototype,"getFriendAddPermission",null),i([$h],e.prototype,"getRealtimeConversations",null),i([$h],e.prototype,"getRealtimeConTotalUnreadCount",null),i([$h],e.prototype,"clearRealtimeConUnreadCount",null),i([$h],e.prototype,"removeRealtimeConversations",null),i([$h],e.prototype,"getRealtimeConUnreadCounts",null),e}();exports.APIContext=eg,exports.AppStorage=Gu,exports.BasicEngine=Ru,exports.BasicLogger=Tr,exports.Codec=au,exports.ConversationListFilterType=Hr,exports.EventEmitter=iu,exports.LogTagId=H,exports.MAX_MESSAGE_CONTENT_BYTES=xe,exports.MAX_U32_INTEGER=Xe,exports.MAX_UPLOAD_FILE_SIZE=5368709120,exports.PBCodec=po,exports.PluginContext=Au,exports.RCResult=ft,exports.RTCPluginContext=Pu,exports.SuspendablePromise=Et,exports.UPLOAD_FILE_CHUNK_SIZE=10485760,exports.UUId=nt,exports.Validator=vt,exports.ValidatorManage=Du,exports.VersionManage=et,exports.assert=function(e,t,r,n){if(void 0===n&&(n=!1),!Uu(e,t,r,n))throw new Lu("'".concat(e,"' is invalid: ").concat(JSON.stringify(t)))},exports.fail=gt,exports.fixUrlProtocol=pr,exports.forEach=ou,exports.getMessageTypeDescription=Vr,exports.getUUID=function(){return nt.gen()},exports.getUUID22=function(){return nt.genWithLen(22)},exports.hasMessageTypeDescription=Gr,exports.httpRequest=br,exports.isArray=Ot,exports.isBoolean=function(e){return"boolean"==typeof e},exports.isFunction=Nt,exports.isHttpUrl=Mt,exports.isInteger=Ct,exports.isLimitedArray=function(e){return function(t){if(!Ot(t)||void 0!==e.minLength&&t.length<e.minLength||void 0!==e.maxLength&&t.length>e.maxLength)return!1;if(!e.itemValidator)return!0;var r=!0;return t.every((function(t){var n=e.itemValidator&&e.itemValidator(t);return"object"==typeof n?n.errorKey?(r={errorKey:n.errorKey,valid:n.valid},!1):(r=n.valid,n.valid):(r=!!n,n)})),r}},exports.isLimitedString=St,exports.isNull=function(e){return"[object Null]"===Object.prototype.toString.call(e)},exports.isNumber=Rt,exports.isObject=Pt,exports.isString=Tt,exports.isUndefined=wt,exports.isValidConversation=function(e,t){var r;return Pt(e)?(t&&!t.includes(e.conversationType)&&(r="conversationTypeNotSupport"),xt(e.targetId)||(r="targetId"),Ut(e.conversationType)||(r="conversationType"),wt(e.channelId)||Dt(e.channelId)||(r="channelId"),wt(r)?{valid:!0}:{valid:wt(r),errorKey:r}):{valid:!1,errorKey:"conversation"}},exports.isValidConversationType=Ut,exports.isValidEnum=function(e){return Object.values(e.type).includes(e.value)},exports.isValidFileType=function(e){return Rt(e)&&Object.prototype.hasOwnProperty.call(exports.FileType,e)},exports.isValidGroupId=function(e){return St({minLength:1,maxLength:64})(e)&&/^[a-zA-Z0-9+=\-_|:]*$/.test(e)},exports.isValidNotificationLevel=function(e){return Rt(e)&&Object.prototype.hasOwnProperty.call(exports.NotificationLevel,e)},exports.isValidTargetId=xt,exports.logger=nu,exports.map=su,exports.notEmptyArray=function(e){return Ot(e)&&e.length>0},exports.notEmptyObject=Lt,exports.notEmptyString=At,exports.ok=ht,exports.runtime=lo,exports.trans2IReceivedStatusInfo=Bt,exports.trans2NotificationLevel=function(e){return e===exports.NotificationStatus.OPEN?exports.NotificationLevel.AT_MESSAGE_NOTIFICATION:exports.NotificationLevel.NOT_SET},exports.trans2NotificationStatus=Le,exports.transformReceivedStatusFlag=function(e){var t=exports.ReceivedStatus.UNREAD;return(null==e?void 0:e.isRead)&&(t|=exports.ReceivedStatus.READ),(null==e?void 0:e.isListened)&&(t|=exports.ReceivedStatus.LISTENED),(null==e?void 0:e.isDownload)&&(t|=exports.ReceivedStatus.DOWNLOADED),(null==e?void 0:e.isRetrieved)&&(t|=exports.ReceivedStatus.RETRIEVED),t},exports.usingCppEngine=Ft,exports.validate=Uu;
|